X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=PLC%2FAccessors%2FAccessors_site.py;h=b51d42e956b4a032409485206f90238005deebd2;hb=d20644a48d03667bb25dc583517de06e94606c64;hp=11fad2315c6c47e21f3bee8ee988a8cfee8143a3;hpb=9d29c605c9bc8afbf3807e79087ebea454a56d24;p=plcapi.git diff --git a/PLC/Accessors/Accessors_site.py b/PLC/Accessors/Accessors_site.py index 11fad23..b51d42e 100644 --- a/PLC/Accessors/Accessors_site.py +++ b/PLC/Accessors/Accessors_site.py @@ -4,8 +4,15 @@ # Accessors_site.py is the place where you can define your own local tag accessors # this will not be overwritten through rpm upgrades # -# Now that Sites are taggable too, the name may be confusing, think of is as -# Accessors_local.py +# Historical note: now that Sites are taggable too, the name may be confusing, +# think of this as Accessors_local.py +# +# to ensure creation of new tag_types, just run +# service plc start accessors +# also for the running API to take the new accessors into account, you need to +# apachectl restart +# or to stay on the safe side, simply do +# service plc restart # # methods denotes the set of methods (names) that get inserted into the API # it is updated by define_accessors @@ -17,7 +24,6 @@ from PLC.Interfaces import Interface from PLC.Slices import Slice from PLC.Sites import Site from PLC.Persons import Person -#from PLC.Ilinks import Ilink from PLC.Accessors.Factory import define_accessors, all_roles, person_roles, tech_roles @@ -25,9 +31,18 @@ import sys current_module = sys.modules[__name__] #### example : attach vlan ids on interfaces -# The third argument expose_in_api is a boolean flag that tells whether this tag may be handled -# through the Add/Get/Update methods as a native field # #define_accessors(current_module, Interface, "Vlan", "vlan", # "interface/general", "tag for setting VLAN id", # get_roles=all_roles, set_roles=tech_roles) +# +# The optional expose_in_api is a boolean flag that tells whether this tag may be handled +# through the Add/Get/Update methods as a native field +# e.g. +#define_accessors(current_module, Node, "Foo", "foo", +# "node/example", "my own description for foo", +# get_roles=all_roles, set_roles=all_roles) +# will let you do +# GetNodes ( {'foo':'*bar*'},['hostname','foo']) +# +#