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 # distribution to be deployed
31 define_accessors(current_module, Node, "Pldistro", "pldistro",
32 "node/config", "PlanetLab distribution",
33 get_roles=all_roles, set_roles=["admin"], expose_in_api=True)
34 # node deployment (alpha, beta, ...)
35 define_accessors(current_module, Node, "Deployment", "deployment",
36 "node/operation", 'typically "alpha", "beta", or "production"',
37 get_roles=all_roles, set_roles=["admin"], expose_in_api=True)
39 define_accessors(current_module, Node, "Extensions", "extensions",
40 "node/config", "space-separated list of extensions to install",
41 get_roles=all_roles, set_roles=["admin"])
42 # test nodes perform their installation from an uncompressed bootstrapfs
43 define_accessors(current_module, Node, "PlainBootstrapfs", "plain-bootstrapfs",
44 "node/config", "use uncompressed bootstrapfs when set",
45 get_roles=all_roles, set_roles=tech_roles)
48 # xxx - don't expose yet in api interface and slices dont know how to use that yet
49 define_accessors(current_module, Interface, "Ifname", "ifname",
50 "interface/config", "linux name",
51 get_roles=all_roles, set_roles=tech_roles, expose_in_api=True)
52 define_accessors(current_module, Interface, "Driver", "driver",
53 "interface/config", "driver name",
54 get_roles=all_roles, set_roles=tech_roles)
55 define_accessors(current_module, Interface, "Alias", "alias",
56 "interface/config", "interface alias",
57 get_roles=all_roles, set_roles=tech_roles)