aws-sdk 1.32.0 → 1.50.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +28 -10
- data/bin/aws-rb +11 -1
- data/endpoints.json +191 -26
- data/lib/aws/api_config/AutoScaling-2011-01-01.yml +201 -0
- data/lib/aws/api_config/CloudFormation-2010-05-15.yml +15 -1
- data/lib/aws/api_config/CloudFront-2013-11-22.yml +2918 -0
- data/lib/aws/api_config/CloudFront-2014-01-31.yml +2934 -0
- data/lib/aws/api_config/CloudFront-2014-05-31.yml +3100 -0
- data/lib/aws/api_config/CloudSearch-2013-01-01.yml +1164 -0
- data/lib/aws/api_config/CloudTrail-2013-11-01.yml +4 -33
- data/lib/aws/api_config/DynamoDB-2012-08-10.yml +101 -1
- data/lib/aws/api_config/EC2-2013-08-15.yml +2 -2
- data/lib/aws/api_config/EC2-2013-10-01.yml +2 -2
- data/lib/aws/api_config/EC2-2013-10-15.yml +3 -78
- data/lib/aws/api_config/EC2-2014-02-01.yml +4755 -0
- data/lib/aws/api_config/EC2-2014-05-01.yml +4812 -0
- data/lib/aws/api_config/ELB-2012-06-01.yml +65 -1
- data/lib/aws/api_config/EMR-2009-03-31.yml +20 -1
- data/lib/aws/api_config/ElastiCache-2014-03-24.yml +1375 -0
- data/lib/aws/api_config/ElastiCache-2014-07-15.yml +1385 -0
- data/lib/aws/api_config/ElasticBeanstalk-2010-12-01.yml +8 -1
- data/lib/aws/api_config/ElasticTranscoder-2012-09-25.yml +798 -1
- data/lib/aws/api_config/IAM-2010-05-08.yml +44 -2
- data/lib/aws/api_config/Kinesis-2013-12-02.yml +1 -1
- data/lib/aws/api_config/OpsWorks-2013-02-18.yml +201 -1
- data/lib/aws/api_config/RDS-2013-09-09.yml +1 -2
- data/lib/aws/api_config/Redshift-2012-12-01.yml +25 -1
- data/lib/aws/api_config/Route53-2013-04-01.yml +889 -0
- data/lib/aws/api_config/SNS-2010-03-31.yml +16 -1
- data/lib/aws/api_config/SQS-2012-11-05.yml +86 -1
- data/lib/aws/api_config/STS-2011-06-15.yml +5 -1
- data/lib/aws/api_config/SimpleEmailService-2010-12-01.yml +1 -1
- data/lib/aws/api_config/Support-2013-04-15.yml +63 -0
- data/lib/aws/auto_scaling/group.rb +1 -1
- data/lib/aws/cloud_formation/stack_resource_collection.rb +1 -1
- data/lib/aws/cloud_front/client.rb +13 -1
- data/lib/aws/cloud_search/client.rb +6 -2
- data/lib/aws/cloud_watch/alarm.rb +3 -0
- data/lib/aws/core.rb +16 -1
- data/lib/aws/core/client.rb +10 -1
- data/lib/aws/core/configuration.rb +3 -2
- data/lib/aws/core/credential_providers.rb +130 -12
- data/lib/aws/core/http/connection_pool.rb +23 -3
- data/lib/aws/core/http/net_http_handler.rb +18 -21
- data/lib/aws/core/http/request.rb +10 -0
- data/lib/aws/core/ini_parser.rb +42 -0
- data/lib/aws/core/lazy_error_classes.rb +20 -2
- data/lib/aws/core/log_formatter.rb +1 -1
- data/lib/aws/core/model.rb +5 -0
- data/lib/aws/core/option_grammar.rb +9 -9
- data/lib/aws/core/policy.rb +2 -3
- data/lib/aws/core/response.rb +4 -0
- data/lib/aws/core/signers/version_4.rb +1 -1
- data/lib/aws/core/signers/version_4/chunk_signed_stream.rb +1 -1
- data/lib/aws/core/xml/frame.rb +1 -0
- data/lib/aws/core/xml/grammar.rb +1 -0
- data/lib/aws/dynamo_db.rb +16 -0
- data/lib/aws/dynamo_db/batch_write.rb +2 -0
- data/lib/aws/dynamo_db/table.rb +4 -8
- data/lib/aws/ec2.rb +1 -1
- data/lib/aws/ec2/client.rb +64 -1
- data/lib/aws/ec2/image_collection.rb +1 -2
- data/lib/aws/ec2/instance.rb +3 -3
- data/lib/aws/ec2/instance_collection.rb +14 -3
- data/lib/aws/ec2/snapshot_collection.rb +1 -1
- data/lib/aws/ec2/subnet_collection.rb +7 -3
- data/lib/aws/ec2/tagged_collection.rb +14 -0
- data/lib/aws/ec2/volume_collection.rb +4 -0
- data/lib/aws/ec2/vpc.rb +8 -0
- data/lib/aws/ec2/vpc_collection.rb +1 -1
- data/lib/aws/elasticache/client.rb +8 -2
- data/lib/aws/emr/job_flow_collection.rb +4 -6
- data/lib/aws/glacier.rb +4 -4
- data/lib/aws/glacier/vault.rb +1 -1
- data/lib/aws/iam/server_certificate.rb +24 -17
- data/lib/aws/iam/signing_certificate.rb +13 -1
- data/lib/aws/rails.rb +1 -1
- data/lib/aws/rds/db_instance.rb +5 -6
- data/lib/aws/record/abstract_base.rb +0 -1
- data/lib/aws/record/hash_model.rb +1 -1
- data/lib/aws/record/model.rb +1 -1
- data/lib/aws/route_53/client.rb +5 -2
- data/lib/aws/route_53/hosted_zone.rb +39 -16
- data/lib/aws/route_53/hosted_zone_collection.rb +2 -1
- data/lib/aws/s3/bucket_lifecycle_configuration.rb +22 -6
- data/lib/aws/s3/cipher_io.rb +1 -1
- data/lib/aws/s3/client.rb +155 -7
- data/lib/aws/s3/client/xml.rb +7 -0
- data/lib/aws/s3/multipart_upload.rb +3 -1
- data/lib/aws/s3/object_collection.rb +1 -1
- data/lib/aws/s3/presign_v4.rb +13 -4
- data/lib/aws/s3/s3_object.rb +3 -0
- data/lib/aws/simple_email_service.rb +13 -0
- data/lib/aws/simple_email_service/identity.rb +21 -0
- data/lib/aws/simple_workflow/decision_task.rb +2 -2
- data/lib/aws/simple_workflow/decision_task_collection.rb +0 -2
- data/lib/aws/simple_workflow/option_formatters.rb +1 -1
- data/lib/aws/simple_workflow/workflow_execution_collection.rb +2 -2
- data/lib/aws/simple_workflow/workflow_type.rb +0 -2
- data/lib/aws/sns/message.rb +11 -1
- data/lib/aws/sns/topic.rb +1 -1
- data/lib/aws/sns/topic_collection.rb +1 -1
- data/lib/aws/sqs/queue.rb +26 -14
- data/lib/aws/sqs/queue_collection.rb +4 -0
- data/lib/aws/sqs/received_message.rb +4 -0
- data/lib/aws/sts/client.rb +9 -0
- data/lib/aws/version.rb +1 -1
- metadata +113 -117
@@ -76,6 +76,10 @@ module AWS
|
|
76
76
|
#
|
77
77
|
# @option options [String] :volume_type
|
78
78
|
#
|
79
|
+
# @option options [Boolean] :encrypted (false)
|
80
|
+
# When true, the volume will be encrypted.
|
81
|
+
# For more information, refer to [Amazon EBS Encryption](http://http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSEncryption.html)
|
82
|
+
#
|
79
83
|
# @return [Volume]
|
80
84
|
#
|
81
85
|
def create options = {}
|
data/lib/aws/ec2/vpc.rb
CHANGED
@@ -48,6 +48,14 @@ module AWS
|
|
48
48
|
resp.vpc_set.find{|v| v.vpc_id == vpc_id }
|
49
49
|
end
|
50
50
|
|
51
|
+
# @return [Boolean] Returns `true` if the resource exists.
|
52
|
+
def exists?
|
53
|
+
get_resource
|
54
|
+
true
|
55
|
+
rescue Errors::InvalidVpcID::NotFound
|
56
|
+
false
|
57
|
+
end
|
58
|
+
|
51
59
|
# Deletes the current VPC. The VPC must be empty before it can
|
52
60
|
# be deleted.
|
53
61
|
# @return [nil]
|
@@ -30,7 +30,7 @@ module AWS
|
|
30
30
|
#
|
31
31
|
# @param [Hash] options
|
32
32
|
#
|
33
|
-
# @option options [
|
33
|
+
# @option options [Symbol] :instance_tenancy (:default)
|
34
34
|
# The allowed tenancy of instances launched into the VPC. A value of
|
35
35
|
# `:default` means instances can be launched with any tenancy; a value
|
36
36
|
# of `:dedicated` means all instances launched into the VPC will be launched with
|
@@ -17,7 +17,7 @@ module AWS
|
|
17
17
|
# Client class for Amazon ElastiCache.
|
18
18
|
class Client < Core::QueryClient
|
19
19
|
|
20
|
-
API_VERSION = '
|
20
|
+
API_VERSION = '2014-07-15'
|
21
21
|
|
22
22
|
signature_version :Version4, 'elasticache'
|
23
23
|
|
@@ -27,9 +27,15 @@ module AWS
|
|
27
27
|
end
|
28
28
|
|
29
29
|
class Client::V20130615 < Client
|
30
|
-
|
31
30
|
define_client_methods('2013-06-15')
|
31
|
+
end
|
32
|
+
|
33
|
+
class Client::V20140324 < Client
|
34
|
+
define_client_methods('2014-03-24')
|
35
|
+
end
|
32
36
|
|
37
|
+
class Client::V20140715 < Client
|
38
|
+
define_client_methods('2014-07-15')
|
33
39
|
end
|
34
40
|
end
|
35
41
|
end
|
@@ -132,11 +132,10 @@ module AWS
|
|
132
132
|
# # enumerate jobs that are more than an hour old
|
133
133
|
# emr.job_flows.created_before(Time.now - 3600).each{|job| ... }
|
134
134
|
#
|
135
|
-
# @param [Time,DateTime,Date] time
|
135
|
+
# @param [Time,DateTime,Date,Integer] time
|
136
136
|
# @return [JobFlowCollection]
|
137
137
|
def created_before time
|
138
|
-
|
139
|
-
filter(:created_before, time)
|
138
|
+
filter(:created_before, time.to_i)
|
140
139
|
end
|
141
140
|
|
142
141
|
# Returns a new collection that will only enumerate job flows that
|
@@ -145,11 +144,10 @@ module AWS
|
|
145
144
|
# # enumerate jobs that are at most 1 hour old
|
146
145
|
# emr.job_flows.created_after(Time.now - 3600).each{|job| ... }
|
147
146
|
#
|
148
|
-
# @param [Time,DateTime,Date] time
|
147
|
+
# @param [Time,DateTime,Date,Integer] time
|
149
148
|
# @return [JobFlowCollection]
|
150
149
|
def created_after time
|
151
|
-
|
152
|
-
filter(:created_after, time)
|
150
|
+
filter(:created_after, time.to_i)
|
153
151
|
end
|
154
152
|
|
155
153
|
# @param [String,Symbol] name
|
data/lib/aws/glacier.rb
CHANGED
@@ -21,10 +21,10 @@ module AWS
|
|
21
21
|
# To use Amazon Glacier you must first
|
22
22
|
# [sign up here](http://aws.amazon.com/glacier/).
|
23
23
|
#
|
24
|
-
# For more information about
|
24
|
+
# For more information about Amazon Glacier:
|
25
25
|
#
|
26
|
-
# * [
|
27
|
-
# * [
|
26
|
+
# * [Amazon Glacier](http://aws.amazon.com/glacier/)
|
27
|
+
# * [Amazon Glacier Documentation](http://aws.amazon.com/documentation/glacier/)
|
28
28
|
#
|
29
29
|
# # Credentials
|
30
30
|
#
|
@@ -61,7 +61,7 @@ module AWS
|
|
61
61
|
endpoint_prefix 'glacier'
|
62
62
|
|
63
63
|
# @option options[String] :account_id ('-')
|
64
|
-
def
|
64
|
+
def initialize options = {}
|
65
65
|
@account_id = options[:account_id] || '-'
|
66
66
|
super
|
67
67
|
end
|
data/lib/aws/glacier/vault.rb
CHANGED
@@ -20,6 +20,30 @@ module AWS
|
|
20
20
|
#
|
21
21
|
# You can use this class to get information about a certificate
|
22
22
|
# and to delete it.
|
23
|
+
#
|
24
|
+
# @attr [String] name The name that identifies the server certificate.
|
25
|
+
#
|
26
|
+
# @attr_reader [String] id The stable and unique string identifying
|
27
|
+
# the server certificate.
|
28
|
+
#
|
29
|
+
# @attr_reader [Time] updload_date The date when the server certificate was
|
30
|
+
# uploaded.
|
31
|
+
#
|
32
|
+
# @attr_reader [String] arn The Amazon Resource Name (ARN)
|
33
|
+
# specifying the server certificate. For more information
|
34
|
+
# about ARNs and how to use them in policies, see
|
35
|
+
# {http://docs.amazonwebservices.com/IAM/latest/UserGuide/index.html?Using_Identifiers.html
|
36
|
+
# Identifiers for IAM Entities} in <i>Using AWS Identity and
|
37
|
+
# Access Management</i>.
|
38
|
+
#
|
39
|
+
# @attr [String] path Path to the server certificate.
|
40
|
+
#
|
41
|
+
# @attr_reader [String] certificate_body The contents of the public key
|
42
|
+
# certificate.
|
43
|
+
#
|
44
|
+
# @attr_reader [String] certificate_chain The contents of the public key
|
45
|
+
# certificate chain.
|
46
|
+
#
|
23
47
|
class ServerCertificate < Resource
|
24
48
|
|
25
49
|
prefix_update_attributes
|
@@ -30,27 +54,14 @@ module AWS
|
|
30
54
|
super(opts)
|
31
55
|
end
|
32
56
|
|
33
|
-
# @attr [String] The name that identifies the server
|
34
|
-
# certificate.
|
35
57
|
mutable_attribute :name, :static => true, :from => :server_certificate_name
|
36
58
|
|
37
|
-
# @attr_reader [String] The stable and unique string identifying
|
38
|
-
# the server certificate.
|
39
59
|
attribute :id, :static => true, :from => :server_certificate_id
|
40
60
|
|
41
|
-
# @attr_reader [Time] The date when the server certificate was
|
42
|
-
# uploaded.
|
43
61
|
attribute :upload_date, :static => true
|
44
62
|
|
45
|
-
# @attr_reader [String] The Amazon Resource Name (ARN)
|
46
|
-
# specifying the server certificate. For more information
|
47
|
-
# about ARNs and how to use them in policies, see
|
48
|
-
# {http://docs.amazonwebservices.com/IAM/latest/UserGuide/index.html?Using_Identifiers.html
|
49
|
-
# Identifiers for IAM Entities} in <i>Using AWS Identity and
|
50
|
-
# Access Management</i>.
|
51
63
|
attribute :arn
|
52
64
|
|
53
|
-
# @attr [String] Path to the server certificate.
|
54
65
|
mutable_attribute :path do
|
55
66
|
translates_input do |path|
|
56
67
|
path = "/#{path}" unless path[0] == ?/
|
@@ -59,12 +70,8 @@ module AWS
|
|
59
70
|
end
|
60
71
|
end
|
61
72
|
|
62
|
-
# @attr_reader [String] The contents of the public key
|
63
|
-
# certificate.
|
64
73
|
attribute :certificate_body
|
65
74
|
|
66
|
-
# @attr_reader [String] The contents of the public key
|
67
|
-
# certificate chain.
|
68
75
|
attribute :certificate_chain
|
69
76
|
|
70
77
|
provider(:get_server_certificate) do |provider|
|
@@ -142,6 +142,18 @@ module AWS
|
|
142
142
|
nil
|
143
143
|
end
|
144
144
|
|
145
|
+
# @return [Boolean] Returns `true` if the resource exists.
|
146
|
+
def exists?
|
147
|
+
exists = false
|
148
|
+
SigningCertificateCollection.new(:config => config).each do |cert|
|
149
|
+
if cert.id == self.id
|
150
|
+
exists = true
|
151
|
+
break
|
152
|
+
end
|
153
|
+
end
|
154
|
+
exists
|
155
|
+
end
|
156
|
+
|
145
157
|
# @api private
|
146
158
|
protected
|
147
159
|
def resource_identifiers
|
@@ -157,7 +169,7 @@ module AWS
|
|
157
169
|
# have is fewer than one page of results.
|
158
170
|
# @api private
|
159
171
|
protected
|
160
|
-
def get_resource attribute
|
172
|
+
def get_resource attribute = nil
|
161
173
|
options = user ? { :user_name => user.name } : {}
|
162
174
|
client.list_signing_certificates(options)
|
163
175
|
end
|
data/lib/aws/rails.rb
CHANGED
@@ -134,7 +134,7 @@ module AWS
|
|
134
134
|
# If you need to supply configuration values for SES that are different than
|
135
135
|
# those in {AWS.config} then you can pass those options:
|
136
136
|
#
|
137
|
-
# AWS.add_action_mailer_delivery_method(:ses, custom_options)
|
137
|
+
# AWS::Rails.add_action_mailer_delivery_method(:ses, custom_options)
|
138
138
|
#
|
139
139
|
# @param [Symbol] name (:amazon_ses) The name of the delivery
|
140
140
|
# method. The name used here should be the same as you set in
|
data/lib/aws/rds/db_instance.rb
CHANGED
@@ -193,12 +193,11 @@ module AWS
|
|
193
193
|
|
194
194
|
# @return [Boolean] Returns `true` if the db instance exists.
|
195
195
|
def exists?
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
end
|
196
|
+
fail AWS::RDS::Errors::DBInstanceNotFound if id.to_s.empty?
|
197
|
+
get_resource
|
198
|
+
true
|
199
|
+
rescue AWS::RDS::Errors::DBInstanceNotFound
|
200
|
+
false
|
202
201
|
end
|
203
202
|
|
204
203
|
protected
|
@@ -140,7 +140,7 @@ module AWS
|
|
140
140
|
def populate_id
|
141
141
|
hash_key = self.class.hash_key_attribute
|
142
142
|
if hash_key.options[:default_hash_key_attribute]
|
143
|
-
self[hash_key.name] =
|
143
|
+
self[hash_key.name] = SecureRandom.uuid
|
144
144
|
end
|
145
145
|
end
|
146
146
|
|
data/lib/aws/record/model.rb
CHANGED
data/lib/aws/route_53/client.rb
CHANGED
@@ -17,7 +17,7 @@ module AWS
|
|
17
17
|
# Client class for Route53.
|
18
18
|
class Client < Core::RESTXMLClient
|
19
19
|
|
20
|
-
API_VERSION = '
|
20
|
+
API_VERSION = '2013-04-01'
|
21
21
|
|
22
22
|
signature_version :Version3Https
|
23
23
|
|
@@ -27,9 +27,12 @@ module AWS
|
|
27
27
|
end
|
28
28
|
|
29
29
|
class Client::V20121212 < Client
|
30
|
-
|
31
30
|
define_client_methods('2012-12-12')
|
31
|
+
end
|
32
32
|
|
33
|
+
class Client::V20130401 < Client
|
34
|
+
define_client_methods('2013-04-01')
|
33
35
|
end
|
36
|
+
|
34
37
|
end
|
35
38
|
end
|
@@ -21,8 +21,6 @@ module AWS
|
|
21
21
|
#
|
22
22
|
# @attr_reader [String] name The hosted zone name.
|
23
23
|
#
|
24
|
-
# @attr_reader [String] caller_reference
|
25
|
-
#
|
26
24
|
# @attr_reader [Integer] resource_record_set_count
|
27
25
|
# The resource record set count.
|
28
26
|
#
|
@@ -30,6 +28,18 @@ module AWS
|
|
30
28
|
#
|
31
29
|
class HostedZone < Core::Resource
|
32
30
|
|
31
|
+
S3_HOSTED_ZONE_IDS = {
|
32
|
+
'us-east-1' => 'Z3AQBSTGFYJSTF',
|
33
|
+
'us-west-2' => 'Z3BJ6K6RIION7M',
|
34
|
+
'us-west-1' => 'Z2F56UZL2M1ACD',
|
35
|
+
'eu-west-1' => 'Z1BKCTXD74EZPE',
|
36
|
+
'ap-southeast-1' => 'Z3O0J2DXBE1FTB',
|
37
|
+
'ap-southeast-2' => 'Z1WCIGYICN2BYD',
|
38
|
+
'ap-northeast-1' => 'Z2M4EHUR26P7ZW',
|
39
|
+
'sa-east-1' => 'Z7KQH4QJS55SO',
|
40
|
+
'us-gov-west-1' => 'Z31GFT0UA1I2HV'
|
41
|
+
}
|
42
|
+
|
33
43
|
# @api private
|
34
44
|
def initialize id, options = {}
|
35
45
|
@id = id.sub(%r!^/hostedzone/!, '')
|
@@ -50,26 +60,36 @@ module AWS
|
|
50
60
|
"/hostedzone/#{id}"
|
51
61
|
end
|
52
62
|
|
53
|
-
|
63
|
+
define_attribute_type :list
|
54
64
|
|
55
|
-
|
65
|
+
define_attribute_type :get
|
56
66
|
|
57
|
-
|
67
|
+
list_attribute :name, :static => true
|
58
68
|
|
59
|
-
|
69
|
+
list_attribute :configuration, :from => :config, :static => true
|
60
70
|
|
61
|
-
|
71
|
+
list_attribute :resource_record_set_count
|
62
72
|
|
63
|
-
|
64
|
-
resp[:hosted_zone] if resp[:hosted_zone][:id] == path
|
65
|
-
end
|
73
|
+
get_attribute :delegation_set, :static => true
|
66
74
|
|
67
|
-
|
68
|
-
|
75
|
+
provider(:list_hosted_zones) do |provider|
|
76
|
+
provider.find do |resp|
|
77
|
+
resp.data[:hosted_zones].find do |detail|
|
78
|
+
detail[:hosted_zone][:id] == path
|
79
|
+
end
|
80
|
+
end
|
81
|
+
provider.provides *list_attributes.keys
|
69
82
|
end
|
70
83
|
|
71
|
-
|
72
|
-
|
84
|
+
provider(:create_hosted_zone, :get_hosted_zone) do |provider|
|
85
|
+
provider.find do |resp|
|
86
|
+
if resp[:hosted_zone][:id] == path
|
87
|
+
resp[:hosted_zone][:delegation_set] = resp[:delegation_set]
|
88
|
+
resp[:hosted_zone]
|
89
|
+
end
|
90
|
+
end
|
91
|
+
provider.provides *list_attributes.keys
|
92
|
+
provider.provides *get_attributes.keys
|
73
93
|
end
|
74
94
|
|
75
95
|
# Deletes the hosted zone.
|
@@ -86,7 +106,10 @@ module AWS
|
|
86
106
|
|
87
107
|
# @return [Boolean] Returns `true` if this hosted zone exists.
|
88
108
|
def exists?
|
89
|
-
get_resource
|
109
|
+
get_resource
|
110
|
+
true
|
111
|
+
rescue Errors::NoSuchHostedZone
|
112
|
+
false
|
90
113
|
end
|
91
114
|
|
92
115
|
# Returns resource record sets.
|
@@ -99,7 +122,7 @@ module AWS
|
|
99
122
|
protected
|
100
123
|
|
101
124
|
def resource_identifiers
|
102
|
-
[[:id, id], [:name, name]
|
125
|
+
[[:id, id], [:name, name]]
|
103
126
|
end
|
104
127
|
|
105
128
|
def get_resource attr_name = nil
|
@@ -24,7 +24,8 @@ module AWS
|
|
24
24
|
# # Find existing hosted zone
|
25
25
|
#
|
26
26
|
# r53 = AWS::Route53.new
|
27
|
-
#
|
27
|
+
# # to lookup a route53 hosted zone, you need to use the zone id (i.e hosted_zone.id)
|
28
|
+
# hosted_zone = r53.hosted_zones['Zabcdefghijklm']
|
28
29
|
#
|
29
30
|
class HostedZoneCollection
|
30
31
|
|
@@ -12,7 +12,6 @@
|
|
12
12
|
# language governing permissions and limitations under the License.
|
13
13
|
|
14
14
|
require 'nokogiri'
|
15
|
-
require 'uuidtools'
|
16
15
|
|
17
16
|
module AWS
|
18
17
|
class S3
|
@@ -165,11 +164,13 @@ module AWS
|
|
165
164
|
options[:expiration_time] = expiration_time
|
166
165
|
end
|
167
166
|
|
168
|
-
id = options[:id] ||
|
167
|
+
id = options[:id] || SecureRandom.uuid
|
169
168
|
opts = {
|
170
169
|
:status => options[:disabled] == true ? 'Disabled' : 'Enabled',
|
171
170
|
:expiration_time => options[:expiration_time],
|
172
|
-
:glacier_transition_time => options[:glacier_transition_time]
|
171
|
+
:glacier_transition_time => options[:glacier_transition_time],
|
172
|
+
:noncurrent_version_transition_days => options[:noncurrent_version_transition_days],
|
173
|
+
:noncurrent_version_expiration_days => options[:noncurrent_version_expiration_days]
|
173
174
|
}
|
174
175
|
rule = Rule.new(self, id, prefix, opts)
|
175
176
|
self.rules << rule
|
@@ -241,10 +242,10 @@ module AWS
|
|
241
242
|
#
|
242
243
|
# @return [nil]
|
243
244
|
#
|
244
|
-
def update &block
|
245
|
+
def update arg = {}, &block
|
245
246
|
begin
|
246
247
|
@batching = true
|
247
|
-
|
248
|
+
instance_exec(arg, &block) if block_given?
|
248
249
|
persist(true)
|
249
250
|
ensure
|
250
251
|
@batching = false
|
@@ -305,6 +306,13 @@ module AWS
|
|
305
306
|
xml.Date "#{date}T00:00:00Z"
|
306
307
|
end
|
307
308
|
end if rule.glacier_transition_time
|
309
|
+
xml.NoncurrentVersionTransition do
|
310
|
+
xml.StorageClass 'GLACIER'
|
311
|
+
xml.NoncurrentDays rule.noncurrent_version_transition_days
|
312
|
+
end if rule.noncurrent_version_transition_days
|
313
|
+
xml.NoncurrentVersionExpiration do
|
314
|
+
xml.NoncurrentDays rule.noncurrent_version_expiration_days
|
315
|
+
end if rule.noncurrent_version_expiration_days
|
308
316
|
end
|
309
317
|
end
|
310
318
|
end
|
@@ -385,6 +393,12 @@ module AWS
|
|
385
393
|
@glacier_transition_time = convert_time_value(value)
|
386
394
|
end
|
387
395
|
|
396
|
+
# @return [Integer]
|
397
|
+
attr_accessor :noncurrent_version_transition_days
|
398
|
+
|
399
|
+
# @return [Integer]
|
400
|
+
attr_accessor :noncurrent_version_expiration_days
|
401
|
+
|
388
402
|
# @return [String] Returns the rule status, 'Enabled' or 'Disabled'
|
389
403
|
attr_accessor :status
|
390
404
|
|
@@ -412,7 +426,9 @@ module AWS
|
|
412
426
|
other.prefix == prefix and
|
413
427
|
other.expiration_time == expiration_time and
|
414
428
|
other.glacier_transition_time == glacier_transition_time and
|
415
|
-
other.status == status
|
429
|
+
other.status == status and
|
430
|
+
other.noncurrent_version_transition_days == noncurrent_version_transition_days and
|
431
|
+
other.noncurrent_version_expiration_days == noncurrent_version_expiration_days
|
416
432
|
end
|
417
433
|
alias_method :==, :eql?
|
418
434
|
|