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-1.22.0 lib/fog/aws/requests/auto_scaling/set_instance_health.rb
fog-1.21.0 lib/fog/aws/requests/auto_scaling/set_instance_health.rb
fog-maestrodev-1.20.0.20140305101839 lib/fog/aws/requests/auto_scaling/set_instance_health.rb
fog-maestrodev-1.20.0.20140305101305 lib/fog/aws/requests/auto_scaling/set_instance_health.rb
fog-maestrodev-1.19.0.20140212012611 lib/fog/aws/requests/auto_scaling/set_instance_health.rb
fog-1.20.0 lib/fog/aws/requests/auto_scaling/set_instance_health.rb
fog-maestrodev-1.19.0.20140110004459 lib/fog/aws/requests/auto_scaling/set_instance_health.rb
fog-maestrodev-1.19.0.20140110003812 lib/fog/aws/requests/auto_scaling/set_instance_health.rb
fog-maestrodev-1.19.0.20140109202555 lib/fog/aws/requests/auto_scaling/set_instance_health.rb
fog-maestrodev-1.19.0.20140107192102 lib/fog/aws/requests/auto_scaling/set_instance_health.rb
fog-maestrodev-1.19.0.20140107142106 lib/fog/aws/requests/auto_scaling/set_instance_health.rb
fog-maestrodev-1.19.0.20131219203941 lib/fog/aws/requests/auto_scaling/set_instance_health.rb
fog-maestrodev-1.18.0.20131219193542 lib/fog/aws/requests/auto_scaling/set_instance_health.rb
fog-1.19.0 lib/fog/aws/requests/auto_scaling/set_instance_health.rb
fog-maestrodev-1.18.0.20131219033443 lib/fog/aws/requests/auto_scaling/set_instance_health.rb
fog-maestrodev-1.18.0.20131219032002 lib/fog/aws/requests/auto_scaling/set_instance_health.rb
fog-maestrodev-1.18.0.20131219030716 lib/fog/aws/requests/auto_scaling/set_instance_health.rb
fog-maestrodev-1.18.0.20131219022322 lib/fog/aws/requests/auto_scaling/set_instance_health.rb
fog-maestrodev-1.18.0.20131218202447 lib/fog/aws/requests/auto_scaling/set_instance_health.rb
fog-maestrodev-1.18.0.20131209091424 lib/fog/aws/requests/auto_scaling/set_instance_health.rb