1 # Thierry Parmentelat - INRIA
4 from PLC.Nodes import Node
5 from PLC.Interfaces import Interface
6 from PLC.Slices import Slice
7 #from PLC.Ilinks import Ilink
9 from PLC.Accessors.Factory import define_accessors, all_roles, tech_roles
12 current_module = sys.modules[__name__]
15 # most of these tag types are defined in MyPLC/db-config, so any details here in the
16 # description/category area is unlikely to make it into the database
20 # xxx - don't expose yet in api interface and slices dont know how to use that yet
21 define_accessors(current_module, Slice, "Vref", "vref",
22 "slice/config", "vserver reference image type",
23 get_roles=all_roles, set_roles=["admin"], expose_in_api=True)
27 define_accessors(current_module, Node, "Arch", "arch",
28 "node/config", "architecture name",
29 get_roles=all_roles, set_roles=tech_roles, expose_in_api=True)
30 # define the dummynet connection to a node
31 define_accessors(current_module, Node, "Dummynet", "dummynet", "node/config",
32 "dummynet box connected to the node", get_roles=all_roles, set_roles="pi")
33 # distribution to be deployed
34 define_accessors(current_module, Node, "Pldistro", "pldistro",
35 "node/config", "PlanetLab distribution",
36 get_roles=all_roles, set_roles=["admin"], expose_in_api=True)
37 # node deployment (alpha, beta, ...)
38 define_accessors(current_module, Node, "Deployment", "deployment",
39 "node/operation", 'typically "alpha", "beta", or "production"',
40 get_roles=all_roles, set_roles=["admin"], expose_in_api=True)
42 define_accessors(current_module, Node, "Extensions", "extensions",
43 "node/config", "space-separated list of extensions to install",
44 get_roles=all_roles, set_roles=["admin"])
45 # test nodes perform their installation from an uncompressed bootstrapfs
46 define_accessors(current_module, Node, "PlainBootstrapfs", "plain-bootstrapfs",
47 "node/config", "use uncompressed bootstrapfs when set",
48 get_roles=all_roles, set_roles=tech_roles)
51 # xxx - don't expose yet in api interface and slices dont know how to use that yet
52 define_accessors(current_module, Interface, "Ifname", "ifname",
53 "interface/config", "linux name",
54 get_roles=all_roles, set_roles=tech_roles, expose_in_api=True)
55 define_accessors(current_module, Interface, "Driver", "driver",
56 "interface/config", "driver name",
57 get_roles=all_roles, set_roles=tech_roles)
58 define_accessors(current_module, Interface, "Alias", "alias",
59 "interface/config", "interface alias",
60 get_roles=all_roles, set_roles=tech_roles)