|
| 1 | +# This file has been copied from: |
| 2 | +#-- |
| 3 | +# Amazon Web Services EC2 + ELB API Ruby library |
| 4 | +# |
| 5 | +# Ruby Gem Name:: amazon-ec2 |
| 6 | +# Author:: Glenn Rempe (mailto:[email protected]) |
| 7 | +# Copyright:: Copyright (c) 2007-2009 Glenn Rempe |
| 8 | +# License:: Distributes under the same terms as Ruby |
| 9 | +# Home:: http://github.com/grempe/amazon-ec2/tree/master |
| 10 | +#++ |
| 11 | + |
| 12 | +#-- |
| 13 | +# AWS ERROR CODES |
| 14 | +# AWS can throw error exceptions that contain a '.' in them. |
| 15 | +# since we can't name an exception class with that '.' I compressed |
| 16 | +# each class name into the non-dot version which allows us to retain |
| 17 | +# the granularity of the exception. |
| 18 | +#++ |
| 19 | + |
| 20 | +module AWS |
| 21 | + |
| 22 | + # All AWS errors are superclassed by Error < RuntimeError |
| 23 | + class Error < RuntimeError; end |
| 24 | + |
| 25 | + # CLIENT : A client side argument error |
| 26 | + class ArgumentError < Error; end |
| 27 | + |
| 28 | + # Elastic Compute Cloud |
| 29 | + ############################ |
| 30 | + |
| 31 | + # EC2 : User has the maximum number of allowed IP addresses. |
| 32 | + class AddressLimitExceeded < Error; end |
| 33 | + |
| 34 | + # EC2 : The limit on the number of Amazon EBS volumes attached to one instance has been exceeded. |
| 35 | + class AttachmentLimitExceeded < Error; end |
| 36 | + |
| 37 | + # EC2 : User not authorized. |
| 38 | + class AuthFailure < Error; end |
| 39 | + |
| 40 | + # EC2 : Volume is in incorrect state |
| 41 | + class IncorrectState < Error; end |
| 42 | + |
| 43 | + # EC2 : User has max allowed concurrent running instances. |
| 44 | + class InstanceLimitExceeded < Error; end |
| 45 | + |
| 46 | + # EC2 : The value of an item added to, or removed from, an image attribute is invalid. |
| 47 | + class InvalidAMIAttributeItemValue < Error; end |
| 48 | + |
| 49 | + # EC2 : Specified AMI ID is not valid. |
| 50 | + class InvalidAMIIDMalformed < Error; end |
| 51 | + |
| 52 | + # EC2 : Specified AMI ID does not exist. |
| 53 | + class InvalidAMIIDNotFound < Error; end |
| 54 | + |
| 55 | + # EC2 : Specified AMI ID has been deregistered and is no longer available. |
| 56 | + class InvalidAMIIDUnavailable < Error; end |
| 57 | + |
| 58 | + # EC2 : The instance cannot detach from a volume to which it is not attached. |
| 59 | + class InvalidAttachmentNotFound < Error; end |
| 60 | + |
| 61 | + # EC2 : The device to which you are trying to attach (i.e. /dev/sdh) is already in use on the instance. |
| 62 | + class InvalidDeviceInUse < Error; end |
| 63 | + |
| 64 | + # EC2 : Specified instance ID is not valid. |
| 65 | + class InvalidInstanceIDMalformed < Error; end |
| 66 | + |
| 67 | + # EC2 : Specified instance ID does not exist. |
| 68 | + class InvalidInstanceIDNotFound < Error; end |
| 69 | + |
| 70 | + # EC2 : Specified keypair name does not exist. |
| 71 | + class InvalidKeyPairNotFound < Error; end |
| 72 | + |
| 73 | + # EC2 : Attempt to create a duplicate keypair. |
| 74 | + class InvalidKeyPairDuplicate < Error; end |
| 75 | + |
| 76 | + # EC2 : Specified group name does not exist. |
| 77 | + class InvalidGroupNotFound < Error; end |
| 78 | + |
| 79 | + # EC2 : Attempt to create a duplicate group. |
| 80 | + class InvalidGroupDuplicate < Error; end |
| 81 | + |
| 82 | + # EC2 : Specified group can not be deleted because it is in use. |
| 83 | + class InvalidGroupInUse < Error; end |
| 84 | + |
| 85 | + # EC2 : Specified group name is a reserved name. |
| 86 | + class InvalidGroupReserved < Error; end |
| 87 | + |
| 88 | + # EC2 : Specified AMI has an unparsable manifest. |
| 89 | + class InvalidManifest < Error; end |
| 90 | + |
| 91 | + # EC2 : RunInstances was called with minCount and maxCount set to 0 or minCount > maxCount. |
| 92 | + class InvalidParameterCombination < Error; end |
| 93 | + |
| 94 | + # EC2 : The value supplied for a parameter was invalid. |
| 95 | + class InvalidParameterValue < Error; end |
| 96 | + |
| 97 | + # EC2 : Attempt to authorize a permission that has already been authorized. |
| 98 | + class InvalidPermissionDuplicate < Error; end |
| 99 | + |
| 100 | + # EC2 : Specified permission is invalid. |
| 101 | + class InvalidPermissionMalformed < Error; end |
| 102 | + |
| 103 | + # EC2 : Specified reservation ID is invalid. |
| 104 | + class InvalidReservationIDMalformed < Error; end |
| 105 | + |
| 106 | + # EC2 : Specified reservation ID does not exist. |
| 107 | + class InvalidReservationIDNotFound < Error; end |
| 108 | + |
| 109 | + # EC2 : The snapshot ID that was passed as an argument was malformed. |
| 110 | + class InvalidSnapshotIDMalformed < Error; end |
| 111 | + |
| 112 | + # EC2 : The specified snapshot does not exist. |
| 113 | + class InvalidSnapshotIDNotFound < Error; end |
| 114 | + |
| 115 | + # EC2 : The user ID is neither in the form of an AWS account ID or one |
| 116 | + # of the special values accepted by the owner or executableBy flags |
| 117 | + # in the DescribeImages call. |
| 118 | + class InvalidUserIDMalformed < Error; end |
| 119 | + |
| 120 | + # EC2 : Reserved Instances ID not found. |
| 121 | + class InvalidReservedInstancesId < Error; end |
| 122 | + |
| 123 | + # EC2 : Reserved Instances Offering ID not found. |
| 124 | + class InvalidReservedInstancesOfferingId < Error; end |
| 125 | + |
| 126 | + # EC2 : The volume ID that was passed as an argument was malformed. |
| 127 | + class InvalidVolumeIDMalformed < Error; end |
| 128 | + |
| 129 | + # EC2 : The volume specified does not exist. |
| 130 | + class InvalidVolumeIDNotFound < Error; end |
| 131 | + |
| 132 | + # EC2 : The volume already exists in the system. |
| 133 | + class InvalidVolumeIDDuplicate < Error; end |
| 134 | + |
| 135 | + # EC2 : The specified volume ID and instance ID are in different Availability Zones. |
| 136 | + class InvalidVolumeIDZoneMismatch < Error; end |
| 137 | + |
| 138 | + # EC2 : The zone specified does not exist. |
| 139 | + class InvalidZoneNotFound < Error; end |
| 140 | + |
| 141 | + # EC2 : Insufficient Reserved Instances capacity. |
| 142 | + class InsufficientReservedInstancesCapacity < Error; end |
| 143 | + |
| 144 | + # EC2 : The instance specified does not support EBS. |
| 145 | + class NonEBSInstance < Error; end |
| 146 | + |
| 147 | + # EC2 : The limit on the number of Amazon EBS snapshots in the pending state has been exceeded. |
| 148 | + class PendingSnapshotLimitExceeded < Error; end |
| 149 | + |
| 150 | + # EC2 : Your current quota does not allow you to purchase the required number of reserved instances. |
| 151 | + class ReservedInstancesLimitExceeded < Error; end |
| 152 | + |
| 153 | + # EC2 : The limit on the number of Amazon EBS snapshots has been exceeded. |
| 154 | + class SnapshotLimitExceeded < Error; end |
| 155 | + |
| 156 | + # EC2 : An unknown parameter was passed as an argument |
| 157 | + class UnknownParameter < Error; end |
| 158 | + |
| 159 | + # EC2 : The limit on the number of Amazon EBS volumes has been exceeded. |
| 160 | + class VolumeLimitExceeded < Error; end |
| 161 | + |
| 162 | + # Server Error Codes |
| 163 | + ### |
| 164 | + |
| 165 | + # Server : Internal Error. |
| 166 | + class InternalError < Error; end |
| 167 | + |
| 168 | + # Server : Not enough available addresses to satisfy your minimum request. |
| 169 | + class InsufficientAddressCapacity < Error; end |
| 170 | + |
| 171 | + # Server : There are not enough available instances to satisfy your minimum request. |
| 172 | + class InsufficientInstanceCapacity < Error; end |
| 173 | + |
| 174 | + # Server : There are not enough available reserved instances to satisfy your minimum request. |
| 175 | + class InsufficientReservedInstanceCapacity < Error; end |
| 176 | + |
| 177 | + # Server : The server is overloaded and cannot handle the request. |
| 178 | + class Unavailable < Error; end |
| 179 | + |
| 180 | + # Elastic Load Balancer |
| 181 | + ############################ |
| 182 | + |
| 183 | + # ELB : The Load balancer specified was not found. |
| 184 | + class LoadBalancerNotFound < Error; end |
| 185 | + |
| 186 | + # ELB : |
| 187 | + class ValidationError < Error; end |
| 188 | + |
| 189 | + # ELB : |
| 190 | + class DuplicateLoadBalancerName < Error; end |
| 191 | + |
| 192 | + # ELB : |
| 193 | + class TooManyLoadBalancers < Error; end |
| 194 | + |
| 195 | + # ELB : |
| 196 | + class InvalidInstance < Error; end |
| 197 | + |
| 198 | + # ELB : |
| 199 | + class InvalidConfigurationRequest < Error; end |
| 200 | + |
| 201 | + # API Errors |
| 202 | + ############################ |
| 203 | + |
| 204 | + # Server : Invalid AWS Account |
| 205 | + class InvalidClientTokenId < Error; end |
| 206 | + |
| 207 | + # Server : The provided signature does not match. |
| 208 | + class SignatureDoesNotMatch < Error; end |
| 209 | + |
| 210 | +end |
| 211 | + |
0 commit comments