from PLC.Persons import Person
#from PLC.Ilinks import Ilink
-from PLC.Accessors.Factory import define_accessors, all_roles, tech_roles
+from PLC.Accessors.Factory import define_accessors, admin_roles, all_roles, tech_roles
import sys
current_module = sys.modules[__name__]
# NOTE.
-# most of these tag types are defined in MyPLC/db-config, so any details here in the
-# description/category area is unlikely to make it into the database
+# The 'Get' and 'Set' accessors defined here automagically create the corresponding TagType in the database
+# for safety, some crucial tags are forced to be created at plc startup time, through the db-config.d mechanism
+# You might wish to keep this roughly in sync with db-config.d/011-standard_tags
#
#
define_accessors(current_module, Interface, "Alias", "alias",
"interface/config", "interface alias",
get_roles=all_roles, set_roles=tech_roles)
+define_accessors(current_module, Interface, "Backdoor", "backdoor",
+ "interface/hidden", "For testing new settings",
+ get_roles=all_roles, set_roles=admin_roles)
-# site
-define_accessors(current_module, Site, "Foo", "foo",
- "site/test", "some name",
- get_roles=all_roles, set_roles=all_roles, expose_in_api=True)
}
# xxx probably defined someplace else
+admin_roles = ['admin']
all_roles = [ 'admin', 'pi', 'tech', 'user', 'node' ]
tech_roles = [ 'admin', 'pi', 'tech' ]
+++ /dev/null
-# -*-python-*-
-# $Id$
-# $URL$
-#################### node tags
-default_node_tags = [
- { 'tagname' : 'arch',
- 'description' : 'architecture name',
- 'category' : 'node/config',
- 'min_role_id' : 40} ,
- { 'tagname' : 'pldistro',
- 'description' : 'PlanetLab distribution',
- 'category' : 'node/config',
- 'min_role_id' : 10} ,
- { 'tagname' : 'deployment',
- 'description' : 'typically "alpha", "beta", or "production"',
- 'category' : 'node/operation',
- 'min_role_id' : 10} ,
-
- ]
-
-for node_type in default_node_tags: SetTagType (node_type)
--- /dev/null
+# -*-python-*-
+# $Id$
+# $URL$
+
+# force creation of tags defined as accessors
+
+#################### slice tags
+GetSliceVref(0)
+GetSliceArch(0)
+GetSlicePldistro(0)
+GetSliceFcdistro(0)
+
+#################### node tags
+#
+GetNodeArch(0)
+GetNodePldistro(0)
+GetNodeFcdistro(0)
+GetNodeDeployment(0)
+GetNodeExtensions(0)
+GetNodePlainBootstrapfs(0)
+GetNodeSerial(0)
+GetNodeCramfs(0)
+GetNodeKvariant(0)
+GetNodeKargs(0)
+GetNodeNoHangcheck(0)
+
+#################### interface settings
+
+# force creation of tags defined as accessors
+
+GetInterfaceIfname(0)
+GetInterfaceDriver(0)
+GetInterfaceAlias(0)
+GetInterfaceBackdoor(0)
+
+++ /dev/null
-# -*-python-*-
-# $Id$
-# $URL$
-#################### interface settings
-# xxx this should move to PLC/Accessors
-
-default_interface_types = \
-[
- {'category' : "interface/general",
- 'tagname' : "ifname",
- 'description': "Set interface name, instead of eth0 or the like",
- 'min_role_id' : 40},
-
- {'category' : "interface/multihome",
- 'tagname' : "alias",
- 'description': "Specifies that the network is used for multihoming",
- 'min_role_id' : 40},
-
- {'category' : "interface/hidden",
- 'tagname' : "backdoor",
- 'description': "For testing new settings",
- 'min_role_id' : 10},
-]
-
-for setting_type in default_interface_types:
- SetTagType(setting_type)
--- /dev/null
+# -*-python-*-
+# $Id: 012-interface_tags -1 $
+# $URL: svn+ssh://thierry@svn.planet-lab.org/svn/MyPLC/trunk/db-config.d/012-interface_tags $
+#################### interface settings
+
+# force creation of tags defined as accessors
+GetInterfaceMode(0)
+GetInterfaceEssid(0)
+GetInterfaceNw(0)
+GetInterfaceFreq(0)
+GetInterfaceChannel(0)
+GetInterfaceSens(0)
+GetInterfaceRate(0)
+GetInterfaceKey(0)
+GetInterfaceKey1(0)
+GetInterfaceKey2(0)
+GetInterfaceKey3(0)
+GetInterfaceKey4(0)
+GetInterfaceSecurityMode(0)
+GetInterfaceIwconfig(0)
+GetInterfaceIwpriv(0)
+++ /dev/null
-# -*-python-*-
-# $Id: 012-interface_tags -1 $
-# $URL: svn+ssh://thierry@svn.planet-lab.org/svn/MyPLC/trunk/db-config.d/012-interface_tags $
-#################### interface settings
-# xxx this should move to PLC/Accessors
-
-wireless_interface_types = [
-
- { 'category' : "interface/wifi",
- 'tagname' : x,
- 'description' : "802.11 %s -- see %s"%(y,z),
- 'min_role_id' : 40 } for (x,y,z) in [
-
- ("mode","Mode","iwconfig"),
-
- ("essid","ESSID","iwconfig"),
-
- ("nw","Network Id","iwconfig"),
-
- ("freq","Frequency","iwconfig"),
-
- ("channel","Channel","iwconfig"),
-
- ("sens","sensitivity threshold","iwconfig"),
-
- ("rate","Rate","iwconfig"),
-
- ("key","key","iwconfig key"),
-
- ("key1","key1","iwconfig key [1]"),
-
- ("key2","key2","iwconfig key [2]"),
-
- ("key3","key3","iwconfig key [3]"),
-
- ("key4","key4","iwconfig key [4]"),
-
- ("securitymode","Security mode","iwconfig enc"),
-
- ("iwconfig","Additional parameters to iwconfig","ifup-wireless"),
-
- ("iwpriv","Additional parameters to iwpriv","ifup-wireless"),
-
- ]
- ]
-
-for setting_type in wireless_interface_types:
- SetTagType(setting_type)