actually create nodetags
[myplc.git] / db-config.d / 04-slicetags
1 #################### slice tag types
2 # xxx this should move to PLC/Accessors
3
4 # Setup default slice tag types
5 slicetag_types = \
6 [
7     # Slice type (only vserver is supported)
8     {'tagname': "type",
9      'description': "Type of slice (e.g. vserver)",
10      'category' : 'slice/general',
11      'min_role_id': 20},
12     
13     # System slice
14     {'tagname': "system",
15      'description': "Is a default system slice (1) or not (0 or unset)",
16      'category' : 'slice/general',
17      'min_role_id': 10},
18     
19     # Slice enabled (1) or suspended (0)
20     {'tagname': "enabled",
21      'description': "Slice enabled (1 or unset) or suspended (0)",
22      'category' : 'slice/general',
23      'min_role_id': 10},
24     
25     # Slice reference image
26     {'tagname': "vref",
27      'description': "Reference image",
28      'category' : 'slice/config',
29      'min_role_id': 30},
30     
31     # Slice initialization script
32     {'tagname': "initscript",
33      'description': "Slice initialization script",
34      'category' : 'slice/config',
35      'min_role_id': 10},
36     
37     # IP Addresses for a Slice
38     {'tagname': "ip_addresses",
39      'description': "Add an ip address to a slice/sliver.",
40      'category' : 'slice/rspec',
41      'min_role_id': 10},
42     
43     # CPU share
44     {'tagname': "cpu_pct",
45      'description': "Reserved CPU percent",
46      'category' : 'slice/rspec',
47      'min_role_id': 10},
48     {'tagname': "cpu_share",
49      'description': "Number of CPU shares",
50      'category' : 'slice/rspec',
51      'min_role_id': 10},
52     
53     # Bandwidth limits
54     {'tagname': "net_min_rate",
55      'description': "Minimum bandwidth (kbps)",
56      'category' : 'slice/rspec',
57      'min_role_id': 10},
58     {'tagname': "net_max_rate",
59      'description': "Maximum bandwidth (kbps)",
60      'category' : 'slice/rspec',
61      'min_role_id': 10},
62     {'tagname': "net_i2_min_rate",
63      'description': "Minimum bandwidth over I2 routes (kbps)",
64      'category' : 'slice/rspec',
65      'min_role_id': 10},
66     {'tagname': "net_i2_max_rate",
67      'description': "Maximum bandwidth over I2 routes (kbps)",
68      'category' : 'slice/rspec',
69      'min_role_id': 10},
70     {'tagname': "net_max_kbyte",
71      'description': "Maximum daily network Tx KByte limit.",
72      'category' : 'slice/rspec',
73      'min_role_id': 10},
74     {'tagname': "net_thresh_kbyte",
75      'description': "KByte limit before warning and throttling.",
76      'category' : 'slice/rspec',
77      'min_role_id': 10},
78     {'tagname': "net_i2_max_kbyte",
79      'description': "Maximum daily network Tx KByte limit to I2 hosts.",
80      'category' : 'slice/rspec',
81      'min_role_id': 10},
82     {'tagname': "net_i2_thresh_kbyte",
83      'description': "KByte limit to I2 hosts before warning and throttling.",
84      'category' : 'slice/rspec',
85      'min_role_id': 10},
86     {'tagname': "net_share",
87      'description': "Number of bandwidth shares",
88      'category' : 'slice/rspec',
89      'min_role_id': 10},
90     {'tagname': "net_i2_share",
91      'description': "Number of bandwidth shares over I2 routes",
92      'category' : 'slice/rspec',
93      'min_role_id': 10},
94     
95     # Disk quota
96     {'tagname': "disk_max",
97      'description': "Disk quota (1k disk blocks)",
98      'category' : 'slice/rspec',
99      'min_role_id': 10},
100     
101     # Proper operations
102     {'tagname': "proper_op",
103      'description': "Proper operation (e.g. bind_socket)",
104      'category' : 'slice/rspec',
105      'min_role_id': 10},
106     
107     # VServer capabilities 
108     {'tagname': "capabilities",
109      'description': "VServer bcapabilities (separate by commas)",
110      'category' : 'slice/rspec',
111      'min_role_id': 10},
112     
113     # Vsys
114     {'tagname': "vsys",
115      'description': "Bind vsys script fd's to a slice's vsys directory.",
116      'category' : 'slice/rspec',
117      'min_role_id': 10},
118     
119     # CoDemux
120     {'tagname': "codemux",
121      'description': "Demux HTTP between slices using localhost ports. Value in the form 'host, localhost port'.",
122      'category' : 'slice/rspec',
123      'min_role_id': 10},
124     
125     # Delegation
126     {'tagname': "delegations",
127      'description': "Coma seperated list of slices to give delegation authority to.",
128      'category' : 'slice/rspec',
129      'min_role_id': 10}
130 ]
131
132 # add in the platform supported rlimits to the default_attribute_types
133 for entry in resource.__dict__.keys() + ["VLIMIT_OPENFD"]:
134     if entry.find("LIMIT_")==1:
135         rlim = entry[len("RLIMIT_"):]
136         rlim = rlim.lower()
137         for ty in ("min","soft","hard"):
138             attribute = {
139                 'tagname': "%s_%s"%(rlim,ty),
140                 'description': "Per sliver RLIMIT %s_%s."%(rlim,ty),
141                 'category': 'slice/limit',
142                 'min_role_id': 10 #admin
143                 }
144             slicetag_types.append(attribute)
145
146 for slicetag_type in slicetag_types:
147     SetTagType(slicetag_type)