2 # Thierry Parmentelat - INRIA
4 from PLC.Nodes import Node
5 from PLC.Interfaces import Interface
6 from PLC.Slices import Slice
7 from PLC.Sites import Site
8 from PLC.Persons import Person
10 from PLC.Accessors.Factory import define_accessors, admin_roles, all_roles, tech_roles
13 current_module = sys.modules[__name__]
15 # this is how to request the features
16 define_accessors(current_module, Slice, "OmfControl","omf_control",
17 "slice/usertools","Pre-install and configure OMF Resource Controller in slice if set",
18 set_roles=all_roles, expose_in_api=True)
21 define_accessors(current_module, Slice, "SliverHMAC","enable_hmac",
22 "slice/usertools","Create HMAC keys for node in slice (slivers)",
23 set_roles=all_roles, expose_in_api=True)
25 # this is where the crypto stuff gets stored
26 # this ends up in a sliver tag - the node creates that
27 # the accessors engine does not know how to create sliver accessors
28 # like e.g. GetSliverHmac(node,slice)
29 # but they are mentioned here as they are related to the above
31 # Security capability to empower a slice to make an authenticated API call, set by silverauth NM plugin.
32 define_accessors(current_module, Slice, "Hmac","hmac",
33 "slice/auth", "Sliver authorization key, for authenticated API call",
34 set_roles=['admin','node'])
35 # sliver-dependant ssh key, used to authenticate the experimental plane with OMF tools
36 define_accessors(current_module, Slice, "SshKey", "ssh_key",
37 'slice/auth', "Sliver public ssh key",
38 set_roles= ['admin','node'])