Web Security Scanner V1 API - Class Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client (v1.0.0)

Reference documentation and code samples for the Web Security Scanner V1 API class Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client.

Client for the WebSecurityScanner service.

Web Security Scanner Service identifies security vulnerabilities in web applications hosted on Google Cloud. It crawls your application, and attempts to exercise as many user inputs and event handlers as possible.

Inherits

  • Object

Methods

.configure

def self.configure() { |config| ... } -> Client::Configuration

Configure the WebSecurityScanner Client class.

See Configuration for a description of the configuration fields.

Yields
  • (config) — Configure the Client client.
Yield Parameter
Example
# Modify the configuration for all WebSecurityScanner clients
::Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client.configure do |config|
  config.timeout = 10.0
end

#configure

def configure() { |config| ... } -> Client::Configuration

Configure the WebSecurityScanner Client instance.

The configuration is set to the derived mode, meaning that values can be changed, but structural changes (adding new fields, etc.) are not allowed. Structural changes should be made on Client.configure.

See Configuration for a description of the configuration fields.

Yields
  • (config) — Configure the Client client.
Yield Parameter

#create_scan_config

def create_scan_config(request, options = nil) -> ::Google::Cloud::WebSecurityScanner::V1::ScanConfig
def create_scan_config(parent: nil, scan_config: nil) -> ::Google::Cloud::WebSecurityScanner::V1::ScanConfig

Creates a new ScanConfig.

Overloads
def create_scan_config(request, options = nil) -> ::Google::Cloud::WebSecurityScanner::V1::ScanConfig
Pass arguments to create_scan_config via a request object, either of type CreateScanConfigRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::WebSecurityScanner::V1::CreateScanConfigRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def create_scan_config(parent: nil, scan_config: nil) -> ::Google::Cloud::WebSecurityScanner::V1::ScanConfig
Pass arguments to create_scan_config via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • parent (::String) — Required. The parent resource name where the scan is created, which should be a project resource name in the format 'projects/{projectId}'.
  • scan_config (::Google::Cloud::WebSecurityScanner::V1::ScanConfig, ::Hash) — Required. The ScanConfig to be created.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/web_security_scanner/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::WebSecurityScanner::V1::CreateScanConfigRequest.new

# Call the create_scan_config method.
result = client.create_scan_config request

# The returned object is of type Google::Cloud::WebSecurityScanner::V1::ScanConfig.
p result

#delete_scan_config

def delete_scan_config(request, options = nil) -> ::Google::Protobuf::Empty
def delete_scan_config(name: nil) -> ::Google::Protobuf::Empty

Deletes an existing ScanConfig and its child resources.

Overloads
def delete_scan_config(request, options = nil) -> ::Google::Protobuf::Empty
Pass arguments to delete_scan_config via a request object, either of type DeleteScanConfigRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::WebSecurityScanner::V1::DeleteScanConfigRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def delete_scan_config(name: nil) -> ::Google::Protobuf::Empty
Pass arguments to delete_scan_config via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameter
  • name (::String) — Required. The resource name of the ScanConfig to be deleted. The name follows the format of 'projects/{projectId}/scanConfigs/{scanConfigId}'.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/web_security_scanner/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::WebSecurityScanner::V1::DeleteScanConfigRequest.new

# Call the delete_scan_config method.
result = client.delete_scan_config request

# The returned object is of type Google::Protobuf::Empty.
p result

#get_finding

def get_finding(request, options = nil) -> ::Google::Cloud::WebSecurityScanner::V1::Finding
def get_finding(name: nil) -> ::Google::Cloud::WebSecurityScanner::V1::Finding

Gets a Finding.

Overloads
def get_finding(request, options = nil) -> ::Google::Cloud::WebSecurityScanner::V1::Finding
Pass arguments to get_finding via a request object, either of type GetFindingRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::WebSecurityScanner::V1::GetFindingRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def get_finding(name: nil) -> ::Google::Cloud::WebSecurityScanner::V1::Finding
Pass arguments to get_finding via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameter
  • name (::String) — Required. The resource name of the Finding to be returned. The name follows the format of 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}/findings/{findingId}'.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/web_security_scanner/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::WebSecurityScanner::V1::GetFindingRequest.new

# Call the get_finding method.
result = client.get_finding request

# The returned object is of type Google::Cloud::WebSecurityScanner::V1::Finding.
p result

#get_scan_config

def get_scan_config(request, options = nil) -> ::Google::Cloud::WebSecurityScanner::V1::ScanConfig
def get_scan_config(name: nil) -> ::Google::Cloud::WebSecurityScanner::V1::ScanConfig

Gets a ScanConfig.

Overloads
def get_scan_config(request, options = nil) -> ::Google::Cloud::WebSecurityScanner::V1::ScanConfig
Pass arguments to get_scan_config via a request object, either of type GetScanConfigRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::WebSecurityScanner::V1::GetScanConfigRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def get_scan_config(name: nil) -> ::Google::Cloud::WebSecurityScanner::V1::ScanConfig
Pass arguments to get_scan_config via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameter
  • name (::String) — Required. The resource name of the ScanConfig to be returned. The name follows the format of 'projects/{projectId}/scanConfigs/{scanConfigId}'.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/web_security_scanner/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::WebSecurityScanner::V1::GetScanConfigRequest.new

# Call the get_scan_config method.
result = client.get_scan_config request

# The returned object is of type Google::Cloud::WebSecurityScanner::V1::ScanConfig.
p result

#get_scan_run

def get_scan_run(request, options = nil) -> ::Google::Cloud::WebSecurityScanner::V1::ScanRun
def get_scan_run(name: nil) -> ::Google::Cloud::WebSecurityScanner::V1::ScanRun

Gets a ScanRun.

Overloads
def get_scan_run(request, options = nil) -> ::Google::Cloud::WebSecurityScanner::V1::ScanRun
Pass arguments to get_scan_run via a request object, either of type GetScanRunRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::WebSecurityScanner::V1::GetScanRunRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def get_scan_run(name: nil) -> ::Google::Cloud::WebSecurityScanner::V1::ScanRun
Pass arguments to get_scan_run via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameter
  • name (::String) — Required. The resource name of the ScanRun to be returned. The name follows the format of 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/web_security_scanner/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::WebSecurityScanner::V1::GetScanRunRequest.new

# Call the get_scan_run method.
result = client.get_scan_run request

# The returned object is of type Google::Cloud::WebSecurityScanner::V1::ScanRun.
p result

#initialize

def initialize() { |config| ... } -> Client

Create a new WebSecurityScanner client object.

Yields
  • (config) — Configure the WebSecurityScanner client.
Yield Parameter
Returns
  • (Client) — a new instance of Client
Example
# Create a client using the default configuration
client = ::Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client.new

# Create a client using a custom configuration
client = ::Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client.new do |config|
  config.timeout = 10.0
end

#list_crawled_urls

def list_crawled_urls(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::WebSecurityScanner::V1::CrawledUrl>
def list_crawled_urls(parent: nil, page_token: nil, page_size: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::WebSecurityScanner::V1::CrawledUrl>

List CrawledUrls under a given ScanRun.

Overloads
def list_crawled_urls(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::WebSecurityScanner::V1::CrawledUrl>
Pass arguments to list_crawled_urls via a request object, either of type ListCrawledUrlsRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::WebSecurityScanner::V1::ListCrawledUrlsRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def list_crawled_urls(parent: nil, page_token: nil, page_size: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::WebSecurityScanner::V1::CrawledUrl>
Pass arguments to list_crawled_urls via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • parent (::String) — Required. The parent resource name, which should be a scan run resource name in the format 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'.
  • page_token (::String) — A token identifying a page of results to be returned. This should be a next_page_token value returned from a previous List request. If unspecified, the first page of results is returned.
  • page_size (::Integer) — The maximum number of CrawledUrls to return, can be limited by server. If not specified or not positive, the implementation will select a reasonable value.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Returns
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/web_security_scanner/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::WebSecurityScanner::V1::ListCrawledUrlsRequest.new

# Call the list_crawled_urls method.
result = client.list_crawled_urls request

# The returned object is of type Gapic::PagedEnumerable. You can iterate
# over elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::WebSecurityScanner::V1::CrawledUrl.
  p item
end

#list_finding_type_stats

def list_finding_type_stats(request, options = nil) -> ::Google::Cloud::WebSecurityScanner::V1::ListFindingTypeStatsResponse
def list_finding_type_stats(parent: nil) -> ::Google::Cloud::WebSecurityScanner::V1::ListFindingTypeStatsResponse

List all FindingTypeStats under a given ScanRun.

Overloads
def list_finding_type_stats(request, options = nil) -> ::Google::Cloud::WebSecurityScanner::V1::ListFindingTypeStatsResponse
Pass arguments to list_finding_type_stats via a request object, either of type ListFindingTypeStatsRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::WebSecurityScanner::V1::ListFindingTypeStatsRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def list_finding_type_stats(parent: nil) -> ::Google::Cloud::WebSecurityScanner::V1::ListFindingTypeStatsResponse
Pass arguments to list_finding_type_stats via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameter
  • parent (::String) — Required. The parent resource name, which should be a scan run resource name in the format 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/web_security_scanner/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::WebSecurityScanner::V1::ListFindingTypeStatsRequest.new

# Call the list_finding_type_stats method.
result = client.list_finding_type_stats request

# The returned object is of type Google::Cloud::WebSecurityScanner::V1::ListFindingTypeStatsResponse.
p result

#list_findings

def list_findings(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::WebSecurityScanner::V1::Finding>
def list_findings(parent: nil, filter: nil, page_token: nil, page_size: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::WebSecurityScanner::V1::Finding>

List Findings under a given ScanRun.

Overloads
def list_findings(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::WebSecurityScanner::V1::Finding>
Pass arguments to list_findings via a request object, either of type ListFindingsRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::WebSecurityScanner::V1::ListFindingsRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def list_findings(parent: nil, filter: nil, page_token: nil, page_size: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::WebSecurityScanner::V1::Finding>
Pass arguments to list_findings via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • parent (::String) — Required. The parent resource name, which should be a scan run resource name in the format 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'.
  • filter (::String) — The filter expression. The expression must be in the format:
  • page_token (::String) — A token identifying a page of results to be returned. This should be a next_page_token value returned from a previous List request. If unspecified, the first page of results is returned.
  • page_size (::Integer) — The maximum number of Findings to return, can be limited by server. If not specified or not positive, the implementation will select a reasonable value.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Returns
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/web_security_scanner/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::WebSecurityScanner::V1::ListFindingsRequest.new

# Call the list_findings method.
result = client.list_findings request

# The returned object is of type Gapic::PagedEnumerable. You can iterate
# over elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::WebSecurityScanner::V1::Finding.
  p item
end

#list_scan_configs

def list_scan_configs(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::WebSecurityScanner::V1::ScanConfig>
def list_scan_configs(parent: nil, page_token: nil, page_size: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::WebSecurityScanner::V1::ScanConfig>

Lists ScanConfigs under a given project.

Overloads
def list_scan_configs(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::WebSecurityScanner::V1::ScanConfig>
Pass arguments to list_scan_configs via a request object, either of type ListScanConfigsRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::WebSecurityScanner::V1::ListScanConfigsRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def list_scan_configs(parent: nil, page_token: nil, page_size: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::WebSecurityScanner::V1::ScanConfig>
Pass arguments to list_scan_configs via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • parent (::String) — Required. The parent resource name, which should be a project resource name in the format 'projects/{projectId}'.
  • page_token (::String) — A token identifying a page of results to be returned. This should be a next_page_token value returned from a previous List request. If unspecified, the first page of results is returned.
  • page_size (::Integer) — The maximum number of ScanConfigs to return, can be limited by server. If not specified or not positive, the implementation will select a reasonable value.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Returns
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/web_security_scanner/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::WebSecurityScanner::V1::ListScanConfigsRequest.new

# Call the list_scan_configs method.
result = client.list_scan_configs request

# The returned object is of type Gapic::PagedEnumerable. You can iterate
# over elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::WebSecurityScanner::V1::ScanConfig.
  p item
end

#list_scan_runs

def list_scan_runs(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::WebSecurityScanner::V1::ScanRun>
def list_scan_runs(parent: nil, page_token: nil, page_size: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::WebSecurityScanner::V1::ScanRun>

Lists ScanRuns under a given ScanConfig, in descending order of ScanRun stop time.

Overloads
def list_scan_runs(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::WebSecurityScanner::V1::ScanRun>
Pass arguments to list_scan_runs via a request object, either of type ListScanRunsRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::WebSecurityScanner::V1::ListScanRunsRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def list_scan_runs(parent: nil, page_token: nil, page_size: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::WebSecurityScanner::V1::ScanRun>
Pass arguments to list_scan_runs via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • parent (::String) — Required. The parent resource name, which should be a scan resource name in the format 'projects/{projectId}/scanConfigs/{scanConfigId}'.
  • page_token (::String) — A token identifying a page of results to be returned. This should be a next_page_token value returned from a previous List request. If unspecified, the first page of results is returned.
  • page_size (::Integer) — The maximum number of ScanRuns to return, can be limited by server. If not specified or not positive, the implementation will select a reasonable value.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Returns
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/web_security_scanner/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::WebSecurityScanner::V1::ListScanRunsRequest.new

# Call the list_scan_runs method.
result = client.list_scan_runs request

# The returned object is of type Gapic::PagedEnumerable. You can iterate
# over elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::WebSecurityScanner::V1::ScanRun.
  p item
end

#start_scan_run

def start_scan_run(request, options = nil) -> ::Google::Cloud::WebSecurityScanner::V1::ScanRun
def start_scan_run(name: nil) -> ::Google::Cloud::WebSecurityScanner::V1::ScanRun

Start a ScanRun according to the given ScanConfig.

Overloads
def start_scan_run(request, options = nil) -> ::Google::Cloud::WebSecurityScanner::V1::ScanRun
Pass arguments to start_scan_run via a request object, either of type StartScanRunRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::WebSecurityScanner::V1::StartScanRunRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def start_scan_run(name: nil) -> ::Google::Cloud::WebSecurityScanner::V1::ScanRun
Pass arguments to start_scan_run via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameter
  • name (::String) — Required. The resource name of the ScanConfig to be used. The name follows the format of 'projects/{projectId}/scanConfigs/{scanConfigId}'.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/web_security_scanner/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::WebSecurityScanner::V1::StartScanRunRequest.new

# Call the start_scan_run method.
result = client.start_scan_run request

# The returned object is of type Google::Cloud::WebSecurityScanner::V1::ScanRun.
p result

#stop_scan_run

def stop_scan_run(request, options = nil) -> ::Google::Cloud::WebSecurityScanner::V1::ScanRun
def stop_scan_run(name: nil) -> ::Google::Cloud::WebSecurityScanner::V1::ScanRun

Stops a ScanRun. The stopped ScanRun is returned.

Overloads
def stop_scan_run(request, options = nil) -> ::Google::Cloud::WebSecurityScanner::V1::ScanRun
Pass arguments to stop_scan_run via a request object, either of type StopScanRunRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::WebSecurityScanner::V1::StopScanRunRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def stop_scan_run(name: nil) -> ::Google::Cloud::WebSecurityScanner::V1::ScanRun
Pass arguments to stop_scan_run via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameter
  • name (::String) — Required. The resource name of the ScanRun to be stopped. The name follows the format of 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/web_security_scanner/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::WebSecurityScanner::V1::StopScanRunRequest.new

# Call the stop_scan_run method.
result = client.stop_scan_run request

# The returned object is of type Google::Cloud::WebSecurityScanner::V1::ScanRun.
p result

#universe_domain

def universe_domain() -> String

The effective universe domain

Returns
  • (String)

#update_scan_config

def update_scan_config(request, options = nil) -> ::Google::Cloud::WebSecurityScanner::V1::ScanConfig
def update_scan_config(scan_config: nil, update_mask: nil) -> ::Google::Cloud::WebSecurityScanner::V1::ScanConfig

Updates a ScanConfig. This method support partial update of a ScanConfig.

Overloads
def update_scan_config(request, options = nil) -> ::Google::Cloud::WebSecurityScanner::V1::ScanConfig
Pass arguments to update_scan_config via a request object, either of type UpdateScanConfigRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::WebSecurityScanner::V1::UpdateScanConfigRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def update_scan_config(scan_config: nil, update_mask: nil) -> ::Google::Cloud::WebSecurityScanner::V1::ScanConfig
Pass arguments to update_scan_config via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • scan_config (::Google::Cloud::WebSecurityScanner::V1::ScanConfig, ::Hash) — Required. The ScanConfig to be updated. The name field must be set to identify the resource to be updated. The values of fields not covered by the mask will be ignored.
  • update_mask (::Google::Protobuf::FieldMask, ::Hash) — Required. The update mask applies to the resource. For the FieldMask definition, see https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/web_security_scanner/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::WebSecurityScanner::V1::UpdateScanConfigRequest.new

# Call the update_scan_config method.
result = client.update_scan_config request

# The returned object is of type Google::Cloud::WebSecurityScanner::V1::ScanConfig.
p result