2 #################### slice tag types
3 # xxx this should move to PLC/Accessors
5 # Setup default slice tag types
8 # Slice type (only vserver is supported)
10 'description': "Type of slice (e.g. vserver)",
11 'category' : 'slice/general',
12 'roles': ['admin','pi']},
16 'description': "Is a default system slice (1) or not (0 or unset)",
17 'category' : 'slice/general'},
19 # Slice enabled (1) or suspended (0)
20 {'tagname': "enabled",
21 'description': "Slice enabled (1 or unset) or suspended (0)",
22 'category' : 'slice/general'},
24 # Slice reference image
26 'description': "Reference image",
27 'category' : 'slice/config',
28 'roles' : ['admin','pi','user']},
30 # Slice initialization script
31 {'tagname': "initscript",
32 'description': "Slice initialization script",
33 'category' : 'slice/usertools',
34 'roles' : ['admin','pi','user']},
36 # IP Addresses for a Slice
37 {'tagname': "ip_addresses",
38 'description': "Add an ip address to a slice/sliver.",
39 'category' : 'slice/rspec'},
42 {'tagname': "cpu_pct",
43 'description': "Reserved CPU percent",
44 'category' : 'slice/rspec'},
45 {'tagname': "cpu_share",
46 'description': "Number of CPU shares",
47 'category' : 'slice/rspec'},
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'},
82 {'tagname': "disk_max",
83 'description': "Disk quota (1k disk blocks)",
84 'category' : 'slice/rspec'},
87 {'tagname': "proper_op",
88 'description': "Proper operation (e.g. bind_socket)",
89 'category' : 'slice/rspec'},
91 # VServer capabilities
92 {'tagname': "capabilities",
93 'description': "VServer bcapabilities (separate by commas)",
94 'category' : 'slice/rspec'},
98 'description': "Bind vsys script fd's to a slice's vsys directory.",
99 'category' : 'slice/rspec'},
102 {'tagname': "codemux",
103 'description': "Demux HTTP between slices using localhost ports. Value in the form 'host, localhost port'.",
104 'category' : 'slice/rspec'},
107 {'tagname': "delegations",
108 'description': "Coma seperated list of slices to give delegation authority to.",
109 'category' : 'slice/rspec',
110 'roles' : ['admin','pi','user']},
112 # Security capability to empower a slice to make an authenticated API call, set by silverauth NM plugin.
114 'description': "Sliver authorization key.",
115 'category' : 'slice/auth',
116 'roles': ['admin','pi']},
118 {'tagname': "ssh_key",
119 'description': "Sliver public ssh key.",
120 'category' : 'slice/auth',
121 'roles': ['admin','pi']},
123 # Capability to give a sliver access to unused raw disk
124 {'tagname': "rawdisk",
125 'description': "map unused raw disk devices into the slice",
126 'category' : 'slice/access', # we should get rid of this category thing
127 'roles': ['admin','pi']},
129 { 'tagname' : 'exempt_slice_until',
130 'description' : 'Exclude this slice from MyOps until given date (YYYYMMDD)',
131 'category' : 'slice/myops'},
133 # DistributedRateLimiting slice
135 'description': "Is a default Distributed Rate Limiting slice (1) or not (0 or unset)",
136 'category' : 'slice/general'},
138 # OMF controlled slice
139 {'tagname': "omf_control",
140 'description': "Pre-install and configure OMF Resource Controller in slice if set",
141 'category' : 'slice/usertools'},
144 # add in the platform supported rlimits to the default_attribute_types
145 for entry in resource.__dict__.keys() + ["VLIMIT_OPENFD"]:
146 if entry.find("LIMIT_")==1:
147 rlim = entry[len("RLIMIT_"):]
149 for ty in ("min","soft","hard"):
151 'tagname': "%s_%s"%(rlim,ty),
152 'description': "Per sliver RLIMIT %s_%s."%(rlim,ty),
153 'category': 'slice/limit',
155 slicetag_types.append(attribute)
157 for slicetag_type in slicetag_types:
158 SetTagType(slicetag_type)