DRL slice
[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': 30},
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': 30},
130
131     # Security capability to empower a slice to make an authenticated API call, set by silverauth NM plugin.
132     {'tagname': "hmac",
133      'description': "Sliver authorization key.",
134      'category' : 'slice/auth',
135      'min_role_id': 20},
136
137     # Capability to give a sliver access to unused raw disk
138     {'tagname': "rawdisk",
139      'description': "map unused raw disk devices into the slice",
140      'category' : 'slice/access', # we should get rid of this category thing
141      'min_role_id': 20},
142
143     { 'tagname' : 'exempt_slice_until',
144       'description' : 'Exclude this slice from MyOps until given date (YYYYMMDD)',
145       'category' : 'slice/myops', 
146       'min_role_id' : 10} ,
147
148     # DistributedRateLimiting slice
149     {'tagname': "drl",
150      'description': "Is a default Distributed Rate Limiting slice (1) or not (0 or unset)",
151      'category' : 'slice/general',
152      'min_role_id': 10},
153 ]
154
155 # add in the platform supported rlimits to the default_attribute_types
156 for entry in resource.__dict__.keys() + ["VLIMIT_OPENFD"]:
157     if entry.find("LIMIT_")==1:
158         rlim = entry[len("RLIMIT_"):]
159         rlim = rlim.lower()
160         for ty in ("min","soft","hard"):
161             attribute = {
162                 'tagname': "%s_%s"%(rlim,ty),
163                 'description': "Per sliver RLIMIT %s_%s."%(rlim,ty),
164                 'category': 'slice/limit',
165                 'min_role_id': 10 #admin
166                 }
167             slicetag_types.append(attribute)
168
169 for slicetag_type in slicetag_types:
170     SetTagType(slicetag_type)