Workload Manager V1 API - Class Google::Cloud::WorkloadManager::V1::WorkloadManager::Client (v0.1.0)

Reference documentation and code samples for the Workload Manager V1 API class Google::Cloud::WorkloadManager::V1::WorkloadManager::Client.

Client for the WorkloadManager service.

The Workload Manager provides various tools to deploy, validate and observe your workloads running on Google Cloud.

Inherits

  • Object

Methods

.configure

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

Configure the WorkloadManager 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 WorkloadManager clients
::Google::Cloud::WorkloadManager::V1::WorkloadManager::Client.configure do |config|
  config.timeout = 10.0
end

#configure

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

Configure the WorkloadManager 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_evaluation

def create_evaluation(request, options = nil) -> ::Gapic::Operation
def create_evaluation(parent: nil, evaluation_id: nil, evaluation: nil, request_id: nil) -> ::Gapic::Operation

Creates a new Evaluation in a given project and location.

Overloads
def create_evaluation(request, options = nil) -> ::Gapic::Operation
Pass arguments to create_evaluation via a request object, either of type CreateEvaluationRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::WorkloadManager::V1::CreateEvaluationRequest, ::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_evaluation(parent: nil, evaluation_id: nil, evaluation: nil, request_id: nil) -> ::Gapic::Operation
Pass arguments to create_evaluation 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 resource prefix of the evaluation location using the form: projects/{project_id}/locations/{location_id}.
  • evaluation_id (::String) — Required. Id of the requesting object.
  • evaluation (::Google::Cloud::WorkloadManager::V1::Evaluation, ::Hash) — Required. The resource being created.
  • request_id (::String) — Optional. An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. The server will guarantee that for at least 60 minutes since the first request.

    For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.

    The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).

Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)
Returns
  • (::Gapic::Operation)
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/workload_manager/v1"

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

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

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

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

#delete_evaluation

def delete_evaluation(request, options = nil) -> ::Gapic::Operation
def delete_evaluation(name: nil, request_id: nil, force: nil) -> ::Gapic::Operation

Deletes a single Evaluation.

Overloads
def delete_evaluation(request, options = nil) -> ::Gapic::Operation
Pass arguments to delete_evaluation via a request object, either of type DeleteEvaluationRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::WorkloadManager::V1::DeleteEvaluationRequest, ::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_evaluation(name: nil, request_id: nil, force: nil) -> ::Gapic::Operation
Pass arguments to delete_evaluation 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
  • name (::String) — Required. Name of the resource.
  • request_id (::String) — Optional. An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. The server will guarantee that for at least 60 minutes after the first request.

    For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.

    The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).

  • force (::Boolean) — Optional. Followed the best practice from https://aip.dev/135#cascading-delete.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)
Returns
  • (::Gapic::Operation)
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/workload_manager/v1"

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

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

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

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

#delete_execution

def delete_execution(request, options = nil) -> ::Gapic::Operation
def delete_execution(name: nil, request_id: nil) -> ::Gapic::Operation

Deletes a single Execution.

Overloads
def delete_execution(request, options = nil) -> ::Gapic::Operation
Pass arguments to delete_execution via a request object, either of type DeleteExecutionRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::WorkloadManager::V1::DeleteExecutionRequest, ::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_execution(name: nil, request_id: nil) -> ::Gapic::Operation
Pass arguments to delete_execution 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
  • name (::String) — Required. Name of the resource.
  • request_id (::String) — Optional. An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. The server will guarantee that for at least 60 minutes after the first request.

    For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.

    The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).

Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)
Returns
  • (::Gapic::Operation)
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/workload_manager/v1"

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

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

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

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

#get_evaluation

def get_evaluation(request, options = nil) -> ::Google::Cloud::WorkloadManager::V1::Evaluation
def get_evaluation(name: nil) -> ::Google::Cloud::WorkloadManager::V1::Evaluation

Gets details of a single Evaluation.

Overloads
def get_evaluation(request, options = nil) -> ::Google::Cloud::WorkloadManager::V1::Evaluation
Pass arguments to get_evaluation via a request object, either of type GetEvaluationRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::WorkloadManager::V1::GetEvaluationRequest, ::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_evaluation(name: nil) -> ::Google::Cloud::WorkloadManager::V1::Evaluation
Pass arguments to get_evaluation 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. Name of the resource.
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/workload_manager/v1"

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

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

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

# The returned object is of type Google::Cloud::WorkloadManager::V1::Evaluation.
p result

#get_execution

def get_execution(request, options = nil) -> ::Google::Cloud::WorkloadManager::V1::Execution
def get_execution(name: nil) -> ::Google::Cloud::WorkloadManager::V1::Execution

Gets details of a single Execution.

Overloads
def get_execution(request, options = nil) -> ::Google::Cloud::WorkloadManager::V1::Execution
Pass arguments to get_execution via a request object, either of type GetExecutionRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::WorkloadManager::V1::GetExecutionRequest, ::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_execution(name: nil) -> ::Google::Cloud::WorkloadManager::V1::Execution
Pass arguments to get_execution 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. Name of the resource.
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/workload_manager/v1"

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

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

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

# The returned object is of type Google::Cloud::WorkloadManager::V1::Execution.
p result

#initialize

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

Create a new WorkloadManager client object.

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

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

#list_evaluations

def list_evaluations(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::WorkloadManager::V1::Evaluation>
def list_evaluations(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::WorkloadManager::V1::Evaluation>

Lists Evaluations in a given project and location.

Overloads
def list_evaluations(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::WorkloadManager::V1::Evaluation>
Pass arguments to list_evaluations via a request object, either of type ListEvaluationsRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::WorkloadManager::V1::ListEvaluationsRequest, ::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_evaluations(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::WorkloadManager::V1::Evaluation>
Pass arguments to list_evaluations 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. Parent value for ListEvaluationsRequest.
  • page_size (::Integer) — Requested page size. Server may return fewer items than requested. If unspecified, server will pick an appropriate default.
  • page_token (::String) — A token identifying a page of results the server should return.
  • filter (::String) — Filter to be applied when listing the evaluation results.
  • order_by (::String) — Hint for how to order the results.
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/workload_manager/v1"

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

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

# Call the list_evaluations method.
result = client.list_evaluations 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::WorkloadManager::V1::Evaluation.
  p item
end

#list_execution_results

def list_execution_results(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::WorkloadManager::V1::ExecutionResult>
def list_execution_results(parent: nil, page_size: nil, page_token: nil, filter: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::WorkloadManager::V1::ExecutionResult>

Lists the result of a single evaluation.

Overloads
def list_execution_results(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::WorkloadManager::V1::ExecutionResult>
Pass arguments to list_execution_results via a request object, either of type ListExecutionResultsRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::WorkloadManager::V1::ListExecutionResultsRequest, ::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_execution_results(parent: nil, page_size: nil, page_token: nil, filter: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::WorkloadManager::V1::ExecutionResult>
Pass arguments to list_execution_results 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 execution results. Format: {parent}/evaluations//executions//results.
  • page_size (::Integer) — Requested page size. Server may return fewer items than requested. If unspecified, server will pick an appropriate default.
  • page_token (::String) — A token identifying a page of results the server should return.
  • filter (::String) — Filtering results.
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/workload_manager/v1"

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

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

# Call the list_execution_results method.
result = client.list_execution_results 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::WorkloadManager::V1::ExecutionResult.
  p item
end

#list_executions

def list_executions(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::WorkloadManager::V1::Execution>
def list_executions(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::WorkloadManager::V1::Execution>

Lists Executions in a given project and location.

Overloads
def list_executions(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::WorkloadManager::V1::Execution>
Pass arguments to list_executions via a request object, either of type ListExecutionsRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::WorkloadManager::V1::ListExecutionsRequest, ::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_executions(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::WorkloadManager::V1::Execution>
Pass arguments to list_executions 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 resource prefix of the Execution using the form: projects/{project}/locations/{location}/evaluations/{evaluation}.
  • page_size (::Integer) — Requested page size. Server may return fewer items than requested. If unspecified, server will pick an appropriate default.
  • page_token (::String) — A token identifying a page of results the server should return.
  • filter (::String) — Filtering results.
  • order_by (::String) — Field to sort by. See https://google.aip.dev/132#ordering for more details.
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/workload_manager/v1"

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

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

# Call the list_executions method.
result = client.list_executions 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::WorkloadManager::V1::Execution.
  p item
end

#list_rules

def list_rules(request, options = nil) -> ::Google::Cloud::WorkloadManager::V1::ListRulesResponse
def list_rules(parent: nil, page_size: nil, page_token: nil, filter: nil, custom_rules_bucket: nil, evaluation_type: nil) -> ::Google::Cloud::WorkloadManager::V1::ListRulesResponse

Lists rules in a given project.

Overloads
def list_rules(request, options = nil) -> ::Google::Cloud::WorkloadManager::V1::ListRulesResponse
Pass arguments to list_rules via a request object, either of type ListRulesRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::WorkloadManager::V1::ListRulesRequest, ::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_rules(parent: nil, page_size: nil, page_token: nil, filter: nil, custom_rules_bucket: nil, evaluation_type: nil) -> ::Google::Cloud::WorkloadManager::V1::ListRulesResponse
Pass arguments to list_rules 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 [project] on which to execute the request. The format is: projects/{project_id}/locations/{location} Currently, the pre-defined rules are global available to all projects and all regions.
  • page_size (::Integer) — Requested page size. Server may return fewer items than requested. If unspecified, server will pick an appropriate default.
  • page_token (::String) — A token identifying a page of results the server should return.
  • filter (::String) — Filter based on primary_category, secondary_category.
  • custom_rules_bucket (::String) — The Cloud Storage bucket name for custom rules.
  • evaluation_type (::Google::Cloud::WorkloadManager::V1::Evaluation::EvaluationType) — Optional. The evaluation type of the rules will be applied to. The Cloud Storage bucket name for custom rules.
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/workload_manager/v1"

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

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

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

# The returned object is of type Google::Cloud::WorkloadManager::V1::ListRulesResponse.
p result

#list_scanned_resources

def list_scanned_resources(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::WorkloadManager::V1::ScannedResource>
def list_scanned_resources(parent: nil, rule: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::WorkloadManager::V1::ScannedResource>

List all scanned resources for a single Execution.

Overloads
def list_scanned_resources(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::WorkloadManager::V1::ScannedResource>
Pass arguments to list_scanned_resources via a request object, either of type ListScannedResourcesRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::WorkloadManager::V1::ListScannedResourcesRequest, ::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_scanned_resources(parent: nil, rule: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::WorkloadManager::V1::ScannedResource>
Pass arguments to list_scanned_resources 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. Parent for ListScannedResourcesRequest.
  • rule (::String) — Rule name.
  • page_size (::Integer) — Requested page size. Server may return fewer items than requested. If unspecified, server will pick an appropriate default.
  • page_token (::String) — A token identifying a page of results the server should return.
  • filter (::String) — Filtering results.
  • order_by (::String) — Field to sort by. See https://google.aip.dev/132#ordering for more details.
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/workload_manager/v1"

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

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

# Call the list_scanned_resources method.
result = client.list_scanned_resources 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::WorkloadManager::V1::ScannedResource.
  p item
end

#location_client

def location_client() -> Google::Cloud::Location::Locations::Client

Get the associated client for mix-in of the Locations.

Returns
  • (Google::Cloud::Location::Locations::Client)

#logger

def logger() -> Logger

The logger used for request/response debug logging.

Returns
  • (Logger)

#operations_client

def operations_client() -> ::Google::Cloud::WorkloadManager::V1::WorkloadManager::Operations

Get the associated client for long-running operations.

#run_evaluation

def run_evaluation(request, options = nil) -> ::Gapic::Operation
def run_evaluation(name: nil, execution_id: nil, execution: nil, request_id: nil) -> ::Gapic::Operation

Creates a new Execution in a given project and location.

Overloads
def run_evaluation(request, options = nil) -> ::Gapic::Operation
Pass arguments to run_evaluation via a request object, either of type RunEvaluationRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::WorkloadManager::V1::RunEvaluationRequest, ::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 run_evaluation(name: nil, execution_id: nil, execution: nil, request_id: nil) -> ::Gapic::Operation
Pass arguments to run_evaluation 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
  • name (::String) — Required. The resource name of the Evaluation using the form: projects/{project}/locations/{location}/evaluations/{evaluation}.
  • execution_id (::String) — Required. ID of the execution which will be created.
  • execution (::Google::Cloud::WorkloadManager::V1::Execution, ::Hash) — Required. The resource being created.
  • request_id (::String) — Optional. An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. The server will guarantee that for at least 60 minutes since the first request.

    For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.

    The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).

Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)
Returns
  • (::Gapic::Operation)
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/workload_manager/v1"

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

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

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

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

#universe_domain

def universe_domain() -> String

The effective universe domain

Returns
  • (String)

#update_evaluation

def update_evaluation(request, options = nil) -> ::Gapic::Operation
def update_evaluation(update_mask: nil, evaluation: nil, request_id: nil) -> ::Gapic::Operation

Updates the parameters of a single Evaluation.

Overloads
def update_evaluation(request, options = nil) -> ::Gapic::Operation
Pass arguments to update_evaluation via a request object, either of type UpdateEvaluationRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::WorkloadManager::V1::UpdateEvaluationRequest, ::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_evaluation(update_mask: nil, evaluation: nil, request_id: nil) -> ::Gapic::Operation
Pass arguments to update_evaluation 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
  • update_mask (::Google::Protobuf::FieldMask, ::Hash) — Required. Field mask is used to specify the fields to be overwritten in the Evaluation resource by the update. The fields specified in the update_mask are relative to the resource, not the full request. A field will be overwritten if it is in the mask.
  • evaluation (::Google::Cloud::WorkloadManager::V1::Evaluation, ::Hash) — Required. The resource being updated.
  • request_id (::String) — Optional. An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. The server will guarantee that for at least 60 minutes since the first request.

    For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.

    The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).

Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)
Returns
  • (::Gapic::Operation)
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/workload_manager/v1"

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

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

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

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end