allow vsys to be set by all persons - for PLC_VSYS_DEFAULTS
[plcapi.git] / db-config.d / 010-slice_tags
1 # -*-python-*-
2 #################### slice tag types
3 # xxx this should move to PLC/Accessors
4
5 # vref is now defined in an accessor
6 # initscript is now defined in an accessor
7     
8 # Setup default slice tag types
9 slicetag_types = \
10 [
11     # Slice type (only vserver is supported)
12     {'tagname': "type",
13      'description': "Type of slice (e.g. vserver)",
14      'category' : 'slice/general',
15      'roles': ['admin','pi']},
16     
17     # System slice
18     {'tagname': "system",
19      'description': "Is a default system slice (1) or not (0 or unset)",
20      'category' : 'slice/general'},
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     
27     # IP Addresses for a Slice
28     {'tagname': "ip_addresses",
29      'description': "Add an ip address to a slice/sliver.",
30      'category' : 'slice/rspec'},
31     {'tagname': "isolate_loopback",
32      'description': "Create an isolated loopback interface within the vserver rather than sharing with all vservers.",
33      'category' : 'slice/rspec'},
34     
35     # CPU share
36     {'tagname': "cpu_pct",
37      'description': "Reserved CPU percent",
38      'category' : 'slice/rspec'},
39     {'tagname': "cpu_share",
40      'description': "Number of CPU shares",
41      'category' : 'slice/rspec'},
42     {'tagname': "cpu_cores",
43      'description': "Number of CPU cores",
44      'category': 'slice/rspec'},
45     {'tagname': "cpu_freezable",
46      'description': "Slice processes should be frozen if cpu_cores is 0",
47      'category': 'slice/rspec'},     
48
49     # Bandwidth limits
50     {'tagname': "net_min_rate",
51      'description': "Minimum bandwidth (kbps)",
52      'category' : 'slice/rspec'},
53     {'tagname': "net_max_rate",
54      'description': "Maximum bandwidth (kbps)",
55      'category' : 'slice/rspec'},
56     {'tagname': "net_i2_min_rate",
57      'description': "Minimum bandwidth over I2 routes (kbps)",
58      'category' : 'slice/rspec'},
59     {'tagname': "net_i2_max_rate",
60      'description': "Maximum bandwidth over I2 routes (kbps)",
61      'category' : 'slice/rspec'},
62     {'tagname': "net_max_kbyte",
63      'description': "Maximum daily network Tx KByte limit.",
64      'category' : 'slice/rspec'},
65     {'tagname': "net_thresh_kbyte",
66      'description': "KByte limit before warning and throttling.",
67      'category' : 'slice/rspec'},
68     {'tagname': "net_i2_max_kbyte",
69      'description': "Maximum daily network Tx KByte limit to I2 hosts.",
70      'category' : 'slice/rspec'},
71     {'tagname': "net_i2_thresh_kbyte",
72      'description': "KByte limit to I2 hosts before warning and throttling.",
73      'category' : 'slice/rspec'},
74     {'tagname': "net_share",
75      'description': "Number of bandwidth shares",
76      'category' : 'slice/rspec'},
77     {'tagname': "net_i2_share",
78      'description': "Number of bandwidth shares over I2 routes",
79      'category' : 'slice/rspec'},
80     
81     # Disk quota
82     {'tagname': "disk_max",
83      'description': "Disk quota (1k disk blocks)",
84      'category' : 'slice/rspec'},
85     
86     # deprecated in nov. 2010
87     # Proper operations
88     #{'tagname': "proper_op",
89     # 'description': "Proper operation (e.g. bind_socket)",
90     # 'category' : 'slice/rspec'},
91     
92     # VServer capabilities 
93     {'tagname': "capabilities",
94      'description': "VServer bcapabilities (separate by commas)",
95      'category' : 'slice/rspec'},
96     
97     # Vsys
98     # need to allow this one so that slice can have that set from PLC_VSYS_DEFAULT
99     {'tagname': "vsys",
100      'description': "Bind vsys script fd's to a slice's /vsys directory.",
101      'category' : 'slice/rspec',
102      'roles': AllPersonRoles()},
103     {'tagname': "vsys_vnet",
104      'description': """Specify the IP range that can be used in a given slice
105 for virtual devices involved in topologies, e.g. 192.168.100.0/24""",
106      'category': 'slice/rspec'},
107     
108     # CoDemux
109     {'tagname': "codemux",
110      'description': "Demux HTTP between slices using localhost ports. Value in the form 'host, localhost port'.",
111      'category' : 'slice/rspec'},
112     
113     # Delegation
114     {'tagname': "delegations",
115      'description': "Coma seperated list of slices to give delegation authority to.",
116      'category' : 'slice/rspec',
117      'roles' : ['admin','pi','user']},
118
119     # Capability to give a sliver access to unused raw disk
120     {'tagname': "rawdisk",
121      'description': "map unused raw disk devices into the slice",
122      'category' : 'slice/access', # we should get rid of this category thing
123      'roles': ['admin','pi']},
124
125     { 'tagname' : 'exempt_slice_until',
126       'description' : 'Exclude this slice from MyOps until given date (YYYYMMDD)',
127       'category' : 'slice/myops'},
128
129     # DistributedRateLimiting slice
130     {'tagname': "drl",
131      'description': "Is a default Distributed Rate Limiting slice (1) or not (0 or unset)",
132      'category' : 'slice/general'},
133
134     {'tagname' : 'interface',
135      'description' : 'The interface tag holds network configuration information until VirtualInterface objects are in PLCAPI',
136      'category' : 'slice/network'},
137
138 ]
139
140 import resource
141 # add in the platform supported rlimits to the default_attribute_types
142 for entry in resource.__dict__.keys() + ["VLIMIT_OPENFD"]:
143     if entry.find("LIMIT_")==1:
144         rlim = entry[len("RLIMIT_"):]
145         rlim = rlim.lower()
146         for ty in ("min","soft","hard"):
147             attribute = {
148                 'tagname': "%s_%s"%(rlim,ty),
149                 'description': "Per sliver RLIMIT %s_%s."%(rlim,ty),
150                 'category': 'slice/limit',
151                 }
152             slicetag_types.append(attribute)
153
154 for slicetag_type in slicetag_types:
155     SetTagType(slicetag_type)