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.18.0.20131209090811 lib/fog/aws/requests/auto_scaling/set_instance_health.rb
fog-maestrodev-1.18.0.20131206115947 lib/fog/aws/requests/auto_scaling/set_instance_health.rb
fog-maestrodev-1.18.0.20131205181604 lib/fog/aws/requests/auto_scaling/set_instance_health.rb
fog-maestrodev-1.18.0.20131127194823 lib/fog/aws/requests/auto_scaling/set_instance_health.rb
fog-maestrodev-1.18.0.20131126183714 lib/fog/aws/requests/auto_scaling/set_instance_health.rb
fog-maestrodev-1.18.0.20131126122111 lib/fog/aws/requests/auto_scaling/set_instance_health.rb
fog-maestrodev-1.18.0.20131125111730 lib/fog/aws/requests/auto_scaling/set_instance_health.rb
fog-maestrodev-1.18.0.20131125083406 lib/fog/aws/requests/auto_scaling/set_instance_health.rb
fog-maestrodev-1.18.0.20131123105121 lib/fog/aws/requests/auto_scaling/set_instance_health.rb
fog-maestrodev-1.18.0.20131122203507 lib/fog/aws/requests/auto_scaling/set_instance_health.rb
fog-maestrodev-1.18.0.20131121075022 lib/fog/aws/requests/auto_scaling/set_instance_health.rb
fog-maestrodev-1.18.0.20131118164830 lib/fog/aws/requests/auto_scaling/set_instance_health.rb
fog-maestrodev-1.18.0.20131115184302 lib/fog/aws/requests/auto_scaling/set_instance_health.rb
fog-maestrodev-1.18.0.20131114200144 lib/fog/aws/requests/auto_scaling/set_instance_health.rb
gapinc-fog-1.12.1.2.1 lib/fog/aws/requests/auto_scaling/set_instance_health.rb
fog-maestrodev-1.18.0.20131112185232 lib/fog/aws/requests/auto_scaling/set_instance_health.rb
fog-maestrodev-1.18.0.20131111203459 lib/fog/aws/requests/auto_scaling/set_instance_health.rb
fog-1.18.0 lib/fog/aws/requests/auto_scaling/set_instance_health.rb
fog-1.17.0 lib/fog/aws/requests/auto_scaling/set_instance_health.rb
fog-1.16.0 lib/fog/aws/requests/auto_scaling/set_instance_health.rb