BigQuery Reservation V1 API - Class Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::Client (v0.8.1)

Reference documentation and code samples for the BigQuery Reservation V1 API class Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::Client.

REST client for the ReservationService service.

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.

Inherits

  • Object

Methods

.configure

def self.configure() { |config| ... } -> Client::Configuration

Configure the ReservationService Client class.

See Configuration for a description of the configuration fields.

Yields
  • (config) — Configure the Client client.
Yield Parameter
Example
# Modify the configuration for all ReservationService clients
::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::Client.configure do |config|
  config.timeout = 10.0
end

#configure

def configure() { |config| ... } -> Client::Configuration

Configure the ReservationService Client instance.

The configuration is set to the derived mode, meaning that values can be changed, but structural changes (adding new fields, etc.) are not allowed. Structural changes should be made on Client.configure.

See Configuration for a description of the configuration fields.

Yields
  • (config) — Configure the Client client.
Yield Parameter

#create_assignment

def create_assignment(request, options = nil) -> ::Google::Cloud::Bigquery::Reservation::V1::Assignment
def create_assignment(parent: nil, assignment: nil, assignment_id: nil) -> ::Google::Cloud::Bigquery::Reservation::V1::Assignment

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.

Overloads
def create_assignment(request, options = nil) -> ::Google::Cloud::Bigquery::Reservation::V1::Assignment
Pass arguments to create_assignment via a request object, either of type CreateAssignmentRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Bigquery::Reservation::V1::CreateAssignmentRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def create_assignment(parent: nil, assignment: nil, assignment_id: nil) -> ::Google::Cloud::Bigquery::Reservation::V1::Assignment
Pass arguments to create_assignment via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • parent (::String) — Required. The parent resource name of the assignment E.g. projects/myproject/locations/US/reservations/team1-prod
  • assignment (::Google::Cloud::Bigquery::Reservation::V1::Assignment, ::Hash) — Assignment resource to create.
  • assignment_id (::String) — The optional assignment ID. Assignment name will be generated automatically if this field is empty. This field must only contain lower case alphanumeric characters or dashes. Max length is 64 characters.
Yields
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.

#create_capacity_commitment

def create_capacity_commitment(request, options = nil) -> ::Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment
def create_capacity_commitment(parent: nil, capacity_commitment: nil, enforce_single_admin_project_per_org: nil, capacity_commitment_id: nil) -> ::Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment

Creates a new capacity commitment resource.

Overloads
def create_capacity_commitment(request, options = nil) -> ::Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment
Pass arguments to create_capacity_commitment via a request object, either of type CreateCapacityCommitmentRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Bigquery::Reservation::V1::CreateCapacityCommitmentRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def create_capacity_commitment(parent: nil, capacity_commitment: nil, enforce_single_admin_project_per_org: nil, capacity_commitment_id: nil) -> ::Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment
Pass arguments to create_capacity_commitment via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • parent (::String) — Required. Resource name of the parent reservation. E.g., projects/myproject/locations/US
  • capacity_commitment (::Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment, ::Hash) — Content of the capacity commitment to create.
  • enforce_single_admin_project_per_org (::Boolean) — If true, fail the request if another project in the organization has a capacity commitment.
  • capacity_commitment_id (::String) — The optional capacity commitment ID. Capacity commitment name will be generated automatically if this field is empty. This field must only contain lower case alphanumeric characters or dashes. The first and last character cannot be a dash. Max length is 64 characters. NOTE: this ID won't be kept if the capacity commitment is split or merged.
Yields
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.

#create_reservation

def create_reservation(request, options = nil) -> ::Google::Cloud::Bigquery::Reservation::V1::Reservation
def create_reservation(parent: nil, reservation_id: nil, reservation: nil) -> ::Google::Cloud::Bigquery::Reservation::V1::Reservation

Creates a new reservation resource.

Overloads
def create_reservation(request, options = nil) -> ::Google::Cloud::Bigquery::Reservation::V1::Reservation
Pass arguments to create_reservation via a request object, either of type CreateReservationRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Bigquery::Reservation::V1::CreateReservationRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def create_reservation(parent: nil, reservation_id: nil, reservation: nil) -> ::Google::Cloud::Bigquery::Reservation::V1::Reservation
Pass arguments to create_reservation via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • parent (::String) — Required. Project, location. E.g., projects/myproject/locations/US
  • reservation_id (::String) — 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.
  • reservation (::Google::Cloud::Bigquery::Reservation::V1::Reservation, ::Hash) — Definition of the new reservation to create.
Yields
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.

#delete_assignment

def delete_assignment(request, options = nil) -> ::Google::Protobuf::Empty
def delete_assignment(name: nil) -> ::Google::Protobuf::Empty

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.

Overloads
def delete_assignment(request, options = nil) -> ::Google::Protobuf::Empty
Pass arguments to delete_assignment via a request object, either of type DeleteAssignmentRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Bigquery::Reservation::V1::DeleteAssignmentRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def delete_assignment(name: nil) -> ::Google::Protobuf::Empty
Pass arguments to delete_assignment via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameter
  • name (::String) — Required. Name of the resource, e.g. projects/myproject/locations/US/reservations/team1-prod/assignments/123
Yields
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.

#delete_capacity_commitment

def delete_capacity_commitment(request, options = nil) -> ::Google::Protobuf::Empty
def delete_capacity_commitment(name: nil, force: nil) -> ::Google::Protobuf::Empty

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.

Overloads
def delete_capacity_commitment(request, options = nil) -> ::Google::Protobuf::Empty
Pass arguments to delete_capacity_commitment via a request object, either of type DeleteCapacityCommitmentRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Bigquery::Reservation::V1::DeleteCapacityCommitmentRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def delete_capacity_commitment(name: nil, force: nil) -> ::Google::Protobuf::Empty
Pass arguments to delete_capacity_commitment via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • name (::String) — Required. Resource name of the capacity commitment to delete. E.g., projects/myproject/locations/US/capacityCommitments/123
  • force (::Boolean) — Can be used to force delete commitments even if assignments exist. Deleting commitments with assignments may cause queries to fail if they no longer have access to slots.
Yields
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.

#delete_reservation

def delete_reservation(request, options = nil) -> ::Google::Protobuf::Empty
def delete_reservation(name: nil) -> ::Google::Protobuf::Empty

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

Overloads
def delete_reservation(request, options = nil) -> ::Google::Protobuf::Empty
Pass arguments to delete_reservation via a request object, either of type DeleteReservationRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Bigquery::Reservation::V1::DeleteReservationRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def delete_reservation(name: nil) -> ::Google::Protobuf::Empty
Pass arguments to delete_reservation via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameter
  • name (::String) — Required. Resource name of the reservation to retrieve. E.g., projects/myproject/locations/US/reservations/team1-prod
Yields
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.

#get_bi_reservation

def get_bi_reservation(request, options = nil) -> ::Google::Cloud::Bigquery::Reservation::V1::BiReservation
def get_bi_reservation(name: nil) -> ::Google::Cloud::Bigquery::Reservation::V1::BiReservation

Retrieves a BI reservation.

Overloads
def get_bi_reservation(request, options = nil) -> ::Google::Cloud::Bigquery::Reservation::V1::BiReservation
Pass arguments to get_bi_reservation via a request object, either of type GetBiReservationRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Bigquery::Reservation::V1::GetBiReservationRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def get_bi_reservation(name: nil) -> ::Google::Cloud::Bigquery::Reservation::V1::BiReservation
Pass arguments to get_bi_reservation via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameter
  • name (::String) — Required. Name of the requested reservation, for example: projects/{project_id}/locations/{location_id}/biReservation
Yields
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.

#get_capacity_commitment

def get_capacity_commitment(request, options = nil) -> ::Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment
def get_capacity_commitment(name: nil) -> ::Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment

Returns information about the capacity commitment.

Overloads
def get_capacity_commitment(request, options = nil) -> ::Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment
Pass arguments to get_capacity_commitment via a request object, either of type GetCapacityCommitmentRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Bigquery::Reservation::V1::GetCapacityCommitmentRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def get_capacity_commitment(name: nil) -> ::Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment
Pass arguments to get_capacity_commitment via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameter
  • name (::String) — Required. Resource name of the capacity commitment to retrieve. E.g., projects/myproject/locations/US/capacityCommitments/123
Yields
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.

#get_reservation

def get_reservation(request, options = nil) -> ::Google::Cloud::Bigquery::Reservation::V1::Reservation
def get_reservation(name: nil) -> ::Google::Cloud::Bigquery::Reservation::V1::Reservation

Returns information about the reservation.

Overloads
def get_reservation(request, options = nil) -> ::Google::Cloud::Bigquery::Reservation::V1::Reservation
Pass arguments to get_reservation via a request object, either of type GetReservationRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Bigquery::Reservation::V1::GetReservationRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def get_reservation(name: nil) -> ::Google::Cloud::Bigquery::Reservation::V1::Reservation
Pass arguments to get_reservation via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameter
  • name (::String) — Required. Resource name of the reservation to retrieve. E.g., projects/myproject/locations/US/reservations/team1-prod
Yields
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.

#initialize

def initialize() { |config| ... } -> Client

Create a new ReservationService REST client object.

Yields
  • (config) — Configure the ReservationService client.
Yield Parameter
Returns
  • (Client) — a new instance of Client
Example
# Create a client using the default configuration
client = ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::Client.new

# Create a client using a custom configuration
client = ::Google::Cloud::Bigquery::Reservation::V1::ReservationService::Rest::Client.new do |config|
  config.timeout = 10.0
end

#list_assignments

def list_assignments(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Bigquery::Reservation::V1::Assignment>
def list_assignments(parent: nil, page_size: nil, page_token: nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Bigquery::Reservation::V1::Assignment>

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.

Overloads
def list_assignments(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Bigquery::Reservation::V1::Assignment>
Pass arguments to list_assignments via a request object, either of type ListAssignmentsRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Bigquery::Reservation::V1::ListAssignmentsRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def list_assignments(parent: nil, page_size: nil, page_token: nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Bigquery::Reservation::V1::Assignment>
Pass arguments to list_assignments via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • parent (::String) — Required. The parent resource name e.g.:

    projects/myproject/locations/US/reservations/team1-prod

    Or:

    projects/myproject/locations/US/reservations/-

  • page_size (::Integer) — The maximum number of items to return per page.
  • page_token (::String) — The next_page_token value returned from a previous List request, if any.
Yields
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
Returns
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.

#list_capacity_commitments

def list_capacity_commitments(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment>
def list_capacity_commitments(parent: nil, page_size: nil, page_token: nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment>

Lists all the capacity commitments for the admin project.

Overloads
def list_capacity_commitments(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment>
Pass arguments to list_capacity_commitments via a request object, either of type ListCapacityCommitmentsRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Bigquery::Reservation::V1::ListCapacityCommitmentsRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def list_capacity_commitments(parent: nil, page_size: nil, page_token: nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment>
Pass arguments to list_capacity_commitments via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • parent (::String) — Required. Resource name of the parent reservation. E.g., projects/myproject/locations/US
  • page_size (::Integer) — The maximum number of items to return.
  • page_token (::String) — The next_page_token value returned from a previous List request, if any.
Yields
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
Returns
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.

#list_reservations

def list_reservations(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Bigquery::Reservation::V1::Reservation>
def list_reservations(parent: nil, page_size: nil, page_token: nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Bigquery::Reservation::V1::Reservation>

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

Overloads
def list_reservations(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Bigquery::Reservation::V1::Reservation>
Pass arguments to list_reservations via a request object, either of type ListReservationsRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Bigquery::Reservation::V1::ListReservationsRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def list_reservations(parent: nil, page_size: nil, page_token: nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Bigquery::Reservation::V1::Reservation>
Pass arguments to list_reservations via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • parent (::String) — Required. The parent resource name containing project and location, e.g.: projects/myproject/locations/US
  • page_size (::Integer) — The maximum number of items to return per page.
  • page_token (::String) — The next_page_token value returned from a previous List request, if any.
Yields
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
Returns
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.

#merge_capacity_commitments

def merge_capacity_commitments(request, options = nil) -> ::Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment
def merge_capacity_commitments(parent: nil, capacity_commitment_ids: nil) -> ::Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment

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.

Overloads
def merge_capacity_commitments(request, options = nil) -> ::Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment
Pass arguments to merge_capacity_commitments via a request object, either of type MergeCapacityCommitmentsRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Bigquery::Reservation::V1::MergeCapacityCommitmentsRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def merge_capacity_commitments(parent: nil, capacity_commitment_ids: nil) -> ::Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment
Pass arguments to merge_capacity_commitments via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • parent (::String) — Parent resource that identifies admin project and location e.g., projects/myproject/locations/us
  • capacity_commitment_ids (::Array<::String>) — 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
Yields
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.

#move_assignment

def move_assignment(request, options = nil) -> ::Google::Cloud::Bigquery::Reservation::V1::Assignment
def move_assignment(name: nil, destination_id: nil, assignment_id: nil) -> ::Google::Cloud::Bigquery::Reservation::V1::Assignment

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.

Overloads
def move_assignment(request, options = nil) -> ::Google::Cloud::Bigquery::Reservation::V1::Assignment
Pass arguments to move_assignment via a request object, either of type MoveAssignmentRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Bigquery::Reservation::V1::MoveAssignmentRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def move_assignment(name: nil, destination_id: nil, assignment_id: nil) -> ::Google::Cloud::Bigquery::Reservation::V1::Assignment
Pass arguments to move_assignment via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • name (::String) — Required. The resource name of the assignment, e.g. projects/myproject/locations/US/reservations/team1-prod/assignments/123
  • destination_id (::String) — The new reservation ID, e.g.: projects/myotherproject/locations/US/reservations/team2-prod
  • assignment_id (::String) — The optional assignment ID. A new assignment name is generated if this field is empty.

    This field can contain only lowercase alphanumeric characters or dashes. Max length is 64 characters.

Yields
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.

#search_all_assignments

def search_all_assignments(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Bigquery::Reservation::V1::Assignment>
def search_all_assignments(parent: nil, query: nil, page_size: nil, page_token: nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Bigquery::Reservation::V1::Assignment>

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/*.
Overloads
def search_all_assignments(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Bigquery::Reservation::V1::Assignment>
Pass arguments to search_all_assignments via a request object, either of type SearchAllAssignmentsRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Bigquery::Reservation::V1::SearchAllAssignmentsRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def search_all_assignments(parent: nil, query: nil, page_size: nil, page_token: nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Bigquery::Reservation::V1::Assignment>
Pass arguments to search_all_assignments via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • parent (::String) — Required. The resource name with location (project name could be the wildcard '-'), e.g.: projects/-/locations/US.
  • query (::String) —

    Please specify resource name as assignee in the query.

    Examples:

    • assignee=projects/myproject
    • assignee=folders/123
    • assignee=organizations/456
  • page_size (::Integer) — The maximum number of items to return per page.
  • page_token (::String) — The next_page_token value returned from a previous List request, if any.
Yields
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
Returns
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.

#search_assignments

def search_assignments(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Bigquery::Reservation::V1::Assignment>
def search_assignments(parent: nil, query: nil, page_size: nil, page_token: nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Bigquery::Reservation::V1::Assignment>

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.

Overloads
def search_assignments(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Bigquery::Reservation::V1::Assignment>
Pass arguments to search_assignments via a request object, either of type SearchAssignmentsRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Bigquery::Reservation::V1::SearchAssignmentsRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def search_assignments(parent: nil, query: nil, page_size: nil, page_token: nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Bigquery::Reservation::V1::Assignment>
Pass arguments to search_assignments via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • parent (::String) — Required. The resource name of the admin project(containing project and location), e.g.: projects/myproject/locations/US.
  • query (::String) —

    Please specify resource name as assignee in the query.

    Examples:

    • assignee=projects/myproject
    • assignee=folders/123
    • assignee=organizations/456
  • page_size (::Integer) — The maximum number of items to return per page.
  • page_token (::String) — The next_page_token value returned from a previous List request, if any.
Yields
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
Returns
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.

#split_capacity_commitment

def split_capacity_commitment(request, options = nil) -> ::Google::Cloud::Bigquery::Reservation::V1::SplitCapacityCommitmentResponse
def split_capacity_commitment(name: nil, slot_count: nil) -> ::Google::Cloud::Bigquery::Reservation::V1::SplitCapacityCommitmentResponse

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.

Overloads
def split_capacity_commitment(request, options = nil) -> ::Google::Cloud::Bigquery::Reservation::V1::SplitCapacityCommitmentResponse
Pass arguments to split_capacity_commitment via a request object, either of type SplitCapacityCommitmentRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Bigquery::Reservation::V1::SplitCapacityCommitmentRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def split_capacity_commitment(name: nil, slot_count: nil) -> ::Google::Cloud::Bigquery::Reservation::V1::SplitCapacityCommitmentResponse
Pass arguments to split_capacity_commitment via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • name (::String) — Required. The resource name e.g.,: projects/myproject/locations/US/capacityCommitments/123
  • slot_count (::Integer) — Number of slots in the capacity commitment after the split.
Yields
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.

#update_assignment

def update_assignment(request, options = nil) -> ::Google::Cloud::Bigquery::Reservation::V1::Assignment
def update_assignment(assignment: nil, update_mask: nil) -> ::Google::Cloud::Bigquery::Reservation::V1::Assignment

Updates an existing assignment.

Only the priority field can be updated.

Overloads
def update_assignment(request, options = nil) -> ::Google::Cloud::Bigquery::Reservation::V1::Assignment
Pass arguments to update_assignment via a request object, either of type UpdateAssignmentRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Bigquery::Reservation::V1::UpdateAssignmentRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def update_assignment(assignment: nil, update_mask: nil) -> ::Google::Cloud::Bigquery::Reservation::V1::Assignment
Pass arguments to update_assignment via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
Yields
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.

#update_bi_reservation

def update_bi_reservation(request, options = nil) -> ::Google::Cloud::Bigquery::Reservation::V1::BiReservation
def update_bi_reservation(bi_reservation: nil, update_mask: nil) -> ::Google::Cloud::Bigquery::Reservation::V1::BiReservation

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.

Overloads
def update_bi_reservation(request, options = nil) -> ::Google::Cloud::Bigquery::Reservation::V1::BiReservation
Pass arguments to update_bi_reservation via a request object, either of type UpdateBiReservationRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Bigquery::Reservation::V1::UpdateBiReservationRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def update_bi_reservation(bi_reservation: nil, update_mask: nil) -> ::Google::Cloud::Bigquery::Reservation::V1::BiReservation
Pass arguments to update_bi_reservation via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
Yields
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.

#update_capacity_commitment

def update_capacity_commitment(request, options = nil) -> ::Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment
def update_capacity_commitment(capacity_commitment: nil, update_mask: nil) -> ::Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment

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.

Overloads
def update_capacity_commitment(request, options = nil) -> ::Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment
Pass arguments to update_capacity_commitment via a request object, either of type UpdateCapacityCommitmentRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Bigquery::Reservation::V1::UpdateCapacityCommitmentRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def update_capacity_commitment(capacity_commitment: nil, update_mask: nil) -> ::Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment
Pass arguments to update_capacity_commitment via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
Yields
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.

#update_reservation

def update_reservation(request, options = nil) -> ::Google::Cloud::Bigquery::Reservation::V1::Reservation
def update_reservation(reservation: nil, update_mask: nil) -> ::Google::Cloud::Bigquery::Reservation::V1::Reservation

Updates an existing reservation resource.

Overloads
def update_reservation(request, options = nil) -> ::Google::Cloud::Bigquery::Reservation::V1::Reservation
Pass arguments to update_reservation via a request object, either of type UpdateReservationRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Bigquery::Reservation::V1::UpdateReservationRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def update_reservation(reservation: nil, update_mask: nil) -> ::Google::Cloud::Bigquery::Reservation::V1::Reservation
Pass arguments to update_reservation via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
Yields
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.