Google Cloud BigQuery C++ Client  2.1.0
A C++ Client Library for Google Cloud BigQuery
Public Member Functions | Friends | List of all members
google::cloud::bigquery::ReservationServiceClient Class Reference

This API allows users to manage their flat-rate BigQuery reservations. More...

#include <google/cloud/bigquery/reservation_client.h>

Public Member Functions

 ReservationServiceClient (std::shared_ptr< ReservationServiceConnection > connection, Options opts={})
 
 ~ReservationServiceClient ()
 
 ReservationServiceClient (ReservationServiceClient const &)=default
 
ReservationServiceClientoperator= (ReservationServiceClient const &)=default
 
 ReservationServiceClient (ReservationServiceClient &&)=default
 
ReservationServiceClientoperator= (ReservationServiceClient &&)=default
 
StatusOr< google::cloud::bigquery::reservation::v1::Reservation > CreateReservation (std::string const &parent, google::cloud::bigquery::reservation::v1::Reservation const &reservation, std::string const &reservation_id, Options opts={})
 Creates a new reservation resource. More...
 
StatusOr< google::cloud::bigquery::reservation::v1::Reservation > CreateReservation (google::cloud::bigquery::reservation::v1::CreateReservationRequest const &request, Options opts={})
 Creates a new reservation resource. More...
 
StreamRange< google::cloud::bigquery::reservation::v1::Reservation > ListReservations (std::string const &parent, Options opts={})
 Lists all the reservations for the project in the specified location. More...
 
StreamRange< google::cloud::bigquery::reservation::v1::Reservation > ListReservations (google::cloud::bigquery::reservation::v1::ListReservationsRequest request, Options opts={})
 Lists all the reservations for the project in the specified location. More...
 
StatusOr< google::cloud::bigquery::reservation::v1::Reservation > GetReservation (std::string const &name, Options opts={})
 Returns information about the reservation. More...
 
StatusOr< google::cloud::bigquery::reservation::v1::Reservation > GetReservation (google::cloud::bigquery::reservation::v1::GetReservationRequest const &request, Options opts={})
 Returns information about the reservation. More...
 
Status DeleteReservation (std::string const &name, Options opts={})
 Deletes a reservation. More...
 
Status DeleteReservation (google::cloud::bigquery::reservation::v1::DeleteReservationRequest const &request, Options opts={})
 Deletes a reservation. More...
 
StatusOr< google::cloud::bigquery::reservation::v1::Reservation > UpdateReservation (google::cloud::bigquery::reservation::v1::Reservation const &reservation, google::protobuf::FieldMask const &update_mask, Options opts={})
 Updates an existing reservation resource. More...
 
StatusOr< google::cloud::bigquery::reservation::v1::Reservation > UpdateReservation (google::cloud::bigquery::reservation::v1::UpdateReservationRequest const &request, Options opts={})
 Updates an existing reservation resource. More...
 
StatusOr< google::cloud::bigquery::reservation::v1::CapacityCommitment > CreateCapacityCommitment (std::string const &parent, google::cloud::bigquery::reservation::v1::CapacityCommitment const &capacity_commitment, Options opts={})
 Creates a new capacity commitment resource. More...
 
StatusOr< google::cloud::bigquery::reservation::v1::CapacityCommitment > CreateCapacityCommitment (google::cloud::bigquery::reservation::v1::CreateCapacityCommitmentRequest const &request, Options opts={})
 Creates a new capacity commitment resource. More...
 
StreamRange< google::cloud::bigquery::reservation::v1::CapacityCommitment > ListCapacityCommitments (std::string const &parent, Options opts={})
 Lists all the capacity commitments for the admin project. More...
 
StreamRange< google::cloud::bigquery::reservation::v1::CapacityCommitment > ListCapacityCommitments (google::cloud::bigquery::reservation::v1::ListCapacityCommitmentsRequest request, Options opts={})
 Lists all the capacity commitments for the admin project. More...
 
StatusOr< google::cloud::bigquery::reservation::v1::CapacityCommitment > GetCapacityCommitment (std::string const &name, Options opts={})
 Returns information about the capacity commitment. More...
 
StatusOr< google::cloud::bigquery::reservation::v1::CapacityCommitment > GetCapacityCommitment (google::cloud::bigquery::reservation::v1::GetCapacityCommitmentRequest const &request, Options opts={})
 Returns information about the capacity commitment. More...
 
Status DeleteCapacityCommitment (std::string const &name, Options opts={})
 Deletes a capacity commitment. More...
 
Status DeleteCapacityCommitment (google::cloud::bigquery::reservation::v1::DeleteCapacityCommitmentRequest const &request, Options opts={})
 Deletes a capacity commitment. More...
 
StatusOr< google::cloud::bigquery::reservation::v1::CapacityCommitment > UpdateCapacityCommitment (google::cloud::bigquery::reservation::v1::CapacityCommitment const &capacity_commitment, google::protobuf::FieldMask const &update_mask, Options opts={})
 Updates an existing capacity commitment. More...
 
StatusOr< google::cloud::bigquery::reservation::v1::CapacityCommitment > UpdateCapacityCommitment (google::cloud::bigquery::reservation::v1::UpdateCapacityCommitmentRequest const &request, Options opts={})
 Updates an existing capacity commitment. More...
 
StatusOr< google::cloud::bigquery::reservation::v1::SplitCapacityCommitmentResponse > SplitCapacityCommitment (std::string const &name, std::int64_t slot_count, Options opts={})
 Splits capacity commitment to two commitments of the same plan and commitment_end_time. More...
 
StatusOr< google::cloud::bigquery::reservation::v1::SplitCapacityCommitmentResponse > SplitCapacityCommitment (google::cloud::bigquery::reservation::v1::SplitCapacityCommitmentRequest const &request, Options opts={})
 Splits capacity commitment to two commitments of the same plan and commitment_end_time. More...
 
StatusOr< google::cloud::bigquery::reservation::v1::CapacityCommitment > MergeCapacityCommitments (std::string const &parent, std::vector< std::string > const &capacity_commitment_ids, Options opts={})
 Merges capacity commitments of the same plan into a single commitment. More...
 
StatusOr< google::cloud::bigquery::reservation::v1::CapacityCommitment > MergeCapacityCommitments (google::cloud::bigquery::reservation::v1::MergeCapacityCommitmentsRequest const &request, Options opts={})
 Merges capacity commitments of the same plan into a single commitment. More...
 
StatusOr< google::cloud::bigquery::reservation::v1::Assignment > CreateAssignment (std::string const &parent, google::cloud::bigquery::reservation::v1::Assignment const &assignment, Options opts={})
 Creates an assignment object which allows the given project to submit jobs of a certain type using slots from the specified reservation. More...
 
StatusOr< google::cloud::bigquery::reservation::v1::Assignment > CreateAssignment (google::cloud::bigquery::reservation::v1::CreateAssignmentRequest const &request, Options opts={})
 Creates an assignment object which allows the given project to submit jobs of a certain type using slots from the specified reservation. More...
 
StreamRange< google::cloud::bigquery::reservation::v1::Assignment > ListAssignments (std::string const &parent, Options opts={})
 Lists assignments. More...
 
StreamRange< google::cloud::bigquery::reservation::v1::Assignment > ListAssignments (google::cloud::bigquery::reservation::v1::ListAssignmentsRequest request, Options opts={})
 Lists assignments. More...
 
Status DeleteAssignment (std::string const &name, Options opts={})
 Deletes a assignment. More...
 
Status DeleteAssignment (google::cloud::bigquery::reservation::v1::DeleteAssignmentRequest const &request, Options opts={})
 Deletes a assignment. More...
 
StreamRange< google::cloud::bigquery::reservation::v1::Assignment > SearchAssignments (std::string const &parent, std::string const &query, Options opts={})
 Deprecated: Looks up assignments for a specified resource for a particular region. More...
 
StreamRange< google::cloud::bigquery::reservation::v1::Assignment > SearchAssignments (google::cloud::bigquery::reservation::v1::SearchAssignmentsRequest request, Options opts={})
 Deprecated: Looks up assignments for a specified resource for a particular region. More...
 
StreamRange< google::cloud::bigquery::reservation::v1::Assignment > SearchAllAssignments (std::string const &parent, std::string const &query, Options opts={})
 Looks up assignments for a specified resource for a particular region. More...
 
StreamRange< google::cloud::bigquery::reservation::v1::Assignment > SearchAllAssignments (google::cloud::bigquery::reservation::v1::SearchAllAssignmentsRequest request, Options opts={})
 Looks up assignments for a specified resource for a particular region. More...
 
StatusOr< google::cloud::bigquery::reservation::v1::Assignment > MoveAssignment (std::string const &name, std::string const &destination_id, Options opts={})
 Moves an assignment under a new reservation. More...
 
StatusOr< google::cloud::bigquery::reservation::v1::Assignment > MoveAssignment (google::cloud::bigquery::reservation::v1::MoveAssignmentRequest const &request, Options opts={})
 Moves an assignment under a new reservation. More...
 
StatusOr< google::cloud::bigquery::reservation::v1::Assignment > UpdateAssignment (google::cloud::bigquery::reservation::v1::Assignment const &assignment, google::protobuf::FieldMask const &update_mask, Options opts={})
 Updates an existing assignment. More...
 
StatusOr< google::cloud::bigquery::reservation::v1::Assignment > UpdateAssignment (google::cloud::bigquery::reservation::v1::UpdateAssignmentRequest const &request, Options opts={})
 Updates an existing assignment. More...
 
StatusOr< google::cloud::bigquery::reservation::v1::BiReservation > GetBiReservation (std::string const &name, Options opts={})
 Retrieves a BI reservation. More...
 
StatusOr< google::cloud::bigquery::reservation::v1::BiReservation > GetBiReservation (google::cloud::bigquery::reservation::v1::GetBiReservationRequest const &request, Options opts={})
 Retrieves a BI reservation. More...
 
StatusOr< google::cloud::bigquery::reservation::v1::BiReservation > UpdateBiReservation (google::cloud::bigquery::reservation::v1::BiReservation const &bi_reservation, google::protobuf::FieldMask const &update_mask, Options opts={})
 Updates a BI reservation. More...
 
StatusOr< google::cloud::bigquery::reservation::v1::BiReservation > UpdateBiReservation (google::cloud::bigquery::reservation::v1::UpdateBiReservationRequest const &request, Options opts={})
 Updates a BI reservation. More...
 

Friends

bool operator== (ReservationServiceClient const &a, ReservationServiceClient const &b)
 
bool operator!= (ReservationServiceClient const &a, ReservationServiceClient const &b)
 

Detailed Description

This API allows users to manage their flat-rate 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.

Definition at line 75 of file reservation_client.h.

Constructor & Destructor Documentation

◆ ReservationServiceClient() [1/3]

google::cloud::bigquery::ReservationServiceClient::ReservationServiceClient ( std::shared_ptr< ReservationServiceConnection connection,
Options  opts = {} 
)
explicit

◆ ~ReservationServiceClient()

google::cloud::bigquery::ReservationServiceClient::~ReservationServiceClient ( )

◆ ReservationServiceClient() [2/3]

google::cloud::bigquery::ReservationServiceClient::ReservationServiceClient ( ReservationServiceClient const &  )
default

◆ ReservationServiceClient() [3/3]

google::cloud::bigquery::ReservationServiceClient::ReservationServiceClient ( ReservationServiceClient &&  )
default

Member Function Documentation

◆ CreateAssignment() [1/2]

StatusOr<google::cloud::bigquery::reservation::v1::Assignment> google::cloud::bigquery::ReservationServiceClient::CreateAssignment ( google::cloud::bigquery::reservation::v1::CreateAssignmentRequest const &  request,
Options  opts = {} 
)

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 and project2.
  • Assignments for all three entities (organizationA, project1, and project2) 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
requestgoogle::cloud::bigquery::reservation::v1::CreateAssignmentRequest
optsOptional. Override the class-level options, such as retry and backoff policies.
Returns
google::cloud::bigquery::reservation::v1::Assignment

◆ CreateAssignment() [2/2]

StatusOr<google::cloud::bigquery::reservation::v1::Assignment> google::cloud::bigquery::ReservationServiceClient::CreateAssignment ( std::string const &  parent,
google::cloud::bigquery::reservation::v1::Assignment const &  assignment,
Options  opts = {} 
)

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 and project2.
  • Assignments for all three entities (organizationA, project1, and project2) 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
parentRequired. The parent resource name of the assignment E.g. projects/myproject/locations/US/reservations/team1-prod
assignmentAssignment resource to create.
optsOptional. Override the class-level options, such as retry and backoff policies.
Returns
google::cloud::bigquery::reservation::v1::Assignment

◆ CreateCapacityCommitment() [1/2]

StatusOr<google::cloud::bigquery::reservation::v1::CapacityCommitment> google::cloud::bigquery::ReservationServiceClient::CreateCapacityCommitment ( google::cloud::bigquery::reservation::v1::CreateCapacityCommitmentRequest const &  request,
Options  opts = {} 
)

Creates a new capacity commitment resource.

Parameters
requestgoogle::cloud::bigquery::reservation::v1::CreateCapacityCommitmentRequest
optsOptional. Override the class-level options, such as retry and backoff policies.
Returns
google::cloud::bigquery::reservation::v1::CapacityCommitment

◆ CreateCapacityCommitment() [2/2]

StatusOr<google::cloud::bigquery::reservation::v1::CapacityCommitment> google::cloud::bigquery::ReservationServiceClient::CreateCapacityCommitment ( std::string const &  parent,
google::cloud::bigquery::reservation::v1::CapacityCommitment const &  capacity_commitment,
Options  opts = {} 
)

Creates a new capacity commitment resource.

Parameters
parentRequired. Resource name of the parent reservation. E.g., projects/myproject/locations/US
capacity_commitmentContent of the capacity commitment to create.
optsOptional. Override the class-level options, such as retry and backoff policies.
Returns
google::cloud::bigquery::reservation::v1::CapacityCommitment

◆ CreateReservation() [1/2]

StatusOr<google::cloud::bigquery::reservation::v1::Reservation> google::cloud::bigquery::ReservationServiceClient::CreateReservation ( google::cloud::bigquery::reservation::v1::CreateReservationRequest const &  request,
Options  opts = {} 
)

Creates a new reservation resource.

Parameters
requestgoogle::cloud::bigquery::reservation::v1::CreateReservationRequest
optsOptional. Override the class-level options, such as retry and backoff policies.
Returns
google::cloud::bigquery::reservation::v1::Reservation

◆ CreateReservation() [2/2]

StatusOr<google::cloud::bigquery::reservation::v1::Reservation> google::cloud::bigquery::ReservationServiceClient::CreateReservation ( std::string const &  parent,
google::cloud::bigquery::reservation::v1::Reservation const &  reservation,
std::string const &  reservation_id,
Options  opts = {} 
)

Creates a new reservation resource.

Parameters
parentRequired. Project, location. E.g., projects/myproject/locations/US
reservationDefinition of the new reservation to create.
reservation_idThe 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.
optsOptional. Override the class-level options, such as retry and backoff policies.
Returns
google::cloud::bigquery::reservation::v1::Reservation

◆ DeleteAssignment() [1/2]

Status google::cloud::bigquery::ReservationServiceClient::DeleteAssignment ( google::cloud::bigquery::reservation::v1::DeleteAssignmentRequest const &  request,
Options  opts = {} 
)

Deletes a assignment.

No expansion will happen.

Example:

  • Organization organizationA contains two projects, project1 and project2.
  • 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
requestgoogle::cloud::bigquery::reservation::v1::DeleteAssignmentRequest
optsOptional. Override the class-level options, such as retry and backoff policies.

◆ DeleteAssignment() [2/2]

Status google::cloud::bigquery::ReservationServiceClient::DeleteAssignment ( std::string const &  name,
Options  opts = {} 
)

Deletes a assignment.

No expansion will happen.

Example:

  • Organization organizationA contains two projects, project1 and project2.
  • 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
nameRequired. Name of the resource, e.g. projects/myproject/locations/US/reservations/team1-prod/assignments/123
optsOptional. Override the class-level options, such as retry and backoff policies.

◆ DeleteCapacityCommitment() [1/2]

Status google::cloud::bigquery::ReservationServiceClient::DeleteCapacityCommitment ( google::cloud::bigquery::reservation::v1::DeleteCapacityCommitmentRequest const &  request,
Options  opts = {} 
)

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
requestgoogle::cloud::bigquery::reservation::v1::DeleteCapacityCommitmentRequest
optsOptional. Override the class-level options, such as retry and backoff policies.

◆ DeleteCapacityCommitment() [2/2]

Status google::cloud::bigquery::ReservationServiceClient::DeleteCapacityCommitment ( std::string const &  name,
Options  opts = {} 
)

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
nameRequired. Resource name of the capacity commitment to delete. E.g., projects/myproject/locations/US/capacityCommitments/123
optsOptional. Override the class-level options, such as retry and backoff policies.

◆ DeleteReservation() [1/2]

Status google::cloud::bigquery::ReservationServiceClient::DeleteReservation ( google::cloud::bigquery::reservation::v1::DeleteReservationRequest const &  request,
Options  opts = {} 
)

Deletes a reservation.

Returns google.rpc.Code.FAILED_PRECONDITION when reservation has assignments.

Parameters
requestgoogle::cloud::bigquery::reservation::v1::DeleteReservationRequest
optsOptional. Override the class-level options, such as retry and backoff policies.

◆ DeleteReservation() [2/2]

Status google::cloud::bigquery::ReservationServiceClient::DeleteReservation ( std::string const &  name,
Options  opts = {} 
)

Deletes a reservation.

Returns google.rpc.Code.FAILED_PRECONDITION when reservation has assignments.

Parameters
nameRequired. Resource name of the reservation to retrieve. E.g., projects/myproject/locations/US/reservations/team1-prod
optsOptional. Override the class-level options, such as retry and backoff policies.

◆ GetBiReservation() [1/2]

StatusOr<google::cloud::bigquery::reservation::v1::BiReservation> google::cloud::bigquery::ReservationServiceClient::GetBiReservation ( google::cloud::bigquery::reservation::v1::GetBiReservationRequest const &  request,
Options  opts = {} 
)

Retrieves a BI reservation.

Parameters
requestgoogle::cloud::bigquery::reservation::v1::GetBiReservationRequest
optsOptional. Override the class-level options, such as retry and backoff policies.
Returns
google::cloud::bigquery::reservation::v1::BiReservation

◆ GetBiReservation() [2/2]

StatusOr<google::cloud::bigquery::reservation::v1::BiReservation> google::cloud::bigquery::ReservationServiceClient::GetBiReservation ( std::string const &  name,
Options  opts = {} 
)

Retrieves a BI reservation.

Parameters
nameRequired. Name of the requested reservation, for example: projects/{project_id}/locations/{location_id}/biReservation
optsOptional. Override the class-level options, such as retry and backoff policies.
Returns
google::cloud::bigquery::reservation::v1::BiReservation

◆ GetCapacityCommitment() [1/2]

StatusOr<google::cloud::bigquery::reservation::v1::CapacityCommitment> google::cloud::bigquery::ReservationServiceClient::GetCapacityCommitment ( google::cloud::bigquery::reservation::v1::GetCapacityCommitmentRequest const &  request,
Options  opts = {} 
)

Returns information about the capacity commitment.

Parameters
requestgoogle::cloud::bigquery::reservation::v1::GetCapacityCommitmentRequest
optsOptional. Override the class-level options, such as retry and backoff policies.
Returns
google::cloud::bigquery::reservation::v1::CapacityCommitment

◆ GetCapacityCommitment() [2/2]

StatusOr<google::cloud::bigquery::reservation::v1::CapacityCommitment> google::cloud::bigquery::ReservationServiceClient::GetCapacityCommitment ( std::string const &  name,
Options  opts = {} 
)

Returns information about the capacity commitment.

Parameters
nameRequired. Resource name of the capacity commitment to retrieve. E.g., projects/myproject/locations/US/capacityCommitments/123
optsOptional. Override the class-level options, such as retry and backoff policies.
Returns
google::cloud::bigquery::reservation::v1::CapacityCommitment

◆ GetReservation() [1/2]

StatusOr<google::cloud::bigquery::reservation::v1::Reservation> google::cloud::bigquery::ReservationServiceClient::GetReservation ( google::cloud::bigquery::reservation::v1::GetReservationRequest const &  request,
Options  opts = {} 
)

Returns information about the reservation.

Parameters
requestgoogle::cloud::bigquery::reservation::v1::GetReservationRequest
optsOptional. Override the class-level options, such as retry and backoff policies.
Returns
google::cloud::bigquery::reservation::v1::Reservation

◆ GetReservation() [2/2]

StatusOr<google::cloud::bigquery::reservation::v1::Reservation> google::cloud::bigquery::ReservationServiceClient::GetReservation ( std::string const &  name,
Options  opts = {} 
)

Returns information about the reservation.

Parameters
nameRequired. Resource name of the reservation to retrieve. E.g., projects/myproject/locations/US/reservations/team1-prod
optsOptional. Override the class-level options, such as retry and backoff policies.
Returns
google::cloud::bigquery::reservation::v1::Reservation

◆ ListAssignments() [1/2]

StreamRange<google::cloud::bigquery::reservation::v1::Assignment> google::cloud::bigquery::ReservationServiceClient::ListAssignments ( google::cloud::bigquery::reservation::v1::ListAssignmentsRequest  request,
Options  opts = {} 
)

Lists assignments.

Only explicitly created assignments will be returned.

Example:

  • Organization organizationA contains two projects, project1 and project2.
  • 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
requestgoogle::cloud::bigquery::reservation::v1::ListAssignmentsRequest
optsOptional. Override the class-level options, such as retry and backoff policies.
Returns
google::cloud::bigquery::reservation::v1::Assignment

◆ ListAssignments() [2/2]

StreamRange<google::cloud::bigquery::reservation::v1::Assignment> google::cloud::bigquery::ReservationServiceClient::ListAssignments ( std::string const &  parent,
Options  opts = {} 
)

Lists assignments.

Only explicitly created assignments will be returned.

Example:

  • Organization organizationA contains two projects, project1 and project2.
  • 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
parentRequired. The parent resource name e.g.: projects/myproject/locations/US/reservations/team1-prod Or: projects/myproject/locations/US/reservations/-
optsOptional. Override the class-level options, such as retry and backoff policies.
Returns
google::cloud::bigquery::reservation::v1::Assignment

◆ ListCapacityCommitments() [1/2]

StreamRange<google::cloud::bigquery::reservation::v1::CapacityCommitment> google::cloud::bigquery::ReservationServiceClient::ListCapacityCommitments ( google::cloud::bigquery::reservation::v1::ListCapacityCommitmentsRequest  request,
Options  opts = {} 
)

Lists all the capacity commitments for the admin project.

Parameters
requestgoogle::cloud::bigquery::reservation::v1::ListCapacityCommitmentsRequest
optsOptional. Override the class-level options, such as retry and backoff policies.
Returns
google::cloud::bigquery::reservation::v1::CapacityCommitment

◆ ListCapacityCommitments() [2/2]

StreamRange<google::cloud::bigquery::reservation::v1::CapacityCommitment> google::cloud::bigquery::ReservationServiceClient::ListCapacityCommitments ( std::string const &  parent,
Options  opts = {} 
)

Lists all the capacity commitments for the admin project.

Parameters
parentRequired. Resource name of the parent reservation. E.g., projects/myproject/locations/US
optsOptional. Override the class-level options, such as retry and backoff policies.
Returns
google::cloud::bigquery::reservation::v1::CapacityCommitment

◆ ListReservations() [1/2]

StreamRange<google::cloud::bigquery::reservation::v1::Reservation> google::cloud::bigquery::ReservationServiceClient::ListReservations ( google::cloud::bigquery::reservation::v1::ListReservationsRequest  request,
Options  opts = {} 
)

Lists all the reservations for the project in the specified location.

Parameters
requestgoogle::cloud::bigquery::reservation::v1::ListReservationsRequest
optsOptional. Override the class-level options, such as retry and backoff policies.
Returns
google::cloud::bigquery::reservation::v1::Reservation

◆ ListReservations() [2/2]

StreamRange<google::cloud::bigquery::reservation::v1::Reservation> google::cloud::bigquery::ReservationServiceClient::ListReservations ( std::string const &  parent,
Options  opts = {} 
)

Lists all the reservations for the project in the specified location.

Parameters
parentRequired. The parent resource name containing project and location, e.g.: projects/myproject/locations/US
optsOptional. Override the class-level options, such as retry and backoff policies.
Returns
google::cloud::bigquery::reservation::v1::Reservation

◆ MergeCapacityCommitments() [1/2]

StatusOr<google::cloud::bigquery::reservation::v1::CapacityCommitment> google::cloud::bigquery::ReservationServiceClient::MergeCapacityCommitments ( google::cloud::bigquery::reservation::v1::MergeCapacityCommitmentsRequest const &  request,
Options  opts = {} 
)

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
requestgoogle::cloud::bigquery::reservation::v1::MergeCapacityCommitmentsRequest
optsOptional. Override the class-level options, such as retry and backoff policies.
Returns
google::cloud::bigquery::reservation::v1::CapacityCommitment

◆ MergeCapacityCommitments() [2/2]

StatusOr<google::cloud::bigquery::reservation::v1::CapacityCommitment> google::cloud::bigquery::ReservationServiceClient::MergeCapacityCommitments ( std::string const &  parent,
std::vector< std::string > const &  capacity_commitment_ids,
Options  opts = {} 
)

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
parentParent resource that identifies admin project and location e.g., projects/myproject/locations/us
capacity_commitment_idsIds 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
optsOptional. Override the class-level options, such as retry and backoff policies.
Returns
google::cloud::bigquery::reservation::v1::CapacityCommitment

◆ MoveAssignment() [1/2]

StatusOr<google::cloud::bigquery::reservation::v1::Assignment> google::cloud::bigquery::ReservationServiceClient::MoveAssignment ( google::cloud::bigquery::reservation::v1::MoveAssignmentRequest const &  request,
Options  opts = {} 
)

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
requestgoogle::cloud::bigquery::reservation::v1::MoveAssignmentRequest
optsOptional. Override the class-level options, such as retry and backoff policies.
Returns
google::cloud::bigquery::reservation::v1::Assignment

◆ MoveAssignment() [2/2]

StatusOr<google::cloud::bigquery::reservation::v1::Assignment> google::cloud::bigquery::ReservationServiceClient::MoveAssignment ( std::string const &  name,
std::string const &  destination_id,
Options  opts = {} 
)

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
nameRequired. The resource name of the assignment, e.g. projects/myproject/locations/US/reservations/team1-prod/assignments/123
destination_idThe new reservation ID, e.g.: projects/myotherproject/locations/US/reservations/team2-prod
optsOptional. Override the class-level options, such as retry and backoff policies.
Returns
google::cloud::bigquery::reservation::v1::Assignment

◆ operator=() [1/2]

ReservationServiceClient& google::cloud::bigquery::ReservationServiceClient::operator= ( ReservationServiceClient &&  )
default

◆ operator=() [2/2]

ReservationServiceClient& google::cloud::bigquery::ReservationServiceClient::operator= ( ReservationServiceClient const &  )
default

◆ SearchAllAssignments() [1/2]

StreamRange<google::cloud::bigquery::reservation::v1::Assignment> google::cloud::bigquery::ReservationServiceClient::SearchAllAssignments ( google::cloud::bigquery::reservation::v1::SearchAllAssignmentsRequest  request,
Options  opts = {} 
)

Looks up assignments for a specified resource for a particular region.

If the request is about a project:

  1. Assignments created on the project will be returned if they exist.
  2. Otherwise assignments created on the closest ancestor will be returned.
  3. 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:

  1. permission on the assignee will be verified in this API.
  2. Hierarchy lookup (project->folder->organization) happens in this API.
  3. Parent here is projects/*‍/locations/*, instead of projects/*‍/locations/*reservations/*.
Parameters
requestgoogle::cloud::bigquery::reservation::v1::SearchAllAssignmentsRequest
optsOptional. Override the class-level options, such as retry and backoff policies.
Returns
google::cloud::bigquery::reservation::v1::Assignment

◆ SearchAllAssignments() [2/2]

StreamRange<google::cloud::bigquery::reservation::v1::Assignment> google::cloud::bigquery::ReservationServiceClient::SearchAllAssignments ( std::string const &  parent,
std::string const &  query,
Options  opts = {} 
)

Looks up assignments for a specified resource for a particular region.

If the request is about a project:

  1. Assignments created on the project will be returned if they exist.
  2. Otherwise assignments created on the closest ancestor will be returned.
  3. 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:

  1. permission on the assignee will be verified in this API.
  2. Hierarchy lookup (project->folder->organization) happens in this API.
  3. Parent here is projects/*‍/locations/*, instead of projects/*‍/locations/*reservations/*.
Parameters
parentRequired. The resource name with location (project name could be the wildcard '-'), e.g.: projects/-/locations/US.
queryPlease specify resource name as assignee in the query. Examples:
  • assignee=projects/myproject
  • assignee=folders/123
  • assignee=organizations/456
optsOptional. Override the class-level options, such as retry and backoff policies.
Returns
google::cloud::bigquery::reservation::v1::Assignment

◆ SearchAssignments() [1/2]

StreamRange<google::cloud::bigquery::reservation::v1::Assignment> google::cloud::bigquery::ReservationServiceClient::SearchAssignments ( google::cloud::bigquery::reservation::v1::SearchAssignmentsRequest  request,
Options  opts = {} 
)

Deprecated: Looks up assignments for a specified resource for a particular region.

If the request is about a project:

  1. Assignments created on the project will be returned if they exist.
  2. Otherwise assignments created on the closest ancestor will be returned.
  3. 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:

  1. permission on the assignee will be verified in this API.
  2. Hierarchy lookup (project->folder->organization) happens in this API.
  3. Parent here is projects/*‍/locations/*, instead of projects/*‍/locations/*reservations/*.

Note "-" cannot be used for projects nor locations.

Parameters
requestgoogle::cloud::bigquery::reservation::v1::SearchAssignmentsRequest
optsOptional. Override the class-level options, such as retry and backoff policies.
Returns
google::cloud::bigquery::reservation::v1::Assignment

◆ SearchAssignments() [2/2]

StreamRange<google::cloud::bigquery::reservation::v1::Assignment> google::cloud::bigquery::ReservationServiceClient::SearchAssignments ( std::string const &  parent,
std::string const &  query,
Options  opts = {} 
)

Deprecated: Looks up assignments for a specified resource for a particular region.

If the request is about a project:

  1. Assignments created on the project will be returned if they exist.
  2. Otherwise assignments created on the closest ancestor will be returned.
  3. 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:

  1. permission on the assignee will be verified in this API.
  2. Hierarchy lookup (project->folder->organization) happens in this API.
  3. Parent here is projects/*‍/locations/*, instead of projects/*‍/locations/*reservations/*.

Note "-" cannot be used for projects nor locations.

Parameters
parentRequired. The resource name of the admin project(containing project and location), e.g.: projects/myproject/locations/US.
queryPlease specify resource name as assignee in the query. Examples:
  • assignee=projects/myproject
  • assignee=folders/123
  • assignee=organizations/456
optsOptional. Override the class-level options, such as retry and backoff policies.
Returns
google::cloud::bigquery::reservation::v1::Assignment

◆ SplitCapacityCommitment() [1/2]

StatusOr< google::cloud::bigquery::reservation::v1::SplitCapacityCommitmentResponse> google::cloud::bigquery::ReservationServiceClient::SplitCapacityCommitment ( google::cloud::bigquery::reservation::v1::SplitCapacityCommitmentRequest const &  request,
Options  opts = {} 
)

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
requestgoogle::cloud::bigquery::reservation::v1::SplitCapacityCommitmentRequest
optsOptional. Override the class-level options, such as retry and backoff policies.
Returns
google::cloud::bigquery::reservation::v1::SplitCapacityCommitmentResponse

◆ SplitCapacityCommitment() [2/2]

StatusOr< google::cloud::bigquery::reservation::v1::SplitCapacityCommitmentResponse> google::cloud::bigquery::ReservationServiceClient::SplitCapacityCommitment ( std::string const &  name,
std::int64_t  slot_count,
Options  opts = {} 
)

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
nameRequired. The resource name e.g.,: projects/myproject/locations/US/capacityCommitments/123
slot_countNumber of slots in the capacity commitment after the split.
optsOptional. Override the class-level options, such as retry and backoff policies.
Returns
google::cloud::bigquery::reservation::v1::SplitCapacityCommitmentResponse

◆ UpdateAssignment() [1/2]

StatusOr<google::cloud::bigquery::reservation::v1::Assignment> google::cloud::bigquery::ReservationServiceClient::UpdateAssignment ( google::cloud::bigquery::reservation::v1::Assignment const &  assignment,
google::protobuf::FieldMask const &  update_mask,
Options  opts = {} 
)

Updates an existing assignment.

Only the priority field can be updated.

Parameters
assignmentContent of the assignment to update.
update_maskStandard field mask for the set of fields to be updated.
optsOptional. Override the class-level options, such as retry and backoff policies.
Returns
google::cloud::bigquery::reservation::v1::Assignment

◆ UpdateAssignment() [2/2]

StatusOr<google::cloud::bigquery::reservation::v1::Assignment> google::cloud::bigquery::ReservationServiceClient::UpdateAssignment ( google::cloud::bigquery::reservation::v1::UpdateAssignmentRequest const &  request,
Options  opts = {} 
)

Updates an existing assignment.

Only the priority field can be updated.

Parameters
requestgoogle::cloud::bigquery::reservation::v1::UpdateAssignmentRequest
optsOptional. Override the class-level options, such as retry and backoff policies.
Returns
google::cloud::bigquery::reservation::v1::Assignment

◆ UpdateBiReservation() [1/2]

StatusOr<google::cloud::bigquery::reservation::v1::BiReservation> google::cloud::bigquery::ReservationServiceClient::UpdateBiReservation ( google::cloud::bigquery::reservation::v1::BiReservation const &  bi_reservation,
google::protobuf::FieldMask const &  update_mask,
Options  opts = {} 
)

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
bi_reservationA reservation to update.
update_maskA list of fields to be updated in this request.
optsOptional. Override the class-level options, such as retry and backoff policies.
Returns
google::cloud::bigquery::reservation::v1::BiReservation

◆ UpdateBiReservation() [2/2]

StatusOr<google::cloud::bigquery::reservation::v1::BiReservation> google::cloud::bigquery::ReservationServiceClient::UpdateBiReservation ( google::cloud::bigquery::reservation::v1::UpdateBiReservationRequest const &  request,
Options  opts = {} 
)

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
requestgoogle::cloud::bigquery::reservation::v1::UpdateBiReservationRequest
optsOptional. Override the class-level options, such as retry and backoff policies.
Returns
google::cloud::bigquery::reservation::v1::BiReservation

◆ UpdateCapacityCommitment() [1/2]

StatusOr<google::cloud::bigquery::reservation::v1::CapacityCommitment> google::cloud::bigquery::ReservationServiceClient::UpdateCapacityCommitment ( google::cloud::bigquery::reservation::v1::CapacityCommitment const &  capacity_commitment,
google::protobuf::FieldMask const &  update_mask,
Options  opts = {} 
)

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
capacity_commitmentContent of the capacity commitment to update.
update_maskStandard field mask for the set of fields to be updated.
optsOptional. Override the class-level options, such as retry and backoff policies.
Returns
google::cloud::bigquery::reservation::v1::CapacityCommitment

◆ UpdateCapacityCommitment() [2/2]

StatusOr<google::cloud::bigquery::reservation::v1::CapacityCommitment> google::cloud::bigquery::ReservationServiceClient::UpdateCapacityCommitment ( google::cloud::bigquery::reservation::v1::UpdateCapacityCommitmentRequest const &  request,
Options  opts = {} 
)

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
requestgoogle::cloud::bigquery::reservation::v1::UpdateCapacityCommitmentRequest
optsOptional. Override the class-level options, such as retry and backoff policies.
Returns
google::cloud::bigquery::reservation::v1::CapacityCommitment

◆ UpdateReservation() [1/2]

StatusOr<google::cloud::bigquery::reservation::v1::Reservation> google::cloud::bigquery::ReservationServiceClient::UpdateReservation ( google::cloud::bigquery::reservation::v1::Reservation const &  reservation,
google::protobuf::FieldMask const &  update_mask,
Options  opts = {} 
)

Updates an existing reservation resource.

Parameters
reservationContent of the reservation to update.
update_maskStandard field mask for the set of fields to be updated.
optsOptional. Override the class-level options, such as retry and backoff policies.
Returns
google::cloud::bigquery::reservation::v1::Reservation

◆ UpdateReservation() [2/2]

StatusOr<google::cloud::bigquery::reservation::v1::Reservation> google::cloud::bigquery::ReservationServiceClient::UpdateReservation ( google::cloud::bigquery::reservation::v1::UpdateReservationRequest const &  request,
Options  opts = {} 
)

Updates an existing reservation resource.

Parameters
requestgoogle::cloud::bigquery::reservation::v1::UpdateReservationRequest
optsOptional. Override the class-level options, such as retry and backoff policies.
Returns
google::cloud::bigquery::reservation::v1::Reservation

Friends And Related Function Documentation

◆ operator!=

bool operator!= ( ReservationServiceClient const &  a,
ReservationServiceClient const &  b 
)
friend

Definition at line 97 of file reservation_client.h.

◆ operator==

bool operator== ( ReservationServiceClient const &  a,
ReservationServiceClient const &  b 
)
friend

Definition at line 93 of file reservation_client.h.