Reference documentation and code samples for the Assured Workloads for Government V1 API class Google::Cloud::AssuredWorkloads::V1::AssuredWorkloadsService::Client.
Client for the AssuredWorkloadsService service.
Service to manage AssuredWorkloads.
Inherits
- Object
Methods
.configure
def self.configure() { |config| ... } -> Client::Configuration
Configure the AssuredWorkloadsService Client class.
See Configuration for a description of the configuration fields.
- (config) — Configure the Client client.
- config (Client::Configuration)
# Modify the configuration for all AssuredWorkloadsService clients ::Google::Cloud::AssuredWorkloads::V1::AssuredWorkloadsService::Client.configure do |config| config.timeout = 10.0 end
#configure
def configure() { |config| ... } -> Client::Configuration
Configure the AssuredWorkloadsService 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.
- (config) — Configure the Client client.
- config (Client::Configuration)
#create_workload
def create_workload(request, options = nil) -> ::Gapic::Operation
def create_workload(parent: nil, workload: nil, external_id: nil) -> ::Gapic::Operation
Creates Assured Workload.
def create_workload(request, options = nil) -> ::Gapic::Operation
create_workload
via a request object, either of type
CreateWorkloadRequest or an equivalent Hash.
- request (::Google::Cloud::AssuredWorkloads::V1::CreateWorkloadRequest, ::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_workload(parent: nil, workload: nil, external_id: nil) -> ::Gapic::Operation
create_workload
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).
-
parent (::String) — Required. The resource name of the new Workload's parent.
Must be of the form
organizations/{org_id}/locations/{location_id}
. - workload (::Google::Cloud::AssuredWorkloads::V1::Workload, ::Hash) — Required. Assured Workload to create
- external_id (::String) — Optional. A identifier associated with the workload and underlying projects which allows for the break down of billing costs for a workload. The value provided for the identifier will add a label to the workload and contained projects with the identifier as the value.
- (response, operation) — Access the result along with the RPC operation
- response (::Gapic::Operation)
- operation (::GRPC::ActiveCall::Operation)
- (::Gapic::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require "google/cloud/assured_workloads/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::AssuredWorkloads::V1::AssuredWorkloadsService::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::AssuredWorkloads::V1::CreateWorkloadRequest.new # Call the create_workload method. result = client.create_workload request # The returned object is of type Gapic::Operation. You can use this # object to check the status of an operation, cancel it, or wait # for results. Here is how to block until completion: result.wait_until_done! timeout: 60 if result.response? p result.response else puts "Error!" end
#delete_workload
def delete_workload(request, options = nil) -> ::Google::Protobuf::Empty
def delete_workload(name: nil, etag: nil) -> ::Google::Protobuf::Empty
Deletes the workload. Make sure that workload's direct children are already in a deleted state, otherwise the request will fail with a FAILED_PRECONDITION error.
def delete_workload(request, options = nil) -> ::Google::Protobuf::Empty
delete_workload
via a request object, either of type
DeleteWorkloadRequest or an equivalent Hash.
- request (::Google::Cloud::AssuredWorkloads::V1::DeleteWorkloadRequest, ::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_workload(name: nil, etag: nil) -> ::Google::Protobuf::Empty
delete_workload
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).
-
name (::String) — Required. The
name
field is used to identify the workload. Format: organizations/{org_id}/locations/{location_id}/workloads/{workload_id} - etag (::String) — Optional. The etag of the workload. If this is provided, it must match the server's etag.
- (response, operation) — Access the result along with the RPC operation
- response (::Google::Protobuf::Empty)
- operation (::GRPC::ActiveCall::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require "google/cloud/assured_workloads/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::AssuredWorkloads::V1::AssuredWorkloadsService::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::AssuredWorkloads::V1::DeleteWorkloadRequest.new # Call the delete_workload method. result = client.delete_workload request # The returned object is of type Google::Protobuf::Empty. p result
#get_workload
def get_workload(request, options = nil) -> ::Google::Cloud::AssuredWorkloads::V1::Workload
def get_workload(name: nil) -> ::Google::Cloud::AssuredWorkloads::V1::Workload
Gets Assured Workload associated with a CRM Node
def get_workload(request, options = nil) -> ::Google::Cloud::AssuredWorkloads::V1::Workload
get_workload
via a request object, either of type
GetWorkloadRequest or an equivalent Hash.
- request (::Google::Cloud::AssuredWorkloads::V1::GetWorkloadRequest, ::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_workload(name: nil) -> ::Google::Cloud::AssuredWorkloads::V1::Workload
get_workload
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).
- name (::String) — Required. The resource name of the Workload to fetch. This is the workloads's relative path in the API, formatted as "organizations/{organization_id}/locations/{location_id}/workloads/{workload_id}". For example, "organizations/123/locations/us-east1/workloads/assured-workload-1".
- (response, operation) — Access the result along with the RPC operation
- response (::Google::Cloud::AssuredWorkloads::V1::Workload)
- operation (::GRPC::ActiveCall::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require "google/cloud/assured_workloads/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::AssuredWorkloads::V1::AssuredWorkloadsService::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::AssuredWorkloads::V1::GetWorkloadRequest.new # Call the get_workload method. result = client.get_workload request # The returned object is of type Google::Cloud::AssuredWorkloads::V1::Workload. p result
#initialize
def initialize() { |config| ... } -> Client
Create a new AssuredWorkloadsService client object.
- (config) — Configure the AssuredWorkloadsService client.
- config (Client::Configuration)
- (Client) — a new instance of Client
# Create a client using the default configuration client = ::Google::Cloud::AssuredWorkloads::V1::AssuredWorkloadsService::Client.new # Create a client using a custom configuration client = ::Google::Cloud::AssuredWorkloads::V1::AssuredWorkloadsService::Client.new do |config| config.timeout = 10.0 end
#list_workloads
def list_workloads(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::AssuredWorkloads::V1::Workload>
def list_workloads(parent: nil, page_size: nil, page_token: nil, filter: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::AssuredWorkloads::V1::Workload>
Lists Assured Workloads under a CRM Node.
def list_workloads(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::AssuredWorkloads::V1::Workload>
list_workloads
via a request object, either of type
ListWorkloadsRequest or an equivalent Hash.
- request (::Google::Cloud::AssuredWorkloads::V1::ListWorkloadsRequest, ::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_workloads(parent: nil, page_size: nil, page_token: nil, filter: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::AssuredWorkloads::V1::Workload>
list_workloads
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).
-
parent (::String) — Required. Parent Resource to list workloads from.
Must be of the form
organizations/{org_id}/locations/{location}
. - page_size (::Integer) — Page size.
- page_token (::String) — Page token returned from previous request. Page token contains context from previous request. Page token needs to be passed in the second and following requests.
- filter (::String) — A custom filter for filtering by properties of a workload. At this time, only filtering by labels is supported.
- (response, operation) — Access the result along with the RPC operation
- response (::Gapic::PagedEnumerable<::Google::Cloud::AssuredWorkloads::V1::Workload>)
- operation (::GRPC::ActiveCall::Operation)
- (::Gapic::PagedEnumerable<::Google::Cloud::AssuredWorkloads::V1::Workload>)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require "google/cloud/assured_workloads/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::AssuredWorkloads::V1::AssuredWorkloadsService::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::AssuredWorkloads::V1::ListWorkloadsRequest.new # Call the list_workloads method. result = client.list_workloads request # The returned object is of type Gapic::PagedEnumerable. You can # iterate over all elements by calling #each, and the enumerable # will lazily make API calls to fetch subsequent pages. Other # methods are also available for managing paging directly. result.each do |response| # Each element is of type ::Google::Cloud::AssuredWorkloads::V1::Workload. p response end
#operations_client
def operations_client() -> ::Google::Cloud::AssuredWorkloads::V1::AssuredWorkloadsService::Operations
Get the associated client for long-running operations.
#update_workload
def update_workload(request, options = nil) -> ::Google::Cloud::AssuredWorkloads::V1::Workload
def update_workload(workload: nil, update_mask: nil) -> ::Google::Cloud::AssuredWorkloads::V1::Workload
Updates an existing workload. Currently allows updating of workload display_name and labels. For force updates don't set etag field in the Workload. Only one update operation per workload can be in progress.
def update_workload(request, options = nil) -> ::Google::Cloud::AssuredWorkloads::V1::Workload
update_workload
via a request object, either of type
UpdateWorkloadRequest or an equivalent Hash.
- request (::Google::Cloud::AssuredWorkloads::V1::UpdateWorkloadRequest, ::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_workload(workload: nil, update_mask: nil) -> ::Google::Cloud::AssuredWorkloads::V1::Workload
update_workload
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).
-
workload (::Google::Cloud::AssuredWorkloads::V1::Workload, ::Hash) — Required. The workload to update.
The workload’s
name
field is used to identify the workload to be updated. Format: organizations/{org_id}/locations/{location_id}/workloads/{workload_id} - update_mask (::Google::Protobuf::FieldMask, ::Hash) — Required. The list of fields to be updated.
- (response, operation) — Access the result along with the RPC operation
- response (::Google::Cloud::AssuredWorkloads::V1::Workload)
- operation (::GRPC::ActiveCall::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require "google/cloud/assured_workloads/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::AssuredWorkloads::V1::AssuredWorkloadsService::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::AssuredWorkloads::V1::UpdateWorkloadRequest.new # Call the update_workload method. result = client.update_workload request # The returned object is of type Google::Cloud::AssuredWorkloads::V1::Workload. p result