Class ReservationServiceAsyncClient

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

A reservation provides computational resource guarantees, in the form of slots <https://cloud.google.com/bigquery/docs/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.

Inheritance

builtins.object > ReservationServiceAsyncClient

Properties

transport

Returns the transport used by the client instance.

Returns
TypeDescription
ReservationServiceTransportThe transport used by the client instance.

Methods

assignment_path

assignment_path(project: str, location: str, reservation: str, assignment: str)

Returns a fully-qualified assignment string.

Parameters
NameDescription
project str
location str
reservation str
assignment str

bi_reservation_path

bi_reservation_path(project: str, location: str)

Returns a fully-qualified bi_reservation string.

Parameters
NameDescription
project str
location str

capacity_commitment_path

capacity_commitment_path(project: str, location: str, capacity_commitment: str)

Returns a fully-qualified capacity_commitment string.

Parameters
NameDescription
project str
location str
capacity_commitment str

common_billing_account_path

common_billing_account_path(billing_account: str)

Returns a fully-qualified billing_account string.

Parameter
NameDescription
billing_account str

common_folder_path

common_folder_path(folder: str)

Returns a fully-qualified folder string.

Parameter
NameDescription
folder str

common_location_path

common_location_path(project: str, location: str)

Returns a fully-qualified location string.

Parameters
NameDescription
project str
location str

common_organization_path

common_organization_path(organization: str)

Returns a fully-qualified organization string.

Parameter
NameDescription
organization str

common_project_path

common_project_path(project: str)

Returns a fully-qualified project string.

Parameter
NameDescription
project str

create_assignment

create_assignment(request: Optional[Union[google.cloud.bigquery_reservation_v1.types.reservation.CreateAssignmentRequest, dict]] = None, *, parent: Optional[str] = None, assignment: Optional[google.cloud.bigquery_reservation_v1.types.reservation.Assignment] = None, retry: Union[google.api_core.retry.Retry, object] = <_MethodDefault._DEFAULT_VALUE: <object object>>, timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = ())

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
NameDescription
request Union[google.cloud.bigquery_reservation_v1.types.CreateAssignmentRequest, dict]

The request object. The request for ReservationService.CreateAssignment. Note: "bigquery.reservationAssignments.create" permission is required on the related assignee.

parent `str`

Required. The parent resource name of the assignment E.g. projects/myproject/locations/US/reservations/team1-prod This corresponds to the parent field on the request instance; if request is provided, this should not be set.

assignment Assignment

Assignment resource to create. This corresponds to the assignment field on the request instance; if request is provided, this should not be set.

retry google.api_core.retry.Retry

Designation of what errors, if any, should be retried.

timeout float

The timeout for this request.

metadata Sequence[Tuple[str, str]]

Strings which should be sent along with the request as metadata.

Returns
TypeDescription
google.cloud.bigquery_reservation_v1.types.AssignmentA Assignment allows a project to submit jobs of a certain type using slots from the specified reservation.

create_capacity_commitment

create_capacity_commitment(request: Optional[Union[google.cloud.bigquery_reservation_v1.types.reservation.CreateCapacityCommitmentRequest, dict]] = None, *, parent: Optional[str] = None, capacity_commitment: Optional[google.cloud.bigquery_reservation_v1.types.reservation.CapacityCommitment] = None, retry: Union[google.api_core.retry.Retry, object] = <_MethodDefault._DEFAULT_VALUE: <object object>>, timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = ())

Creates a new capacity commitment resource.

Parameters
NameDescription
request Union[google.cloud.bigquery_reservation_v1.types.CreateCapacityCommitmentRequest, dict]

The request object. The request for ReservationService.CreateCapacityCommitment.

parent `str`

Required. Resource name of the parent reservation. E.g., projects/myproject/locations/US This corresponds to the parent field on the request instance; if request is provided, this should not be set.

capacity_commitment CapacityCommitment

Content of the capacity commitment to create. This corresponds to the capacity_commitment field on the request instance; if request is provided, this should not be set.

retry google.api_core.retry.Retry

Designation of what errors, if any, should be retried.

timeout float

The timeout for this request.

metadata Sequence[Tuple[str, str]]

Strings which should be sent along with the request as metadata.

Returns
TypeDescription
google.cloud.bigquery_reservation_v1.types.CapacityCommitmentCapacity commitment is a way to purchase compute capacity for BigQuery jobs (in the form of slots) with some committed period of usage. Annual commitments renew by default. Commitments can be removed after their commitment end time passes. In order to remove annual commitment, its plan needs to be changed to monthly or flex first. A capacity commitment resource exists as a child resource of the admin project.

create_reservation

create_reservation(request: Optional[Union[google.cloud.bigquery_reservation_v1.types.reservation.CreateReservationRequest, dict]] = None, *, parent: Optional[str] = None, reservation: Optional[google.cloud.bigquery_reservation_v1.types.reservation.Reservation] = None, reservation_id: Optional[str] = None, retry: Union[google.api_core.retry.Retry, object] = <_MethodDefault._DEFAULT_VALUE: <object object>>, timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = ())

Creates a new reservation resource.

Parameters
NameDescription
request Union[google.cloud.bigquery_reservation_v1.types.CreateReservationRequest, dict]

The request object. The request for ReservationService.CreateReservation.

parent `str`

Required. Project, location. E.g., projects/myproject/locations/US This corresponds to the parent field on the request instance; if request is provided, this should not be set.

reservation Reservation

Definition of the new reservation to create. This corresponds to the reservation field on the request instance; if request is provided, this should not be set.

reservation_id `str`

The reservation ID. This field must only contain lower case alphanumeric characters or dash. Max length is 64 characters. This corresponds to the reservation_id field on the request instance; if request is provided, this should not be set.

retry google.api_core.retry.Retry

Designation of what errors, if any, should be retried.

timeout float

The timeout for this request.

metadata Sequence[Tuple[str, str]]

Strings which should be sent along with the request as metadata.

Returns
TypeDescription
google.cloud.bigquery_reservation_v1.types.ReservationA reservation is a mechanism used to guarantee slots to users.

delete_assignment

delete_assignment(request: Optional[Union[google.cloud.bigquery_reservation_v1.types.reservation.DeleteAssignmentRequest, dict]] = None, *, name: Optional[str] = None, retry: Union[google.api_core.retry.Retry, object] = <_MethodDefault._DEFAULT_VALUE: <object object>>, timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = ())

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
NameDescription
request Union[google.cloud.bigquery_reservation_v1.types.DeleteAssignmentRequest, dict]

The request object. The request for ReservationService.DeleteAssignment. Note: "bigquery.reservationAssignments.delete" permission is required on the related assignee.

name `str`

Required. Name of the resource, e.g. projects/myproject/locations/US/reservations/team1-prod/assignments/123 This corresponds to the name field on the request instance; if request is provided, this should not be set.

retry google.api_core.retry.Retry

Designation of what errors, if any, should be retried.

timeout float

The timeout for this request.

metadata Sequence[Tuple[str, str]]

Strings which should be sent along with the request as metadata.

delete_capacity_commitment

delete_capacity_commitment(request: Optional[Union[google.cloud.bigquery_reservation_v1.types.reservation.DeleteCapacityCommitmentRequest, dict]] = None, *, name: Optional[str] = None, retry: Union[google.api_core.retry.Retry, object] = <_MethodDefault._DEFAULT_VALUE: <object object>>, timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = ())

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
NameDescription
request Union[google.cloud.bigquery_reservation_v1.types.DeleteCapacityCommitmentRequest, dict]

The request object. The request for ReservationService.DeleteCapacityCommitment.

name `str`

Required. Resource name of the capacity commitment to delete. E.g., projects/myproject/locations/US/capacityCommitments/123 This corresponds to the name field on the request instance; if request is provided, this should not be set.

retry google.api_core.retry.Retry

Designation of what errors, if any, should be retried.

timeout float

The timeout for this request.

metadata Sequence[Tuple[str, str]]

Strings which should be sent along with the request as metadata.

delete_reservation

delete_reservation(request: Optional[Union[google.cloud.bigquery_reservation_v1.types.reservation.DeleteReservationRequest, dict]] = None, *, name: Optional[str] = None, retry: Union[google.api_core.retry.Retry, object] = <_MethodDefault._DEFAULT_VALUE: <object object>>, timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = ())

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

Parameters
NameDescription
request Union[google.cloud.bigquery_reservation_v1.types.DeleteReservationRequest, dict]

The request object. The request for ReservationService.DeleteReservation.

name `str`

Required. Resource name of the reservation to retrieve. E.g., projects/myproject/locations/US/reservations/team1-prod This corresponds to the name field on the request instance; if request is provided, this should not be set.

retry google.api_core.retry.Retry

Designation of what errors, if any, should be retried.

timeout float

The timeout for this request.

metadata Sequence[Tuple[str, str]]

Strings which should be sent along with the request as metadata.

from_service_account_file

from_service_account_file(filename: str, *args, **kwargs)

Creates an instance of this client using the provided credentials file.

Parameters
NameDescription
filename str

The path to the service account private key json file.

args

Additional arguments to pass to the constructor.

kwargs

Additional arguments to pass to the constructor.

Returns
TypeDescription
ReservationServiceAsyncClientThe constructed client.

from_service_account_info

from_service_account_info(info: dict, *args, **kwargs)

Creates an instance of this client using the provided credentials info.

Parameters
NameDescription
info dict

The service account private key info.

args

Additional arguments to pass to the constructor.

kwargs

Additional arguments to pass to the constructor.

Returns
TypeDescription
ReservationServiceAsyncClientThe constructed client.

from_service_account_json

from_service_account_json(filename: str, *args, **kwargs)

Creates an instance of this client using the provided credentials file.

Parameters
NameDescription
filename str

The path to the service account private key json file.

args

Additional arguments to pass to the constructor.

kwargs

Additional arguments to pass to the constructor.

Returns
TypeDescription
ReservationServiceAsyncClientThe constructed client.

get_bi_reservation

get_bi_reservation(request: Optional[Union[google.cloud.bigquery_reservation_v1.types.reservation.GetBiReservationRequest, dict]] = None, *, name: Optional[str] = None, retry: Union[google.api_core.retry.Retry, object] = <_MethodDefault._DEFAULT_VALUE: <object object>>, timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = ())

Retrieves a BI reservation.

Parameters
NameDescription
request Union[google.cloud.bigquery_reservation_v1.types.GetBiReservationRequest, dict]

The request object. A request to get a singleton BI reservation.

name `str`

Required. Name of the requested reservation, for example: projects/{project_id}/locations/{location_id}/biReservation This corresponds to the name field on the request instance; if request is provided, this should not be set.

retry google.api_core.retry.Retry

Designation of what errors, if any, should be retried.

timeout float

The timeout for this request.

metadata Sequence[Tuple[str, str]]

Strings which should be sent along with the request as metadata.

Returns
TypeDescription
google.cloud.bigquery_reservation_v1.types.BiReservationRepresents a BI Reservation.

get_capacity_commitment

get_capacity_commitment(request: Optional[Union[google.cloud.bigquery_reservation_v1.types.reservation.GetCapacityCommitmentRequest, dict]] = None, *, name: Optional[str] = None, retry: Union[google.api_core.retry.Retry, object] = <_MethodDefault._DEFAULT_VALUE: <object object>>, timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = ())

Returns information about the capacity commitment.

Parameters
NameDescription
request Union[google.cloud.bigquery_reservation_v1.types.GetCapacityCommitmentRequest, dict]

The request object. The request for ReservationService.GetCapacityCommitment.

name `str`

Required. Resource name of the capacity commitment to retrieve. E.g., projects/myproject/locations/US/capacityCommitments/123 This corresponds to the name field on the request instance; if request is provided, this should not be set.

retry google.api_core.retry.Retry

Designation of what errors, if any, should be retried.

timeout float

The timeout for this request.

metadata Sequence[Tuple[str, str]]

Strings which should be sent along with the request as metadata.

Returns
TypeDescription
google.cloud.bigquery_reservation_v1.types.CapacityCommitmentCapacity commitment is a way to purchase compute capacity for BigQuery jobs (in the form of slots) with some committed period of usage. Annual commitments renew by default. Commitments can be removed after their commitment end time passes. In order to remove annual commitment, its plan needs to be changed to monthly or flex first. A capacity commitment resource exists as a child resource of the admin project.

get_reservation

get_reservation(request: Optional[Union[google.cloud.bigquery_reservation_v1.types.reservation.GetReservationRequest, dict]] = None, *, name: Optional[str] = None, retry: Union[google.api_core.retry.Retry, object] = <_MethodDefault._DEFAULT_VALUE: <object object>>, timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = ())

Returns information about the reservation.

Parameters
NameDescription
request Union[google.cloud.bigquery_reservation_v1.types.GetReservationRequest, dict]

The request object. The request for ReservationService.GetReservation.

name `str`

Required. Resource name of the reservation to retrieve. E.g., projects/myproject/locations/US/reservations/team1-prod This corresponds to the name field on the request instance; if request is provided, this should not be set.

retry google.api_core.retry.Retry

Designation of what errors, if any, should be retried.

timeout float

The timeout for this request.

metadata Sequence[Tuple[str, str]]

Strings which should be sent along with the request as metadata.

Returns
TypeDescription
google.cloud.bigquery_reservation_v1.types.ReservationA reservation is a mechanism used to guarantee slots to users.

get_transport_class

get_transport_class()

partial(func, *args, **keywords) - new function with partial application of the given arguments and keywords.

Parameter
NameDescription
label str

list_assignments

list_assignments(request: Optional[Union[google.cloud.bigquery_reservation_v1.types.reservation.ListAssignmentsRequest, dict]] = None, *, parent: Optional[str] = None, retry: Union[google.api_core.retry.Retry, object] = <_MethodDefault._DEFAULT_VALUE: <object object>>, timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = ())

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
NameDescription
request Union[google.cloud.bigquery_reservation_v1.types.ListAssignmentsRequest, dict]

The request object. The request for ReservationService.ListAssignments.

parent `str`

Required. The parent resource name e.g.: projects/myproject/locations/US/reservations/team1-prod Or: projects/myproject/locations/US/reservations/- This corresponds to the parent field on the request instance; if request is provided, this should not be set.

retry google.api_core.retry.Retry

Designation of what errors, if any, should be retried.

timeout float

The timeout for this request.

metadata Sequence[Tuple[str, str]]

Strings which should be sent along with the request as metadata.

Returns
TypeDescription
google.cloud.bigquery_reservation_v1.services.reservation_service.pagers.ListAssignmentsAsyncPagerThe response for ReservationService.ListAssignments. Iterating over this object will yield results and resolve additional pages automatically.

list_capacity_commitments

list_capacity_commitments(request: Optional[Union[google.cloud.bigquery_reservation_v1.types.reservation.ListCapacityCommitmentsRequest, dict]] = None, *, parent: Optional[str] = None, retry: Union[google.api_core.retry.Retry, object] = <_MethodDefault._DEFAULT_VALUE: <object object>>, timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = ())

Lists all the capacity commitments for the admin project.

Parameters
NameDescription
request Union[google.cloud.bigquery_reservation_v1.types.ListCapacityCommitmentsRequest, dict]

The request object. The request for ReservationService.ListCapacityCommitments.

parent `str`

Required. Resource name of the parent reservation. E.g., projects/myproject/locations/US This corresponds to the parent field on the request instance; if request is provided, this should not be set.

retry google.api_core.retry.Retry

Designation of what errors, if any, should be retried.

timeout float

The timeout for this request.

metadata Sequence[Tuple[str, str]]

Strings which should be sent along with the request as metadata.

Returns
TypeDescription
google.cloud.bigquery_reservation_v1.services.reservation_service.pagers.ListCapacityCommitmentsAsyncPagerThe response for ReservationService.ListCapacityCommitments. Iterating over this object will yield results and resolve additional pages automatically.

list_reservations

list_reservations(request: Optional[Union[google.cloud.bigquery_reservation_v1.types.reservation.ListReservationsRequest, dict]] = None, *, parent: Optional[str] = None, retry: Union[google.api_core.retry.Retry, object] = <_MethodDefault._DEFAULT_VALUE: <object object>>, timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = ())

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

Parameters
NameDescription
request Union[google.cloud.bigquery_reservation_v1.types.ListReservationsRequest, dict]

The request object. The request for ReservationService.ListReservations.

parent `str`

Required. The parent resource name containing project and location, e.g.: projects/myproject/locations/US This corresponds to the parent field on the request instance; if request is provided, this should not be set.

retry google.api_core.retry.Retry

Designation of what errors, if any, should be retried.

timeout float

The timeout for this request.

metadata Sequence[Tuple[str, str]]

Strings which should be sent along with the request as metadata.

Returns
TypeDescription
google.cloud.bigquery_reservation_v1.services.reservation_service.pagers.ListReservationsAsyncPagerThe response for ReservationService.ListReservations. Iterating over this object will yield results and resolve additional pages automatically.

merge_capacity_commitments

merge_capacity_commitments(request: Optional[Union[google.cloud.bigquery_reservation_v1.types.reservation.MergeCapacityCommitmentsRequest, dict]] = None, *, parent: Optional[str] = None, capacity_commitment_ids: Optional[Sequence[str]] = None, retry: Union[google.api_core.retry.Retry, object] = <_MethodDefault._DEFAULT_VALUE: <object object>>, timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = ())

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
NameDescription
request Union[google.cloud.bigquery_reservation_v1.types.MergeCapacityCommitmentsRequest, dict]

The request object. The request for ReservationService.MergeCapacityCommitments.

parent `str`

Parent resource that identifies admin project and location e.g., projects/myproject/locations/us This corresponds to the parent field on the request instance; if request is provided, this should not be set.

capacity_commitment_ids :class:`Sequence[str]`

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 This corresponds to the capacity_commitment_ids field on the request instance; if request is provided, this should not be set.

retry google.api_core.retry.Retry

Designation of what errors, if any, should be retried.

timeout float

The timeout for this request.

metadata Sequence[Tuple[str, str]]

Strings which should be sent along with the request as metadata.

Returns
TypeDescription
google.cloud.bigquery_reservation_v1.types.CapacityCommitmentCapacity commitment is a way to purchase compute capacity for BigQuery jobs (in the form of slots) with some committed period of usage. Annual commitments renew by default. Commitments can be removed after their commitment end time passes. In order to remove annual commitment, its plan needs to be changed to monthly or flex first. A capacity commitment resource exists as a child resource of the admin project.

move_assignment

move_assignment(request: Optional[Union[google.cloud.bigquery_reservation_v1.types.reservation.MoveAssignmentRequest, dict]] = None, *, name: Optional[str] = None, destination_id: Optional[str] = None, retry: Union[google.api_core.retry.Retry, object] = <_MethodDefault._DEFAULT_VALUE: <object object>>, timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = ())

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
NameDescription
request Union[google.cloud.bigquery_reservation_v1.types.MoveAssignmentRequest, dict]

The request object. The request for ReservationService.MoveAssignment. Note: "bigquery.reservationAssignments.create" permission is required on the destination_id. Note: "bigquery.reservationAssignments.create" and "bigquery.reservationAssignments.delete" permission are required on the related assignee.

name `str`

Required. The resource name of the assignment, e.g. projects/myproject/locations/US/reservations/team1-prod/assignments/123 This corresponds to the name field on the request instance; if request is provided, this should not be set.

destination_id `str`

The new reservation ID, e.g.: projects/myotherproject/locations/US/reservations/team2-prod This corresponds to the destination_id field on the request instance; if request is provided, this should not be set.

retry google.api_core.retry.Retry

Designation of what errors, if any, should be retried.

timeout float

The timeout for this request.

metadata Sequence[Tuple[str, str]]

Strings which should be sent along with the request as metadata.

Returns
TypeDescription
google.cloud.bigquery_reservation_v1.types.AssignmentA Assignment allows a project to submit jobs of a certain type using slots from the specified reservation.

parse_assignment_path

parse_assignment_path(path: str)

Parses a assignment path into its component segments.

Parameter
NameDescription
path str

parse_bi_reservation_path

parse_bi_reservation_path(path: str)

Parses a bi_reservation path into its component segments.

Parameter
NameDescription
path str

parse_capacity_commitment_path

parse_capacity_commitment_path(path: str)

Parses a capacity_commitment path into its component segments.

Parameter
NameDescription
path str

parse_common_billing_account_path

parse_common_billing_account_path(path: str)

Parse a billing_account path into its component segments.

Parameter
NameDescription
path str

parse_common_folder_path

parse_common_folder_path(path: str)

Parse a folder path into its component segments.

Parameter
NameDescription
path str

parse_common_location_path

parse_common_location_path(path: str)

Parse a location path into its component segments.

Parameter
NameDescription
path str

parse_common_organization_path

parse_common_organization_path(path: str)

Parse a organization path into its component segments.

Parameter
NameDescription
path str

parse_common_project_path

parse_common_project_path(path: str)

Parse a project path into its component segments.

Parameter
NameDescription
path str

parse_reservation_path

parse_reservation_path(path: str)

Parses a reservation path into its component segments.

Parameter
NameDescription
path str

reservation_path

reservation_path(project: str, location: str, reservation: str)

Returns a fully-qualified reservation string.

Parameters
NameDescription
project str
location str
reservation str

search_all_assignments

search_all_assignments(request: Optional[Union[google.cloud.bigquery_reservation_v1.types.reservation.SearchAllAssignmentsRequest, dict]] = None, *, parent: Optional[str] = None, query: Optional[str] = None, retry: Union[google.api_core.retry.Retry, object] = <_MethodDefault._DEFAULT_VALUE: <object object>>, timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = ())

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
NameDescription
request Union[google.cloud.bigquery_reservation_v1.types.SearchAllAssignmentsRequest, dict]

The request object. The request for ReservationService.SearchAllAssignments. Note: "bigquery.reservationAssignments.search" permission is required on the related assignee.

parent `str`

Required. The resource name with location (project name could be the wildcard '-'), e.g.: projects/-/locations/US. This corresponds to the parent field on the request instance; if request is provided, this should not be set.

query `str`

Please specify resource name as assignee in the query. Examples: - assignee=projects/myproject - assignee=folders/123 - assignee=organizations/456 This corresponds to the query field on the request instance; if request is provided, this should not be set.

retry google.api_core.retry.Retry

Designation of what errors, if any, should be retried.

timeout float

The timeout for this request.

metadata Sequence[Tuple[str, str]]

Strings which should be sent along with the request as metadata.

Returns
TypeDescription
google.cloud.bigquery_reservation_v1.services.reservation_service.pagers.SearchAllAssignmentsAsyncPagerThe response for ReservationService.SearchAllAssignments. Iterating over this object will yield results and resolve additional pages automatically.

search_assignments

search_assignments(request: Optional[Union[google.cloud.bigquery_reservation_v1.types.reservation.SearchAssignmentsRequest, dict]] = None, *, parent: Optional[str] = None, query: Optional[str] = None, retry: Union[google.api_core.retry.Retry, object] = <_MethodDefault._DEFAULT_VALUE: <object object>>, timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = ())

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
NameDescription
request Union[google.cloud.bigquery_reservation_v1.types.SearchAssignmentsRequest, dict]

The request object. The request for ReservationService.SearchAssignments. Note: "bigquery.reservationAssignments.search" permission is required on the related assignee.

parent `str`

Required. The resource name of the admin project(containing project and location), e.g.: projects/myproject/locations/US. This corresponds to the parent field on the request instance; if request is provided, this should not be set.

query `str`

Please specify resource name as assignee in the query. Examples: - assignee=projects/myproject - assignee=folders/123 - assignee=organizations/456 This corresponds to the query field on the request instance; if request is provided, this should not be set.

retry google.api_core.retry.Retry

Designation of what errors, if any, should be retried.

timeout float

The timeout for this request.

metadata Sequence[Tuple[str, str]]

Strings which should be sent along with the request as metadata.

Returns
TypeDescription
google.cloud.bigquery_reservation_v1.services.reservation_service.pagers.SearchAssignmentsAsyncPagerThe response for ReservationService.SearchAssignments. Iterating over this object will yield results and resolve additional pages automatically.

split_capacity_commitment

split_capacity_commitment(request: Optional[Union[google.cloud.bigquery_reservation_v1.types.reservation.SplitCapacityCommitmentRequest, dict]] = None, *, name: Optional[str] = None, slot_count: Optional[int] = None, retry: Union[google.api_core.retry.Retry, object] = <_MethodDefault._DEFAULT_VALUE: <object object>>, timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = ())

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 would change the plan of the first one to FLEX and then delete it.

Parameters
NameDescription
request Union[google.cloud.bigquery_reservation_v1.types.SplitCapacityCommitmentRequest, dict]

The request object. The request for ReservationService.SplitCapacityCommitment.

name `str`

Required. The resource name e.g.,: projects/myproject/locations/US/capacityCommitments/123 This corresponds to the name field on the request instance; if request is provided, this should not be set.

slot_count `int`

Number of slots in the capacity commitment after the split. This corresponds to the slot_count field on the request instance; if request is provided, this should not be set.

retry google.api_core.retry.Retry

Designation of what errors, if any, should be retried.

timeout float

The timeout for this request.

metadata Sequence[Tuple[str, str]]

Strings which should be sent along with the request as metadata.

Returns
TypeDescription
google.cloud.bigquery_reservation_v1.types.SplitCapacityCommitmentResponseThe response for ReservationService.SplitCapacityCommitment.

update_bi_reservation

update_bi_reservation(request: Optional[Union[google.cloud.bigquery_reservation_v1.types.reservation.UpdateBiReservationRequest, dict]] = None, *, bi_reservation: Optional[google.cloud.bigquery_reservation_v1.types.reservation.BiReservation] = None, update_mask: Optional[google.protobuf.field_mask_pb2.FieldMask] = None, retry: Union[google.api_core.retry.Retry, object] = <_MethodDefault._DEFAULT_VALUE: <object object>>, timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = ())

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
NameDescription
request Union[google.cloud.bigquery_reservation_v1.types.UpdateBiReservationRequest, dict]

The request object. A request to update a BI reservation.

bi_reservation BiReservation

A reservation to update. This corresponds to the bi_reservation field on the request instance; if request is provided, this should not be set.

update_mask `google.protobuf.field_mask_pb2.FieldMask`

A list of fields to be updated in this request. This corresponds to the update_mask field on the request instance; if request is provided, this should not be set.

retry google.api_core.retry.Retry

Designation of what errors, if any, should be retried.

timeout float

The timeout for this request.

metadata Sequence[Tuple[str, str]]

Strings which should be sent along with the request as metadata.

Returns
TypeDescription
google.cloud.bigquery_reservation_v1.types.BiReservationRepresents a BI Reservation.

update_capacity_commitment

update_capacity_commitment(request: Optional[Union[google.cloud.bigquery_reservation_v1.types.reservation.UpdateCapacityCommitmentRequest, dict]] = None, *, capacity_commitment: Optional[google.cloud.bigquery_reservation_v1.types.reservation.CapacityCommitment] = None, update_mask: Optional[google.protobuf.field_mask_pb2.FieldMask] = None, retry: Union[google.api_core.retry.Retry, object] = <_MethodDefault._DEFAULT_VALUE: <object object>>, timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = ())

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
NameDescription
request Union[google.cloud.bigquery_reservation_v1.types.UpdateCapacityCommitmentRequest, dict]

The request object. The request for ReservationService.UpdateCapacityCommitment.

capacity_commitment CapacityCommitment

Content of the capacity commitment to update. This corresponds to the capacity_commitment field on the request instance; if request is provided, this should not be set.

update_mask `google.protobuf.field_mask_pb2.FieldMask`

Standard field mask for the set of fields to be updated. This corresponds to the update_mask field on the request instance; if request is provided, this should not be set.

retry google.api_core.retry.Retry

Designation of what errors, if any, should be retried.

timeout float

The timeout for this request.

metadata Sequence[Tuple[str, str]]

Strings which should be sent along with the request as metadata.

Returns
TypeDescription
google.cloud.bigquery_reservation_v1.types.CapacityCommitmentCapacity commitment is a way to purchase compute capacity for BigQuery jobs (in the form of slots) with some committed period of usage. Annual commitments renew by default. Commitments can be removed after their commitment end time passes. In order to remove annual commitment, its plan needs to be changed to monthly or flex first. A capacity commitment resource exists as a child resource of the admin project.

update_reservation

update_reservation(request: Optional[Union[google.cloud.bigquery_reservation_v1.types.reservation.UpdateReservationRequest, dict]] = None, *, reservation: Optional[google.cloud.bigquery_reservation_v1.types.reservation.Reservation] = None, update_mask: Optional[google.protobuf.field_mask_pb2.FieldMask] = None, retry: Union[google.api_core.retry.Retry, object] = <_MethodDefault._DEFAULT_VALUE: <object object>>, timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = ())

Updates an existing reservation resource.

Parameters
NameDescription
request Union[google.cloud.bigquery_reservation_v1.types.UpdateReservationRequest, dict]

The request object. The request for ReservationService.UpdateReservation.

reservation Reservation

Content of the reservation to update. This corresponds to the reservation field on the request instance; if request is provided, this should not be set.

update_mask `google.protobuf.field_mask_pb2.FieldMask`

Standard field mask for the set of fields to be updated. This corresponds to the update_mask field on the request instance; if request is provided, this should not be set.

retry google.api_core.retry.Retry

Designation of what errors, if any, should be retried.

timeout float

The timeout for this request.

metadata Sequence[Tuple[str, str]]

Strings which should be sent along with the request as metadata.

Returns
TypeDescription
google.cloud.bigquery_reservation_v1.types.ReservationA reservation is a mechanism used to guarantee slots to users.