Class: Aws::Inspector2::Waiters::ConnectorConnected

Inherits:
Object
  • Object
show all
Defined in:
gems/aws-sdk-inspector2/lib/aws-sdk-inspector2/waiters.rb

Overview

Wait until a connector reaches the CONNECTED health status, typically after CreateConnector or UpdateConnector + ConnectorEnabled. Caller MUST filter ListConnectors by the specific connector ARN so the matchers apply only to the target connector. Success when all returned items have health.connectorStatus == CONNECTED. Failure when any item is in health.connectorStatus == FAILED_TO_CONNECT or enablementStatus == FAILED_TO_ENABLE.

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ ConnectorConnected

Returns a new instance of ConnectorConnected.

Parameters:

  • options (Hash)

Options Hash (options):

  • :client (required, Client)
  • :max_attempts (Integer) — default: 5
  • :delay (Integer) — default: 30
  • :before_attempt (Proc)
  • :before_wait (Proc)


87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
# File 'gems/aws-sdk-inspector2/lib/aws-sdk-inspector2/waiters.rb', line 87

def initialize(options)
  @client = options.fetch(:client)
  @waiter = Aws::Waiters::Waiter.new({
    max_attempts: 5,
    delay: 30,
    poller: Aws::Waiters::Poller.new(
      operation_name: :list_connectors,
      acceptors: [
        {
          "matcher" => "pathAll",
          "argument" => "items[].health.connector_status",
          "state" => "success",
          "expected" => "CONNECTED"
        },
        {
          "matcher" => "pathAny",
          "argument" => "items[].health.connector_status",
          "state" => "failure",
          "expected" => "FAILED_TO_CONNECT"
        },
        {
          "matcher" => "pathAny",
          "argument" => "items[].enablement_status",
          "state" => "failure",
          "expected" => "FAILED_TO_ENABLE"
        }
      ]
    )
  }.merge(options))
end

Instance Method Details

#wait(params = {}) ⇒ Types::ListConnectorsResponse

Returns a response object which responds to the following methods:

Parameters:

  • params (Hash) (defaults to: {})

    a customizable set of options

Options Hash (params):

  • :max_results (Integer)

    The maximum number of results to return in a single call. To retrieve the remaining results, make another request with the nextToken value returned from this request.

  • :next_token (String)

    A token to use for paginating results. Set this value to null for the first request. For subsequent calls, use the nextToken value returned from the previous request.

  • :filter_criteria (Types::ConnectorFilterCriteria)

    The filter criteria to apply to the list of connectors.

Returns:



120
121
122
# File 'gems/aws-sdk-inspector2/lib/aws-sdk-inspector2/waiters.rb', line 120

def wait(params = {})
  @waiter.wait(client: @client, params: params)
end