cc1  v2.1
CC1 source code docs
 All Classes Namespaces Files Functions Variables Pages
states.py
Go to the documentation of this file.
1 # -*- coding: utf-8 -*-
2 # @COPYRIGHT_begin
3 #
4 # Copyright [2010-2014] Institute of Nuclear Physics PAN, Krakow, Poland
5 #
6 # Licensed under the Apache License, Version 2.0 (the "License");
7 # you may not use this file except in compliance with the License.
8 # You may obtain a copy of the License at
9 #
10 # http://www.apache.org/licenses/LICENSE-2.0
11 #
12 # Unless required by applicable law or agreed to in writing, software
13 # distributed under the License is distributed on an "AS IS" BASIS,
14 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 # See the License for the specific language governing permissions and
16 # limitations under the License.
17 #
18 # @COPYRIGHT_end
19 
20 ##
21 # @package src.common.states
22 # Dictionaries of the states' numbers and messages:
23 #
24 # - \c vm_states dictionary,
25 # - \c farm_states dictionary,
26 # - \c node_states dictionary,
27 # - \c vnc_states dictionary,
28 # - \c lease_states dictionary,
29 # - \c template_states dictionary,
30 # - \c image_type dictionary,
31 # - \c image_access dictionary,
32 # - \c image_states dictionary,
33 # - \c image_platforms dictionary,
34 # - \c filesystems dictionary,
35 # - \c filesystems_inv dictionary,
36 # - \c group_states dictionary,
37 # - \c cluster_states dictionary,
38 # - \c message_levels dictionary,
39 # - \c storage_states dictionary.
40 #
41 
42 vm_states = {'init': 0,
43  'running': 1,
44  'closing': 2,
45  'closed': 3,
46  'saving': 4,
47  'failed': 5,
48  'saving failed': 6,
49  'running ctx': 7,
50  'restart': 8,
51  'suspend': 9,
52  'turned off': 10,
53  'erased': 11,
54  'erasing': 12
55  }
56 
57 farm_states = {'init': 0,
58  'init_head': 1, # head is running, without ctx, wn are only in db
59  'init_nodes': 2, # head ctx called, wn are now copied
60  'running': 3,
61  'closing': 4,
62  'closed': 5,
63  'failed': 6,
64  'unconfigured': 7, # could not generate ssh key, or update hosts\
65  'nodes_copied': 8,
66  'saving_head': 9,
67  }
68 
69 node_states = {
70  'init': 0,
71  'ok': 1,
72  'locked': 2,
73  'deleted': 3,
74  'storage_lock': 4,
75  'offline': 5,
76  }
77 
78 vnc_states = {
79  'detached': 0,
80  'attached': 1
81  }
82 
83 lease_states = {
84  'free': 0,
85  'used': 1
86  }
87 
88 template_states = {
89  'active': 0,
90  'deleted': 1
91  }
92 
93 image_types = {
94  'cd': 0,
95  'storage': 1,
96  'vm': 2
97  }
98 
99 image_access = {
100  'private': 0,
101  'public': 1,
102  'group': 2
103  }
104 
105 image_states = {
106  'ok': 0,
107  'locked': 1,
108  'adding': 2,
109  'failed': 3,
110  'unavailable': 4,
111  'formatting': 5
112  }
113 
114 image_platforms = {
115  'unknown': 0,
116  'linux': 1,
117  'unix': 2,
118  'windows': 3,
119  'mac os': 4,
120  'other': 5
121  }
122 
123 group_states = {
124  'waiting': 0,
125  'ok': 1,
126  'not member': 2
127  }
128 
129 user_active_states = {
130  'inactive': 0,
131  'email_confirmed': 1,
132  'ok': 2,
133  'blocked': 3
134  }
135 
136 cluster_states = {
137  'ok': 0,
138  'locked': 1
139  }
140 message_levels = {
141  'error': 0,
142  'warn': 1,
143  'info': 2
144  }
145 
146 storage_states = {
147  'ok': 0,
148  'locked': 1
149  }
150 
151 ec2names = {
152  'unassigned': 0,
153  'm1.small': 1,
154  'm1.medium': 2,
155  'm1.large': 3,
156  'm1.xlarge': 4,
157  'm1.micro': 5,
158  'c1.medium': 6,
159  'c1.xlarge': 7,
160  'm2.xlarge': 8,
161  'm2.2xlarge': 9,
162  'm2.4xlarge': 10,
163  'cc1.4xlarge': 11,
164  'cg1.4xlarge': 12,
165 }
166 
167 available_network_states = {
168  'ok': 0,
169  'locked': 1,
170  }
171 
172 registration_states = {
173  'completed': 0,
174  'mail_confirmation': 1,
175  'admin_confirmation': 2,
176  'error': 3,
177  }
178 
179 stat_resolutions = {
180  '10': 0,
181  '60': 1, # 1 min
182  '300': 2, # 5 min
183  '900': 3, # 15 min
184  '3600': 4, # 1 h
185  '86400': 5, # 24 h
186  '604800': 6, # 7 days
187  }
188 
189 stat_names = {
190  'cpu_time': 0,
191  'rd_req': 1,
192  'rd_bytes': 2,
193  'wr_req': 3,
194  'wr_bytes': 4,
195  'rx_bytes': 5,
196  'rx_packets': 6,
197  'tx_bytes': 7,
198  'tx_packets': 8,
199  }
200 
201 stat_ranges = {
202  '3600': 0, # 1h
203  '21600': 1, # 6h
204  '43200': 2, # 12h
205  '86400': 3, # 1 day
206  '604800': 4, # 1 week
207  '2592000': 5, # 1 month
208  '31536000': 6, # 1 year
209  }
210 
211 stat_units = {
212  'bytes': 0,
213  'time': 1,
214  'ops': 2,
215  'num': 3,
216  }
217 
218 command_states = {
219  'pending': 0,
220  'executing': 1,
221  'failed': 2,
222  'timeout': 3,
223  'finished': 4
224 }
225