This API allows users to manage their BigQuery reservations.
A reservation provides computational resource guarantees, in the form of slots, to users. A slot is a unit of computational power in BigQuery, and serves as the basic unit of parallelism. In a scan of a multi-partitioned table, a single slot operates on a single partition of the table. A reservation resource exists as a child resource of the admin project and location, e.g.: projects/myproject/locations/US/reservations/reservationName
.
A capacity commitment is a way to purchase compute capacity for BigQuery jobs (in the form of slots) with some committed period of usage. A capacity commitment resource exists as a child resource of the admin project and location, e.g.: projects/myproject/locations/US/capacityCommitments/id
.
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
ReservationServiceClient(ReservationServiceClient const &)
Copy and move support
Parameter | |
---|---|
Name | Description |
|
ReservationServiceClient const &
|
ReservationServiceClient(ReservationServiceClient &&)
Copy and move support
Parameter | |
---|---|
Name | Description |
|
ReservationServiceClient &&
|
ReservationServiceClient(std::shared_ptr< ReservationServiceConnection >, Options)
Parameters | |
---|---|
Name | Description |
connection |
std::shared_ptr< ReservationServiceConnection >
|
opts |
Options
|
Operators
operator=(ReservationServiceClient const &)
Copy and move support
Parameter | |
---|---|
Name | Description |
|
ReservationServiceClient const &
|
Returns | |
---|---|
Type | Description |
ReservationServiceClient & |
operator=(ReservationServiceClient &&)
Copy and move support
Parameter | |
---|---|
Name | Description |
|
ReservationServiceClient &&
|
Returns | |
---|---|
Type | Description |
ReservationServiceClient & |
Functions
CreateReservation(std::string const &, google::cloud::bigquery::reservation::v1::Reservation const &, std::string const &, Options)
Creates a new reservation resource.
Parameters | |
---|---|
Name | Description |
parent |
std::string const &
Required. Project, location. E.g., |
reservation |
google::cloud::bigquery::reservation::v1::Reservation const &
Definition of the new reservation to create. |
reservation_id |
std::string const &
The reservation ID. It must only contain lower case alphanumeric characters or dashes. It must start with a letter and must not end with a dash. Its maximum length is 64 characters. |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::cloud::bigquery::reservation::v1::Reservation > |
the result of the RPC. The response message type (google.cloud.bigquery.reservation.v1.Reservation) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
CreateReservation(google::cloud::bigquery::reservation::v1::CreateReservationRequest const &, Options)
Creates a new reservation resource.
Parameters | |
---|---|
Name | Description |
request |
google::cloud::bigquery::reservation::v1::CreateReservationRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::cloud::bigquery::reservation::v1::Reservation > |
the result of the RPC. The response message type (google.cloud.bigquery.reservation.v1.Reservation) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
ListReservations(std::string const &, Options)
Lists all the reservations for the project in the specified location.
Parameters | |
---|---|
Name | Description |
parent |
std::string const &
Required. The parent resource name containing project and location, e.g.: |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StreamRange< google::cloud::bigquery::reservation::v1::Reservation > |
a StreamRange to iterate of the results. See the documentation of this type for details. In brief, this class has |
ListReservations(google::cloud::bigquery::reservation::v1::ListReservationsRequest, Options)
Lists all the reservations for the project in the specified location.
Parameters | |
---|---|
Name | Description |
request |
google::cloud::bigquery::reservation::v1::ListReservationsRequest
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StreamRange< google::cloud::bigquery::reservation::v1::Reservation > |
a StreamRange to iterate of the results. See the documentation of this type for details. In brief, this class has |
GetReservation(std::string const &, Options)
Returns information about the reservation.
Parameters | |
---|---|
Name | Description |
name |
std::string const &
Required. Resource name of the reservation to retrieve. E.g., |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::cloud::bigquery::reservation::v1::Reservation > |
the result of the RPC. The response message type (google.cloud.bigquery.reservation.v1.Reservation) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
GetReservation(google::cloud::bigquery::reservation::v1::GetReservationRequest const &, Options)
Returns information about the reservation.
Parameters | |
---|---|
Name | Description |
request |
google::cloud::bigquery::reservation::v1::GetReservationRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::cloud::bigquery::reservation::v1::Reservation > |
the result of the RPC. The response message type (google.cloud.bigquery.reservation.v1.Reservation) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
DeleteReservation(std::string const &, Options)
Deletes a reservation.
Returns google.rpc.Code.FAILED_PRECONDITION
when reservation has assignments.
Parameters | |
---|---|
Name | Description |
name |
std::string const &
Required. Resource name of the reservation to retrieve. E.g., |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
Status |
a |
DeleteReservation(google::cloud::bigquery::reservation::v1::DeleteReservationRequest const &, Options)
Deletes a reservation.
Returns google.rpc.Code.FAILED_PRECONDITION
when reservation has assignments.
Parameters | |
---|---|
Name | Description |
request |
google::cloud::bigquery::reservation::v1::DeleteReservationRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
Status |
a |
UpdateReservation(google::cloud::bigquery::reservation::v1::Reservation const &, google::protobuf::FieldMask const &, Options)
Updates an existing reservation resource.
Parameters | |
---|---|
Name | Description |
reservation |
google::cloud::bigquery::reservation::v1::Reservation const &
Content of the reservation to update. |
update_mask |
google::protobuf::FieldMask const &
Standard field mask for the set of fields to be updated. |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::cloud::bigquery::reservation::v1::Reservation > |
the result of the RPC. The response message type (google.cloud.bigquery.reservation.v1.Reservation) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
UpdateReservation(google::cloud::bigquery::reservation::v1::UpdateReservationRequest const &, Options)
Updates an existing reservation resource.
Parameters | |
---|---|
Name | Description |
request |
google::cloud::bigquery::reservation::v1::UpdateReservationRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::cloud::bigquery::reservation::v1::Reservation > |
the result of the RPC. The response message type (google.cloud.bigquery.reservation.v1.Reservation) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
CreateCapacityCommitment(std::string const &, google::cloud::bigquery::reservation::v1::CapacityCommitment const &, Options)
Creates a new capacity commitment resource.
Parameters | |
---|---|
Name | Description |
parent |
std::string const &
Required. Resource name of the parent reservation. E.g., |
capacity_commitment |
google::cloud::bigquery::reservation::v1::CapacityCommitment const &
Content of the capacity commitment to create. |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::cloud::bigquery::reservation::v1::CapacityCommitment > |
the result of the RPC. The response message type (google.cloud.bigquery.reservation.v1.CapacityCommitment) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
CreateCapacityCommitment(google::cloud::bigquery::reservation::v1::CreateCapacityCommitmentRequest const &, Options)
Creates a new capacity commitment resource.
Parameters | |
---|---|
Name | Description |
request |
google::cloud::bigquery::reservation::v1::CreateCapacityCommitmentRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::cloud::bigquery::reservation::v1::CapacityCommitment > |
the result of the RPC. The response message type (google.cloud.bigquery.reservation.v1.CapacityCommitment) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
ListCapacityCommitments(std::string const &, Options)
Lists all the capacity commitments for the admin project.
Parameters | |
---|---|
Name | Description |
parent |
std::string const &
Required. Resource name of the parent reservation. E.g., |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StreamRange< google::cloud::bigquery::reservation::v1::CapacityCommitment > |
a StreamRange to iterate of the results. See the documentation of this type for details. In brief, this class has |
ListCapacityCommitments(google::cloud::bigquery::reservation::v1::ListCapacityCommitmentsRequest, Options)
Lists all the capacity commitments for the admin project.
Parameters | |
---|---|
Name | Description |
request |
google::cloud::bigquery::reservation::v1::ListCapacityCommitmentsRequest
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StreamRange< google::cloud::bigquery::reservation::v1::CapacityCommitment > |
a StreamRange to iterate of the results. See the documentation of this type for details. In brief, this class has |
GetCapacityCommitment(std::string const &, Options)
Returns information about the capacity commitment.
Parameters | |
---|---|
Name | Description |
name |
std::string const &
Required. Resource name of the capacity commitment to retrieve. E.g., |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::cloud::bigquery::reservation::v1::CapacityCommitment > |
the result of the RPC. The response message type (google.cloud.bigquery.reservation.v1.CapacityCommitment) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
GetCapacityCommitment(google::cloud::bigquery::reservation::v1::GetCapacityCommitmentRequest const &, Options)
Returns information about the capacity commitment.
Parameters | |
---|---|
Name | Description |
request |
google::cloud::bigquery::reservation::v1::GetCapacityCommitmentRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::cloud::bigquery::reservation::v1::CapacityCommitment > |
the result of the RPC. The response message type (google.cloud.bigquery.reservation.v1.CapacityCommitment) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
DeleteCapacityCommitment(std::string const &, Options)
Deletes a capacity commitment.
Attempting to delete capacity commitment before its commitment_end_time will fail with the error code google.rpc.Code.FAILED_PRECONDITION
.
Parameters | |
---|---|
Name | Description |
name |
std::string const &
Required. Resource name of the capacity commitment to delete. E.g., |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
Status |
a |
DeleteCapacityCommitment(google::cloud::bigquery::reservation::v1::DeleteCapacityCommitmentRequest const &, Options)
Deletes a capacity commitment.
Attempting to delete capacity commitment before its commitment_end_time will fail with the error code google.rpc.Code.FAILED_PRECONDITION
.
Parameters | |
---|---|
Name | Description |
request |
google::cloud::bigquery::reservation::v1::DeleteCapacityCommitmentRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
Status |
a |
UpdateCapacityCommitment(google::cloud::bigquery::reservation::v1::CapacityCommitment const &, google::protobuf::FieldMask const &, Options)
Updates an existing capacity commitment.
Only plan
and renewal_plan
fields can be updated.
Plan can only be changed to a plan of a longer commitment period. Attempting to change to a plan with shorter commitment period will fail with the error code google.rpc.Code.FAILED_PRECONDITION
.
Parameters | |
---|---|
Name | Description |
capacity_commitment |
google::cloud::bigquery::reservation::v1::CapacityCommitment const &
Content of the capacity commitment to update. |
update_mask |
google::protobuf::FieldMask const &
Standard field mask for the set of fields to be updated. |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::cloud::bigquery::reservation::v1::CapacityCommitment > |
the result of the RPC. The response message type (google.cloud.bigquery.reservation.v1.CapacityCommitment) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
UpdateCapacityCommitment(google::cloud::bigquery::reservation::v1::UpdateCapacityCommitmentRequest const &, Options)
Updates an existing capacity commitment.
Only plan
and renewal_plan
fields can be updated.
Plan can only be changed to a plan of a longer commitment period. Attempting to change to a plan with shorter commitment period will fail with the error code google.rpc.Code.FAILED_PRECONDITION
.
Parameters | |
---|---|
Name | Description |
request |
google::cloud::bigquery::reservation::v1::UpdateCapacityCommitmentRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::cloud::bigquery::reservation::v1::CapacityCommitment > |
the result of the RPC. The response message type (google.cloud.bigquery.reservation.v1.CapacityCommitment) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
SplitCapacityCommitment(std::string const &, std::int64_t, Options)
Splits capacity commitment to two commitments of the same plan and commitment_end_time
.
A common use case is to enable downgrading commitments.
For example, in order to downgrade from 10000 slots to 8000, you might split a 10000 capacity commitment into commitments of 2000 and 8000. Then, you delete the first one after the commitment end time passes.
Parameters | |
---|---|
Name | Description |
name |
std::string const &
Required. The resource name e.g.,: |
slot_count |
std::int64_t
Number of slots in the capacity commitment after the split. |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::cloud::bigquery::reservation::v1::SplitCapacityCommitmentResponse > |
the result of the RPC. The response message type (google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentResponse) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
SplitCapacityCommitment(google::cloud::bigquery::reservation::v1::SplitCapacityCommitmentRequest const &, Options)
Splits capacity commitment to two commitments of the same plan and commitment_end_time
.
A common use case is to enable downgrading commitments.
For example, in order to downgrade from 10000 slots to 8000, you might split a 10000 capacity commitment into commitments of 2000 and 8000. Then, you delete the first one after the commitment end time passes.
Parameters | |
---|---|
Name | Description |
request |
google::cloud::bigquery::reservation::v1::SplitCapacityCommitmentRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::cloud::bigquery::reservation::v1::SplitCapacityCommitmentResponse > |
the result of the RPC. The response message type (google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentResponse) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
MergeCapacityCommitments(std::string const &, std::vector< std::string > const &, Options)
Merges capacity commitments of the same plan into a single commitment.
The resulting capacity commitment has the greater commitment_end_time out of the to-be-merged capacity commitments.
Attempting to merge capacity commitments of different plan will fail with the error code google.rpc.Code.FAILED_PRECONDITION
.
Parameters | |
---|---|
Name | Description |
parent |
std::string const &
Parent resource that identifies admin project and location e.g., |
capacity_commitment_ids |
std::vector< std::string > const &
Ids of capacity commitments to merge. These capacity commitments must exist under admin project and location specified in the parent. ID is the last portion of capacity commitment name e.g., 'abc' for projects/myproject/locations/US/capacityCommitments/abc |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::cloud::bigquery::reservation::v1::CapacityCommitment > |
the result of the RPC. The response message type (google.cloud.bigquery.reservation.v1.CapacityCommitment) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
MergeCapacityCommitments(google::cloud::bigquery::reservation::v1::MergeCapacityCommitmentsRequest const &, Options)
Merges capacity commitments of the same plan into a single commitment.
The resulting capacity commitment has the greater commitment_end_time out of the to-be-merged capacity commitments.
Attempting to merge capacity commitments of different plan will fail with the error code google.rpc.Code.FAILED_PRECONDITION
.
Parameters | |
---|---|
Name | Description |
request |
google::cloud::bigquery::reservation::v1::MergeCapacityCommitmentsRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::cloud::bigquery::reservation::v1::CapacityCommitment > |
the result of the RPC. The response message type (google.cloud.bigquery.reservation.v1.CapacityCommitment) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
CreateAssignment(std::string const &, google::cloud::bigquery::reservation::v1::Assignment const &, Options)
Creates an assignment object which allows the given project to submit jobs of a certain type using slots from the specified reservation.
Currently a resource (project, folder, organization) can only have one assignment per each (job_type, location) combination, and that reservation will be used for all jobs of the matching type.
Different assignments can be created on different levels of the projects, folders or organization hierarchy. During query execution, the assignment is looked up at the project, folder and organization levels in that order. The first assignment found is applied to the query.
When creating assignments, it does not matter if other assignments exist at higher levels.
Example:
- The organization
organizationA
contains two projects,project1
andproject2
. - Assignments for all three entities (
organizationA
,project1
, andproject2
) could all be created and mapped to the same or different reservations.
"None" assignments represent an absence of the assignment. Projects assigned to None use on-demand pricing. To create a "None" assignment, use "none" as a reservation_id in the parent. Example parent: projects/myproject/locations/US/reservations/none
.
Returns google.rpc.Code.PERMISSION_DENIED
if user does not have 'bigquery.admin' permissions on the project using the reservation and the project that owns this reservation.
Returns google.rpc.Code.INVALID_ARGUMENT
when location of the assignment does not match location of the reservation.
Parameters | |
---|---|
Name | Description |
parent |
std::string const &
Required. The parent resource name of the assignment E.g. |
assignment |
google::cloud::bigquery::reservation::v1::Assignment const &
Assignment resource to create. |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::cloud::bigquery::reservation::v1::Assignment > |
the result of the RPC. The response message type (google.cloud.bigquery.reservation.v1.Assignment) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
CreateAssignment(google::cloud::bigquery::reservation::v1::CreateAssignmentRequest const &, Options)
Creates an assignment object which allows the given project to submit jobs of a certain type using slots from the specified reservation.
Currently a resource (project, folder, organization) can only have one assignment per each (job_type, location) combination, and that reservation will be used for all jobs of the matching type.
Different assignments can be created on different levels of the projects, folders or organization hierarchy. During query execution, the assignment is looked up at the project, folder and organization levels in that order. The first assignment found is applied to the query.
When creating assignments, it does not matter if other assignments exist at higher levels.
Example:
- The organization
organizationA
contains two projects,project1
andproject2
. - Assignments for all three entities (
organizationA
,project1
, andproject2
) could all be created and mapped to the same or different reservations.
"None" assignments represent an absence of the assignment. Projects assigned to None use on-demand pricing. To create a "None" assignment, use "none" as a reservation_id in the parent. Example parent: projects/myproject/locations/US/reservations/none
.
Returns google.rpc.Code.PERMISSION_DENIED
if user does not have 'bigquery.admin' permissions on the project using the reservation and the project that owns this reservation.
Returns google.rpc.Code.INVALID_ARGUMENT
when location of the assignment does not match location of the reservation.
Parameters | |
---|---|
Name | Description |
request |
google::cloud::bigquery::reservation::v1::CreateAssignmentRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::cloud::bigquery::reservation::v1::Assignment > |
the result of the RPC. The response message type (google.cloud.bigquery.reservation.v1.Assignment) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
ListAssignments(std::string const &, Options)
Lists assignments.
Only explicitly created assignments will be returned.
Example:
- Organization
organizationA
contains two projects,project1
andproject2
. - Reservation
res1
exists and was created previously. - CreateAssignment was used previously to define the following associations between entities and reservations:
<organizationA, res1>
and<project1, res1>
In this example, ListAssignments will just return the above two assignments for reservation res1
, and no expansion/merge will happen.
The wildcard "-" can be used for reservations in the request. In that case all assignments belongs to the specified project and location will be listed.
Note "-" cannot be used for projects nor locations.
Parameters | |
---|---|
Name | Description |
parent |
std::string const &
Required. The parent resource name e.g.: |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StreamRange< google::cloud::bigquery::reservation::v1::Assignment > |
a StreamRange to iterate of the results. See the documentation of this type for details. In brief, this class has |
ListAssignments(google::cloud::bigquery::reservation::v1::ListAssignmentsRequest, Options)
Lists assignments.
Only explicitly created assignments will be returned.
Example:
- Organization
organizationA
contains two projects,project1
andproject2
. - Reservation
res1
exists and was created previously. - CreateAssignment was used previously to define the following associations between entities and reservations:
<organizationA, res1>
and<project1, res1>
In this example, ListAssignments will just return the above two assignments for reservation res1
, and no expansion/merge will happen.
The wildcard "-" can be used for reservations in the request. In that case all assignments belongs to the specified project and location will be listed.
Note "-" cannot be used for projects nor locations.
Parameters | |
---|---|
Name | Description |
request |
google::cloud::bigquery::reservation::v1::ListAssignmentsRequest
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StreamRange< google::cloud::bigquery::reservation::v1::Assignment > |
a StreamRange to iterate of the results. See the documentation of this type for details. In brief, this class has |
DeleteAssignment(std::string const &, Options)
Deletes a assignment.
No expansion will happen.
Example:
- Organization
organizationA
contains two projects,project1
andproject2
. - Reservation
res1
exists and was created previously. - CreateAssignment was used previously to define the following associations between entities and reservations:
<organizationA, res1>
and<project1, res1>
In this example, deletion of the <organizationA, res1>
assignment won't affect the other assignment <project1, res1>
. After said deletion, queries from project1
will still use res1
while queries from project2
will switch to use on-demand mode.
Parameters | |
---|---|
Name | Description |
name |
std::string const &
Required. Name of the resource, e.g. |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
Status |
a |
DeleteAssignment(google::cloud::bigquery::reservation::v1::DeleteAssignmentRequest const &, Options)
Deletes a assignment.
No expansion will happen.
Example:
- Organization
organizationA
contains two projects,project1
andproject2
. - Reservation
res1
exists and was created previously. - CreateAssignment was used previously to define the following associations between entities and reservations:
<organizationA, res1>
and<project1, res1>
In this example, deletion of the <organizationA, res1>
assignment won't affect the other assignment <project1, res1>
. After said deletion, queries from project1
will still use res1
while queries from project2
will switch to use on-demand mode.
Parameters | |
---|---|
Name | Description |
request |
google::cloud::bigquery::reservation::v1::DeleteAssignmentRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
Status |
a |
SearchAssignments(std::string const &, std::string const &, Options)
Deprecated: Looks up assignments for a specified resource for a particular region. If the request is about a project:
- Assignments created on the project will be returned if they exist.
- Otherwise assignments created on the closest ancestor will be returned.
- Assignments for different JobTypes will all be returned.
The same logic applies if the request is about a folder.
If the request is about an organization, then assignments created on the organization will be returned (organization doesn't have ancestors).
Comparing to ListAssignments, there are some behavior differences:
- permission on the assignee will be verified in this API.
- Hierarchy lookup (project->folder->organization) happens in this API.
- Parent here is
projects/*/locations/*
, instead ofprojects/*/locations/*reservations/*
.
Note "-" cannot be used for projects nor locations.
Parameters | |
---|---|
Name | Description |
parent |
std::string const &
Required. The resource name of the admin project(containing project and
location), e.g.: |
query |
std::string const &
Please specify resource name as assignee in the query.
|
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StreamRange< google::cloud::bigquery::reservation::v1::Assignment > |
a StreamRange to iterate of the results. See the documentation of this type for details. In brief, this class has |
SearchAssignments(google::cloud::bigquery::reservation::v1::SearchAssignmentsRequest, Options)
Deprecated: Looks up assignments for a specified resource for a particular region. If the request is about a project:
- Assignments created on the project will be returned if they exist.
- Otherwise assignments created on the closest ancestor will be returned.
- Assignments for different JobTypes will all be returned.
The same logic applies if the request is about a folder.
If the request is about an organization, then assignments created on the organization will be returned (organization doesn't have ancestors).
Comparing to ListAssignments, there are some behavior differences:
- permission on the assignee will be verified in this API.
- Hierarchy lookup (project->folder->organization) happens in this API.
- Parent here is
projects/*/locations/*
, instead ofprojects/*/locations/*reservations/*
.
Note "-" cannot be used for projects nor locations.
Parameters | |
---|---|
Name | Description |
request |
google::cloud::bigquery::reservation::v1::SearchAssignmentsRequest
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StreamRange< google::cloud::bigquery::reservation::v1::Assignment > |
a StreamRange to iterate of the results. See the documentation of this type for details. In brief, this class has |
SearchAllAssignments(std::string const &, std::string const &, Options)
Looks up assignments for a specified resource for a particular region.
If the request is about a project:
- Assignments created on the project will be returned if they exist.
- Otherwise assignments created on the closest ancestor will be returned.
- Assignments for different JobTypes will all be returned.
The same logic applies if the request is about a folder.
If the request is about an organization, then assignments created on the organization will be returned (organization doesn't have ancestors).
Comparing to ListAssignments, there are some behavior differences:
- permission on the assignee will be verified in this API.
- Hierarchy lookup (project->folder->organization) happens in this API.
- Parent here is
projects/*/locations/*
, instead ofprojects/*/locations/*reservations/*
.
Parameters | |
---|---|
Name | Description |
parent |
std::string const &
Required. The resource name with location (project name could be the wildcard '-'), e.g.: |
query |
std::string const &
Please specify resource name as assignee in the query.
|
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StreamRange< google::cloud::bigquery::reservation::v1::Assignment > |
a StreamRange to iterate of the results. See the documentation of this type for details. In brief, this class has |
SearchAllAssignments(google::cloud::bigquery::reservation::v1::SearchAllAssignmentsRequest, Options)
Looks up assignments for a specified resource for a particular region.
If the request is about a project:
- Assignments created on the project will be returned if they exist.
- Otherwise assignments created on the closest ancestor will be returned.
- Assignments for different JobTypes will all be returned.
The same logic applies if the request is about a folder.
If the request is about an organization, then assignments created on the organization will be returned (organization doesn't have ancestors).
Comparing to ListAssignments, there are some behavior differences:
- permission on the assignee will be verified in this API.
- Hierarchy lookup (project->folder->organization) happens in this API.
- Parent here is
projects/*/locations/*
, instead ofprojects/*/locations/*reservations/*
.
Parameters | |
---|---|
Name | Description |
request |
google::cloud::bigquery::reservation::v1::SearchAllAssignmentsRequest
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StreamRange< google::cloud::bigquery::reservation::v1::Assignment > |
a StreamRange to iterate of the results. See the documentation of this type for details. In brief, this class has |
MoveAssignment(std::string const &, std::string const &, Options)
Moves an assignment under a new reservation.
This differs from removing an existing assignment and recreating a new one by providing a transactional change that ensures an assignee always has an associated reservation.
Parameters | |
---|---|
Name | Description |
name |
std::string const &
Required. The resource name of the assignment, e.g. |
destination_id |
std::string const &
The new reservation ID, e.g.: |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::cloud::bigquery::reservation::v1::Assignment > |
the result of the RPC. The response message type (google.cloud.bigquery.reservation.v1.Assignment) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
MoveAssignment(google::cloud::bigquery::reservation::v1::MoveAssignmentRequest const &, Options)
Moves an assignment under a new reservation.
This differs from removing an existing assignment and recreating a new one by providing a transactional change that ensures an assignee always has an associated reservation.
Parameters | |
---|---|
Name | Description |
request |
google::cloud::bigquery::reservation::v1::MoveAssignmentRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::cloud::bigquery::reservation::v1::Assignment > |
the result of the RPC. The response message type (google.cloud.bigquery.reservation.v1.Assignment) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
UpdateAssignment(google::cloud::bigquery::reservation::v1::Assignment const &, google::protobuf::FieldMask const &, Options)
Updates an existing assignment.
Only the priority
field can be updated.
Parameters | |
---|---|
Name | Description |
assignment |
google::cloud::bigquery::reservation::v1::Assignment const &
Content of the assignment to update. |
update_mask |
google::protobuf::FieldMask const &
Standard field mask for the set of fields to be updated. |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::cloud::bigquery::reservation::v1::Assignment > |
the result of the RPC. The response message type (google.cloud.bigquery.reservation.v1.Assignment) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
UpdateAssignment(google::cloud::bigquery::reservation::v1::UpdateAssignmentRequest const &, Options)
Updates an existing assignment.
Only the priority
field can be updated.
Parameters | |
---|---|
Name | Description |
request |
google::cloud::bigquery::reservation::v1::UpdateAssignmentRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::cloud::bigquery::reservation::v1::Assignment > |
the result of the RPC. The response message type (google.cloud.bigquery.reservation.v1.Assignment) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
GetBiReservation(std::string const &, Options)
Retrieves a BI reservation.
Parameters | |
---|---|
Name | Description |
name |
std::string const &
Required. Name of the requested reservation, for example: |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::cloud::bigquery::reservation::v1::BiReservation > |
the result of the RPC. The response message type (google.cloud.bigquery.reservation.v1.BiReservation) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
GetBiReservation(google::cloud::bigquery::reservation::v1::GetBiReservationRequest const &, Options)
Retrieves a BI reservation.
Parameters | |
---|---|
Name | Description |
request |
google::cloud::bigquery::reservation::v1::GetBiReservationRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::cloud::bigquery::reservation::v1::BiReservation > |
the result of the RPC. The response message type (google.cloud.bigquery.reservation.v1.BiReservation) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
UpdateBiReservation(google::cloud::bigquery::reservation::v1::BiReservation const &, google::protobuf::FieldMask const &, Options)
Updates a BI reservation.
Only fields specified in the field_mask
are updated.
A singleton BI reservation always exists with default size 0. In order to reserve BI capacity it needs to be updated to an amount greater than 0. In order to release BI capacity reservation size must be set to 0.
Parameters | |
---|---|
Name | Description |
bi_reservation |
google::cloud::bigquery::reservation::v1::BiReservation const &
A reservation to update. |
update_mask |
google::protobuf::FieldMask const &
A list of fields to be updated in this request. |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::cloud::bigquery::reservation::v1::BiReservation > |
the result of the RPC. The response message type (google.cloud.bigquery.reservation.v1.BiReservation) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
UpdateBiReservation(google::cloud::bigquery::reservation::v1::UpdateBiReservationRequest const &, Options)
Updates a BI reservation.
Only fields specified in the field_mask
are updated.
A singleton BI reservation always exists with default size 0. In order to reserve BI capacity it needs to be updated to an amount greater than 0. In order to release BI capacity reservation size must be set to 0.
Parameters | |
---|---|
Name | Description |
request |
google::cloud::bigquery::reservation::v1::UpdateBiReservationRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::cloud::bigquery::reservation::v1::BiReservation > |
the result of the RPC. The response message type (google.cloud.bigquery.reservation.v1.BiReservation) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |