cc1
v2.1
CC1 source code docs
Main Page
Related Pages
Packages
Classes
Files
File List
All
Classes
Namespaces
Files
Functions
Variables
Pages
error.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.ec2.error
22
# EC2 API exceptions
23
#
24
# @copyright Copyright (c) 2012 Institute of Nuclear Physics PAS <http://www.ifj.edu.pl/>
25
# @author Oleksandr Gituliar <gituliar@gmail.com>
26
# @author Łukasz Chrząszcz <l.chrzaszcz@gmail.com>
27
#
28
29
from
ec2
import
lookup
30
31
##
32
# Superclass for EC2 API exceptions.
33
class
EC2Exception
(BaseException):
34
35
##
36
# Store `context` used to build an error `message` in `to_xml`.
37
def
__init__
(self, **context):
38
self.
context
= context
39
40
##
41
# Return XML with error details compatible with Amazon EC2 WSDL.
42
def
to_xml
(self):
43
template = lookup.get_template(
'error.xml'
)
44
return
template.render(
45
code=self.code,
46
message=self.message % self.
context
,
47
)
48
49
class
AuthFailure
(
EC2Exception
):
50
code =
"AuthFailure"
51
message =
"AWS was not able to validate the provided access credentials."
52
#The address '%(address)s' does not belong to you
53
54
class
InsufficientAddressCapacity
(
EC2Exception
):
55
code =
"InsufficientAddressCapacity"
56
message =
"Not enough available addresses to satisfy your minimum request."
57
58
class
InvalidAction
(
EC2Exception
):
59
code =
"InvalidAction"
60
message =
"The action %(action)s is not valid for this web service."
61
62
class
InvalidAMIID
(object):
63
class
NotFound
(
EC2Exception
):
64
code =
"InvalidAMIID.NotFound"
65
message =
"The AMI ID '%(image_id)s' does not exist"
66
class
Malformed
(
EC2Exception
):
67
code =
"InvalidAMIID.Malformed"
68
message =
"Specified AMI ID is malformed"
69
class
Unavailable
(
EC2Exception
):
70
code =
"InvalidAMIID.Unavailable"
71
message =
"Specified AMI is temporarily unavailable"
72
73
class
InvalidInstanceID
(object):
74
class
Malformed
(
EC2Exception
):
75
code =
"InvalidInstanceID.Malformed"
76
message =
"The Instance ID '%(image_id)s' is not valid"
77
class
NotFound
(
EC2Exception
):
78
code =
"InvalidInstanceID.NotFound"
79
message =
"The Instance ID '%(image_id)s' does not exist"
80
81
class
InvalidKeyPair
(object):
82
class
Duplicate
(
EC2Exception
):
83
code =
"InvalidKeyPair.Duplicate"
84
message =
"The keypair '%(key_name)s' already exists."
85
class
NotFound
(
EC2Exception
):
86
code =
"InvalidKeyPair.NotFound"
87
message =
"The key pair '%(key_name)s' does not exist"
88
89
class
InvalidZone
(object):
90
class
NotFound
(
EC2Exception
):
91
code =
"InvalidZone.NotFound"
92
message =
"The zone '%(zone_name)s' does not exist."
93
94
class
MissingParameter
(
EC2Exception
):
95
code =
"MissingParameter"
96
message =
"The request must contain the parameter %(parameter)s"
97
98
class
UndefinedError
(
EC2Exception
):
99
code =
"UndefinedError"
100
message =
"There is no dedicated error to describe this situation. Contact developers if you need more information."
101
102
103
class
UnknownParameter
(
EC2Exception
):
104
code =
"UnknownParameter"
105
message =
"The parameter %(parameter)s is not recognized"
106
107
# Łukasz Chrząszcz : Amazon
108
class
VolumeInUse
(
EC2Exception
):
109
code =
"VolumeInUse"
110
message =
"Specified volume is attached to VM"
111
112
class
InvalidVolume
(object):
113
class
NotFound
(
EC2Exception
):
114
code =
"InvalidVolume"
115
message =
"Specified volume does not exist"
116
117
class
InvalidVolumeID
(object):
118
class
Duplicate
(
EC2Exception
):
119
code =
""
120
message =
""
121
class
Malformed
(
EC2Exception
):
122
code =
"InvalidVolumeID.Malformed"
123
message =
"Specified Volume ID is malformed, use only digits"
124
125
class
DiskImageSizeTooLarge
(
EC2Exception
):
126
code =
"DiskImageSizeTooLarge"
127
message =
"Quota exceeded"
128
129
class
InvalidParameterValue
(
EC2Exception
):
130
code =
"InvalidParameterValue"
131
message =
"A value specified in a parameter is not valid"
132
133
class
InvalidParameter
(
EC2Exception
):
134
code =
"InvalidParameter"
135
message =
"Invalid parameter"
136
137
class
InternalError
(
EC2Exception
):
138
code =
"InternalError"
139
message =
"An internal error has occurred. Try again later. If the problem persists, contact administrator"
140
141
class
InvalidAddress
(object):
142
class
NotFound
(
EC2Exception
):
143
code =
"InvalidAddress.NotFound"
144
message =
"Couldn't find specified Elastic IP address"
145
146
class
CannotDelete
(
EC2Exception
):
147
code =
"CannotDelete"
148
message =
"Can't delete default security group"
149
150
class
InvalidGroup
(object):
151
class
NotFound
(
EC2Exception
):
152
code =
"InvalidGroup.NotFound"
153
message =
"The specified security group does not exist"
154
155
class
InvalidIPAddress
(object):
156
class
InUse
(
EC2Exception
):
157
code =
"InvalidIPAddress"
158
message =
"Specified IP Address is already in use. You must first disassociate it from the instance"
159
160
class
InvalidFilter
(
EC2Exception
):
161
code =
"InvalidFilter"
162
message =
"The specified filter is not correct or it is not supported"
163
164
class
InvalidID
(
EC2Exception
):
165
code =
"InvalidID"
166
message =
"ID you've given is not valid or you cannot create tag for given resource."
167
168
class
InvalidAttachment
(object):
169
class
NotFound
(
EC2Exception
):
170
code =
"InvalidAttachment"
171
message =
"Volume not attached"
172
173
class
ResourceLimitExceeded
(
EC2Exception
):
174
code =
"ResourceLimitExceeded"
175
message =
"You've exceeded limit assigned to your account. Exceeded limit: %(resource)s"
176
177
# =================== S3 Errors ===================
178
179
class
MethodNotAllowed
(
EC2Exception
):
180
code =
"MethodNotAllowed"
181
message =
"The specified method is not allowed for given resource"
182
183
class
InvalidArgument
(
EC2Exception
):
184
code =
"InvalidArgument"
185
message =
"The specified argument is not valid"
186
187
class
InvalidURI
(
EC2Exception
):
188
code =
"InvalidURI"
189
message =
"Couldn't parse the specified URI"
190
191
class
InvalidAccessKeyId
(
EC2Exception
):
192
code =
"InvalidAccessKeyId"
193
message =
"The access key ID you provided is not valid"
194
195
class
InvalidManifest
(
EC2Exception
):
196
code =
"InvalidManifest"
197
message =
"The specified manifest is unparsable"
198
199
class
EntityTooLarge
(
EC2Exception
):
200
code =
"EntityTooLarge"
201
message =
"You don't have enough disk space"
202
203
class
IncompleteBody
(
EC2Exception
):
204
code =
"IncompleteBody"
205
message =
"The size of body is not equal to the provided Content-Length header value"
206
ec2
error.py
Generated on Wed Jun 18 2014 13:33:06 for cc1 by
1.8.1.2