11fad2315c6c47e21f3bee8ee988a8cfee8143a3
[plcapi.git] / PLC / Accessors / Accessors_site.py
1 #
2 # Thierry Parmentelat - INRIA
3 #
4 # Accessors_site.py is the place where you can define your own local tag accessors
5 # this will not be overwritten through rpm upgrades
6 #
7 # Now that Sites are taggable too, the name may be confusing, think of is as
8 # Accessors_local.py
9 #
10 # methods denotes the set of methods (names) that get inserted into the API
11 # it is updated by define_accessors
12
13 methods=[]
14
15 from PLC.Nodes import Node
16 from PLC.Interfaces import Interface
17 from PLC.Slices import Slice
18 from PLC.Sites import Site
19 from PLC.Persons import Person
20 #from PLC.Ilinks import Ilink
21
22 from PLC.Accessors.Factory import define_accessors, all_roles, person_roles, tech_roles
23
24 import sys
25 current_module = sys.modules[__name__]
26
27 #### example : attach vlan ids on interfaces
28 # The third argument expose_in_api is a boolean flag that tells whether this tag may be handled
29 #   through the Add/Get/Update methods as a native field
30 #
31 #define_accessors(current_module, Interface, "Vlan", "vlan",
32 #                  "interface/general", "tag for setting VLAN id",
33 #                  get_roles=all_roles, set_roles=tech_roles)