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