aws-sdk 1.8.2 → 1.8.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -33,6 +33,7 @@ require 'aws/core/autoloader'
33
33
  # * {AWS::ELB}
34
34
  # * {AWS::EMR}
35
35
  # * {AWS::Glacier}
36
+ # * {AWS::OpsWorks}
36
37
  # * {AWS::IAM}
37
38
  # * {AWS::Redshift}
38
39
  # * {AWS::RDS}
@@ -334,6 +335,9 @@ module AWS
334
335
  #
335
336
  # AWS.config(:proxy_uri => 'https://user:password@my.proxy:443/path?query')
336
337
  #
338
+ # @option options [String] :ops_works_endpoint ('opsworks.us-east-1.amazonaws.com')
339
+ # The service endpoint for AWS OpsWorks.
340
+ #
337
341
  # @option options [String] :redshift_endpoint ('redshift.us-east-1.amazonaws.com')
338
342
  # The service endpoint for Amazon Redshift.
339
343
  #
@@ -150,6 +150,9 @@ module AWS
150
150
  # @attr_reader [URI,nil] route_53_endpoint ('route53.amazonaws.com')
151
151
  # The service endpoint for Amazon Route 53.
152
152
  #
153
+ # @attr_reader [URI,nil] ops_works_endpoint ('opsworks.us-east-1.amazonaws.com')
154
+ # The service endpoint for AWS OpsWorks.
155
+ #
153
156
  # @attr_reader [URI,nil] redshift_endpoint ('redshift.us-east-1.amazonaws.com')
154
157
  # The service endpoint for Amazon Redshift.
155
158
  #
@@ -81,6 +81,17 @@ module AWS
81
81
  validate!(value.to_hash, rules[:members])
82
82
  end
83
83
 
84
+ def validate_map rules, value, opt_name, context = nil
85
+ unless value.respond_to?(:to_hash)
86
+ format_error('hash value', opt_name, context)
87
+ end
88
+ value.inject({}) do |values,(k,v)|
89
+ context = "member #{k.inspect} of :#{opt_name}"
90
+ values[k] = validate_value(rules[:members], v, opt_name, context)
91
+ values
92
+ end
93
+ end
94
+
84
95
  # Ensures the value is an array (or at least enumerable) and
85
96
  # that the yielded values are valid.
86
97
  def validate_array rules, value, opt_name, context = nil
@@ -168,7 +168,7 @@ module AWS
168
168
  def batch_get &block
169
169
  batch = BatchGet.new(:config => config)
170
170
  yield(batch)
171
- batch.enumerator
171
+ batch.to_enum(:each)
172
172
  end
173
173
 
174
174
  # Yields a batch for writing (put and delete) items across multiple
@@ -29,7 +29,7 @@ module AWS
29
29
  # item.attributes.values_at(:title, :description)
30
30
  #
31
31
  # @example Retrieving all attributes in hash form
32
- # item.attributes.to_h
32
+ # item.attributes.to_hash
33
33
  #
34
34
  # @example Replacing the value of an attribute
35
35
  # item.attributes[:title] = "Automobiles"
@@ -51,7 +51,7 @@ module AWS
51
51
  # end
52
52
  #
53
53
  # @example Returning overwritten values
54
- # item.attributes.to_h # => { "foo" => "bar",
54
+ # item.attributes.to_hash # => { "foo" => "bar",
55
55
  # "name" => "fred" }
56
56
  # item.attributes.set(
57
57
  # { "foo" => "baz" },
@@ -84,11 +84,11 @@ module AWS
84
84
  #
85
85
  # attributes.each { |name, value| puts "#{name} = #{value}" }
86
86
  #
87
- # @param (see #to_h)
87
+ # @param (see #to_hash)
88
88
  #
89
- # @option options (see #to_h)
89
+ # @option options (see #to_hash)
90
90
  def each(options = {}, &block)
91
- to_h(options).each(&block)
91
+ to_hash(options).each(&block)
92
92
  end
93
93
 
94
94
  # @yieldparam [String] name Each attribute name.
@@ -422,9 +422,10 @@ module AWS
422
422
  # @option options [Boolean] :consistent_read If set to true,
423
423
  # then a consistent read is issued, otherwise an eventually
424
424
  # consistent read is used.
425
- def to_h options = {}
425
+ def to_hash options = {}
426
426
  values_from_response_hash(get_item(options))
427
427
  end
428
+ alias_method :to_h, :to_hash
428
429
 
429
430
  private
430
431
  def item_key_options(options = {})
@@ -35,6 +35,9 @@ module AWS
35
35
  # e.g. "m1.small". The instance must be in a stopped state to
36
36
  # change the instance type.
37
37
  #
38
+ # @attr [Boolean] ebs_optimized The instance must be in a stopped state to
39
+ # change the ebs_optimized state.
40
+ #
38
41
  # @attr [Boolean] api_termination_disabled True if the instance
39
42
  # cannot be terminated using the {#terminate} method. This
40
43
  # attribute can be changed at any time.
@@ -286,6 +289,8 @@ module AWS
286
289
 
287
290
  mutable_describe_call_attribute :instance_type
288
291
 
292
+ mutable_describe_call_attribute :ebs_optimized
293
+
289
294
  mutable_describe_call_attribute :kernel_id, :set_as => :kernel
290
295
 
291
296
  mutable_describe_call_attribute :ramdisk_id, :set_as => :ramdisk
@@ -431,21 +436,50 @@ module AWS
431
436
  SecurityGroup.new(g.group_id, :name => g.group_name, :config => config)
432
437
  end
433
438
  end
434
-
435
439
  alias_method :groups, :security_groups
436
440
 
437
- # @return [Hash<String,Attachment>] Returns a hash of device mappings.
441
+ # @return [Hash<String,Attachment>] Returns a hash of attachments.
438
442
  # The keys are device name strings (e.g. '/dev/sda') and the values
439
443
  # are {Attachment} objects.
440
- def block_device_mappings
444
+ # @note This method will not return data for ephemeral volumes.
445
+ # @see {#block_devices}
446
+ def attachments
441
447
  (block_device_mapping || []).inject({}) do |m, mapping|
442
- device = mapping.device_name
443
- volume = Volume.new(mapping.ebs.volume_id, :config => config)
444
- attachment = Attachment.new(volume, self, device, :config => config)
445
- m[device] = attachment
448
+ if mapping[:ebs]
449
+ device = mapping[:device_name]
450
+ volume = Volume.new(mapping[:ebs][:volume_id], :config => config)
451
+ attachment = Attachment.new(volume, self, device, :config => config)
452
+ m[device] = attachment
453
+ end
446
454
  m
447
455
  end
448
456
  end
457
+ alias_method :block_device_mappings, :attachments
458
+
459
+ # Returns a list of block device mappings.
460
+ #
461
+ # instance.block_devices
462
+ # #=>
463
+ # [
464
+ # {
465
+ # :device_name => "/dev/sda2",
466
+ # :ebs => {
467
+ # :volume_id => "vol-123",
468
+ # :status => "attaching",
469
+ # :attach_time => time,
470
+ # :delete_on_termination => true
471
+ # }
472
+ # }, {
473
+ # :device_name => "/dev/sdb",
474
+ # :virtual_name => "ephemeral0",
475
+ # }
476
+ # ]
477
+ #
478
+ # @return [Array<Hash>] Returns a list of block device mappings. This
479
+ # list may contain ephemeral volumes.
480
+ def block_devices
481
+ block_device_mapping.to_a
482
+ end
449
483
 
450
484
  # Enables monitoring for this instance.
451
485
  # @return [nil]
@@ -67,8 +67,16 @@ module AWS
67
67
  # parameter group to associate with this Cache cluster. If this
68
68
  # argument is omitted, the default CacheParameterGroup for the
69
69
  # specified engine will be used.
70
- # * +:cache_security_group_names+ - *required* - (Array<String>) A list
71
- # of Cache Security Group Names to associate with this Cache Cluster.
70
+ # * +:cache_subnet_group_name+ - (String) The name of the Cache Subnet
71
+ # Group to be used for the Cache Cluster. Use this parameter only
72
+ # when you are creating a cluster in an Amazon Virtual Private Cloud
73
+ # (VPC).
74
+ # * +:cache_security_group_names+ - (Array<String>) A list of Cache
75
+ # Security Group Names to associate with this Cache Cluster.
76
+ # * +:security_group_ids+ - (Array<String>) Specifies the VPC Security
77
+ # Groups associated with the Cache Cluster. Use this parameter only
78
+ # when you are creating a cluster in an Amazon Virtual Private Cloud
79
+ # (VPC).
72
80
  # * +:preferred_availability_zone+ - (String) The EC2 Availability Zone
73
81
  # that the Cache Cluster will be created in. In normal use, all
74
82
  # CacheNodes belonging to a CacheCluster are placed in the preferred
@@ -91,6 +99,10 @@ module AWS
91
99
  # The #data method of the response object returns
92
100
  # a hash with the following structure:
93
101
  # * +:cache_cluster_id+ - (String)
102
+ # * +:configuration_endpoint+ - (Hash)
103
+ # * +:address+ - (String)
104
+ # * +:port+ - (Integer)
105
+ # * +:client_download_landing_page+ - (String)
94
106
  # * +:cache_node_type+ - (String)
95
107
  # * +:engine+ - (String)
96
108
  # * +:engine_version+ - (String)
@@ -113,6 +125,7 @@ module AWS
113
125
  # * +:cache_parameter_group_name+ - (String)
114
126
  # * +:parameter_apply_status+ - (String)
115
127
  # * +:cache_node_ids_to_reboot+ - (Array<String>)
128
+ # * +:cache_subnet_group_name+ - (String)
116
129
  # * +:cache_nodes+ - (Array<Hash>)
117
130
  # * +:cache_node_id+ - (String)
118
131
  # * +:cache_node_status+ - (String)
@@ -122,6 +135,9 @@ module AWS
122
135
  # * +:port+ - (Integer)
123
136
  # * +:parameter_group_status+ - (String)
124
137
  # * +:auto_minor_version_upgrade+ - (Boolean)
138
+ # * +:security_groups+ - (Array<Hash>)
139
+ # * +:security_group_id+ - (String)
140
+ # * +:status+ - (String)
125
141
 
126
142
  # @!method create_cache_parameter_group(options = {})
127
143
  # Calls the CreateCacheParameterGroup API operation.
@@ -161,6 +177,28 @@ module AWS
161
177
  # * +:ec2_security_group_name+ - (String)
162
178
  # * +:ec2_security_group_owner_id+ - (String)
163
179
 
180
+ # @!method create_cache_subnet_group(options = {})
181
+ # Calls the CreateCacheSubnetGroup API operation.
182
+ # @param [Hash] options
183
+ # * +:cache_subnet_group_name+ - *required* - (String) The name for the
184
+ # Cache Subnet Group. This value is stored as a lowercase string.
185
+ # Constraints: Must contain no more than 255 alphanumeric characters
186
+ # or hyphens. Example: mysubnetgroup
187
+ # * +:cache_subnet_group_description+ - *required* - (String) The
188
+ # description for the Cache Subnet Group.
189
+ # * +:subnet_ids+ - *required* - (Array<String>) The EC2 Subnet IDs for
190
+ # the Cache Subnet Group.
191
+ # @return [Core::Response]
192
+ # The #data method of the response object returns
193
+ # a hash with the following structure:
194
+ # * +:cache_subnet_group_name+ - (String)
195
+ # * +:cache_subnet_group_description+ - (String)
196
+ # * +:vpc_id+ - (String)
197
+ # * +:subnets+ - (Array<Hash>)
198
+ # * +:subnet_identifier+ - (String)
199
+ # * +:subnet_availability_zone+ - (Hash)
200
+ # * +:name+ - (String)
201
+
164
202
  # @!method delete_cache_cluster(options = {})
165
203
  # Calls the DeleteCacheCluster API operation.
166
204
  # @param [Hash] options
@@ -171,6 +209,10 @@ module AWS
171
209
  # The #data method of the response object returns
172
210
  # a hash with the following structure:
173
211
  # * +:cache_cluster_id+ - (String)
212
+ # * +:configuration_endpoint+ - (Hash)
213
+ # * +:address+ - (String)
214
+ # * +:port+ - (Integer)
215
+ # * +:client_download_landing_page+ - (String)
174
216
  # * +:cache_node_type+ - (String)
175
217
  # * +:engine+ - (String)
176
218
  # * +:engine_version+ - (String)
@@ -193,6 +235,7 @@ module AWS
193
235
  # * +:cache_parameter_group_name+ - (String)
194
236
  # * +:parameter_apply_status+ - (String)
195
237
  # * +:cache_node_ids_to_reboot+ - (Array<String>)
238
+ # * +:cache_subnet_group_name+ - (String)
196
239
  # * +:cache_nodes+ - (Array<Hash>)
197
240
  # * +:cache_node_id+ - (String)
198
241
  # * +:cache_node_status+ - (String)
@@ -202,6 +245,9 @@ module AWS
202
245
  # * +:port+ - (Integer)
203
246
  # * +:parameter_group_status+ - (String)
204
247
  # * +:auto_minor_version_upgrade+ - (Boolean)
248
+ # * +:security_groups+ - (Array<Hash>)
249
+ # * +:security_group_id+ - (String)
250
+ # * +:status+ - (String)
205
251
 
206
252
  # @!method delete_cache_parameter_group(options = {})
207
253
  # Calls the DeleteCacheParameterGroup API operation.
@@ -219,6 +265,14 @@ module AWS
219
265
  # security group.
220
266
  # @return [Core::Response]
221
267
 
268
+ # @!method delete_cache_subnet_group(options = {})
269
+ # Calls the DeleteCacheSubnetGroup API operation.
270
+ # @param [Hash] options
271
+ # * +:cache_subnet_group_name+ - *required* - (String) The name of the
272
+ # Cache Subnet Group to delete. Constraints: Must contain no more
273
+ # than 255 alphanumeric characters or hyphens.
274
+ # @return [Core::Response]
275
+
222
276
  # @!method describe_cache_clusters(options = {})
223
277
  # Calls the DescribeCacheClusters API operation.
224
278
  # @param [Hash] options
@@ -244,6 +298,10 @@ module AWS
244
298
  # * +:marker+ - (String)
245
299
  # * +:cache_clusters+ - (Array<Hash>)
246
300
  # * +:cache_cluster_id+ - (String)
301
+ # * +:configuration_endpoint+ - (Hash)
302
+ # * +:address+ - (String)
303
+ # * +:port+ - (Integer)
304
+ # * +:client_download_landing_page+ - (String)
247
305
  # * +:cache_node_type+ - (String)
248
306
  # * +:engine+ - (String)
249
307
  # * +:engine_version+ - (String)
@@ -266,6 +324,7 @@ module AWS
266
324
  # * +:cache_parameter_group_name+ - (String)
267
325
  # * +:parameter_apply_status+ - (String)
268
326
  # * +:cache_node_ids_to_reboot+ - (Array<String>)
327
+ # * +:cache_subnet_group_name+ - (String)
269
328
  # * +:cache_nodes+ - (Array<Hash>)
270
329
  # * +:cache_node_id+ - (String)
271
330
  # * +:cache_node_status+ - (String)
@@ -275,6 +334,41 @@ module AWS
275
334
  # * +:port+ - (Integer)
276
335
  # * +:parameter_group_status+ - (String)
277
336
  # * +:auto_minor_version_upgrade+ - (Boolean)
337
+ # * +:security_groups+ - (Array<Hash>)
338
+ # * +:security_group_id+ - (String)
339
+ # * +:status+ - (String)
340
+
341
+ # @!method describe_cache_engine_versions(options = {})
342
+ # Calls the DescribeCacheEngineVersions API operation.
343
+ # @param [Hash] options
344
+ # * +:engine+ - (String) The cache engine to return.
345
+ # * +:engine_version+ - (String) The cache engine version to return.
346
+ # Example: 1.4.14
347
+ # * +:cache_parameter_group_family+ - (String) The name of a specific
348
+ # Cache Parameter Group family to return details for. Constraints:
349
+ # Must be 1 to 255 alphanumeric characters First character must be a
350
+ # letter Cannot end with a hyphen or contain two consecutive hyphens
351
+ # * +:max_records+ - (Integer) The maximum number of records to include
352
+ # in the response. If more records exist than the specified
353
+ # MaxRecords value, a marker is included in the response so that the
354
+ # remaining results may be retrieved.
355
+ # * +:marker+ - (String) An optional marker provided in the previous
356
+ # DescribeCacheParameterGroups request. If this parameter is
357
+ # specified, the response includes only records beyond the marker, up
358
+ # to the value specified by MaxRecords.
359
+ # * +:default_only+ - (Boolean) Indicates that only the default version
360
+ # of the specified engine or engine and major version combination is
361
+ # returned.
362
+ # @return [Core::Response]
363
+ # The #data method of the response object returns
364
+ # a hash with the following structure:
365
+ # * +:marker+ - (String)
366
+ # * +:cache_engine_versions+ - (Array<Hash>)
367
+ # * +:engine+ - (String)
368
+ # * +:engine_version+ - (String)
369
+ # * +:cache_parameter_group_family+ - (String)
370
+ # * +:cache_engine_description+ - (String)
371
+ # * +:cache_engine_version_description+ - (String)
278
372
 
279
373
  # @!method describe_cache_parameter_groups(options = {})
280
374
  # Calls the DescribeCacheParameterGroups API operation.
@@ -365,6 +459,33 @@ module AWS
365
459
  # * +:ec2_security_group_name+ - (String)
366
460
  # * +:ec2_security_group_owner_id+ - (String)
367
461
 
462
+ # @!method describe_cache_subnet_groups(options = {})
463
+ # Calls the DescribeCacheSubnetGroups API operation.
464
+ # @param [Hash] options
465
+ # * +:cache_subnet_group_name+ - (String) The name of the Cache Subnet
466
+ # Group to return details for.
467
+ # * +:max_records+ - (Integer) The maximum number of records to include
468
+ # in the response. If more records exist than the specified
469
+ # MaxRecords value, a marker is included in the response so that the
470
+ # remaining results may be retrieved. Default: 100 Constraints:
471
+ # minimum 20, maximum 100
472
+ # * +:marker+ - (String) An optional marker provided in the previous
473
+ # DescribeCacheSubnetGroups request. If this parameter is specified,
474
+ # the response includes only records beyond the marker, up to the
475
+ # value specified by MaxRecords.
476
+ # @return [Core::Response]
477
+ # The #data method of the response object returns
478
+ # a hash with the following structure:
479
+ # * +:marker+ - (String)
480
+ # * +:cache_subnet_groups+ - (Array<Hash>)
481
+ # * +:cache_subnet_group_name+ - (String)
482
+ # * +:cache_subnet_group_description+ - (String)
483
+ # * +:vpc_id+ - (String)
484
+ # * +:subnets+ - (Array<Hash>)
485
+ # * +:subnet_identifier+ - (String)
486
+ # * +:subnet_availability_zone+ - (Hash)
487
+ # * +:name+ - (String)
488
+
368
489
  # @!method describe_engine_default_parameters(options = {})
369
490
  # Calls the DescribeEngineDefaultParameters API operation.
370
491
  # @param [Hash] options
@@ -553,6 +674,10 @@ module AWS
553
674
  # change is asynchronously applied as soon as possible. Constraints:
554
675
  # Must contain no more than 255 alphanumeric characters. Must not be
555
676
  # "Default".
677
+ # * +:security_group_ids+ - (Array<String>) Specifies the VPC Security
678
+ # Groups associated with the Cache Cluster. This parameter can be
679
+ # used only with clusters that are created in an Amazon Virtual
680
+ # Private Cloud (VPC).
556
681
  # * +:preferred_maintenance_window+ - (String) The weekly time range
557
682
  # (in UTC) during which system maintenance can occur, which may
558
683
  # result in an outage. This change is made immediately. If moving
@@ -585,6 +710,10 @@ module AWS
585
710
  # The #data method of the response object returns
586
711
  # a hash with the following structure:
587
712
  # * +:cache_cluster_id+ - (String)
713
+ # * +:configuration_endpoint+ - (Hash)
714
+ # * +:address+ - (String)
715
+ # * +:port+ - (Integer)
716
+ # * +:client_download_landing_page+ - (String)
588
717
  # * +:cache_node_type+ - (String)
589
718
  # * +:engine+ - (String)
590
719
  # * +:engine_version+ - (String)
@@ -607,6 +736,7 @@ module AWS
607
736
  # * +:cache_parameter_group_name+ - (String)
608
737
  # * +:parameter_apply_status+ - (String)
609
738
  # * +:cache_node_ids_to_reboot+ - (Array<String>)
739
+ # * +:cache_subnet_group_name+ - (String)
610
740
  # * +:cache_nodes+ - (Array<Hash>)
611
741
  # * +:cache_node_id+ - (String)
612
742
  # * +:cache_node_status+ - (String)
@@ -616,6 +746,9 @@ module AWS
616
746
  # * +:port+ - (Integer)
617
747
  # * +:parameter_group_status+ - (String)
618
748
  # * +:auto_minor_version_upgrade+ - (Boolean)
749
+ # * +:security_groups+ - (Array<Hash>)
750
+ # * +:security_group_id+ - (String)
751
+ # * +:status+ - (String)
619
752
 
620
753
  # @!method modify_cache_parameter_group(options = {})
621
754
  # Calls the ModifyCacheParameterGroup API operation.
@@ -635,6 +768,28 @@ module AWS
635
768
  # a hash with the following structure:
636
769
  # * +:cache_parameter_group_name+ - (String)
637
770
 
771
+ # @!method modify_cache_subnet_group(options = {})
772
+ # Calls the ModifyCacheSubnetGroup API operation.
773
+ # @param [Hash] options
774
+ # * +:cache_subnet_group_name+ - *required* - (String) The name for the
775
+ # Cache Subnet Group. This value is stored as a lowercase string.
776
+ # Constraints: Must contain no more than 255 alphanumeric characters
777
+ # or hyphens. Example: mysubnetgroup
778
+ # * +:cache_subnet_group_description+ - (String) The description for
779
+ # the Cache Subnet Group.
780
+ # * +:subnet_ids+ - (Array<String>) The EC2 Subnet IDs for the Cache
781
+ # Subnet Group.
782
+ # @return [Core::Response]
783
+ # The #data method of the response object returns
784
+ # a hash with the following structure:
785
+ # * +:cache_subnet_group_name+ - (String)
786
+ # * +:cache_subnet_group_description+ - (String)
787
+ # * +:vpc_id+ - (String)
788
+ # * +:subnets+ - (Array<Hash>)
789
+ # * +:subnet_identifier+ - (String)
790
+ # * +:subnet_availability_zone+ - (Hash)
791
+ # * +:name+ - (String)
792
+
638
793
  # @!method purchase_reserved_cache_nodes_offering(options = {})
639
794
  # Calls the PurchaseReservedCacheNodesOffering API operation.
640
795
  # @param [Hash] options
@@ -675,6 +830,10 @@ module AWS
675
830
  # The #data method of the response object returns
676
831
  # a hash with the following structure:
677
832
  # * +:cache_cluster_id+ - (String)
833
+ # * +:configuration_endpoint+ - (Hash)
834
+ # * +:address+ - (String)
835
+ # * +:port+ - (Integer)
836
+ # * +:client_download_landing_page+ - (String)
678
837
  # * +:cache_node_type+ - (String)
679
838
  # * +:engine+ - (String)
680
839
  # * +:engine_version+ - (String)
@@ -697,6 +856,7 @@ module AWS
697
856
  # * +:cache_parameter_group_name+ - (String)
698
857
  # * +:parameter_apply_status+ - (String)
699
858
  # * +:cache_node_ids_to_reboot+ - (Array<String>)
859
+ # * +:cache_subnet_group_name+ - (String)
700
860
  # * +:cache_nodes+ - (Array<Hash>)
701
861
  # * +:cache_node_id+ - (String)
702
862
  # * +:cache_node_status+ - (String)
@@ -706,6 +866,9 @@ module AWS
706
866
  # * +:port+ - (Integer)
707
867
  # * +:parameter_group_status+ - (String)
708
868
  # * +:auto_minor_version_upgrade+ - (Boolean)
869
+ # * +:security_groups+ - (Array<Hash>)
870
+ # * +:security_group_id+ - (String)
871
+ # * +:status+ - (String)
709
872
 
710
873
  # @!method reset_cache_parameter_group(options = {})
711
874
  # Calls the ResetCacheParameterGroup API operation.
@@ -750,7 +913,7 @@ module AWS
750
913
 
751
914
  # end client methods #
752
915
 
753
- define_client_methods('2012-03-09')
916
+ define_client_methods('2012-11-15')
754
917
 
755
918
  end
756
919
  end