aws-sdk 1.5.8 → 1.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (53) hide show
  1. data/lib/aws.rb +2 -0
  2. data/lib/aws/api_config/Route53-2012-02-29.yml +348 -0
  3. data/lib/aws/auto_scaling/client.rb +362 -588
  4. data/lib/aws/cloud_formation/client.rb +155 -224
  5. data/lib/aws/cloud_watch/client.rb +156 -229
  6. data/lib/aws/core.rb +67 -52
  7. data/lib/aws/core/client.rb +81 -82
  8. data/lib/aws/core/collection/with_limit_and_next_token.rb +2 -2
  9. data/lib/aws/core/configuration.rb +75 -72
  10. data/lib/aws/core/http/net_http_handler.rb +3 -3
  11. data/lib/aws/core/http/request.rb +107 -138
  12. data/lib/aws/core/inflection.rb +3 -3
  13. data/lib/aws/core/json_client.rb +106 -0
  14. data/lib/aws/core/option_grammar.rb +10 -1
  15. data/lib/aws/core/options/validator.rb +140 -0
  16. data/lib/aws/core/options/xml_serializer.rb +98 -0
  17. data/lib/aws/core/query_client.rb +131 -0
  18. data/lib/aws/core/rest_client.rb +90 -0
  19. data/lib/aws/core/rest_client/input_handler.rb +145 -0
  20. data/lib/aws/core/rest_client/output_handler.rb +43 -0
  21. data/lib/aws/core/signature/version_2.rb +7 -7
  22. data/lib/aws/core/signature/version_3.rb +5 -1
  23. data/lib/aws/core/signature/version_3_https.rb +51 -0
  24. data/lib/aws/core/signature/version_4.rb +5 -22
  25. data/lib/aws/core/signer.rb +1 -1
  26. data/lib/aws/core/uri_escape.rb +2 -0
  27. data/lib/aws/core/xml/frame.rb +8 -8
  28. data/lib/aws/core/xml/grammar.rb +8 -3
  29. data/lib/aws/dynamo_db/client.rb +600 -662
  30. data/lib/aws/ec2/client.rb +2688 -3492
  31. data/lib/aws/ec2/request.rb +0 -1
  32. data/lib/aws/elb/client.rb +280 -407
  33. data/lib/aws/emr/client.rb +7 -7
  34. data/lib/aws/iam/client.rb +822 -1268
  35. data/lib/aws/route_53.rb +71 -0
  36. data/lib/aws/route_53/client.rb +272 -0
  37. data/lib/aws/route_53/config.rb +18 -0
  38. data/lib/aws/route_53/errors.rb +22 -0
  39. data/lib/aws/route_53/request.rb +23 -0
  40. data/lib/aws/s3/object_version_collection.rb +6 -6
  41. data/lib/aws/s3/paginated_collection.rb +1 -1
  42. data/lib/aws/s3/request.rb +10 -5
  43. data/lib/aws/simple_db/client.rb +184 -234
  44. data/lib/aws/simple_email_service/client.rb +147 -238
  45. data/lib/aws/simple_workflow/client.rb +997 -1191
  46. data/lib/aws/sns/client.rb +176 -264
  47. data/lib/aws/sqs/client.rb +162 -253
  48. data/lib/aws/sqs/queue.rb +1 -1
  49. data/lib/aws/sqs/request.rb +4 -0
  50. data/lib/aws/sts/client.rb +57 -66
  51. metadata +95 -71
  52. data/lib/aws/core/client/query_json.rb +0 -112
  53. data/lib/aws/core/client/query_xml.rb +0 -122
@@ -0,0 +1,71 @@
1
+ # Copyright 2011-2012 Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License"). You
4
+ # may not use this file except in compliance with the License. A copy of
5
+ # the License is located at
6
+ #
7
+ # http://aws.amazon.com/apache2.0/
8
+ #
9
+ # or in the "license" file accompanying this file. This file is
10
+ # distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
11
+ # ANY KIND, either express or implied. See the License for the specific
12
+ # language governing permissions and limitations under the License.
13
+
14
+ require 'aws/core'
15
+ require 'aws/route_53/config'
16
+
17
+ module AWS
18
+
19
+ # This class is the starting point for working with Amazon Route 53.
20
+ #
21
+ # To use Amazon Route 53 you must first
22
+ # {sign up here}[http://aws.amazon.com/route53/].
23
+ #
24
+ # For more information about Amazon Route 53:
25
+ #
26
+ # * {Amazon Route 53}[http://aws.amazon.com/route53/]
27
+ # * {Amazon Route 53 Documentation}[http://aws.amazon.com/documentation/route53/]
28
+ #
29
+ # = Credentials
30
+ #
31
+ # You can setup default credentials for all AWS services via
32
+ # AWS.config:
33
+ #
34
+ # AWS.config(
35
+ # :access_key_id => 'YOUR_ACCESS_KEY_ID',
36
+ # :secret_access_key => 'YOUR_SECRET_ACCESS_KEY')
37
+ #
38
+ # Or you can set them directly on the AWS::Route53 interface:
39
+ #
40
+ # r53 = AWS::Route53.new(
41
+ # :access_key_id => 'YOUR_ACCESS_KEY_ID',
42
+ # :secret_access_key => 'YOUR_SECRET_ACCESS_KEY')
43
+ #
44
+ # = Using the Client
45
+ #
46
+ # AWS::Route53 does not provide higher level abstractions for Route 53 at
47
+ # this time. You can still access all of the API methods using
48
+ # {AWS::Route53::Client}. Here is how you access the client and make
49
+ # a simple request:
50
+ #
51
+ # r53 = AWS::Route53.new
52
+ #
53
+ # resp = r53.client.list_hosted_zones
54
+ # resp[:hosted_zones].each do |zone|
55
+ # # ...
56
+ # end
57
+ #
58
+ # See {Client} for documentation on all of the supported operations.
59
+ #
60
+ class Route53
61
+
62
+ AWS.register_autoloads(self, 'aws/route_53') do
63
+ autoload :Client, 'client'
64
+ autoload :Errors, 'errors'
65
+ autoload :Request, 'request'
66
+ end
67
+
68
+ include Core::ServiceInterface
69
+
70
+ end
71
+ end
@@ -0,0 +1,272 @@
1
+ # Copyright 2011-2012 Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License"). You
4
+ # may not use this file except in compliance with the License. A copy of
5
+ # the License is located at
6
+ #
7
+ # http://aws.amazon.com/apache2.0/
8
+ #
9
+ # or in the "license" file accompanying this file. This file is
10
+ # distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
11
+ # ANY KIND, either express or implied. See the License for the specific
12
+ # language governing permissions and limitations under the License.
13
+
14
+ module AWS
15
+ class Route53
16
+ class Client < Core::Client
17
+
18
+ API_VERSION = '2012-02-29'
19
+
20
+ extend Core::RESTClient
21
+
22
+ # @private
23
+ CACHEABLE_REQUESTS = Set[]
24
+
25
+ ## client methods ##
26
+
27
+ # Calls the POST ChangeResourceRecordSets API operation.
28
+ # @method change_resource_record_sets(options = {})
29
+ # @param [Hash] options
30
+ # * +:hosted_zone_id+ - *required* - (String) Alias resource record sets
31
+ # only: The value of the hosted zone ID, CanonicalHostedZoneNameId, for
32
+ # the LoadBalancer. Currently, Route 53 supports alias resource record
33
+ # sets only for Elastic Load Balancing. For more information, an
34
+ # example, and several ways to get the hosted zone ID for the
35
+ # LoadBalancer, see Creating Alias Resource Record Sets for Elastic
36
+ # Load Balancing in the Amazon Route 53 Developer Guide.
37
+ # * +:change_batch+ - *required* - (Hash) A complex type that contains an
38
+ # optional comment and the Changes element.
39
+ # * +:comment+ - (String) Optional: Any comments you want to include
40
+ # about a change batch request.
41
+ # * +:changes+ - *required* - (Array<Hash>) A complex type that
42
+ # contains one Change element for each resource record set that you
43
+ # want to create or delete.
44
+ # * +:action+ - *required* - (String) The action to perform. Valid
45
+ # values: CREATE | DELETE
46
+ # * +:resource_record_set+ - *required* - (Hash) Information about
47
+ # the resource record set to create or delete.
48
+ # * +:name+ - *required* - (String) The domain name of the current
49
+ # resource record set.
50
+ # * +:type+ - *required* - (String) The type of the current
51
+ # resource record set.
52
+ # * +:set_identifier+ - (String) Weighted resource record sets or
53
+ # Regional resource record sets only: An identifier that
54
+ # differentiates among multiple resource record sets that have
55
+ # the same combination of DNS name and type.
56
+ # * +:weight+ - (Integer) Weighted resource record sets only: Among
57
+ # resource record sets that have the same combination of DNS name
58
+ # and type, a value that determines what portion of traffic for
59
+ # the current resource record set is routed to the associated
60
+ # location.
61
+ # * +:region+ - (String) Regional resource record sets only: Among
62
+ # resource record sets that have the same combination of DNS name
63
+ # and type, a value that specifies the AWS region for the current
64
+ # resource record set.
65
+ # * +:ttl+ - (Integer) The cache time to live for the current
66
+ # resource record set.
67
+ # * +:resource_records+ - (Array<Hash>) A complex type that
68
+ # contains the resource records for the current resource record
69
+ # set.
70
+ # * +:value+ - *required* - (String) The value of the Value
71
+ # element for the current resource record set.
72
+ # * +:alias_target+ - (Hash) Alias resource record sets only:
73
+ # Information about the Elastic Load Balancing LoadBalancer to
74
+ # which you are redirecting traffic.
75
+ # * +:hosted_zone_id+ - *required* - (String) Alias resource
76
+ # record sets only: The value of the hosted zone ID,
77
+ # CanonicalHostedZoneNameId, for the LoadBalancer. Currently,
78
+ # Route 53 supports alias resource record sets only for Elastic
79
+ # Load Balancing. For more information, an example, and several
80
+ # ways to get the hosted zone ID for the LoadBalancer, see
81
+ # Creating Alias Resource Record Sets for Elastic Load
82
+ # Balancing in the Amazon Route 53 Developer Guide.
83
+ # * +:dns_name+ - *required* - (String) Alias resource record
84
+ # sets only: The external DNS name associated with the
85
+ # LoadBalancer. Currently, Route 53 supports alias resource
86
+ # record sets only for Elastic Load Balancing. For more
87
+ # information, an example, and several ways to get the hosted
88
+ # zone ID for the LoadBalancer, see Creating Alias Resource
89
+ # Record Sets for Elastic Load Balancing in the Amazon Route 53
90
+ # Developer Guide.
91
+ # @return [Core::Response]
92
+ # The #data method of the response object returns
93
+ # a hash with the following structure:
94
+ # * +:change_info+ - (Hash)
95
+ # * +:id+ - (String)
96
+ # * +:status+ - (String)
97
+ # * +:submitted_at+ - (Time)
98
+ # * +:comment+ - (String)
99
+ define_client_method :change_resource_record_sets, 'ChangeResourceRecordSets'
100
+
101
+ # Calls the POST CreateHostedZone API operation.
102
+ # @method create_hosted_zone(options = {})
103
+ # @param [Hash] options
104
+ # * +:name+ - *required* - (String) The name of the domain. This must be
105
+ # a fully-specified domain, for example, www.example.com. The trailing
106
+ # dot is optional; Route 53 assumes that the domain name is fully
107
+ # qualified. This means that Route 53 treats www.example.com (without a
108
+ # trailing dot) and www.example.com. (with a trailing dot) as
109
+ # identical. This is the name you have registered with your DNS
110
+ # registrar. You should ask your registrar to change the authoritative
111
+ # name servers for your domain to the set of NameServers elements
112
+ # returned in DelegationSet.
113
+ # * +:caller_reference+ - *required* - (String) A unique string that
114
+ # identifies the request and that allows failed CreateHostedZone
115
+ # requests to be retried without the risk of executing the operation
116
+ # twice. You must use a unique CallerReference string every time you
117
+ # create a hosted zone. CallerReference can be any unique string; you
118
+ # might choose to use a string that identifies your project, such as
119
+ # DNSMigration_01. Valid characters are any Unicode code points that
120
+ # are legal in an XML 1.0 document. The UTF-8 encoding of the value
121
+ # must be less than 128 bytes.
122
+ # * +:hosted_zone_config+ - (Hash) A complex type that contains an
123
+ # optional comment about your hosted zone.
124
+ # * +:comment+ - (String) An optional comment about your hosted zone.
125
+ # If you don't want to specify a comment, you can omit the
126
+ # HostedZoneConfig and Comment elements from the XML document.
127
+ # @return [Core::Response]
128
+ # The #data method of the response object returns
129
+ # a hash with the following structure:
130
+ # * +:hosted_zone+ - (Hash)
131
+ # * +:id+ - (String)
132
+ # * +:name+ - (String)
133
+ # * +:caller_reference+ - (String)
134
+ # * +:config+ - (Hash)
135
+ # * +:comment+ - (String)
136
+ # * +:resource_record_set_count+ - (Integer)
137
+ # * +:change_info+ - (Hash)
138
+ # * +:id+ - (String)
139
+ # * +:status+ - (String)
140
+ # * +:submitted_at+ - (Time)
141
+ # * +:comment+ - (String)
142
+ # * +:delegation_set+ - (Hash)
143
+ # * +:name_servers+ - (Array<String>)
144
+ define_client_method :create_hosted_zone, 'CreateHostedZone'
145
+
146
+ # Calls the DELETE DeleteHostedZone API operation.
147
+ # @method delete_hosted_zone(options = {})
148
+ # @param [Hash] options
149
+ # * +:id+ - *required* - (String) The ID of the request. Include this ID
150
+ # in a call to GetChange to track when the change has propagated to all
151
+ # Route 53 DNS servers.
152
+ # @return [Core::Response]
153
+ # The #data method of the response object returns
154
+ # a hash with the following structure:
155
+ # * +:change_info+ - (Hash)
156
+ # * +:id+ - (String)
157
+ # * +:status+ - (String)
158
+ # * +:submitted_at+ - (Time)
159
+ # * +:comment+ - (String)
160
+ define_client_method :delete_hosted_zone, 'DeleteHostedZone'
161
+
162
+ # Calls the GET GetChange API operation.
163
+ # @method get_change(options = {})
164
+ # @param [Hash] options
165
+ # * +:id+ - *required* - (String) The ID of the change batch request. The
166
+ # value that you specify here is the value that
167
+ # ChangeResourceRecordSets returned in the Id element when you
168
+ # submitted the request.
169
+ # @return [Core::Response]
170
+ # The #data method of the response object returns
171
+ # a hash with the following structure:
172
+ # * +:change_info+ - (Hash)
173
+ # * +:id+ - (String)
174
+ # * +:status+ - (String)
175
+ # * +:submitted_at+ - (Time)
176
+ # * +:comment+ - (String)
177
+ define_client_method :get_change, 'GetChange'
178
+
179
+ # Calls the GET GetHostedZone API operation.
180
+ # @method get_hosted_zone(options = {})
181
+ # @param [Hash] options
182
+ # * +:id+ - *required* - (String) The ID of the hosted zone for which you
183
+ # want to get a list of the name servers in the delegation set.
184
+ # @return [Core::Response]
185
+ # The #data method of the response object returns
186
+ # a hash with the following structure:
187
+ # * +:hosted_zone+ - (Hash)
188
+ # * +:id+ - (String)
189
+ # * +:name+ - (String)
190
+ # * +:caller_reference+ - (String)
191
+ # * +:config+ - (Hash)
192
+ # * +:comment+ - (String)
193
+ # * +:resource_record_set_count+ - (Integer)
194
+ # * +:delegation_set+ - (Hash)
195
+ # * +:name_servers+ - (Array<String>)
196
+ define_client_method :get_hosted_zone, 'GetHostedZone'
197
+
198
+ # Calls the GET ListHostedZones API operation.
199
+ # @method list_hosted_zones(options = {})
200
+ # @param [Hash] options
201
+ # * +:marker+ - (String) If the request returned more than one page of
202
+ # results, submit another request and specify the value of NextMarker
203
+ # from the last response in the marker parameter to get the next page
204
+ # of results.
205
+ # * +:max_items+ - (Integer) Specify the maximum number of hosted zones
206
+ # to return per page of results.
207
+ # @return [Core::Response]
208
+ # The #data method of the response object returns
209
+ # a hash with the following structure:
210
+ # * +:hosted_zones+ - (Array<Hash>)
211
+ # * +:id+ - (String)
212
+ # * +:name+ - (String)
213
+ # * +:caller_reference+ - (String)
214
+ # * +:config+ - (Hash)
215
+ # * +:comment+ - (String)
216
+ # * +:resource_record_set_count+ - (Integer)
217
+ # * +:marker+ - (String)
218
+ # * +:is_truncated+ - (Boolean)
219
+ # * +:next_marker+ - (String)
220
+ # * +:max_items+ - (Integer)
221
+ define_client_method :list_hosted_zones, 'ListHostedZones'
222
+
223
+ # Calls the GET ListResourceRecordSets API operation.
224
+ # @method list_resource_record_sets(options = {})
225
+ # @param [Hash] options
226
+ # * +:hosted_zone_id+ - *required* - (String) The ID of the hosted zone
227
+ # that contains the resource record sets that you want to get.
228
+ # * +:start_record_name+ - (String) The first name in the lexicographic
229
+ # ordering of domain names that you want the ListResourceRecordSets
230
+ # request to list.
231
+ # * +:start_record_type+ - (String) The DNS type at which to begin the
232
+ # listing of resource record sets. Valid values: A | AAAA | CNAME | MX
233
+ # | NS | PTR | SOA | SPF | SRV | TXT Values for Weighted Resource
234
+ # Record Sets: A | AAAA | CNAME | TXT Values for Regional Resource
235
+ # Record Sets: A | AAAA | CNAME | TXT Values for Alias Resource Record
236
+ # Sets: A | AAAA Constraint: Specifying type without specifying name
237
+ # returns an InvalidInput error.
238
+ # * +:start_record_identifier+ - (String) Weighted resource record sets
239
+ # only: If results were truncated for a given DNS name and type,
240
+ # specify the value of
241
+ # ListResourceRecordSetsResponse$NextRecordIdentifier from the previous
242
+ # response to get the next resource record set that has the current DNS
243
+ # name and type.
244
+ # * +:max_items+ - (Integer) The maximum number of records you want in
245
+ # the response body.
246
+ # @return [Core::Response]
247
+ # The #data method of the response object returns
248
+ # a hash with the following structure:
249
+ # * +:resource_record_sets+ - (Array<Hash>)
250
+ # * +:name+ - (String)
251
+ # * +:type+ - (String)
252
+ # * +:set_identifier+ - (String)
253
+ # * +:weight+ - (Integer)
254
+ # * +:region+ - (String)
255
+ # * +:ttl+ - (Integer)
256
+ # * +:resource_records+ - (Array<Hash>)
257
+ # * +:value+ - (String)
258
+ # * +:alias_target+ - (Hash)
259
+ # * +:hosted_zone_id+ - (String)
260
+ # * +:dns_name+ - (String)
261
+ # * +:is_truncated+ - (Boolean)
262
+ # * +:next_record_name+ - (String)
263
+ # * +:next_record_type+ - (String)
264
+ # * +:next_record_identifier+ - (String)
265
+ # * +:max_items+ - (Integer)
266
+ define_client_method :list_resource_record_sets, 'ListResourceRecordSets'
267
+
268
+ ## end client methods ##
269
+
270
+ end
271
+ end
272
+ end
@@ -0,0 +1,18 @@
1
+ # Copyright 2011-2012 Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License"). You
4
+ # may not use this file except in compliance with the License. A copy of
5
+ # the License is located at
6
+ #
7
+ # http://aws.amazon.com/apache2.0/
8
+ #
9
+ # or in the "license" file accompanying this file. This file is
10
+ # distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
11
+ # ANY KIND, either express or implied. See the License for the specific
12
+ # language governing permissions and limitations under the License.
13
+
14
+ AWS::Core::Configuration.module_eval do
15
+
16
+ add_service 'Route53', 'route_53', 'route53.amazonaws.com'
17
+
18
+ end
@@ -0,0 +1,22 @@
1
+ # Copyright 2011-2012 Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License"). You
4
+ # may not use this file except in compliance with the License. A copy of
5
+ # the License is located at
6
+ #
7
+ # http://aws.amazon.com/apache2.0/
8
+ #
9
+ # or in the "license" file accompanying this file. This file is
10
+ # distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
11
+ # ANY KIND, either express or implied. See the License for the specific
12
+ # language governing permissions and limitations under the License.
13
+
14
+ module AWS
15
+ class Route53
16
+ module Errors
17
+
18
+ extend Core::LazyErrorClasses
19
+
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,23 @@
1
+ # Copyright 2011-2012 Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License"). You
4
+ # may not use this file except in compliance with the License. A copy of
5
+ # the License is located at
6
+ #
7
+ # http://aws.amazon.com/apache2.0/
8
+ #
9
+ # or in the "license" file accompanying this file. This file is
10
+ # distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
11
+ # ANY KIND, either express or implied. See the License for the specific
12
+ # language governing permissions and limitations under the License.
13
+
14
+ module AWS
15
+ class Route53
16
+
17
+ # @private
18
+ class Request < Core::Http::Request
19
+ include Core::Signature::Version3HTTPS
20
+ end
21
+
22
+ end
23
+ end
@@ -16,15 +16,15 @@ module AWS
16
16
 
17
17
  # For S3 buckets with versioning enabled, objects will store versions
18
18
  # each time you write to them.
19
- #
19
+ #
20
20
  # object = bucket.objects['myobj']
21
21
  # object.write('1')
22
22
  # object.write('2')
23
23
  # object.write('3')
24
24
  #
25
25
  # object.versions.collect(&:read)
26
- # #=> ['1', '2', '3']
27
- #
26
+ # #=> ['1', '2', '3']
27
+ #
28
28
  # To see all the version id for a particular object, access the any particular version,
29
29
  # and see the latest version:
30
30
  #
@@ -32,7 +32,7 @@ module AWS
32
32
  # #=> T2TwAiZ3SmNr7tOfe0QBa4RZnSb3GSLq
33
33
  # #=> kAEHC_ysT65bT4P3zyYOP1ELA6ajar_6
34
34
  # #=> itHPX6m8na_sog0cAtkgP3QITEE8v5ij
35
- #
35
+ #
36
36
  # object.versions['itHPX6m8na_sog0cAtkgP3QITEE8v5ij']
37
37
  # #=> <AWS::S3::ObjectVersion:<<bucket>>:myobj:itHPX6m8na_sog0cAtkgP3QITEE8v5ij>
38
38
  #
@@ -42,7 +42,7 @@ module AWS
42
42
  # If you know the id of a particular version you can get that object.
43
43
  #
44
44
  # bucket.objects['myobj'].version[version_id].delete
45
- #
45
+ #
46
46
  class ObjectVersionCollection
47
47
 
48
48
  include Core::Model
@@ -58,7 +58,7 @@ module AWS
58
58
  end
59
59
 
60
60
  # Returns an object that represents a single version of the {#object}.
61
- # @param [String] version_id
61
+ # @param [String] version_id
62
62
  # @return [ObjectVersion]
63
63
  def [] version_id
64
64
  ObjectVersion.new(object, version_id)