1
# vim: tabstop=4 shiftwidth=4 softtabstop=4
3
# Copyright 2011 Isaku Yamahata <yamahata at valinux co jp>
6
# Licensed under the Apache License, Version 2.0 (the "License"); you may
7
# not use this file except in compliance with the License. You may obtain
8
# a copy of the License at
10
# http://www.apache.org/licenses/LICENSE-2.0
12
# Unless required by applicable law or agreed to in writing, software
13
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15
# License for the specific language governing permissions and limitations
20
SHUTTING_DOWN_CODE = 32
27
SHUTTING_DOWN = 'shutting-down'
28
TERMINATED = 'terminated'
40
# EC2 API instance status code
42
PENDING: PENDING_CODE,
43
RUNNING: RUNNING_CODE,
44
SHUTTING_DOWN: SHUTTING_DOWN_CODE,
45
TERMINATED: TERMINATED_CODE,
46
STOPPING: STOPPING_CODE,
47
STOPPED: STOPPED_CODE,
50
SHUTOFF: TERMINATED_CODE,
51
MIGRATE: RUNNING_CODE,
54
SUSPEND: STOPPED_CODE,
59
def name_to_code(name):
60
return _NAME_TO_CODE.get(name, PENDING_CODE)