X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=PLC%2FAccessors%2FAccessors_standard.py;h=0a02d8ae818adb1a27352e2d185e6b1ab46992a8;hb=9cc77df7a6b1369b58df577fb03bd1cfca2d0f23;hp=267bae60333d00983418f21f994e5ee8570fec2f;hpb=6d42fce241378ea4028cc579801dba59b5b83765;p=plcapi.git diff --git a/PLC/Accessors/Accessors_standard.py b/PLC/Accessors/Accessors_standard.py index 267bae6..0a02d8a 100644 --- a/PLC/Accessors/Accessors_standard.py +++ b/PLC/Accessors/Accessors_standard.py @@ -18,8 +18,10 @@ current_module = sys.modules[__name__] # # These following accessors are mostly of interest for implementing the -# GetSliceFamily method, that takes into account the vref attribute, -# as well as the 3 attributes below, and the PLC_FLAVOUR config category +# The GetSliceFamily and GetNodeFlavour methods take into account various tags, +# esp. arch, fcdistro, pldistro, vref (for slices) and deployment (for nodes) +# as well as the global PLC_FLAVOUR config category +# in order to return all configuration details for a given node or slice ### slice vref define_accessors(current_module, Slice, "Vref", "vref", @@ -42,14 +44,21 @@ define_accessors(current_module, Slice, "Initscript","initscript", # needs 'admin' so the Set method is accessible define_accessors(current_module, [Slice,Node], "Arch", "arch", "node/slice/config", "node arch or slivers arch", - set_roles=["admin","pi","user","tech","node"], expose_in_api=True) + set_roles=all_roles, expose_in_api=True) define_accessors(current_module, [Slice,Node], "Pldistro", "pldistro", "node/slice/config/sfa", "PlanetLab distribution to use for node or slivers", - set_roles=["admin","pi","user","tech","node"], expose_in_api=True) + set_roles=all_roles, expose_in_api=True) +# fc of course historically was for fedora core define_accessors(current_module, [Slice,Node], "Fcdistro", "fcdistro", - "node/slice/config", "Fedora or CentOS distribution to use for node or slivers", - set_roles=["admin","pi","user","tech","node"], expose_in_api=True) + "node/slice/config", "Linux distribution to use for node or slivers", + set_roles=all_roles, expose_in_api=True) +# the virtualization model to use - this is only used by the bootmanager for +# picking the right options e.g. prior to reinstalling +# see PLC_FLAVOUR_VIRT_MAP to see how the default gets computed +define_accessors(current_module, Node, "Virt", "virt", + "node/operation", 'typically "vs" or "lxc"', + set_roles=all_roles, expose_in_api=True) # node deployment (alpha, beta, ...) define_accessors(current_module, Node, "Deployment", "deployment", "node/operation", 'typically "alpha", "beta", or "production"', @@ -60,7 +69,11 @@ define_accessors(current_module, Node, "Extensions", "extensions", set_roles=["admin"],expose_in_api=True) # access HRN - this is the ideal definition of roles, even if AddNodeTag cannot handle this define_accessors(current_module, Node, "Hrn","hrn", - "node/sfa", "SFA human readable name", + "node/person/sfa", "SFA human readable name", + set_roles=all_roles, expose_in_api=True) +# same for persons +define_accessors(current_module, Person, "Hrn","hrn", + "node/person/sfa", "SFA human readable name", set_roles=all_roles, expose_in_api=True) # test nodes perform their installation from an uncompressed bootstrapfs