Class AssuredWorkloadsServiceClient (2.23.0-rc)

Service to manage AssuredWorkloads.

Equality

Instances of this class created via copy-construction or copy-assignment always compare equal. Instances created with equal std::shared_ptr<*Connection> objects compare equal. Objects that compare equal share the same underlying resources.

Performance

Creating a new instance of this class is a relatively expensive operation, new objects establish new connections to the service. In contrast, copy-construction, move-construction, and the corresponding assignment operations are relatively efficient as the copies share all underlying resources.

Thread Safety

Concurrent access to different instances of this class, even if they compare equal, is guaranteed to work. Two or more threads operating on the same instance of this class is not guaranteed to work. Since copy-construction and move-construction is a relatively efficient operation, consider using such a copy when using this class from multiple threads.

Constructors

AssuredWorkloadsServiceClient(AssuredWorkloadsServiceClient const &)

Copy and move support

Parameter
NameDescription
AssuredWorkloadsServiceClient const &

AssuredWorkloadsServiceClient(AssuredWorkloadsServiceClient &&)

Copy and move support

Parameter
NameDescription
AssuredWorkloadsServiceClient &&

AssuredWorkloadsServiceClient(std::shared_ptr< AssuredWorkloadsServiceConnection >, Options)

Parameters
NameDescription
connection std::shared_ptr< AssuredWorkloadsServiceConnection >
opts Options

Operators

operator=(AssuredWorkloadsServiceClient const &)

Copy and move support

Parameter
NameDescription
AssuredWorkloadsServiceClient const &
Returns
TypeDescription
AssuredWorkloadsServiceClient &

operator=(AssuredWorkloadsServiceClient &&)

Copy and move support

Parameter
NameDescription
AssuredWorkloadsServiceClient &&
Returns
TypeDescription
AssuredWorkloadsServiceClient &

Functions

CreateWorkload(std::string const &, google::cloud::assuredworkloads::v1::Workload const &, Options)

Creates Assured Workload.

Parameters
NameDescription
parent std::string const &

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 const &

Required. Assured Workload to create

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
TypeDescription
future< StatusOr< google::cloud::assuredworkloads::v1::Workload > >

A future that becomes satisfied when the LRO (Long Running Operation) completes or the polling policy in effect for this call is exhausted. The future is satisfied with an error if the LRO completes with an error or the polling policy is exhausted. In this case the StatusOr returned by the future contains the error. If the LRO completes successfully the value of the future contains the LRO's result. For this RPC the result is a google.cloud.assuredworkloads.v1.Workload proto message. The C++ class representing this message is created by Protobuf, using the Protobuf mapping rules.

CreateWorkload(google::cloud::assuredworkloads::v1::CreateWorkloadRequest const &, Options)

Creates Assured Workload.

Parameters
NameDescription
request google::cloud::assuredworkloads::v1::CreateWorkloadRequest const &

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.cloud.assuredworkloads.v1.CreateWorkloadRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
TypeDescription
future< StatusOr< google::cloud::assuredworkloads::v1::Workload > >

A future that becomes satisfied when the LRO (Long Running Operation) completes or the polling policy in effect for this call is exhausted. The future is satisfied with an error if the LRO completes with an error or the polling policy is exhausted. In this case the StatusOr returned by the future contains the error. If the LRO completes successfully the value of the future contains the LRO's result. For this RPC the result is a google.cloud.assuredworkloads.v1.Workload proto message. The C++ class representing this message is created by Protobuf, using the Protobuf mapping rules.

UpdateWorkload(google::cloud::assuredworkloads::v1::Workload const &, google::protobuf::FieldMask const &, Options)

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.

Parameters
NameDescription
workload google::cloud::assuredworkloads::v1::Workload const &

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 const &

Required. The list of fields to be updated.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
TypeDescription
StatusOr< google::cloud::assuredworkloads::v1::Workload >

the result of the RPC. The response message type (google.cloud.assuredworkloads.v1.Workload) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the StatusOr contains the error details.

UpdateWorkload(google::cloud::assuredworkloads::v1::UpdateWorkloadRequest const &, Options)

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.

Parameters
NameDescription
request google::cloud::assuredworkloads::v1::UpdateWorkloadRequest const &

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.cloud.assuredworkloads.v1.UpdateWorkloadRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
TypeDescription
StatusOr< google::cloud::assuredworkloads::v1::Workload >

the result of the RPC. The response message type (google.cloud.assuredworkloads.v1.Workload) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the StatusOr contains the error details.

RestrictAllowedResources(google::cloud::assuredworkloads::v1::RestrictAllowedResourcesRequest const &, Options)

Restrict the list of resources allowed in the Workload environment.

The current list of allowed products can be found at https://cloud.google.com/assured-workloads/docs/supported-products In addition to assuredworkloads.workload.update permission, the user should also have orgpolicy.policy.set permission on the folder resource to use this functionality.

Parameters
NameDescription
request google::cloud::assuredworkloads::v1::RestrictAllowedResourcesRequest const &

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.cloud.assuredworkloads.v1.RestrictAllowedResourcesRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
TypeDescription
StatusOr< google::cloud::assuredworkloads::v1::RestrictAllowedResourcesResponse >

the result of the RPC. The response message type (google.cloud.assuredworkloads.v1.RestrictAllowedResourcesResponse) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the StatusOr contains the error details.

DeleteWorkload(std::string const &, Options)

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.

Parameters
NameDescription
name std::string const &

Required. The name field is used to identify the workload. Format: organizations/{org_id}/locations/{location_id}/workloads/{workload_id}

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
TypeDescription
Status

a Status object. If the request failed, the status contains the details of the failure.

DeleteWorkload(google::cloud::assuredworkloads::v1::DeleteWorkloadRequest const &, Options)

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.

Parameters
NameDescription
request google::cloud::assuredworkloads::v1::DeleteWorkloadRequest const &

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.cloud.assuredworkloads.v1.DeleteWorkloadRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
TypeDescription
Status

a Status object. If the request failed, the status contains the details of the failure.

GetWorkload(std::string const &, Options)

Gets Assured Workload associated with a CRM Node.

Parameters
NameDescription
name std::string const &

Required. The resource name of the Workload to fetch. This is the workload'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".

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
TypeDescription
StatusOr< google::cloud::assuredworkloads::v1::Workload >

the result of the RPC. The response message type (google.cloud.assuredworkloads.v1.Workload) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the StatusOr contains the error details.

GetWorkload(google::cloud::assuredworkloads::v1::GetWorkloadRequest const &, Options)

Gets Assured Workload associated with a CRM Node.

Parameters
NameDescription
request google::cloud::assuredworkloads::v1::GetWorkloadRequest const &

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.cloud.assuredworkloads.v1.GetWorkloadRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
TypeDescription
StatusOr< google::cloud::assuredworkloads::v1::Workload >

the result of the RPC. The response message type (google.cloud.assuredworkloads.v1.Workload) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the StatusOr contains the error details.

ListWorkloads(std::string const &, Options)

Lists Assured Workloads under a CRM Node.

Parameters
NameDescription
parent std::string const &

Required. Parent Resource to list workloads from. Must be of the form organizations/{org_id}/locations/{location}.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
TypeDescription
StreamRange< google::cloud::assuredworkloads::v1::Workload >

a StreamRange to iterate of the results. See the documentation of this type for details. In brief, this class has begin() and end() member functions returning a iterator class meeting the input iterator requirements. The value type for this iterator is a StatusOr as the iteration may fail even after some values are retrieved successfully, for example, if there is a network disconnect. An empty set of results does not indicate an error, it indicates that there are no resources meeting the request criteria. On a successful iteration the StatusOr<T> contains elements of type google.cloud.assuredworkloads.v1.Workload, or rather, the C++ class generated by Protobuf from that type. Please consult the Protobuf documentation for details on the Protobuf mapping rules.

ListWorkloads(google::cloud::assuredworkloads::v1::ListWorkloadsRequest, Options)

Lists Assured Workloads under a CRM Node.

Parameters
NameDescription
request google::cloud::assuredworkloads::v1::ListWorkloadsRequest

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.cloud.assuredworkloads.v1.ListWorkloadsRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
TypeDescription
StreamRange< google::cloud::assuredworkloads::v1::Workload >

a StreamRange to iterate of the results. See the documentation of this type for details. In brief, this class has begin() and end() member functions returning a iterator class meeting the input iterator requirements. The value type for this iterator is a StatusOr as the iteration may fail even after some values are retrieved successfully, for example, if there is a network disconnect. An empty set of results does not indicate an error, it indicates that there are no resources meeting the request criteria. On a successful iteration the StatusOr<T> contains elements of type google.cloud.assuredworkloads.v1.Workload, or rather, the C++ class generated by Protobuf from that type. Please consult the Protobuf documentation for details on the Protobuf mapping rules.

ListViolations(std::string const &, Options)

Lists the Violations in the AssuredWorkload Environment.

Callers may also choose to read across multiple Workloads as per AIP-159 by using '-' (the hyphen or dash character) as a wildcard character instead of workload-id in the parent. Format organizations/{org_id}/locations/{location}/workloads/-

Parameters
NameDescription
parent std::string const &

Required. The Workload name. Format organizations/{org_id}/locations/{location}/workloads/{workload}.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
TypeDescription
StreamRange< google::cloud::assuredworkloads::v1::Violation >

a StreamRange to iterate of the results. See the documentation of this type for details. In brief, this class has begin() and end() member functions returning a iterator class meeting the input iterator requirements. The value type for this iterator is a StatusOr as the iteration may fail even after some values are retrieved successfully, for example, if there is a network disconnect. An empty set of results does not indicate an error, it indicates that there are no resources meeting the request criteria. On a successful iteration the StatusOr<T> contains elements of type google.cloud.assuredworkloads.v1.Violation, or rather, the C++ class generated by Protobuf from that type. Please consult the Protobuf documentation for details on the Protobuf mapping rules.

ListViolations(google::cloud::assuredworkloads::v1::ListViolationsRequest, Options)

Lists the Violations in the AssuredWorkload Environment.

Callers may also choose to read across multiple Workloads as per AIP-159 by using '-' (the hyphen or dash character) as a wildcard character instead of workload-id in the parent. Format organizations/{org_id}/locations/{location}/workloads/-

Parameters
NameDescription
request google::cloud::assuredworkloads::v1::ListViolationsRequest

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.cloud.assuredworkloads.v1.ListViolationsRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
TypeDescription
StreamRange< google::cloud::assuredworkloads::v1::Violation >

a StreamRange to iterate of the results. See the documentation of this type for details. In brief, this class has begin() and end() member functions returning a iterator class meeting the input iterator requirements. The value type for this iterator is a StatusOr as the iteration may fail even after some values are retrieved successfully, for example, if there is a network disconnect. An empty set of results does not indicate an error, it indicates that there are no resources meeting the request criteria. On a successful iteration the StatusOr<T> contains elements of type google.cloud.assuredworkloads.v1.Violation, or rather, the C++ class generated by Protobuf from that type. Please consult the Protobuf documentation for details on the Protobuf mapping rules.

GetViolation(std::string const &, Options)

Retrieves Assured Workload Violation based on ID.

Parameters
NameDescription
name std::string const &

Required. The resource name of the Violation to fetch (ie. Violation.name). Format: organizations/{organization}/locations/{location}/workloads/{workload}/violations/{violation}

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
TypeDescription
StatusOr< google::cloud::assuredworkloads::v1::Violation >

the result of the RPC. The response message type (google.cloud.assuredworkloads.v1.Violation) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the StatusOr contains the error details.

GetViolation(google::cloud::assuredworkloads::v1::GetViolationRequest const &, Options)

Retrieves Assured Workload Violation based on ID.

Parameters
NameDescription
request google::cloud::assuredworkloads::v1::GetViolationRequest const &

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.cloud.assuredworkloads.v1.GetViolationRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
TypeDescription
StatusOr< google::cloud::assuredworkloads::v1::Violation >

the result of the RPC. The response message type (google.cloud.assuredworkloads.v1.Violation) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the StatusOr contains the error details.

AcknowledgeViolation(google::cloud::assuredworkloads::v1::AcknowledgeViolationRequest const &, Options)

Acknowledges an existing violation.

By acknowledging a violation, users acknowledge the existence of a compliance violation in their workload and decide to ignore it due to a valid business justification. Acknowledgement is a permanent operation and it cannot be reverted.

Parameters
NameDescription
request google::cloud::assuredworkloads::v1::AcknowledgeViolationRequest const &

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.cloud.assuredworkloads.v1.AcknowledgeViolationRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
TypeDescription
StatusOr< google::cloud::assuredworkloads::v1::AcknowledgeViolationResponse >

the result of the RPC. The response message type (google.cloud.assuredworkloads.v1.AcknowledgeViolationResponse) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the StatusOr contains the error details.