Class: Aws::Continuum::Waiters::CodeScanSucceeded

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

Overview

Waits until the scan reaches SUCCEEDED, at which point the scan has finished and its findings are available from ListCodeFindings (filter on scanRunId). Triage of those findings and creation of issues continue asynchronously after the scan succeeds. Fails if the scan reaches FAILED. Scans run a build followed by analysis and can take from minutes to several hours. SDKs that use exponential backoff wait at least 60 seconds between polls and back off to at most 8 hours between polls, until the caller's maximum wait time elapses. SDKs and the AWS CLI that use a fixed delay poll every 60 seconds for up to 480 attempts (8 hours).

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ CodeScanSucceeded

Returns a new instance of CodeScanSucceeded.

Parameters:

  • options (Hash)

Options Hash (options):

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


85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
# File 'gems/aws-sdk-continuum/lib/aws-sdk-continuum/waiters.rb', line 85

def initialize(options)
  @client = options.fetch(:client)
  @waiter = Aws::Waiters::Waiter.new({
    max_attempts: 480,
    delay: 60,
    poller: Aws::Waiters::Poller.new(
      operation_name: :get_code_scan,
      acceptors: [
        {
          "matcher" => "path",
          "argument" => "scan.status",
          "state" => "success",
          "expected" => "SUCCEEDED"
        },
        {
          "matcher" => "path",
          "argument" => "scan.status",
          "state" => "failure",
          "expected" => "FAILED"
        }
      ]
    )
  }.merge(options))
end

Instance Method Details

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

Returns a response object which responds to the following methods:

  • #scan => Types::CodeScanData

Parameters:

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

    a customizable set of options

Options Hash (params):

  • :environment_id (required, String) —

    Environment that owns the scan.

  • :scan_run_id (required, String) —

    Scan to retrieve.

Returns:



112
113
114
# File 'gems/aws-sdk-continuum/lib/aws-sdk-continuum/waiters.rb', line 112

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