Class CloudQuotasClient (2.34.0-rc)

The Cloud Quotas API is an infrastructure service for Google Cloud that lets service consumers list and manage their resource usage limits.

  • List/Get the metadata and current status of the quotas for a service.
  • Create/Update quota preferencess that declare the preferred quota values.
  • Check the status of a quota preference request.
  • List/Get pending and historical quota preference.
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

CloudQuotasClient(CloudQuotasClient const &)

Copy and move support

Parameter
Name Description
CloudQuotasClient const &

CloudQuotasClient(CloudQuotasClient &&)

Copy and move support

Parameter
Name Description
CloudQuotasClient &&

CloudQuotasClient(std::shared_ptr< CloudQuotasConnection >, Options)

Parameters
Name Description
connection std::shared_ptr< CloudQuotasConnection >
opts Options

Operators

operator=(CloudQuotasClient const &)

Copy and move support

Parameter
Name Description
CloudQuotasClient const &
Returns
Type Description
CloudQuotasClient &

operator=(CloudQuotasClient &&)

Copy and move support

Parameter
Name Description
CloudQuotasClient &&
Returns
Type Description
CloudQuotasClient &

Functions

ListQuotaInfos(std::string const &, Options)

Lists QuotaInfos of all quotas for a given project, folder or organization.

Parameters
Name Description
parent std::string const &

Required. Parent value of QuotaInfo resources. Listing across different resource containers (such as 'projects/-') is not allowed.
Example names: projects/123/locations/global/services/compute.googleapis.com``folders/234/locations/global/services/compute.googleapis.com``organizations/345/locations/global/services/compute.googleapis.com

opts Options

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

Returns
Type Description
StreamRange< google::api::cloudquotas::v1::QuotaInfo >

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.api.cloudquotas.v1.QuotaInfo, or rather, the C++ class generated by Protobuf from that type. Please consult the Protobuf documentation for details on the Protobuf mapping rules.

ListQuotaInfos(google::api::cloudquotas::v1::ListQuotaInfosRequest, Options)

Lists QuotaInfos of all quotas for a given project, folder or organization.

Parameters
Name Description
request google::api::cloudquotas::v1::ListQuotaInfosRequest

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.api.cloudquotas.v1.ListQuotaInfosRequest. 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
Type Description
StreamRange< google::api::cloudquotas::v1::QuotaInfo >

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.api.cloudquotas.v1.QuotaInfo, or rather, the C++ class generated by Protobuf from that type. Please consult the Protobuf documentation for details on the Protobuf mapping rules.

GetQuotaInfo(std::string const &, Options)

Retrieve the QuotaInfo of a quota for a project, folder or organization.

Parameters
Name Description
name std::string const &

Required. The resource name of the quota info.
An example name: projects/123/locations/global/services/compute.googleapis.com/quotaInfos/CpusPerProjectPerRegion

opts Options

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

Returns
Type Description
StatusOr< google::api::cloudquotas::v1::QuotaInfo >

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

GetQuotaInfo(google::api::cloudquotas::v1::GetQuotaInfoRequest const &, Options)

Retrieve the QuotaInfo of a quota for a project, folder or organization.

Parameters
Name Description
request google::api::cloudquotas::v1::GetQuotaInfoRequest 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.api.cloudquotas.v1.GetQuotaInfoRequest. 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
Type Description
StatusOr< google::api::cloudquotas::v1::QuotaInfo >

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

ListQuotaPreferences(std::string const &, Options)

Lists QuotaPreferences in a given project, folder or organization.

Parameters
Name Description
parent std::string const &

Required. Parent value of QuotaPreference resources. Listing across different resource containers (such as 'projects/-') is not allowed.
When the value starts with 'folders' or 'organizations', it lists the QuotaPreferences for org quotas in the container. It does not list the QuotaPreferences in the descendant projects of the container.
Example parents: projects/123/locations/global

opts Options

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

Returns
Type Description
StreamRange< google::api::cloudquotas::v1::QuotaPreference >

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.api.cloudquotas.v1.QuotaPreference, or rather, the C++ class generated by Protobuf from that type. Please consult the Protobuf documentation for details on the Protobuf mapping rules.

ListQuotaPreferences(google::api::cloudquotas::v1::ListQuotaPreferencesRequest, Options)

Lists QuotaPreferences in a given project, folder or organization.

Parameters
Name Description
request google::api::cloudquotas::v1::ListQuotaPreferencesRequest

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.api.cloudquotas.v1.ListQuotaPreferencesRequest. 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
Type Description
StreamRange< google::api::cloudquotas::v1::QuotaPreference >

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.api.cloudquotas.v1.QuotaPreference, or rather, the C++ class generated by Protobuf from that type. Please consult the Protobuf documentation for details on the Protobuf mapping rules.

GetQuotaPreference(std::string const &, Options)

Gets details of a single QuotaPreference.

Parameters
Name Description
name std::string const &

Required. Name of the resource
Example name: projects/123/locations/global/quota_preferences/my-config-for-us-east1

opts Options

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

Returns
Type Description
StatusOr< google::api::cloudquotas::v1::QuotaPreference >

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

GetQuotaPreference(google::api::cloudquotas::v1::GetQuotaPreferenceRequest const &, Options)

Gets details of a single QuotaPreference.

Parameters
Name Description
request google::api::cloudquotas::v1::GetQuotaPreferenceRequest 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.api.cloudquotas.v1.GetQuotaPreferenceRequest. 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
Type Description
StatusOr< google::api::cloudquotas::v1::QuotaPreference >

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

CreateQuotaPreference(std::string const &, google::api::cloudquotas::v1::QuotaPreference const &, std::string const &, Options)

Creates a new QuotaPreference that declares the desired value for a quota.

Parameters
Name Description
parent std::string const &

Required. Value for parent.
Example: projects/123/locations/global

quota_preference google::api::cloudquotas::v1::QuotaPreference const &

Required. The resource being created

quota_preference_id std::string const &

Optional. Id of the requesting object, must be unique under its parent. If client does not set this field, the service will generate one.

opts Options

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

Returns
Type Description
StatusOr< google::api::cloudquotas::v1::QuotaPreference >

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

CreateQuotaPreference(std::string const &, google::api::cloudquotas::v1::QuotaPreference const &, Options)

Creates a new QuotaPreference that declares the desired value for a quota.

Parameters
Name Description
parent std::string const &

Required. Value for parent.
Example: projects/123/locations/global

quota_preference google::api::cloudquotas::v1::QuotaPreference const &

Required. The resource being created

opts Options

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

Returns
Type Description
StatusOr< google::api::cloudquotas::v1::QuotaPreference >

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

CreateQuotaPreference(google::api::cloudquotas::v1::CreateQuotaPreferenceRequest const &, Options)

Creates a new QuotaPreference that declares the desired value for a quota.

Parameters
Name Description
request google::api::cloudquotas::v1::CreateQuotaPreferenceRequest 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.api.cloudquotas.v1.CreateQuotaPreferenceRequest. 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
Type Description
StatusOr< google::api::cloudquotas::v1::QuotaPreference >

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

UpdateQuotaPreference(google::api::cloudquotas::v1::QuotaPreference const &, google::protobuf::FieldMask const &, Options)

Updates the parameters of a single QuotaPreference.

It can updates the config in any states, not just the ones pending approval.

Parameters
Name Description
quota_preference google::api::cloudquotas::v1::QuotaPreference const &

Required. The resource being updated

update_mask google::protobuf::FieldMask const &

Optional. Field mask is used to specify the fields to be overwritten in the QuotaPreference 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. If the user does not provide a mask then all fields will be overwritten.

opts Options

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

Returns
Type Description
StatusOr< google::api::cloudquotas::v1::QuotaPreference >

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

UpdateQuotaPreference(google::api::cloudquotas::v1::UpdateQuotaPreferenceRequest const &, Options)

Updates the parameters of a single QuotaPreference.

It can updates the config in any states, not just the ones pending approval.

Parameters
Name Description
request google::api::cloudquotas::v1::UpdateQuotaPreferenceRequest 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.api.cloudquotas.v1.UpdateQuotaPreferenceRequest. 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
Type Description
StatusOr< google::api::cloudquotas::v1::QuotaPreference >

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