[DRE-commits] [ruby-aws-sdk] 02/07: Imported Upstream version 1.66.0

Tomasz Nitecki tnnn-guest at moszumanska.debian.org
Mon Feb 29 18:04:22 UTC 2016


This is an automated email from the git hooks/post-receive script.

tnnn-guest pushed a commit to branch master
in repository ruby-aws-sdk.

commit 3e3b02a0dc541ab2db3fe62a0f222816eb60fffb
Author: Tomasz Nitecki <tnnn at tnnn.pl>
Date:   Mon Feb 29 14:32:04 2016 -0300

    Imported Upstream version 1.66.0
---
 lib/aws/api_config/OpsWorks-2013-02-18.yml | 383 ++++++++++++++++++++++++-----
 lib/aws/core/credential_providers.rb       |  14 +-
 lib/aws/ec2/route_table/route.rb           |   4 +-
 lib/aws/s3/client.rb                       |  33 ++-
 lib/aws/s3/multipart_upload.rb             |  20 +-
 lib/aws/s3/presigned_post.rb               |  13 +-
 lib/aws/version.rb                         |   2 +-
 metadata.yml                               |   4 +-
 8 files changed, 378 insertions(+), 95 deletions(-)

diff --git a/lib/aws/api_config/OpsWorks-2013-02-18.yml b/lib/aws/api_config/OpsWorks-2013-02-18.yml
index 7b0f686..179b031 100644
--- a/lib/aws/api_config/OpsWorks-2013-02-18.yml
+++ b/lib/aws/api_config/OpsWorks-2013-02-18.yml
@@ -1,21 +1,19 @@
-# Copyright 2011-2014 Amazon.com, Inc. or its affiliates. All Rights Reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License"). You
-# may not use this file except in compliance with the License. A copy of
-# the License is located at
-#
-#     http://aws.amazon.com/apache2.0/
-#
-# or in the "license" file accompanying this file. This file is
-# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
-# ANY KIND, either express or implied. See the License for the specific
-# language governing permissions and limitations under the License.
-
 ---
 :json_version: '1.1'
 :target_prefix: OpsWorks_20130218.
 :api_version: '2013-02-18'
 :operations:
+- :name: AssignInstance
+  :method: :assign_instance
+  :inputs:
+    InstanceId:
+    - :string
+    - :required
+    LayerIds:
+    - :list:
+      - :string
+    - :required
+  :outputs: {}
 - :name: AssignVolume
   :method: :assign_volume
   :inputs:
@@ -116,6 +114,8 @@
       - :string
     DefaultRootDeviceType:
     - :string
+    AgentVersion:
+    - :string
   :outputs:
     StackId:
       :sym: :stack_id
@@ -260,10 +260,33 @@
     - :string
     RootDeviceType:
     - :string
+    BlockDeviceMappings:
+    - :list:
+      - :structure:
+          DeviceName:
+          - :string
+          NoDevice:
+          - :string
+          VirtualName:
+          - :string
+          Ebs:
+          - :structure:
+              SnapshotId:
+              - :string
+              Iops:
+              - :integer
+              VolumeSize:
+              - :integer
+              VolumeType:
+              - :string
+              DeleteOnTermination:
+              - :boolean
     InstallUpdatesOnBoot:
     - :boolean
     EbsOptimized:
     - :boolean
+    AgentVersion:
+    - :string
   :outputs:
     InstanceId:
       :sym: :instance_id
@@ -342,6 +365,14 @@
     - :boolean
     UseEbsOptimizedInstances:
     - :boolean
+    LifecycleEventConfiguration:
+    - :structure:
+        Shutdown:
+        - :structure:
+            ExecutionTimeout:
+            - :integer
+            DelayUntilElbConnectionsDrained:
+            - :boolean
   :outputs:
     LayerId:
       :sym: :layer_id
@@ -413,6 +444,8 @@
     - :string
     DefaultRootDeviceType:
     - :string
+    AgentVersion:
+    - :string
   :outputs:
     StackId:
       :sym: :stack_id
@@ -479,6 +512,13 @@
     - :string
     - :required
   :outputs: {}
+- :name: DeregisterInstance
+  :method: :deregister_instance
+  :inputs:
+    InstanceId:
+    - :string
+    - :required
+  :outputs: {}
 - :name: DeregisterRdsDbInstance
   :method: :deregister_rds_db_instance
   :inputs:
@@ -493,6 +533,35 @@
     - :string
     - :required
   :outputs: {}
+- :name: DescribeAgentVersions
+  :method: :describe_agent_versions
+  :inputs:
+    StackId:
+    - :string
+    ConfigurationManager:
+    - :structure:
+        Name:
+        - :string
+        Version:
+        - :string
+  :outputs:
+    AgentVersions:
+      :sym: :agent_versions
+      :type: :hash
+      :members:
+        Version:
+          :sym: :version
+          :type: :string
+        ConfigurationManager:
+          :sym: :configuration_manager
+          :type: :hash
+          :members:
+            Name:
+              :sym: :name
+              :type: :string
+            Version:
+              :sym: :version
+              :type: :string
 - :name: DescribeApps
   :method: :describe_apps
   :inputs:
@@ -791,96 +860,156 @@
       :sym: :instances
       :type: :hash
       :members:
-        InstanceId:
-          :sym: :instance_id
+        AgentVersion:
+          :sym: :agent_version
           :type: :string
+        AmiId:
+          :sym: :ami_id
+          :type: :string
+        Architecture:
+          :sym: :architecture
+          :type: :string
+        AutoScalingType:
+          :sym: :auto_scaling_type
+          :type: :string
+        AvailabilityZone:
+          :sym: :availability_zone
+          :type: :string
+        BlockDeviceMappings:
+          :sym: :block_device_mappings
+          :type: :hash
+          :members:
+            DeviceName:
+              :sym: :device_name
+              :type: :string
+            NoDevice:
+              :sym: :no_device
+              :type: :string
+            VirtualName:
+              :sym: :virtual_name
+              :type: :string
+            Ebs:
+              :sym: :ebs
+              :type: :hash
+              :members:
+                SnapshotId:
+                  :sym: :snapshot_id
+                  :type: :string
+                Iops:
+                  :sym: :iops
+                  :type: :integer
+                VolumeSize:
+                  :sym: :volume_size
+                  :type: :integer
+                VolumeType:
+                  :sym: :volume_type
+                  :type: :string
+                DeleteOnTermination:
+                  :sym: :delete_on_termination
+                  :type: :boolean
+        CreatedAt:
+          :sym: :created_at
+          :type: :string
+        EbsOptimized:
+          :sym: :ebs_optimized
+          :type: :boolean
         Ec2InstanceId:
           :sym: :ec2_instance_id
           :type: :string
-        VirtualizationType:
-          :sym: :virtualization_type
+        ElasticIp:
+          :sym: :elastic_ip
           :type: :string
         Hostname:
           :sym: :hostname
           :type: :string
-        StackId:
-          :sym: :stack_id
+        InfrastructureClass:
+          :sym: :infrastructure_class
           :type: :string
-        LayerIds:
-          :sym: :layer_ids
+        InstallUpdatesOnBoot:
+          :sym: :install_updates_on_boot
+          :type: :boolean
+        InstanceId:
+          :sym: :instance_id
           :type: :string
-        SecurityGroupIds:
-          :sym: :security_group_ids
+        InstanceProfileArn:
+          :sym: :instance_profile_arn
           :type: :string
         InstanceType:
           :sym: :instance_type
           :type: :string
-        InstanceProfileArn:
-          :sym: :instance_profile_arn
+        LastServiceErrorId:
+          :sym: :last_service_error_id
           :type: :string
-        Status:
-          :sym: :status
+        LayerIds:
+          :sym: :layer_ids
           :type: :string
         Os:
           :sym: :os
           :type: :string
-        AmiId:
-          :sym: :ami_id
+        Platform:
+          :sym: :platform
           :type: :string
-        AvailabilityZone:
-          :sym: :availability_zone
+        PrivateDns:
+          :sym: :private_dns
           :type: :string
-        SubnetId:
-          :sym: :subnet_id
+        PrivateIp:
+          :sym: :private_ip
           :type: :string
         PublicDns:
           :sym: :public_dns
           :type: :string
-        PrivateDns:
-          :sym: :private_dns
-          :type: :string
         PublicIp:
           :sym: :public_ip
           :type: :string
-        PrivateIp:
-          :sym: :private_ip
+        RegisteredBy:
+          :sym: :registered_by
           :type: :string
-        ElasticIp:
-          :sym: :elastic_ip
+        ReportedAgentVersion:
+          :sym: :reported_agent_version
           :type: :string
-        AutoScalingType:
-          :sym: :auto_scaling_type
+        ReportedOs:
+          :sym: :reported_os
+          :type: :hash
+          :members:
+            Family:
+              :sym: :family
+              :type: :string
+            Name:
+              :sym: :name
+              :type: :string
+            Version:
+              :sym: :version
+              :type: :string
+        RootDeviceType:
+          :sym: :root_device_type
           :type: :string
-        SshKeyName:
-          :sym: :ssh_key_name
+        RootDeviceVolumeId:
+          :sym: :root_device_volume_id
           :type: :string
-        SshHostRsaKeyFingerprint:
-          :sym: :ssh_host_rsa_key_fingerprint
+        SecurityGroupIds:
+          :sym: :security_group_ids
           :type: :string
         SshHostDsaKeyFingerprint:
           :sym: :ssh_host_dsa_key_fingerprint
           :type: :string
-        CreatedAt:
-          :sym: :created_at
+        SshHostRsaKeyFingerprint:
+          :sym: :ssh_host_rsa_key_fingerprint
           :type: :string
-        LastServiceErrorId:
-          :sym: :last_service_error_id
+        SshKeyName:
+          :sym: :ssh_key_name
           :type: :string
-        Architecture:
-          :sym: :architecture
+        StackId:
+          :sym: :stack_id
           :type: :string
-        RootDeviceType:
-          :sym: :root_device_type
+        Status:
+          :sym: :status
           :type: :string
-        RootDeviceVolumeId:
-          :sym: :root_device_volume_id
+        SubnetId:
+          :sym: :subnet_id
+          :type: :string
+        VirtualizationType:
+          :sym: :virtualization_type
           :type: :string
-        InstallUpdatesOnBoot:
-          :sym: :install_updates_on_boot
-          :type: :boolean
-        EbsOptimized:
-          :sym: :ebs_optimized
-          :type: :boolean
 - :name: DescribeLayers
   :method: :describe_layers
   :inputs:
@@ -1005,6 +1134,20 @@
         UseEbsOptimizedInstances:
           :sym: :use_ebs_optimized_instances
           :type: :boolean
+        LifecycleEventConfiguration:
+          :sym: :lifecycle_event_configuration
+          :type: :hash
+          :members:
+            Shutdown:
+              :sym: :shutdown
+              :type: :hash
+              :members:
+                ExecutionTimeout:
+                  :sym: :execution_timeout
+                  :type: :integer
+                DelayUntilElbConnectionsDrained:
+                  :sym: :delay_until_elb_connections_drained
+                  :type: :boolean
 - :name: DescribeLoadBasedAutoScaling
   :method: :describe_load_based_auto_scaling
   :inputs:
@@ -1045,6 +1188,9 @@
             LoadThreshold:
               :sym: :load_threshold
               :type: :float
+            Alarms:
+              :sym: :alarms
+              :type: :string
         DownScaling:
           :sym: :down_scaling
           :type: :hash
@@ -1067,6 +1213,9 @@
             LoadThreshold:
               :sym: :load_threshold
               :type: :float
+            Alarms:
+              :sym: :alarms
+              :type: :string
 - :name: DescribeMyUserProfile
   :method: :describe_my_user_profile
   :inputs: {}
@@ -1242,6 +1391,22 @@
         CreatedAt:
           :sym: :created_at
           :type: :string
+- :name: DescribeStackProvisioningParameters
+  :method: :describe_stack_provisioning_parameters
+  :inputs:
+    StackId:
+    - :string
+    - :required
+  :outputs:
+    AgentInstallerUrl:
+      :sym: :agent_installer_url
+      :type: :string
+    Parameters:
+      :sym: :parameters
+      :type: :map
+      :members:
+        :sym: :map_value
+        :type: :string
 - :name: DescribeStackSummary
   :method: :describe_stack_summary
   :inputs:
@@ -1272,12 +1437,18 @@
           :sym: :instances_count
           :type: :hash
           :members:
+            Assigning:
+              :sym: :assigning
+              :type: :integer
             Booting:
               :sym: :booting
               :type: :integer
             ConnectionLost:
               :sym: :connection_lost
               :type: :integer
+            Deregistering:
+              :sym: :deregistering
+              :type: :integer
             Online:
               :sym: :online
               :type: :integer
@@ -1287,6 +1458,12 @@
             Rebooting:
               :sym: :rebooting
               :type: :integer
+            Registered:
+              :sym: :registered
+              :type: :integer
+            Registering:
+              :sym: :registering
+              :type: :integer
             Requested:
               :sym: :requested
               :type: :integer
@@ -1314,6 +1491,9 @@
             Terminating:
               :sym: :terminating
               :type: :integer
+            Unassigning:
+              :sym: :unassigning
+              :type: :integer
 - :name: DescribeStacks
   :method: :describe_stacks
   :inputs:
@@ -1424,6 +1604,9 @@
         DefaultRootDeviceType:
           :sym: :default_root_device_type
           :type: :string
+        AgentVersion:
+          :sym: :agent_version
+          :type: :string
 - :name: DescribeTimeBasedAutoScaling
   :method: :describe_time_based_auto_scaling
   :inputs:
@@ -1597,6 +1780,31 @@
     Hostname:
       :sym: :hostname
       :type: :string
+- :name: GrantAccess
+  :method: :grant_access
+  :inputs:
+    InstanceId:
+    - :string
+    - :required
+    ValidForInMinutes:
+    - :integer
+  :outputs:
+    TemporaryCredential:
+      :sym: :temporary_credential
+      :type: :hash
+      :members:
+        Username:
+          :sym: :username
+          :type: :string
+        Password:
+          :sym: :password
+          :type: :string
+        ValidForInMinutes:
+          :sym: :valid_for_in_minutes
+          :type: :integer
+        InstanceId:
+          :sym: :instance_id
+          :type: :string
 - :name: RebootInstance
   :method: :reboot_instance
   :inputs:
@@ -1617,6 +1825,32 @@
     ElasticIp:
       :sym: :elastic_ip
       :type: :string
+- :name: RegisterInstance
+  :method: :register_instance
+  :inputs:
+    StackId:
+    - :string
+    - :required
+    Hostname:
+    - :string
+    PublicIp:
+    - :string
+    PrivateIp:
+    - :string
+    RsaPublicKey:
+    - :string
+    RsaPublicKeyFingerprint:
+    - :string
+    InstanceIdentity:
+    - :structure:
+        Document:
+        - :string
+        Signature:
+        - :string
+  :outputs:
+    InstanceId:
+      :sym: :instance_id
+      :type: :string
 - :name: RegisterRdsDbInstance
   :method: :register_rds_db_instance
   :inputs:
@@ -1667,6 +1901,9 @@
         - :double
         LoadThreshold:
         - :double
+        Alarms:
+        - :list:
+          - :string
     DownScaling:
     - :structure:
         InstanceCount:
@@ -1681,6 +1918,9 @@
         - :double
         LoadThreshold:
         - :double
+        Alarms:
+        - :list:
+          - :string
   :outputs: {}
 - :name: SetPermission
   :method: :set_permission
@@ -1777,6 +2017,13 @@
     - :string
     - :required
   :outputs: {}
+- :name: UnassignInstance
+  :method: :unassign_instance
+  :inputs:
+    InstanceId:
+    - :string
+    - :required
+  :outputs: {}
 - :name: UnassignVolume
   :method: :unassign_volume
   :inputs:
@@ -1888,6 +2135,8 @@
     - :boolean
     EbsOptimized:
     - :boolean
+    AgentVersion:
+    - :string
   :outputs: {}
 - :name: UpdateLayer
   :method: :update_layer
@@ -1958,6 +2207,14 @@
     - :boolean
     UseEbsOptimizedInstances:
     - :boolean
+    LifecycleEventConfiguration:
+    - :structure:
+        Shutdown:
+        - :structure:
+            ExecutionTimeout:
+            - :integer
+            DelayUntilElbConnectionsDrained:
+            - :boolean
   :outputs: {}
 - :name: UpdateMyUserProfile
   :method: :update_my_user_profile
@@ -2038,6 +2295,8 @@
     - :string
     UseOpsworksSecurityGroups:
     - :boolean
+    AgentVersion:
+    - :string
   :outputs: {}
 - :name: UpdateUserProfile
   :method: :update_user_profile
diff --git a/lib/aws/core/credential_providers.rb b/lib/aws/core/credential_providers.rb
index 72b42a6..48a881d 100644
--- a/lib/aws/core/credential_providers.rb
+++ b/lib/aws/core/credential_providers.rb
@@ -400,14 +400,22 @@ module AWS
         #   `:access_key_id` or the `:secret_access_key` can not be found.
         #
         def credentials
-          if @credentials_expiration && @credentials_expiration.utc <= (Time.now.utc + (15 * 60))
-            refresh
-          end
+          refresh if near_expiration?
           super
         end
 
         protected
 
+        def near_expiration?
+          if @credentials_expiration.nil?
+            true
+          elsif @credentials_expiration.utc <= (Time.now.utc + (15 * 60))
+            true
+          else
+            false
+          end
+        end
+
         # (see Provider#get_credentials)
         def get_credentials
           retries_left = retries
diff --git a/lib/aws/ec2/route_table/route.rb b/lib/aws/ec2/route_table/route.rb
index e910070..4d16533 100644
--- a/lib/aws/ec2/route_table/route.rb
+++ b/lib/aws/ec2/route_table/route.rb
@@ -30,7 +30,9 @@ module AWS
 
           @route_table = route_table
 
-          @destination_cidr_block = details.destination_cidr_block
+          if details[:destination_cidr_block]
+            @destination_cidr_block = details.destination_cidr_block
+          end
 
           if details[:gateway_id]
             @internet_gateway = InternetGateway.new(
diff --git a/lib/aws/s3/client.rb b/lib/aws/s3/client.rb
index 0005e1c..ea8b790 100644
--- a/lib/aws/s3/client.rb
+++ b/lib/aws/s3/client.rb
@@ -19,6 +19,7 @@ require 'json'
 require 'digest/md5'
 require 'base64'
 require 'nokogiri'
+require 'set'
 
 module AWS
   class S3
@@ -38,6 +39,12 @@ module AWS
 
       XMLNS = "http://s3.amazonaws.com/doc/#{API_VERSION}/"
 
+      HTTP_200_ERROR_OPERATIONS = Set.new([
+        :complete_multipart_upload,
+        :copy_object,
+        :copy_part,
+      ])
+
       autoload :XML, 'aws/s3/client/xml'
 
       # @api private
@@ -168,8 +175,10 @@ module AWS
 
       def extract_error_details response
         if
-          (response.http_response.status >= 300 ||
-            response.request_type == :complete_multipart_upload) and
+          (
+            response.http_response.status >= 300 ||
+            HTTP_200_ERROR_OPERATIONS.include?(response.request_type)
+          ) and
           body = response.http_response.body and
           error = Core::XML::Parser.parse(body) and
           error[:code]
@@ -196,16 +205,22 @@ module AWS
       end
 
       def retryable_error? response
-        super or
-        failed_multipart_upload?(response) or
+        super ||
+        http_200_error?(response) ||
         response.error.is_a?(Errors::RequestTimeout)
       end
 
-      # S3 may return a 200 response code in response to complete_multipart_upload
-      # and then start streaming whitespace until it knows the final result.
-      # At that time it sends an XML message with success or failure.
-      def failed_multipart_upload? response
-        response.request_type == :complete_multipart_upload &&
+      # S3 may return with a 200 status code in the response, but still
+      # embed an error in the body for the following operations:
+      #
+      # * `#complete_multipart_upload`
+      # * `#copy_object`
+      # * `#copy_part`
+      #
+      # To ensure the response is not in error, we have to parse
+      # it before the normal parser.
+      def http_200_error? response
+        HTTP_200_ERROR_OPERATIONS.include?(response.request_type) &&
         extract_error_details(response)
       end
 
diff --git a/lib/aws/s3/multipart_upload.rb b/lib/aws/s3/multipart_upload.rb
index e412465..1edc903 100644
--- a/lib/aws/s3/multipart_upload.rb
+++ b/lib/aws/s3/multipart_upload.rb
@@ -19,19 +19,19 @@ module AWS
     # Represents a multipart upload to an S3 object.  See
     # {S3Object#multipart_upload} for a convenient way to initiate a
     # multipart upload.
-    # 
-    # Note: After you initiate multipart upload and upload one or more 
-    # parts, you must either complete or abort multipart upload in order 
-    # to stop getting charged for storage of the uploaded parts. Only 
-    # after you either complete or abort multipart upload, Amazon S3 
-    # frees up the parts storage and stops charging you for the parts 
+    #
+    # Note: After you initiate multipart upload and upload one or more
+    # parts, you must either complete or abort multipart upload in order
+    # to stop getting charged for storage of the uploaded parts. Only
+    # after you either complete or abort multipart upload, Amazon S3
+    # frees up the parts storage and stops charging you for the parts
     # storage.
     class MultipartUpload
 
       include Core::Model
 
       class EmptyUploadError < StandardError; end
-      
+
       # @api private
       def initialize(object, id, options = {})
         @id = id
@@ -207,10 +207,10 @@ module AWS
         @completed_mutex.synchronize do
           @completed_parts[part_number] = {
             :part_number => part_number,
-            :etag => resp.etag
+            :etag => resp[:etag]
           }
         end
-        UploadedPart.new(self, part_number)
+        UploadedPart.new(self, part_number, :etag => resp[:etag])
       end
 
       # Copies a part.
@@ -240,7 +240,7 @@ module AWS
             :etag => resp[:etag]
           }
         end
-        UploadedPart.new(self, part_number)
+        UploadedPart.new(self, part_number, :etag => resp[:etag])
       end
 
       # Completes the upload by assembling previously uploaded
diff --git a/lib/aws/s3/presigned_post.rb b/lib/aws/s3/presigned_post.rb
index 569639b..d45c602 100644
--- a/lib/aws/s3/presigned_post.rb
+++ b/lib/aws/s3/presigned_post.rb
@@ -207,7 +207,7 @@ module AWS
         @content_length = range_value(opts[:content_length])
         @conditions = opts[:conditions] || {}
         @ignored_fields = [opts[:ignore]].flatten.compact
-        @expires = opts[:expires]
+        @expires = opts[:expires] || Time.now.utc + 60*60
 
         super
 
@@ -397,17 +397,16 @@ module AWS
       # @api private
       private
       def format_expiration
-        time = expires || Time.now.utc + 60*60
         time =
-          case time
+          case expires
           when Time
-            time
+            expires
           when DateTime
-            Time.parse(time.to_s)
+            Time.parse(expires.to_s)
           when Integer
-            (Time.now + time)
+            (Time.now + expires)
           when String
-            Time.parse(time)
+            Time.parse(expires)
           end
         time.utc.iso8601
       end
diff --git a/lib/aws/version.rb b/lib/aws/version.rb
index 15d439a..70f3651 100644
--- a/lib/aws/version.rb
+++ b/lib/aws/version.rb
@@ -13,5 +13,5 @@
 
 module AWS
   # Current version of the AWS SDK for Ruby
-  VERSION = '1.64.0'
+  VERSION = '1.66.0'
 end
diff --git a/metadata.yml b/metadata.yml
index a1ab112..a96ec79 100644
--- a/metadata.yml
+++ b/metadata.yml
@@ -1,14 +1,14 @@
 --- !ruby/object:Gem::Specification
 name: aws-sdk-v1
 version: !ruby/object:Gem::Version
-  version: 1.64.0
+  version: 1.66.0
 platform: ruby
 authors:
 - Amazon Web Services
 autorequire: 
 bindir: bin
 cert_chain: []
-date: 2015-04-03 00:00:00.000000000 Z
+date: 2015-09-05 00:00:00.000000000 Z
 dependencies:
 - !ruby/object:Gem::Dependency
   name: nokogiri

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ruby-extras/ruby-aws-sdk.git



More information about the Pkg-ruby-extras-commits mailing list