850dce577a4b98a56c6b9380c22784f34e29cff4
[plcapi.git] / db-config.d / 010-slice_tags
1 # -*-python-*-
2 # $Id$
3 # $URL$
4 #################### slice tag types
5 # xxx this should move to PLC/Accessors
6
7 # Setup default slice tag types
8 slicetag_types = \
9 [
10     # Slice type (only vserver is supported)
11     {'tagname': "type",
12      'description': "Type of slice (e.g. vserver)",
13      'category' : 'slice/general',
14      'min_role_id': 20},
15     
16     # System slice
17     {'tagname': "system",
18      'description': "Is a default system slice (1) or not (0 or unset)",
19      'category' : 'slice/general',
20      'min_role_id': 10},
21     
22     # Slice enabled (1) or suspended (0)
23     {'tagname': "enabled",
24      'description': "Slice enabled (1 or unset) or suspended (0)",
25      'category' : 'slice/general',
26      'min_role_id': 10},
27     
28     # Slice reference image
29     {'tagname': "vref",
30      'description': "Reference image",
31      'category' : 'slice/config',
32      'min_role_id': 30},
33     
34     # Slice initialization script
35     {'tagname': "initscript",
36      'description': "Slice initialization script",
37      'category' : 'slice/config',
38      'min_role_id': 30},
39     
40     # IP Addresses for a Slice
41     {'tagname': "ip_addresses",
42      'description': "Add an ip address to a slice/sliver.",
43      'category' : 'slice/rspec',
44      'min_role_id': 10},
45     
46     # CPU share
47     {'tagname': "cpu_pct",
48      'description': "Reserved CPU percent",
49      'category' : 'slice/rspec',
50      'min_role_id': 10},
51     {'tagname': "cpu_share",
52      'description': "Number of CPU shares",
53      'category' : 'slice/rspec',
54      'min_role_id': 10},
55     
56     # Bandwidth limits
57     {'tagname': "net_min_rate",
58      'description': "Minimum bandwidth (kbps)",
59      'category' : 'slice/rspec',
60      'min_role_id': 10},
61     {'tagname': "net_max_rate",
62      'description': "Maximum bandwidth (kbps)",
63      'category' : 'slice/rspec',
64      'min_role_id': 10},
65     {'tagname': "net_i2_min_rate",
66      'description': "Minimum bandwidth over I2 routes (kbps)",
67      'category' : 'slice/rspec',
68      'min_role_id': 10},
69     {'tagname': "net_i2_max_rate",
70      'description': "Maximum bandwidth over I2 routes (kbps)",
71      'category' : 'slice/rspec',
72      'min_role_id': 10},
73     {'tagname': "net_max_kbyte",
74      'description': "Maximum daily network Tx KByte limit.",
75      'category' : 'slice/rspec',
76      'min_role_id': 10},
77     {'tagname': "net_thresh_kbyte",
78      'description': "KByte limit before warning and throttling.",
79      'category' : 'slice/rspec',
80      'min_role_id': 10},
81     {'tagname': "net_i2_max_kbyte",
82      'description': "Maximum daily network Tx KByte limit to I2 hosts.",
83      'category' : 'slice/rspec',
84      'min_role_id': 10},
85     {'tagname': "net_i2_thresh_kbyte",
86      'description': "KByte limit to I2 hosts before warning and throttling.",
87      'category' : 'slice/rspec',
88      'min_role_id': 10},
89     {'tagname': "net_share",
90      'description': "Number of bandwidth shares",
91      'category' : 'slice/rspec',
92      'min_role_id': 10},
93     {'tagname': "net_i2_share",
94      'description': "Number of bandwidth shares over I2 routes",
95      'category' : 'slice/rspec',
96      'min_role_id': 10},
97     
98     # Disk quota
99     {'tagname': "disk_max",
100      'description': "Disk quota (1k disk blocks)",
101      'category' : 'slice/rspec',
102      'min_role_id': 10},
103     
104     # Proper operations
105     {'tagname': "proper_op",
106      'description': "Proper operation (e.g. bind_socket)",
107      'category' : 'slice/rspec',
108      'min_role_id': 10},
109     
110     # VServer capabilities 
111     {'tagname': "capabilities",
112      'description': "VServer bcapabilities (separate by commas)",
113      'category' : 'slice/rspec',
114      'min_role_id': 10},
115     
116     # Vsys
117     {'tagname': "vsys",
118      'description': "Bind vsys script fd's to a slice's vsys directory.",
119      'category' : 'slice/rspec',
120      'min_role_id': 10},
121     
122     # CoDemux
123     {'tagname': "codemux",
124      'description': "Demux HTTP between slices using localhost ports. Value in the form 'host, localhost port'.",
125      'category' : 'slice/rspec',
126      'min_role_id': 10},
127     
128     # Delegation
129     {'tagname': "delegations",
130      'description': "Coma seperated list of slices to give delegation authority to.",
131      'category' : 'slice/rspec',
132      'min_role_id': 30},
133
134     # Security capability to empower a slice to make an authenticated API call, set by silverauth NM plugin.
135     {'tagname': "hmac",
136      'description': "Sliver authorization key.",
137      'category' : 'slice/auth',
138      'min_role_id': 20},
139
140     # Capability to give a sliver access to unused raw disk
141     {'tagname': "rawdisk",
142      'description': "map unused raw disk devices into the slice",
143      'category' : 'slice/access', # we should get rid of this category thing
144      'min_role_id': 20},
145
146     { 'tagname' : 'exempt_slice_until',
147       'description' : 'Exclude this slice from MyOps until given date (YYYYMMDD)',
148       'category' : 'slice/myops', 
149       'min_role_id' : 10} ,
150
151     # DistributedRateLimiting slice
152     {'tagname': "drl",
153      'description': "Is a default Distributed Rate Limiting slice (1) or not (0 or unset)",
154      'category' : 'slice/general',
155      'min_role_id': 10},
156 ]
157
158 # add in the platform supported rlimits to the default_attribute_types
159 for entry in resource.__dict__.keys() + ["VLIMIT_OPENFD"]:
160     if entry.find("LIMIT_")==1:
161         rlim = entry[len("RLIMIT_"):]
162         rlim = rlim.lower()
163         for ty in ("min","soft","hard"):
164             attribute = {
165                 'tagname': "%s_%s"%(rlim,ty),
166                 'description': "Per sliver RLIMIT %s_%s."%(rlim,ty),
167                 'category': 'slice/limit',
168                 'min_role_id': 10 #admin
169                 }
170             slicetag_types.append(attribute)
171
172 for slicetag_type in slicetag_types:
173     SetTagType(slicetag_type)