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