Sha256: 773b00238edb9d783b9b321403b05b6dc4548417e2971decda3ab7ff14f3173f

Contents?: true

Size: 1.78 KB

Versions: 72

Compression:

Stored size: 1.78 KB

Contents

module Fog
  module AWS
    class AutoScaling

      class Real

        require 'fog/aws/parsers/auto_scaling/basic'

        # Sets the health status of an instance.
        #
        # ==== Parameters
        # * health_status<~String> - The health status of the instance.
        #   "Healthy" means that the instance is healthy and should remain in
        #   service. "Unhealthy" means that the instance is unhealthy. Auto
        #   Scaling should terminate and replace it.
        # * instance_id<~String> - The identifier of the EC2 instance.
        # * options<~Hash>:
        #   * 'ShouldRespectGracePeriod'<~Boolean> - If true, this call should
        #   respect the grace period associated with the group.
        #
        # ==== Returns
        # * response<~Excon::Response>:
        #   * body<~Hash>:
        #     * 'ResponseMetadata'<~Hash>:
        #       * 'RequestId'<~String> - Id of request
        #
        # ==== See Also
        # http://docs.amazonwebservices.com/AutoScaling/latest/APIReference/API_SetInstanceHealth.html
        #
        def set_instance_health(health_status, instance_id, options = {})
          request({
            'Action'       => 'SetInstanceHealth',
            'HealthStatus' => health_status,
            'InstanceId'   => instance_id,
            :parser        => Fog::Parsers::AWS::AutoScaling::Basic.new
          }.merge!(options))
        end

      end

      class Mock

        def set_instance_health(health_status, instance_id, options = {})
          unless self.data[:health_states].include?(health_status)
            raise Fog::AWS::AutoScaling::ValidationError.new('Valid instance health states are: [#{self.data[:health_states].join(", ")}].')
          end

          Fog::Mock.not_implemented
        end

      end

    end
  end
end

Version data entries

72 entries across 72 versions & 9 rubygems

Version Path
fog-maestrodev-1.15.0.20130927082724 lib/fog/aws/requests/auto_scaling/set_instance_health.rb
fog-maestrodev-1.15.0.20130829165835 lib/fog/aws/requests/auto_scaling/set_instance_health.rb
fog-1.15.0 lib/fog/aws/requests/auto_scaling/set_instance_health.rb
gapinc-fog-1.14.0 lib/fog/aws/requests/auto_scaling/set_instance_health.rb
fog-maestrodev-1.14.0.20130806165225 lib/fog/aws/requests/auto_scaling/set_instance_health.rb
fog-1.14.0 lib/fog/aws/requests/auto_scaling/set_instance_health.rb
fog-1.13.0 lib/fog/aws/requests/auto_scaling/set_instance_health.rb
gapinc-fog-1.12.1.2 lib/fog/aws/requests/auto_scaling/set_instance_health.rb
gapinc-fog-1.12.1.1 lib/fog/aws/requests/auto_scaling/set_instance_health.rb
gapinc-fog-1.12.1a lib/fog/aws/requests/auto_scaling/set_instance_health.rb
gapinc-fog-1.12.1 lib/fog/aws/requests/auto_scaling/set_instance_health.rb
fog-1.12.1 lib/fog/aws/requests/auto_scaling/set_instance_health.rb
fog-1.12.0 lib/fog/aws/requests/auto_scaling/set_instance_health.rb
hpfog-0.0.20 lib/fog/aws/requests/auto_scaling/set_instance_health.rb
vagrant-shell-0.2.6 vendor/bundle/gems/fog-1.10.1/lib/fog/aws/requests/auto_scaling/set_instance_health.rb
vagrant-shell-0.2.5 vendor/bundle/gems/fog-1.10.1/lib/fog/aws/requests/auto_scaling/set_instance_health.rb
fog-nirvanix-1.8.2 lib/fog/aws/requests/auto_scaling/set_instance_health.rb
fog-1.11.1 lib/fog/aws/requests/auto_scaling/set_instance_health.rb
fog-1.11.0 lib/fog/aws/requests/auto_scaling/set_instance_health.rb
fog-nirvanix-1.8.1 lib/fog/aws/requests/auto_scaling/set_instance_health.rb