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