Sha256: ef98bd57b4a43f75a471135f06e0a17b043709240186cf297eaeb8d6729d87e9

Contents?: true

Size: 1.77 KB

Versions: 35

Compression:

Stored size: 1.77 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 data[:health_states].include?(health_status)
            raise Fog::AWS::AutoScaling::ValidationError.new('Valid instance health states are: [#{data[:health_states].join(", ")}].')
          end

          Fog::Mock.not_implemented
        end

      end

    end
  end
end

Version data entries

35 entries across 35 versions & 9 rubygems

Version Path
fog-parser-fix-1.6.1 lib/fog/aws/requests/auto_scaling/set_instance_health.rb
fog-test-again-1.6.0 lib/fog/aws/requests/auto_scaling/set_instance_health.rb
fog-parser-fix-1.6.0 lib/fog/aws/requests/auto_scaling/set_instance_health.rb
fog-1.6.0 lib/fog/aws/requests/auto_scaling/set_instance_health.rb
fog-1.5.0 lib/fog/aws/requests/auto_scaling/set_instance_health.rb
fog-1.4.0 lib/fog/aws/requests/auto_scaling/set_instance_health.rb
brightbox-cli-0.18.1 lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/auto_scaling/set_instance_health.rb
michiels-fog-1.3.1 lib/fog/aws/requests/auto_scaling/set_instance_health.rb
ftl-0.2.0 vendor/bundle/gems/fog-1.3.1/lib/fog/aws/requests/auto_scaling/set_instance_health.rb
brightbox-cli-0.18.0 lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/auto_scaling/set_instance_health.rb
fog-1.3.1 lib/fog/aws/requests/auto_scaling/set_instance_health.rb
fog-1.3.0 lib/fog/aws/requests/auto_scaling/set_instance_health.rb
brightbox-cli-0.17.5 lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/auto_scaling/set_instance_health.rb
fog-1.2.0 lib/fog/aws/requests/auto_scaling/set_instance_health.rb
ktheory-fog-1.1.2 lib/fog/aws/requests/auto_scaling/set_instance_health.rb
brightbox-cli-0.17.4 lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/auto_scaling/set_instance_health.rb
brightbox-cli-0.17.3 lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/auto_scaling/set_instance_health.rb
brightbox-cli-0.17.2 lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/auto_scaling/set_instance_health.rb
brightbox-cli-0.17.1 lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/auto_scaling/set_instance_health.rb
brightbox-cli-0.17.0 lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/auto_scaling/set_instance_health.rb