As of January 1, 2020 this library no longer supports Python 2 on the latest released version. Library versions released prior to that date will continue to be available. For more information please visit Python 2 support on Google Cloud.

ReservationService

class google.cloud.bigquery_reservation_v1.services.reservation_service.ReservationServiceAsyncClient(*, credentials: typing.Optional[google.auth.credentials.Credentials] = None, transport: typing.Optional[typing.Union[str, google.cloud.bigquery_reservation_v1.services.reservation_service.transports.base.ReservationServiceTransport, typing.Callable[[...], google.cloud.bigquery_reservation_v1.services.reservation_service.transports.base.ReservationServiceTransport]]] = 'grpc_asyncio', client_options: typing.Optional[google.api_core.client_options.ClientOptions] = None, client_info: google.api_core.gapic_v1.client_info.ClientInfo = <google.api_core.gapic_v1.client_info.ClientInfo object>)[source]

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.

Instantiates the reservation service async client.

Parameters
  • credentials (Optional[google.auth.credentials.Credentials]) – The authorization credentials to attach to requests. These credentials identify the application to the service; if none are specified, the client will attempt to ascertain the credentials from the environment.

  • transport (Optional[Union[str,ReservationServiceTransport,Callable[..., ReservationServiceTransport]]]) – The transport to use, or a Callable that constructs and returns a new transport to use. If a Callable is given, it will be called with the same set of initialization arguments as used in the ReservationServiceTransport constructor. If set to None, a transport is chosen automatically.

  • client_options (Optional[Union[google.api_core.client_options.ClientOptions, dict]]) –

    Custom options for the client.

    1. The api_endpoint property can be used to override the default endpoint provided by the client when transport is not explicitly provided. Only if this property is not set and transport was not explicitly provided, the endpoint is determined by the GOOGLE_API_USE_MTLS_ENDPOINT environment variable, which have one of the following values: “always” (always use the default mTLS endpoint), “never” (always use the default regular endpoint) and “auto” (auto-switch to the default mTLS endpoint if client certificate is present; this is the default value).

    2. If the GOOGLE_API_USE_CLIENT_CERTIFICATE environment variable is “true”, then the client_cert_source property can be used to provide a client certificate for mTLS transport. If not provided, the default SSL client certificate will be used if present. If GOOGLE_API_USE_CLIENT_CERTIFICATE is “false” or not set, no client certificate will be used.

    3. The universe_domain property can be used to override the default “googleapis.com” universe. Note that api_endpoint property still takes precedence; and universe_domain is currently not supported for mTLS.

  • client_info (google.api_core.gapic_v1.client_info.ClientInfo) – The client info used to send a user-agent string along with API requests. If None, then default info will be used. Generally, you only need to set this if you’re developing your own client library.

Raises

google.auth.exceptions.MutualTlsChannelError – If mutual TLS transport creation failed for any reason.

property api_endpoint

Return the API endpoint used by the client instance.

Returns

The API endpoint used by the client instance.

Return type

str

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

Returns a fully-qualified assignment string.

static bi_reservation_path(project: str, location: str) str

Returns a fully-qualified bi_reservation string.

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

Returns a fully-qualified capacity_commitment string.

static common_billing_account_path(billing_account: str) str

Returns a fully-qualified billing_account string.

static common_folder_path(folder: str) str

Returns a fully-qualified folder string.

static common_location_path(project: str, location: str) str

Returns a fully-qualified location string.

static common_organization_path(organization: str) str

Returns a fully-qualified organization string.

static common_project_path(project: str) str

Returns a fully-qualified project string.

async 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: Optional[Union[google.api_core.retry.retry_unary_async.AsyncRetry, google.api_core.gapic_v1.method._MethodDefault]] = _MethodDefault._DEFAULT_VALUE, timeout: Union[float, object] = _MethodDefault._DEFAULT_VALUE, metadata: Sequence[Tuple[str, str]] = ()) google.cloud.bigquery_reservation_v1.types.reservation.Assignment[source]

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.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import bigquery_reservation_v1

async def sample_create_assignment():
    # Create a client
    client = bigquery_reservation_v1.ReservationServiceAsyncClient()

    # Initialize request argument(s)
    request = bigquery_reservation_v1.CreateAssignmentRequest(
        parent="parent_value",
    )

    # Make the request
    response = await client.create_assignment(request=request)

    # Handle the response
    print(response)
Parameters
  • request (Optional[Union[google.cloud.bigquery_reservation_v1.types.CreateAssignmentRequest, dict]]) – The request object. The request for [ReservationService.CreateAssignment][google.cloud.bigquery.reservation.v1.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 (google.cloud.bigquery_reservation_v1.types.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_async.AsyncRetry) – 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

An assignment allows a project to submit jobs of a certain type using slots from the specified reservation.

Return type

google.cloud.bigquery_reservation_v1.types.Assignment

async 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: Optional[Union[google.api_core.retry.retry_unary_async.AsyncRetry, google.api_core.gapic_v1.method._MethodDefault]] = _MethodDefault._DEFAULT_VALUE, timeout: Union[float, object] = _MethodDefault._DEFAULT_VALUE, metadata: Sequence[Tuple[str, str]] = ()) google.cloud.bigquery_reservation_v1.types.reservation.CapacityCommitment[source]

Creates a new capacity commitment resource.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import bigquery_reservation_v1

async def sample_create_capacity_commitment():
    # Create a client
    client = bigquery_reservation_v1.ReservationServiceAsyncClient()

    # Initialize request argument(s)
    request = bigquery_reservation_v1.CreateCapacityCommitmentRequest(
        parent="parent_value",
    )

    # Make the request
    response = await client.create_capacity_commitment(request=request)

    # Handle the response
    print(response)
Parameters
  • request (Optional[Union[google.cloud.bigquery_reservation_v1.types.CreateCapacityCommitmentRequest, dict]]) – The request object. The request for [ReservationService.CreateCapacityCommitment][google.cloud.bigquery.reservation.v1.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 (google.cloud.bigquery_reservation_v1.types.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_async.AsyncRetry) – 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

Capacity 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.

Return type

google.cloud.bigquery_reservation_v1.types.CapacityCommitment

async 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: Optional[Union[google.api_core.retry.retry_unary_async.AsyncRetry, google.api_core.gapic_v1.method._MethodDefault]] = _MethodDefault._DEFAULT_VALUE, timeout: Union[float, object] = _MethodDefault._DEFAULT_VALUE, metadata: Sequence[Tuple[str, str]] = ()) google.cloud.bigquery_reservation_v1.types.reservation.Reservation[source]

Creates a new reservation resource.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import bigquery_reservation_v1

async def sample_create_reservation():
    # Create a client
    client = bigquery_reservation_v1.ReservationServiceAsyncClient()

    # Initialize request argument(s)
    request = bigquery_reservation_v1.CreateReservationRequest(
        parent="parent_value",
    )

    # Make the request
    response = await client.create_reservation(request=request)

    # Handle the response
    print(response)
Parameters
  • request (Optional[Union[google.cloud.bigquery_reservation_v1.types.CreateReservationRequest, dict]]) – The request object. The request for [ReservationService.CreateReservation][google.cloud.bigquery.reservation.v1.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 (google.cloud.bigquery_reservation_v1.types.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. 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.

    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_async.AsyncRetry) – 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

A reservation is a mechanism used to guarantee slots to users.

Return type

google.cloud.bigquery_reservation_v1.types.Reservation

async delete_assignment(request: Optional[Union[google.cloud.bigquery_reservation_v1.types.reservation.DeleteAssignmentRequest, dict]] = None, *, name: Optional[str] = None, retry: Optional[Union[google.api_core.retry.retry_unary_async.AsyncRetry, google.api_core.gapic_v1.method._MethodDefault]] = _MethodDefault._DEFAULT_VALUE, timeout: Union[float, object] = _MethodDefault._DEFAULT_VALUE, metadata: Sequence[Tuple[str, str]] = ()) None[source]

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.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import bigquery_reservation_v1

async def sample_delete_assignment():
    # Create a client
    client = bigquery_reservation_v1.ReservationServiceAsyncClient()

    # Initialize request argument(s)
    request = bigquery_reservation_v1.DeleteAssignmentRequest(
        name="name_value",
    )

    # Make the request
    await client.delete_assignment(request=request)
Parameters
  • request (Optional[Union[google.cloud.bigquery_reservation_v1.types.DeleteAssignmentRequest, dict]]) – The request object. The request for [ReservationService.DeleteAssignment][google.cloud.bigquery.reservation.v1.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_async.AsyncRetry) – 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.

async delete_capacity_commitment(request: Optional[Union[google.cloud.bigquery_reservation_v1.types.reservation.DeleteCapacityCommitmentRequest, dict]] = None, *, name: Optional[str] = None, retry: Optional[Union[google.api_core.retry.retry_unary_async.AsyncRetry, google.api_core.gapic_v1.method._MethodDefault]] = _MethodDefault._DEFAULT_VALUE, timeout: Union[float, object] = _MethodDefault._DEFAULT_VALUE, metadata: Sequence[Tuple[str, str]] = ()) None[source]

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.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import bigquery_reservation_v1

async def sample_delete_capacity_commitment():
    # Create a client
    client = bigquery_reservation_v1.ReservationServiceAsyncClient()

    # Initialize request argument(s)
    request = bigquery_reservation_v1.DeleteCapacityCommitmentRequest(
        name="name_value",
    )

    # Make the request
    await client.delete_capacity_commitment(request=request)
Parameters
  • request (Optional[Union[google.cloud.bigquery_reservation_v1.types.DeleteCapacityCommitmentRequest, dict]]) – The request object. The request for [ReservationService.DeleteCapacityCommitment][google.cloud.bigquery.reservation.v1.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_async.AsyncRetry) – 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.

async delete_reservation(request: Optional[Union[google.cloud.bigquery_reservation_v1.types.reservation.DeleteReservationRequest, dict]] = None, *, name: Optional[str] = None, retry: Optional[Union[google.api_core.retry.retry_unary_async.AsyncRetry, google.api_core.gapic_v1.method._MethodDefault]] = _MethodDefault._DEFAULT_VALUE, timeout: Union[float, object] = _MethodDefault._DEFAULT_VALUE, metadata: Sequence[Tuple[str, str]] = ()) None[source]

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

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import bigquery_reservation_v1

async def sample_delete_reservation():
    # Create a client
    client = bigquery_reservation_v1.ReservationServiceAsyncClient()

    # Initialize request argument(s)
    request = bigquery_reservation_v1.DeleteReservationRequest(
        name="name_value",
    )

    # Make the request
    await client.delete_reservation(request=request)
Parameters
  • request (Optional[Union[google.cloud.bigquery_reservation_v1.types.DeleteReservationRequest, dict]]) – The request object. The request for [ReservationService.DeleteReservation][google.cloud.bigquery.reservation.v1.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_async.AsyncRetry) – 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.

classmethod from_service_account_file(filename: str, *args, **kwargs)[source]
Creates an instance of this client using the provided credentials

file.

Parameters
  • 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

The constructed client.

Return type

ReservationServiceAsyncClient

classmethod from_service_account_info(info: dict, *args, **kwargs)[source]
Creates an instance of this client using the provided credentials

info.

Parameters
  • 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

The constructed client.

Return type

ReservationServiceAsyncClient

classmethod from_service_account_json(filename: str, *args, **kwargs)
Creates an instance of this client using the provided credentials

file.

Parameters
  • 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

The constructed client.

Return type

ReservationServiceAsyncClient

async get_bi_reservation(request: Optional[Union[google.cloud.bigquery_reservation_v1.types.reservation.GetBiReservationRequest, dict]] = None, *, name: Optional[str] = None, retry: Optional[Union[google.api_core.retry.retry_unary_async.AsyncRetry, google.api_core.gapic_v1.method._MethodDefault]] = _MethodDefault._DEFAULT_VALUE, timeout: Union[float, object] = _MethodDefault._DEFAULT_VALUE, metadata: Sequence[Tuple[str, str]] = ()) google.cloud.bigquery_reservation_v1.types.reservation.BiReservation[source]

Retrieves a BI reservation.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import bigquery_reservation_v1

async def sample_get_bi_reservation():
    # Create a client
    client = bigquery_reservation_v1.ReservationServiceAsyncClient()

    # Initialize request argument(s)
    request = bigquery_reservation_v1.GetBiReservationRequest(
        name="name_value",
    )

    # Make the request
    response = await client.get_bi_reservation(request=request)

    # Handle the response
    print(response)
Parameters
  • request (Optional[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_async.AsyncRetry) – 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

Represents a BI Reservation.

Return type

google.cloud.bigquery_reservation_v1.types.BiReservation

async get_capacity_commitment(request: Optional[Union[google.cloud.bigquery_reservation_v1.types.reservation.GetCapacityCommitmentRequest, dict]] = None, *, name: Optional[str] = None, retry: Optional[Union[google.api_core.retry.retry_unary_async.AsyncRetry, google.api_core.gapic_v1.method._MethodDefault]] = _MethodDefault._DEFAULT_VALUE, timeout: Union[float, object] = _MethodDefault._DEFAULT_VALUE, metadata: Sequence[Tuple[str, str]] = ()) google.cloud.bigquery_reservation_v1.types.reservation.CapacityCommitment[source]

Returns information about the capacity commitment.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import bigquery_reservation_v1

async def sample_get_capacity_commitment():
    # Create a client
    client = bigquery_reservation_v1.ReservationServiceAsyncClient()

    # Initialize request argument(s)
    request = bigquery_reservation_v1.GetCapacityCommitmentRequest(
        name="name_value",
    )

    # Make the request
    response = await client.get_capacity_commitment(request=request)

    # Handle the response
    print(response)
Parameters
  • request (Optional[Union[google.cloud.bigquery_reservation_v1.types.GetCapacityCommitmentRequest, dict]]) – The request object. The request for [ReservationService.GetCapacityCommitment][google.cloud.bigquery.reservation.v1.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_async.AsyncRetry) – 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

Capacity 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.

Return type

google.cloud.bigquery_reservation_v1.types.CapacityCommitment

classmethod get_mtls_endpoint_and_cert_source(client_options: Optional[google.api_core.client_options.ClientOptions] = None)[source]

Return the API endpoint and client cert source for mutual TLS.

The client cert source is determined in the following order: (1) if GOOGLE_API_USE_CLIENT_CERTIFICATE environment variable is not “true”, the client cert source is None. (2) if client_options.client_cert_source is provided, use the provided one; if the default client cert source exists, use the default one; otherwise the client cert source is None.

The API endpoint is determined in the following order: (1) if client_options.api_endpoint if provided, use the provided one. (2) if GOOGLE_API_USE_CLIENT_CERTIFICATE environment variable is “always”, use the default mTLS endpoint; if the environment variable is “never”, use the default API endpoint; otherwise if client cert source exists, use the default mTLS endpoint, otherwise use the default API endpoint.

More details can be found at https://google.aip.dev/auth/4114.

Parameters

client_options (google.api_core.client_options.ClientOptions) – Custom options for the client. Only the api_endpoint and client_cert_source properties may be used in this method.

Returns

returns the API endpoint and the

client cert source to use.

Return type

Tuple[str, Callable[[], Tuple[bytes, bytes]]]

Raises

google.auth.exceptions.MutualTLSChannelError – If any errors happen.

async get_reservation(request: Optional[Union[google.cloud.bigquery_reservation_v1.types.reservation.GetReservationRequest, dict]] = None, *, name: Optional[str] = None, retry: Optional[Union[google.api_core.retry.retry_unary_async.AsyncRetry, google.api_core.gapic_v1.method._MethodDefault]] = _MethodDefault._DEFAULT_VALUE, timeout: Union[float, object] = _MethodDefault._DEFAULT_VALUE, metadata: Sequence[Tuple[str, str]] = ()) google.cloud.bigquery_reservation_v1.types.reservation.Reservation[source]

Returns information about the reservation.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import bigquery_reservation_v1

async def sample_get_reservation():
    # Create a client
    client = bigquery_reservation_v1.ReservationServiceAsyncClient()

    # Initialize request argument(s)
    request = bigquery_reservation_v1.GetReservationRequest(
        name="name_value",
    )

    # Make the request
    response = await client.get_reservation(request=request)

    # Handle the response
    print(response)
Parameters
  • request (Optional[Union[google.cloud.bigquery_reservation_v1.types.GetReservationRequest, dict]]) – The request object. The request for [ReservationService.GetReservation][google.cloud.bigquery.reservation.v1.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_async.AsyncRetry) – 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

A reservation is a mechanism used to guarantee slots to users.

Return type

google.cloud.bigquery_reservation_v1.types.Reservation

classmethod get_transport_class(label: Optional[str] = None) Type[google.cloud.bigquery_reservation_v1.services.reservation_service.transports.base.ReservationServiceTransport]

Returns an appropriate transport class.

Parameters

label – The name of the desired transport. If none is provided, then the first transport in the registry is used.

Returns

The transport class to use.

async list_assignments(request: Optional[Union[google.cloud.bigquery_reservation_v1.types.reservation.ListAssignmentsRequest, dict]] = None, *, parent: Optional[str] = None, retry: Optional[Union[google.api_core.retry.retry_unary_async.AsyncRetry, google.api_core.gapic_v1.method._MethodDefault]] = _MethodDefault._DEFAULT_VALUE, timeout: Union[float, object] = _MethodDefault._DEFAULT_VALUE, metadata: Sequence[Tuple[str, str]] = ()) google.cloud.bigquery_reservation_v1.services.reservation_service.pagers.ListAssignmentsAsyncPager[source]

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.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import bigquery_reservation_v1

async def sample_list_assignments():
    # Create a client
    client = bigquery_reservation_v1.ReservationServiceAsyncClient()

    # Initialize request argument(s)
    request = bigquery_reservation_v1.ListAssignmentsRequest(
        parent="parent_value",
    )

    # Make the request
    page_result = client.list_assignments(request=request)

    # Handle the response
    async for response in page_result:
        print(response)
Parameters
  • request (Optional[Union[google.cloud.bigquery_reservation_v1.types.ListAssignmentsRequest, dict]]) – The request object. The request for [ReservationService.ListAssignments][google.cloud.bigquery.reservation.v1.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_async.AsyncRetry) – 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

The response for

[ReservationService.ListAssignments][google.cloud.bigquery.reservation.v1.ReservationService.ListAssignments].

Iterating over this object will yield results and resolve additional pages automatically.

Return type

google.cloud.bigquery_reservation_v1.services.reservation_service.pagers.ListAssignmentsAsyncPager

async list_capacity_commitments(request: Optional[Union[google.cloud.bigquery_reservation_v1.types.reservation.ListCapacityCommitmentsRequest, dict]] = None, *, parent: Optional[str] = None, retry: Optional[Union[google.api_core.retry.retry_unary_async.AsyncRetry, google.api_core.gapic_v1.method._MethodDefault]] = _MethodDefault._DEFAULT_VALUE, timeout: Union[float, object] = _MethodDefault._DEFAULT_VALUE, metadata: Sequence[Tuple[str, str]] = ()) google.cloud.bigquery_reservation_v1.services.reservation_service.pagers.ListCapacityCommitmentsAsyncPager[source]

Lists all the capacity commitments for the admin project.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import bigquery_reservation_v1

async def sample_list_capacity_commitments():
    # Create a client
    client = bigquery_reservation_v1.ReservationServiceAsyncClient()

    # Initialize request argument(s)
    request = bigquery_reservation_v1.ListCapacityCommitmentsRequest(
        parent="parent_value",
    )

    # Make the request
    page_result = client.list_capacity_commitments(request=request)

    # Handle the response
    async for response in page_result:
        print(response)
Parameters
  • request (Optional[Union[google.cloud.bigquery_reservation_v1.types.ListCapacityCommitmentsRequest, dict]]) – The request object. The request for [ReservationService.ListCapacityCommitments][google.cloud.bigquery.reservation.v1.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_async.AsyncRetry) – 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

The response for

[ReservationService.ListCapacityCommitments][google.cloud.bigquery.reservation.v1.ReservationService.ListCapacityCommitments].

Iterating over this object will yield results and resolve additional pages automatically.

Return type

google.cloud.bigquery_reservation_v1.services.reservation_service.pagers.ListCapacityCommitmentsAsyncPager

async list_reservations(request: Optional[Union[google.cloud.bigquery_reservation_v1.types.reservation.ListReservationsRequest, dict]] = None, *, parent: Optional[str] = None, retry: Optional[Union[google.api_core.retry.retry_unary_async.AsyncRetry, google.api_core.gapic_v1.method._MethodDefault]] = _MethodDefault._DEFAULT_VALUE, timeout: Union[float, object] = _MethodDefault._DEFAULT_VALUE, metadata: Sequence[Tuple[str, str]] = ()) google.cloud.bigquery_reservation_v1.services.reservation_service.pagers.ListReservationsAsyncPager[source]

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

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import bigquery_reservation_v1

async def sample_list_reservations():
    # Create a client
    client = bigquery_reservation_v1.ReservationServiceAsyncClient()

    # Initialize request argument(s)
    request = bigquery_reservation_v1.ListReservationsRequest(
        parent="parent_value",
    )

    # Make the request
    page_result = client.list_reservations(request=request)

    # Handle the response
    async for response in page_result:
        print(response)
Parameters
  • request (Optional[Union[google.cloud.bigquery_reservation_v1.types.ListReservationsRequest, dict]]) – The request object. The request for [ReservationService.ListReservations][google.cloud.bigquery.reservation.v1.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_async.AsyncRetry) – 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

The response for

[ReservationService.ListReservations][google.cloud.bigquery.reservation.v1.ReservationService.ListReservations].

Iterating over this object will yield results and resolve additional pages automatically.

Return type

google.cloud.bigquery_reservation_v1.services.reservation_service.pagers.ListReservationsAsyncPager

async merge_capacity_commitments(request: Optional[Union[google.cloud.bigquery_reservation_v1.types.reservation.MergeCapacityCommitmentsRequest, dict]] = None, *, parent: Optional[str] = None, capacity_commitment_ids: Optional[MutableSequence[str]] = None, retry: Optional[Union[google.api_core.retry.retry_unary_async.AsyncRetry, google.api_core.gapic_v1.method._MethodDefault]] = _MethodDefault._DEFAULT_VALUE, timeout: Union[float, object] = _MethodDefault._DEFAULT_VALUE, metadata: Sequence[Tuple[str, str]] = ()) google.cloud.bigquery_reservation_v1.types.reservation.CapacityCommitment[source]

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.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import bigquery_reservation_v1

async def sample_merge_capacity_commitments():
    # Create a client
    client = bigquery_reservation_v1.ReservationServiceAsyncClient()

    # Initialize request argument(s)
    request = bigquery_reservation_v1.MergeCapacityCommitmentsRequest(
    )

    # Make the request
    response = await client.merge_capacity_commitments(request=request)

    # Handle the response
    print(response)
Parameters
  • request (Optional[Union[google.cloud.bigquery_reservation_v1.types.MergeCapacityCommitmentsRequest, dict]]) – The request object. The request for [ReservationService.MergeCapacityCommitments][google.cloud.bigquery.reservation.v1.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 (MutableSequence[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_async.AsyncRetry) – 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

Capacity 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.

Return type

google.cloud.bigquery_reservation_v1.types.CapacityCommitment

async 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: Optional[Union[google.api_core.retry.retry_unary_async.AsyncRetry, google.api_core.gapic_v1.method._MethodDefault]] = _MethodDefault._DEFAULT_VALUE, timeout: Union[float, object] = _MethodDefault._DEFAULT_VALUE, metadata: Sequence[Tuple[str, str]] = ()) google.cloud.bigquery_reservation_v1.types.reservation.Assignment[source]

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.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import bigquery_reservation_v1

async def sample_move_assignment():
    # Create a client
    client = bigquery_reservation_v1.ReservationServiceAsyncClient()

    # Initialize request argument(s)
    request = bigquery_reservation_v1.MoveAssignmentRequest(
        name="name_value",
    )

    # Make the request
    response = await client.move_assignment(request=request)

    # Handle the response
    print(response)
Parameters
  • request (Optional[Union[google.cloud.bigquery_reservation_v1.types.MoveAssignmentRequest, dict]]) –

    The request object. The request for [ReservationService.MoveAssignment][google.cloud.bigquery.reservation.v1.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_async.AsyncRetry) – 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

An assignment allows a project to submit jobs of a certain type using slots from the specified reservation.

Return type

google.cloud.bigquery_reservation_v1.types.Assignment

static parse_assignment_path(path: str) Dict[str, str]

Parses a assignment path into its component segments.

static parse_bi_reservation_path(path: str) Dict[str, str]

Parses a bi_reservation path into its component segments.

static parse_capacity_commitment_path(path: str) Dict[str, str]

Parses a capacity_commitment path into its component segments.

static parse_common_billing_account_path(path: str) Dict[str, str]

Parse a billing_account path into its component segments.

static parse_common_folder_path(path: str) Dict[str, str]

Parse a folder path into its component segments.

static parse_common_location_path(path: str) Dict[str, str]

Parse a location path into its component segments.

static parse_common_organization_path(path: str) Dict[str, str]

Parse a organization path into its component segments.

static parse_common_project_path(path: str) Dict[str, str]

Parse a project path into its component segments.

static parse_reservation_path(path: str) Dict[str, str]

Parses a reservation path into its component segments.

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

Returns a fully-qualified reservation string.

async 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: Optional[Union[google.api_core.retry.retry_unary_async.AsyncRetry, google.api_core.gapic_v1.method._MethodDefault]] = _MethodDefault._DEFAULT_VALUE, timeout: Union[float, object] = _MethodDefault._DEFAULT_VALUE, metadata: Sequence[Tuple[str, str]] = ()) google.cloud.bigquery_reservation_v1.services.reservation_service.pagers.SearchAllAssignmentsAsyncPager[source]

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/*.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import bigquery_reservation_v1

async def sample_search_all_assignments():
    # Create a client
    client = bigquery_reservation_v1.ReservationServiceAsyncClient()

    # Initialize request argument(s)
    request = bigquery_reservation_v1.SearchAllAssignmentsRequest(
        parent="parent_value",
    )

    # Make the request
    page_result = client.search_all_assignments(request=request)

    # Handle the response
    async for response in page_result:
        print(response)
Parameters
  • request (Optional[Union[google.cloud.bigquery_reservation_v1.types.SearchAllAssignmentsRequest, dict]]) – The request object. The request for [ReservationService.SearchAllAssignments][google.cloud.bigquery.reservation.v1.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_async.AsyncRetry) – 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

The response for

[ReservationService.SearchAllAssignments][google.cloud.bigquery.reservation.v1.ReservationService.SearchAllAssignments].

Iterating over this object will yield results and resolve additional pages automatically.

Return type

google.cloud.bigquery_reservation_v1.services.reservation_service.pagers.SearchAllAssignmentsAsyncPager

async search_assignments(request: Optional[Union[google.cloud.bigquery_reservation_v1.types.reservation.SearchAssignmentsRequest, dict]] = None, *, parent: Optional[str] = None, query: Optional[str] = None, retry: Optional[Union[google.api_core.retry.retry_unary_async.AsyncRetry, google.api_core.gapic_v1.method._MethodDefault]] = _MethodDefault._DEFAULT_VALUE, timeout: Union[float, object] = _MethodDefault._DEFAULT_VALUE, metadata: Sequence[Tuple[str, str]] = ()) google.cloud.bigquery_reservation_v1.services.reservation_service.pagers.SearchAssignmentsAsyncPager[source]

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.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import bigquery_reservation_v1

async def sample_search_assignments():
    # Create a client
    client = bigquery_reservation_v1.ReservationServiceAsyncClient()

    # Initialize request argument(s)
    request = bigquery_reservation_v1.SearchAssignmentsRequest(
        parent="parent_value",
    )

    # Make the request
    page_result = client.search_assignments(request=request)

    # Handle the response
    async for response in page_result:
        print(response)
Parameters
  • request (Optional[Union[google.cloud.bigquery_reservation_v1.types.SearchAssignmentsRequest, dict]]) – The request object. The request for [ReservationService.SearchAssignments][google.cloud.bigquery.reservation.v1.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_async.AsyncRetry) – 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

The response for

[ReservationService.SearchAssignments][google.cloud.bigquery.reservation.v1.ReservationService.SearchAssignments].

Iterating over this object will yield results and resolve additional pages automatically.

Return type

google.cloud.bigquery_reservation_v1.services.reservation_service.pagers.SearchAssignmentsAsyncPager

async 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: Optional[Union[google.api_core.retry.retry_unary_async.AsyncRetry, google.api_core.gapic_v1.method._MethodDefault]] = _MethodDefault._DEFAULT_VALUE, timeout: Union[float, object] = _MethodDefault._DEFAULT_VALUE, metadata: Sequence[Tuple[str, str]] = ()) google.cloud.bigquery_reservation_v1.types.reservation.SplitCapacityCommitmentResponse[source]

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.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import bigquery_reservation_v1

async def sample_split_capacity_commitment():
    # Create a client
    client = bigquery_reservation_v1.ReservationServiceAsyncClient()

    # Initialize request argument(s)
    request = bigquery_reservation_v1.SplitCapacityCommitmentRequest(
        name="name_value",
    )

    # Make the request
    response = await client.split_capacity_commitment(request=request)

    # Handle the response
    print(response)
Parameters
  • request (Optional[Union[google.cloud.bigquery_reservation_v1.types.SplitCapacityCommitmentRequest, dict]]) – The request object. The request for [ReservationService.SplitCapacityCommitment][google.cloud.bigquery.reservation.v1.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_async.AsyncRetry) – 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

The response for

[ReservationService.SplitCapacityCommitment][google.cloud.bigquery.reservation.v1.ReservationService.SplitCapacityCommitment].

Return type

google.cloud.bigquery_reservation_v1.types.SplitCapacityCommitmentResponse

property transport: google.cloud.bigquery_reservation_v1.services.reservation_service.transports.base.ReservationServiceTransport

Returns the transport used by the client instance.

Returns

The transport used by the client instance.

Return type

ReservationServiceTransport

property universe_domain: str

Return the universe domain used by the client instance.

Returns

The universe domain used

by the client instance.

Return type

str

async update_assignment(request: Optional[Union[google.cloud.bigquery_reservation_v1.types.reservation.UpdateAssignmentRequest, dict]] = None, *, assignment: Optional[google.cloud.bigquery_reservation_v1.types.reservation.Assignment] = None, update_mask: Optional[google.protobuf.field_mask_pb2.FieldMask] = None, retry: Optional[Union[google.api_core.retry.retry_unary_async.AsyncRetry, google.api_core.gapic_v1.method._MethodDefault]] = _MethodDefault._DEFAULT_VALUE, timeout: Union[float, object] = _MethodDefault._DEFAULT_VALUE, metadata: Sequence[Tuple[str, str]] = ()) google.cloud.bigquery_reservation_v1.types.reservation.Assignment[source]

Updates an existing assignment.

Only the priority field can be updated.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import bigquery_reservation_v1

async def sample_update_assignment():
    # Create a client
    client = bigquery_reservation_v1.ReservationServiceAsyncClient()

    # Initialize request argument(s)
    request = bigquery_reservation_v1.UpdateAssignmentRequest(
    )

    # Make the request
    response = await client.update_assignment(request=request)

    # Handle the response
    print(response)
Parameters
  • request (Optional[Union[google.cloud.bigquery_reservation_v1.types.UpdateAssignmentRequest, dict]]) – The request object. The request for [ReservationService.UpdateAssignment][google.cloud.bigquery.reservation.v1.ReservationService.UpdateAssignment].

  • assignment (google.cloud.bigquery_reservation_v1.types.Assignment) – Content of the assignment to update. This corresponds to the assignment 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_async.AsyncRetry) – 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

An assignment allows a project to submit jobs of a certain type using slots from the specified reservation.

Return type

google.cloud.bigquery_reservation_v1.types.Assignment

async 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: Optional[Union[google.api_core.retry.retry_unary_async.AsyncRetry, google.api_core.gapic_v1.method._MethodDefault]] = _MethodDefault._DEFAULT_VALUE, timeout: Union[float, object] = _MethodDefault._DEFAULT_VALUE, metadata: Sequence[Tuple[str, str]] = ()) google.cloud.bigquery_reservation_v1.types.reservation.BiReservation[source]

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.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import bigquery_reservation_v1

async def sample_update_bi_reservation():
    # Create a client
    client = bigquery_reservation_v1.ReservationServiceAsyncClient()

    # Initialize request argument(s)
    request = bigquery_reservation_v1.UpdateBiReservationRequest(
    )

    # Make the request
    response = await client.update_bi_reservation(request=request)

    # Handle the response
    print(response)
Parameters
Returns

Represents a BI Reservation.

Return type

google.cloud.bigquery_reservation_v1.types.BiReservation

async 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: Optional[Union[google.api_core.retry.retry_unary_async.AsyncRetry, google.api_core.gapic_v1.method._MethodDefault]] = _MethodDefault._DEFAULT_VALUE, timeout: Union[float, object] = _MethodDefault._DEFAULT_VALUE, metadata: Sequence[Tuple[str, str]] = ()) google.cloud.bigquery_reservation_v1.types.reservation.CapacityCommitment[source]

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.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import bigquery_reservation_v1

async def sample_update_capacity_commitment():
    # Create a client
    client = bigquery_reservation_v1.ReservationServiceAsyncClient()

    # Initialize request argument(s)
    request = bigquery_reservation_v1.UpdateCapacityCommitmentRequest(
    )

    # Make the request
    response = await client.update_capacity_commitment(request=request)

    # Handle the response
    print(response)
Parameters
  • request (Optional[Union[google.cloud.bigquery_reservation_v1.types.UpdateCapacityCommitmentRequest, dict]]) – The request object. The request for [ReservationService.UpdateCapacityCommitment][google.cloud.bigquery.reservation.v1.ReservationService.UpdateCapacityCommitment].

  • capacity_commitment (google.cloud.bigquery_reservation_v1.types.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_async.AsyncRetry) – 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

Capacity 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.

Return type

google.cloud.bigquery_reservation_v1.types.CapacityCommitment

async 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: Optional[Union[google.api_core.retry.retry_unary_async.AsyncRetry, google.api_core.gapic_v1.method._MethodDefault]] = _MethodDefault._DEFAULT_VALUE, timeout: Union[float, object] = _MethodDefault._DEFAULT_VALUE, metadata: Sequence[Tuple[str, str]] = ()) google.cloud.bigquery_reservation_v1.types.reservation.Reservation[source]

Updates an existing reservation resource.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import bigquery_reservation_v1

async def sample_update_reservation():
    # Create a client
    client = bigquery_reservation_v1.ReservationServiceAsyncClient()

    # Initialize request argument(s)
    request = bigquery_reservation_v1.UpdateReservationRequest(
    )

    # Make the request
    response = await client.update_reservation(request=request)

    # Handle the response
    print(response)
Parameters
  • request (Optional[Union[google.cloud.bigquery_reservation_v1.types.UpdateReservationRequest, dict]]) – The request object. The request for [ReservationService.UpdateReservation][google.cloud.bigquery.reservation.v1.ReservationService.UpdateReservation].

  • reservation (google.cloud.bigquery_reservation_v1.types.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_async.AsyncRetry) – 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

A reservation is a mechanism used to guarantee slots to users.

Return type

google.cloud.bigquery_reservation_v1.types.Reservation

class google.cloud.bigquery_reservation_v1.services.reservation_service.ReservationServiceClient(*, credentials: typing.Optional[google.auth.credentials.Credentials] = None, transport: typing.Optional[typing.Union[str, google.cloud.bigquery_reservation_v1.services.reservation_service.transports.base.ReservationServiceTransport, typing.Callable[[...], google.cloud.bigquery_reservation_v1.services.reservation_service.transports.base.ReservationServiceTransport]]] = None, client_options: typing.Optional[typing.Union[google.api_core.client_options.ClientOptions, dict]] = None, client_info: google.api_core.gapic_v1.client_info.ClientInfo = <google.api_core.gapic_v1.client_info.ClientInfo object>)[source]

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.

Instantiates the reservation service client.

Parameters
  • credentials (Optional[google.auth.credentials.Credentials]) – The authorization credentials to attach to requests. These credentials identify the application to the service; if none are specified, the client will attempt to ascertain the credentials from the environment.

  • transport (Optional[Union[str,ReservationServiceTransport,Callable[..., ReservationServiceTransport]]]) – The transport to use, or a Callable that constructs and returns a new transport. If a Callable is given, it will be called with the same set of initialization arguments as used in the ReservationServiceTransport constructor. If set to None, a transport is chosen automatically.

  • client_options (Optional[Union[google.api_core.client_options.ClientOptions, dict]]) –

    Custom options for the client.

    1. The api_endpoint property can be used to override the default endpoint provided by the client when transport is not explicitly provided. Only if this property is not set and transport was not explicitly provided, the endpoint is determined by the GOOGLE_API_USE_MTLS_ENDPOINT environment variable, which have one of the following values: “always” (always use the default mTLS endpoint), “never” (always use the default regular endpoint) and “auto” (auto-switch to the default mTLS endpoint if client certificate is present; this is the default value).

    2. If the GOOGLE_API_USE_CLIENT_CERTIFICATE environment variable is “true”, then the client_cert_source property can be used to provide a client certificate for mTLS transport. If not provided, the default SSL client certificate will be used if present. If GOOGLE_API_USE_CLIENT_CERTIFICATE is “false” or not set, no client certificate will be used.

    3. The universe_domain property can be used to override the default “googleapis.com” universe. Note that the api_endpoint property still takes precedence; and universe_domain is currently not supported for mTLS.

  • client_info (google.api_core.gapic_v1.client_info.ClientInfo) – The client info used to send a user-agent string along with API requests. If None, then default info will be used. Generally, you only need to set this if you’re developing your own client library.

Raises

google.auth.exceptions.MutualTLSChannelError – If mutual TLS transport creation failed for any reason.

__exit__(type, value, traceback)[source]

Releases underlying transport’s resources.

Warning

ONLY use as a context manager if the transport is NOT shared with other clients! Exiting the with block will CLOSE the transport and may cause errors in other clients!

property api_endpoint

Return the API endpoint used by the client instance.

Returns

The API endpoint used by the client instance.

Return type

str

static assignment_path(project: str, location: str, reservation: str, assignment: str) str[source]

Returns a fully-qualified assignment string.

static bi_reservation_path(project: str, location: str) str[source]

Returns a fully-qualified bi_reservation string.

static capacity_commitment_path(project: str, location: str, capacity_commitment: str) str[source]

Returns a fully-qualified capacity_commitment string.

static common_billing_account_path(billing_account: str) str[source]

Returns a fully-qualified billing_account string.

static common_folder_path(folder: str) str[source]

Returns a fully-qualified folder string.

static common_location_path(project: str, location: str) str[source]

Returns a fully-qualified location string.

static common_organization_path(organization: str) str[source]

Returns a fully-qualified organization string.

static common_project_path(project: str) str[source]

Returns a fully-qualified project string.

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: Optional[Union[google.api_core.retry.retry_unary.Retry, google.api_core.gapic_v1.method._MethodDefault]] = _MethodDefault._DEFAULT_VALUE, timeout: Union[float, object] = _MethodDefault._DEFAULT_VALUE, metadata: Sequence[Tuple[str, str]] = ()) google.cloud.bigquery_reservation_v1.types.reservation.Assignment[source]

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.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import bigquery_reservation_v1

def sample_create_assignment():
    # Create a client
    client = bigquery_reservation_v1.ReservationServiceClient()

    # Initialize request argument(s)
    request = bigquery_reservation_v1.CreateAssignmentRequest(
        parent="parent_value",
    )

    # Make the request
    response = client.create_assignment(request=request)

    # Handle the response
    print(response)
Parameters
  • request (Union[google.cloud.bigquery_reservation_v1.types.CreateAssignmentRequest, dict]) – The request object. The request for [ReservationService.CreateAssignment][google.cloud.bigquery.reservation.v1.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 (google.cloud.bigquery_reservation_v1.types.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

An assignment allows a project to submit jobs of a certain type using slots from the specified reservation.

Return type

google.cloud.bigquery_reservation_v1.types.Assignment

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: Optional[Union[google.api_core.retry.retry_unary.Retry, google.api_core.gapic_v1.method._MethodDefault]] = _MethodDefault._DEFAULT_VALUE, timeout: Union[float, object] = _MethodDefault._DEFAULT_VALUE, metadata: Sequence[Tuple[str, str]] = ()) google.cloud.bigquery_reservation_v1.types.reservation.CapacityCommitment[source]

Creates a new capacity commitment resource.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import bigquery_reservation_v1

def sample_create_capacity_commitment():
    # Create a client
    client = bigquery_reservation_v1.ReservationServiceClient()

    # Initialize request argument(s)
    request = bigquery_reservation_v1.CreateCapacityCommitmentRequest(
        parent="parent_value",
    )

    # Make the request
    response = client.create_capacity_commitment(request=request)

    # Handle the response
    print(response)
Parameters
  • request (Union[google.cloud.bigquery_reservation_v1.types.CreateCapacityCommitmentRequest, dict]) – The request object. The request for [ReservationService.CreateCapacityCommitment][google.cloud.bigquery.reservation.v1.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 (google.cloud.bigquery_reservation_v1.types.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

Capacity 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.

Return type

google.cloud.bigquery_reservation_v1.types.CapacityCommitment

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: Optional[Union[google.api_core.retry.retry_unary.Retry, google.api_core.gapic_v1.method._MethodDefault]] = _MethodDefault._DEFAULT_VALUE, timeout: Union[float, object] = _MethodDefault._DEFAULT_VALUE, metadata: Sequence[Tuple[str, str]] = ()) google.cloud.bigquery_reservation_v1.types.reservation.Reservation[source]

Creates a new reservation resource.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import bigquery_reservation_v1

def sample_create_reservation():
    # Create a client
    client = bigquery_reservation_v1.ReservationServiceClient()

    # Initialize request argument(s)
    request = bigquery_reservation_v1.CreateReservationRequest(
        parent="parent_value",
    )

    # Make the request
    response = client.create_reservation(request=request)

    # Handle the response
    print(response)
Parameters
  • request (Union[google.cloud.bigquery_reservation_v1.types.CreateReservationRequest, dict]) – The request object. The request for [ReservationService.CreateReservation][google.cloud.bigquery.reservation.v1.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 (google.cloud.bigquery_reservation_v1.types.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. 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.

    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

A reservation is a mechanism used to guarantee slots to users.

Return type

google.cloud.bigquery_reservation_v1.types.Reservation

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

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.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import bigquery_reservation_v1

def sample_delete_assignment():
    # Create a client
    client = bigquery_reservation_v1.ReservationServiceClient()

    # Initialize request argument(s)
    request = bigquery_reservation_v1.DeleteAssignmentRequest(
        name="name_value",
    )

    # Make the request
    client.delete_assignment(request=request)
Parameters
  • request (Union[google.cloud.bigquery_reservation_v1.types.DeleteAssignmentRequest, dict]) – The request object. The request for [ReservationService.DeleteAssignment][google.cloud.bigquery.reservation.v1.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(request: Optional[Union[google.cloud.bigquery_reservation_v1.types.reservation.DeleteCapacityCommitmentRequest, dict]] = None, *, name: Optional[str] = None, retry: Optional[Union[google.api_core.retry.retry_unary.Retry, google.api_core.gapic_v1.method._MethodDefault]] = _MethodDefault._DEFAULT_VALUE, timeout: Union[float, object] = _MethodDefault._DEFAULT_VALUE, metadata: Sequence[Tuple[str, str]] = ()) None[source]

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.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import bigquery_reservation_v1

def sample_delete_capacity_commitment():
    # Create a client
    client = bigquery_reservation_v1.ReservationServiceClient()

    # Initialize request argument(s)
    request = bigquery_reservation_v1.DeleteCapacityCommitmentRequest(
        name="name_value",
    )

    # Make the request
    client.delete_capacity_commitment(request=request)
Parameters
  • request (Union[google.cloud.bigquery_reservation_v1.types.DeleteCapacityCommitmentRequest, dict]) – The request object. The request for [ReservationService.DeleteCapacityCommitment][google.cloud.bigquery.reservation.v1.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(request: Optional[Union[google.cloud.bigquery_reservation_v1.types.reservation.DeleteReservationRequest, dict]] = None, *, name: Optional[str] = None, retry: Optional[Union[google.api_core.retry.retry_unary.Retry, google.api_core.gapic_v1.method._MethodDefault]] = _MethodDefault._DEFAULT_VALUE, timeout: Union[float, object] = _MethodDefault._DEFAULT_VALUE, metadata: Sequence[Tuple[str, str]] = ()) None[source]

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

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import bigquery_reservation_v1

def sample_delete_reservation():
    # Create a client
    client = bigquery_reservation_v1.ReservationServiceClient()

    # Initialize request argument(s)
    request = bigquery_reservation_v1.DeleteReservationRequest(
        name="name_value",
    )

    # Make the request
    client.delete_reservation(request=request)
Parameters
  • request (Union[google.cloud.bigquery_reservation_v1.types.DeleteReservationRequest, dict]) – The request object. The request for [ReservationService.DeleteReservation][google.cloud.bigquery.reservation.v1.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.

classmethod from_service_account_file(filename: str, *args, **kwargs)[source]
Creates an instance of this client using the provided credentials

file.

Parameters
  • 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

The constructed client.

Return type

ReservationServiceClient

classmethod from_service_account_info(info: dict, *args, **kwargs)[source]
Creates an instance of this client using the provided credentials

info.

Parameters
  • 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

The constructed client.

Return type

ReservationServiceClient

classmethod from_service_account_json(filename: str, *args, **kwargs)
Creates an instance of this client using the provided credentials

file.

Parameters
  • 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

The constructed client.

Return type

ReservationServiceClient

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

Retrieves a BI reservation.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import bigquery_reservation_v1

def sample_get_bi_reservation():
    # Create a client
    client = bigquery_reservation_v1.ReservationServiceClient()

    # Initialize request argument(s)
    request = bigquery_reservation_v1.GetBiReservationRequest(
        name="name_value",
    )

    # Make the request
    response = client.get_bi_reservation(request=request)

    # Handle the response
    print(response)
Parameters
  • 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

Represents a BI Reservation.

Return type

google.cloud.bigquery_reservation_v1.types.BiReservation

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

Returns information about the capacity commitment.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import bigquery_reservation_v1

def sample_get_capacity_commitment():
    # Create a client
    client = bigquery_reservation_v1.ReservationServiceClient()

    # Initialize request argument(s)
    request = bigquery_reservation_v1.GetCapacityCommitmentRequest(
        name="name_value",
    )

    # Make the request
    response = client.get_capacity_commitment(request=request)

    # Handle the response
    print(response)
Parameters
  • request (Union[google.cloud.bigquery_reservation_v1.types.GetCapacityCommitmentRequest, dict]) – The request object. The request for [ReservationService.GetCapacityCommitment][google.cloud.bigquery.reservation.v1.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

Capacity 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.

Return type

google.cloud.bigquery_reservation_v1.types.CapacityCommitment

classmethod get_mtls_endpoint_and_cert_source(client_options: Optional[google.api_core.client_options.ClientOptions] = None)[source]

Deprecated. Return the API endpoint and client cert source for mutual TLS.

The client cert source is determined in the following order: (1) if GOOGLE_API_USE_CLIENT_CERTIFICATE environment variable is not “true”, the client cert source is None. (2) if client_options.client_cert_source is provided, use the provided one; if the default client cert source exists, use the default one; otherwise the client cert source is None.

The API endpoint is determined in the following order: (1) if client_options.api_endpoint if provided, use the provided one. (2) if GOOGLE_API_USE_CLIENT_CERTIFICATE environment variable is “always”, use the default mTLS endpoint; if the environment variable is “never”, use the default API endpoint; otherwise if client cert source exists, use the default mTLS endpoint, otherwise use the default API endpoint.

More details can be found at https://google.aip.dev/auth/4114.

Parameters

client_options (google.api_core.client_options.ClientOptions) – Custom options for the client. Only the api_endpoint and client_cert_source properties may be used in this method.

Returns

returns the API endpoint and the

client cert source to use.

Return type

Tuple[str, Callable[[], Tuple[bytes, bytes]]]

Raises

google.auth.exceptions.MutualTLSChannelError – If any errors happen.

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

Returns information about the reservation.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import bigquery_reservation_v1

def sample_get_reservation():
    # Create a client
    client = bigquery_reservation_v1.ReservationServiceClient()

    # Initialize request argument(s)
    request = bigquery_reservation_v1.GetReservationRequest(
        name="name_value",
    )

    # Make the request
    response = client.get_reservation(request=request)

    # Handle the response
    print(response)
Parameters
  • request (Union[google.cloud.bigquery_reservation_v1.types.GetReservationRequest, dict]) – The request object. The request for [ReservationService.GetReservation][google.cloud.bigquery.reservation.v1.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

A reservation is a mechanism used to guarantee slots to users.

Return type

google.cloud.bigquery_reservation_v1.types.Reservation

list_assignments(request: Optional[Union[google.cloud.bigquery_reservation_v1.types.reservation.ListAssignmentsRequest, dict]] = None, *, parent: Optional[str] = None, retry: Optional[Union[google.api_core.retry.retry_unary.Retry, google.api_core.gapic_v1.method._MethodDefault]] = _MethodDefault._DEFAULT_VALUE, timeout: Union[float, object] = _MethodDefault._DEFAULT_VALUE, metadata: Sequence[Tuple[str, str]] = ()) google.cloud.bigquery_reservation_v1.services.reservation_service.pagers.ListAssignmentsPager[source]

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.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import bigquery_reservation_v1

def sample_list_assignments():
    # Create a client
    client = bigquery_reservation_v1.ReservationServiceClient()

    # Initialize request argument(s)
    request = bigquery_reservation_v1.ListAssignmentsRequest(
        parent="parent_value",
    )

    # Make the request
    page_result = client.list_assignments(request=request)

    # Handle the response
    for response in page_result:
        print(response)
Parameters
  • request (Union[google.cloud.bigquery_reservation_v1.types.ListAssignmentsRequest, dict]) – The request object. The request for [ReservationService.ListAssignments][google.cloud.bigquery.reservation.v1.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

The response for

[ReservationService.ListAssignments][google.cloud.bigquery.reservation.v1.ReservationService.ListAssignments].

Iterating over this object will yield results and resolve additional pages automatically.

Return type

google.cloud.bigquery_reservation_v1.services.reservation_service.pagers.ListAssignmentsPager

list_capacity_commitments(request: Optional[Union[google.cloud.bigquery_reservation_v1.types.reservation.ListCapacityCommitmentsRequest, dict]] = None, *, parent: Optional[str] = None, retry: Optional[Union[google.api_core.retry.retry_unary.Retry, google.api_core.gapic_v1.method._MethodDefault]] = _MethodDefault._DEFAULT_VALUE, timeout: Union[float, object] = _MethodDefault._DEFAULT_VALUE, metadata: Sequence[Tuple[str, str]] = ()) google.cloud.bigquery_reservation_v1.services.reservation_service.pagers.ListCapacityCommitmentsPager[source]

Lists all the capacity commitments for the admin project.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import bigquery_reservation_v1

def sample_list_capacity_commitments():
    # Create a client
    client = bigquery_reservation_v1.ReservationServiceClient()

    # Initialize request argument(s)
    request = bigquery_reservation_v1.ListCapacityCommitmentsRequest(
        parent="parent_value",
    )

    # Make the request
    page_result = client.list_capacity_commitments(request=request)

    # Handle the response
    for response in page_result:
        print(response)
Parameters
  • request (Union[google.cloud.bigquery_reservation_v1.types.ListCapacityCommitmentsRequest, dict]) – The request object. The request for [ReservationService.ListCapacityCommitments][google.cloud.bigquery.reservation.v1.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

The response for

[ReservationService.ListCapacityCommitments][google.cloud.bigquery.reservation.v1.ReservationService.ListCapacityCommitments].

Iterating over this object will yield results and resolve additional pages automatically.

Return type

google.cloud.bigquery_reservation_v1.services.reservation_service.pagers.ListCapacityCommitmentsPager

list_reservations(request: Optional[Union[google.cloud.bigquery_reservation_v1.types.reservation.ListReservationsRequest, dict]] = None, *, parent: Optional[str] = None, retry: Optional[Union[google.api_core.retry.retry_unary.Retry, google.api_core.gapic_v1.method._MethodDefault]] = _MethodDefault._DEFAULT_VALUE, timeout: Union[float, object] = _MethodDefault._DEFAULT_VALUE, metadata: Sequence[Tuple[str, str]] = ()) google.cloud.bigquery_reservation_v1.services.reservation_service.pagers.ListReservationsPager[source]

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

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import bigquery_reservation_v1

def sample_list_reservations():
    # Create a client
    client = bigquery_reservation_v1.ReservationServiceClient()

    # Initialize request argument(s)
    request = bigquery_reservation_v1.ListReservationsRequest(
        parent="parent_value",
    )

    # Make the request
    page_result = client.list_reservations(request=request)

    # Handle the response
    for response in page_result:
        print(response)
Parameters
  • request (Union[google.cloud.bigquery_reservation_v1.types.ListReservationsRequest, dict]) – The request object. The request for [ReservationService.ListReservations][google.cloud.bigquery.reservation.v1.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

The response for

[ReservationService.ListReservations][google.cloud.bigquery.reservation.v1.ReservationService.ListReservations].

Iterating over this object will yield results and resolve additional pages automatically.

Return type

google.cloud.bigquery_reservation_v1.services.reservation_service.pagers.ListReservationsPager

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

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.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import bigquery_reservation_v1

def sample_merge_capacity_commitments():
    # Create a client
    client = bigquery_reservation_v1.ReservationServiceClient()

    # Initialize request argument(s)
    request = bigquery_reservation_v1.MergeCapacityCommitmentsRequest(
    )

    # Make the request
    response = client.merge_capacity_commitments(request=request)

    # Handle the response
    print(response)
Parameters
  • request (Union[google.cloud.bigquery_reservation_v1.types.MergeCapacityCommitmentsRequest, dict]) – The request object. The request for [ReservationService.MergeCapacityCommitments][google.cloud.bigquery.reservation.v1.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 (MutableSequence[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

Capacity 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.

Return type

google.cloud.bigquery_reservation_v1.types.CapacityCommitment

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: Optional[Union[google.api_core.retry.retry_unary.Retry, google.api_core.gapic_v1.method._MethodDefault]] = _MethodDefault._DEFAULT_VALUE, timeout: Union[float, object] = _MethodDefault._DEFAULT_VALUE, metadata: Sequence[Tuple[str, str]] = ()) google.cloud.bigquery_reservation_v1.types.reservation.Assignment[source]

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.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import bigquery_reservation_v1

def sample_move_assignment():
    # Create a client
    client = bigquery_reservation_v1.ReservationServiceClient()

    # Initialize request argument(s)
    request = bigquery_reservation_v1.MoveAssignmentRequest(
        name="name_value",
    )

    # Make the request
    response = client.move_assignment(request=request)

    # Handle the response
    print(response)
Parameters
  • request (Union[google.cloud.bigquery_reservation_v1.types.MoveAssignmentRequest, dict]) –

    The request object. The request for [ReservationService.MoveAssignment][google.cloud.bigquery.reservation.v1.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

An assignment allows a project to submit jobs of a certain type using slots from the specified reservation.

Return type

google.cloud.bigquery_reservation_v1.types.Assignment

static parse_assignment_path(path: str) Dict[str, str][source]

Parses a assignment path into its component segments.

static parse_bi_reservation_path(path: str) Dict[str, str][source]

Parses a bi_reservation path into its component segments.

static parse_capacity_commitment_path(path: str) Dict[str, str][source]

Parses a capacity_commitment path into its component segments.

static parse_common_billing_account_path(path: str) Dict[str, str][source]

Parse a billing_account path into its component segments.

static parse_common_folder_path(path: str) Dict[str, str][source]

Parse a folder path into its component segments.

static parse_common_location_path(path: str) Dict[str, str][source]

Parse a location path into its component segments.

static parse_common_organization_path(path: str) Dict[str, str][source]

Parse a organization path into its component segments.

static parse_common_project_path(path: str) Dict[str, str][source]

Parse a project path into its component segments.

static parse_reservation_path(path: str) Dict[str, str][source]

Parses a reservation path into its component segments.

static reservation_path(project: str, location: str, reservation: str) str[source]

Returns a fully-qualified reservation string.

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: Optional[Union[google.api_core.retry.retry_unary.Retry, google.api_core.gapic_v1.method._MethodDefault]] = _MethodDefault._DEFAULT_VALUE, timeout: Union[float, object] = _MethodDefault._DEFAULT_VALUE, metadata: Sequence[Tuple[str, str]] = ()) google.cloud.bigquery_reservation_v1.services.reservation_service.pagers.SearchAllAssignmentsPager[source]

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/*.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import bigquery_reservation_v1

def sample_search_all_assignments():
    # Create a client
    client = bigquery_reservation_v1.ReservationServiceClient()

    # Initialize request argument(s)
    request = bigquery_reservation_v1.SearchAllAssignmentsRequest(
        parent="parent_value",
    )

    # Make the request
    page_result = client.search_all_assignments(request=request)

    # Handle the response
    for response in page_result:
        print(response)
Parameters
  • request (Union[google.cloud.bigquery_reservation_v1.types.SearchAllAssignmentsRequest, dict]) – The request object. The request for [ReservationService.SearchAllAssignments][google.cloud.bigquery.reservation.v1.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

The response for

[ReservationService.SearchAllAssignments][google.cloud.bigquery.reservation.v1.ReservationService.SearchAllAssignments].

Iterating over this object will yield results and resolve additional pages automatically.

Return type

google.cloud.bigquery_reservation_v1.services.reservation_service.pagers.SearchAllAssignmentsPager

search_assignments(request: Optional[Union[google.cloud.bigquery_reservation_v1.types.reservation.SearchAssignmentsRequest, dict]] = None, *, parent: Optional[str] = None, query: Optional[str] = None, retry: Optional[Union[google.api_core.retry.retry_unary.Retry, google.api_core.gapic_v1.method._MethodDefault]] = _MethodDefault._DEFAULT_VALUE, timeout: Union[float, object] = _MethodDefault._DEFAULT_VALUE, metadata: Sequence[Tuple[str, str]] = ()) google.cloud.bigquery_reservation_v1.services.reservation_service.pagers.SearchAssignmentsPager[source]

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.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import bigquery_reservation_v1

def sample_search_assignments():
    # Create a client
    client = bigquery_reservation_v1.ReservationServiceClient()

    # Initialize request argument(s)
    request = bigquery_reservation_v1.SearchAssignmentsRequest(
        parent="parent_value",
    )

    # Make the request
    page_result = client.search_assignments(request=request)

    # Handle the response
    for response in page_result:
        print(response)
Parameters
  • request (Union[google.cloud.bigquery_reservation_v1.types.SearchAssignmentsRequest, dict]) – The request object. The request for [ReservationService.SearchAssignments][google.cloud.bigquery.reservation.v1.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

The response for

[ReservationService.SearchAssignments][google.cloud.bigquery.reservation.v1.ReservationService.SearchAssignments].

Iterating over this object will yield results and resolve additional pages automatically.

Return type

google.cloud.bigquery_reservation_v1.services.reservation_service.pagers.SearchAssignmentsPager

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: Optional[Union[google.api_core.retry.retry_unary.Retry, google.api_core.gapic_v1.method._MethodDefault]] = _MethodDefault._DEFAULT_VALUE, timeout: Union[float, object] = _MethodDefault._DEFAULT_VALUE, metadata: Sequence[Tuple[str, str]] = ()) google.cloud.bigquery_reservation_v1.types.reservation.SplitCapacityCommitmentResponse[source]

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.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import bigquery_reservation_v1

def sample_split_capacity_commitment():
    # Create a client
    client = bigquery_reservation_v1.ReservationServiceClient()

    # Initialize request argument(s)
    request = bigquery_reservation_v1.SplitCapacityCommitmentRequest(
        name="name_value",
    )

    # Make the request
    response = client.split_capacity_commitment(request=request)

    # Handle the response
    print(response)
Parameters
  • request (Union[google.cloud.bigquery_reservation_v1.types.SplitCapacityCommitmentRequest, dict]) – The request object. The request for [ReservationService.SplitCapacityCommitment][google.cloud.bigquery.reservation.v1.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

The response for

[ReservationService.SplitCapacityCommitment][google.cloud.bigquery.reservation.v1.ReservationService.SplitCapacityCommitment].

Return type

google.cloud.bigquery_reservation_v1.types.SplitCapacityCommitmentResponse

property transport: google.cloud.bigquery_reservation_v1.services.reservation_service.transports.base.ReservationServiceTransport

Returns the transport used by the client instance.

Returns

The transport used by the client

instance.

Return type

ReservationServiceTransport

property universe_domain: str

Return the universe domain used by the client instance.

Returns

The universe domain used by the client instance.

Return type

str

update_assignment(request: Optional[Union[google.cloud.bigquery_reservation_v1.types.reservation.UpdateAssignmentRequest, dict]] = None, *, assignment: Optional[google.cloud.bigquery_reservation_v1.types.reservation.Assignment] = None, update_mask: Optional[google.protobuf.field_mask_pb2.FieldMask] = None, retry: Optional[Union[google.api_core.retry.retry_unary.Retry, google.api_core.gapic_v1.method._MethodDefault]] = _MethodDefault._DEFAULT_VALUE, timeout: Union[float, object] = _MethodDefault._DEFAULT_VALUE, metadata: Sequence[Tuple[str, str]] = ()) google.cloud.bigquery_reservation_v1.types.reservation.Assignment[source]

Updates an existing assignment.

Only the priority field can be updated.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import bigquery_reservation_v1

def sample_update_assignment():
    # Create a client
    client = bigquery_reservation_v1.ReservationServiceClient()

    # Initialize request argument(s)
    request = bigquery_reservation_v1.UpdateAssignmentRequest(
    )

    # Make the request
    response = client.update_assignment(request=request)

    # Handle the response
    print(response)
Parameters
Returns

An assignment allows a project to submit jobs of a certain type using slots from the specified reservation.

Return type

google.cloud.bigquery_reservation_v1.types.Assignment

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: Optional[Union[google.api_core.retry.retry_unary.Retry, google.api_core.gapic_v1.method._MethodDefault]] = _MethodDefault._DEFAULT_VALUE, timeout: Union[float, object] = _MethodDefault._DEFAULT_VALUE, metadata: Sequence[Tuple[str, str]] = ()) google.cloud.bigquery_reservation_v1.types.reservation.BiReservation[source]

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.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import bigquery_reservation_v1

def sample_update_bi_reservation():
    # Create a client
    client = bigquery_reservation_v1.ReservationServiceClient()

    # Initialize request argument(s)
    request = bigquery_reservation_v1.UpdateBiReservationRequest(
    )

    # Make the request
    response = client.update_bi_reservation(request=request)

    # Handle the response
    print(response)
Parameters
Returns

Represents a BI Reservation.

Return type

google.cloud.bigquery_reservation_v1.types.BiReservation

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: Optional[Union[google.api_core.retry.retry_unary.Retry, google.api_core.gapic_v1.method._MethodDefault]] = _MethodDefault._DEFAULT_VALUE, timeout: Union[float, object] = _MethodDefault._DEFAULT_VALUE, metadata: Sequence[Tuple[str, str]] = ()) google.cloud.bigquery_reservation_v1.types.reservation.CapacityCommitment[source]

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.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import bigquery_reservation_v1

def sample_update_capacity_commitment():
    # Create a client
    client = bigquery_reservation_v1.ReservationServiceClient()

    # Initialize request argument(s)
    request = bigquery_reservation_v1.UpdateCapacityCommitmentRequest(
    )

    # Make the request
    response = client.update_capacity_commitment(request=request)

    # Handle the response
    print(response)
Parameters
Returns

Capacity 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.

Return type

google.cloud.bigquery_reservation_v1.types.CapacityCommitment

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: Optional[Union[google.api_core.retry.retry_unary.Retry, google.api_core.gapic_v1.method._MethodDefault]] = _MethodDefault._DEFAULT_VALUE, timeout: Union[float, object] = _MethodDefault._DEFAULT_VALUE, metadata: Sequence[Tuple[str, str]] = ()) google.cloud.bigquery_reservation_v1.types.reservation.Reservation[source]

Updates an existing reservation resource.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import bigquery_reservation_v1

def sample_update_reservation():
    # Create a client
    client = bigquery_reservation_v1.ReservationServiceClient()

    # Initialize request argument(s)
    request = bigquery_reservation_v1.UpdateReservationRequest(
    )

    # Make the request
    response = client.update_reservation(request=request)

    # Handle the response
    print(response)
Parameters
Returns

A reservation is a mechanism used to guarantee slots to users.

Return type

google.cloud.bigquery_reservation_v1.types.Reservation

class google.cloud.bigquery_reservation_v1.services.reservation_service.pagers.ListAssignmentsAsyncPager(method: Callable[[...], Awaitable[google.cloud.bigquery_reservation_v1.types.reservation.ListAssignmentsResponse]], request: google.cloud.bigquery_reservation_v1.types.reservation.ListAssignmentsRequest, response: google.cloud.bigquery_reservation_v1.types.reservation.ListAssignmentsResponse, *, retry: Optional[Union[google.api_core.retry.retry_unary_async.AsyncRetry, google.api_core.gapic_v1.method._MethodDefault]] = _MethodDefault._DEFAULT_VALUE, timeout: Union[float, object] = _MethodDefault._DEFAULT_VALUE, metadata: Sequence[Tuple[str, str]] = ())[source]

A pager for iterating through list_assignments requests.

This class thinly wraps an initial google.cloud.bigquery_reservation_v1.types.ListAssignmentsResponse object, and provides an __aiter__ method to iterate through its assignments field.

If there are more pages, the __aiter__ method will make additional ListAssignments requests and continue to iterate through the assignments field on the corresponding responses.

All the usual google.cloud.bigquery_reservation_v1.types.ListAssignmentsResponse attributes are available on the pager. If multiple requests are made, only the most recent response is retained, and thus used for attribute lookup.

Instantiates the pager.

Parameters
class google.cloud.bigquery_reservation_v1.services.reservation_service.pagers.ListAssignmentsPager(method: Callable[[...], google.cloud.bigquery_reservation_v1.types.reservation.ListAssignmentsResponse], request: google.cloud.bigquery_reservation_v1.types.reservation.ListAssignmentsRequest, response: google.cloud.bigquery_reservation_v1.types.reservation.ListAssignmentsResponse, *, retry: Optional[Union[google.api_core.retry.retry_unary.Retry, google.api_core.gapic_v1.method._MethodDefault]] = _MethodDefault._DEFAULT_VALUE, timeout: Union[float, object] = _MethodDefault._DEFAULT_VALUE, metadata: Sequence[Tuple[str, str]] = ())[source]

A pager for iterating through list_assignments requests.

This class thinly wraps an initial google.cloud.bigquery_reservation_v1.types.ListAssignmentsResponse object, and provides an __iter__ method to iterate through its assignments field.

If there are more pages, the __iter__ method will make additional ListAssignments requests and continue to iterate through the assignments field on the corresponding responses.

All the usual google.cloud.bigquery_reservation_v1.types.ListAssignmentsResponse attributes are available on the pager. If multiple requests are made, only the most recent response is retained, and thus used for attribute lookup.

Instantiate the pager.

Parameters
class google.cloud.bigquery_reservation_v1.services.reservation_service.pagers.ListCapacityCommitmentsAsyncPager(method: Callable[[...], Awaitable[google.cloud.bigquery_reservation_v1.types.reservation.ListCapacityCommitmentsResponse]], request: google.cloud.bigquery_reservation_v1.types.reservation.ListCapacityCommitmentsRequest, response: google.cloud.bigquery_reservation_v1.types.reservation.ListCapacityCommitmentsResponse, *, retry: Optional[Union[google.api_core.retry.retry_unary_async.AsyncRetry, google.api_core.gapic_v1.method._MethodDefault]] = _MethodDefault._DEFAULT_VALUE, timeout: Union[float, object] = _MethodDefault._DEFAULT_VALUE, metadata: Sequence[Tuple[str, str]] = ())[source]

A pager for iterating through list_capacity_commitments requests.

This class thinly wraps an initial google.cloud.bigquery_reservation_v1.types.ListCapacityCommitmentsResponse object, and provides an __aiter__ method to iterate through its capacity_commitments field.

If there are more pages, the __aiter__ method will make additional ListCapacityCommitments requests and continue to iterate through the capacity_commitments field on the corresponding responses.

All the usual google.cloud.bigquery_reservation_v1.types.ListCapacityCommitmentsResponse attributes are available on the pager. If multiple requests are made, only the most recent response is retained, and thus used for attribute lookup.

Instantiates the pager.

Parameters
class google.cloud.bigquery_reservation_v1.services.reservation_service.pagers.ListCapacityCommitmentsPager(method: Callable[[...], google.cloud.bigquery_reservation_v1.types.reservation.ListCapacityCommitmentsResponse], request: google.cloud.bigquery_reservation_v1.types.reservation.ListCapacityCommitmentsRequest, response: google.cloud.bigquery_reservation_v1.types.reservation.ListCapacityCommitmentsResponse, *, retry: Optional[Union[google.api_core.retry.retry_unary.Retry, google.api_core.gapic_v1.method._MethodDefault]] = _MethodDefault._DEFAULT_VALUE, timeout: Union[float, object] = _MethodDefault._DEFAULT_VALUE, metadata: Sequence[Tuple[str, str]] = ())[source]

A pager for iterating through list_capacity_commitments requests.

This class thinly wraps an initial google.cloud.bigquery_reservation_v1.types.ListCapacityCommitmentsResponse object, and provides an __iter__ method to iterate through its capacity_commitments field.

If there are more pages, the __iter__ method will make additional ListCapacityCommitments requests and continue to iterate through the capacity_commitments field on the corresponding responses.

All the usual google.cloud.bigquery_reservation_v1.types.ListCapacityCommitmentsResponse attributes are available on the pager. If multiple requests are made, only the most recent response is retained, and thus used for attribute lookup.

Instantiate the pager.

Parameters
class google.cloud.bigquery_reservation_v1.services.reservation_service.pagers.ListReservationsAsyncPager(method: Callable[[...], Awaitable[google.cloud.bigquery_reservation_v1.types.reservation.ListReservationsResponse]], request: google.cloud.bigquery_reservation_v1.types.reservation.ListReservationsRequest, response: google.cloud.bigquery_reservation_v1.types.reservation.ListReservationsResponse, *, retry: Optional[Union[google.api_core.retry.retry_unary_async.AsyncRetry, google.api_core.gapic_v1.method._MethodDefault]] = _MethodDefault._DEFAULT_VALUE, timeout: Union[float, object] = _MethodDefault._DEFAULT_VALUE, metadata: Sequence[Tuple[str, str]] = ())[source]

A pager for iterating through list_reservations requests.

This class thinly wraps an initial google.cloud.bigquery_reservation_v1.types.ListReservationsResponse object, and provides an __aiter__ method to iterate through its reservations field.

If there are more pages, the __aiter__ method will make additional ListReservations requests and continue to iterate through the reservations field on the corresponding responses.

All the usual google.cloud.bigquery_reservation_v1.types.ListReservationsResponse attributes are available on the pager. If multiple requests are made, only the most recent response is retained, and thus used for attribute lookup.

Instantiates the pager.

Parameters
class google.cloud.bigquery_reservation_v1.services.reservation_service.pagers.ListReservationsPager(method: Callable[[...], google.cloud.bigquery_reservation_v1.types.reservation.ListReservationsResponse], request: google.cloud.bigquery_reservation_v1.types.reservation.ListReservationsRequest, response: google.cloud.bigquery_reservation_v1.types.reservation.ListReservationsResponse, *, retry: Optional[Union[google.api_core.retry.retry_unary.Retry, google.api_core.gapic_v1.method._MethodDefault]] = _MethodDefault._DEFAULT_VALUE, timeout: Union[float, object] = _MethodDefault._DEFAULT_VALUE, metadata: Sequence[Tuple[str, str]] = ())[source]

A pager for iterating through list_reservations requests.

This class thinly wraps an initial google.cloud.bigquery_reservation_v1.types.ListReservationsResponse object, and provides an __iter__ method to iterate through its reservations field.

If there are more pages, the __iter__ method will make additional ListReservations requests and continue to iterate through the reservations field on the corresponding responses.

All the usual google.cloud.bigquery_reservation_v1.types.ListReservationsResponse attributes are available on the pager. If multiple requests are made, only the most recent response is retained, and thus used for attribute lookup.

Instantiate the pager.

Parameters
class google.cloud.bigquery_reservation_v1.services.reservation_service.pagers.SearchAllAssignmentsAsyncPager(method: Callable[[...], Awaitable[google.cloud.bigquery_reservation_v1.types.reservation.SearchAllAssignmentsResponse]], request: google.cloud.bigquery_reservation_v1.types.reservation.SearchAllAssignmentsRequest, response: google.cloud.bigquery_reservation_v1.types.reservation.SearchAllAssignmentsResponse, *, retry: Optional[Union[google.api_core.retry.retry_unary_async.AsyncRetry, google.api_core.gapic_v1.method._MethodDefault]] = _MethodDefault._DEFAULT_VALUE, timeout: Union[float, object] = _MethodDefault._DEFAULT_VALUE, metadata: Sequence[Tuple[str, str]] = ())[source]

A pager for iterating through search_all_assignments requests.

This class thinly wraps an initial google.cloud.bigquery_reservation_v1.types.SearchAllAssignmentsResponse object, and provides an __aiter__ method to iterate through its assignments field.

If there are more pages, the __aiter__ method will make additional SearchAllAssignments requests and continue to iterate through the assignments field on the corresponding responses.

All the usual google.cloud.bigquery_reservation_v1.types.SearchAllAssignmentsResponse attributes are available on the pager. If multiple requests are made, only the most recent response is retained, and thus used for attribute lookup.

Instantiates the pager.

Parameters
class google.cloud.bigquery_reservation_v1.services.reservation_service.pagers.SearchAllAssignmentsPager(method: Callable[[...], google.cloud.bigquery_reservation_v1.types.reservation.SearchAllAssignmentsResponse], request: google.cloud.bigquery_reservation_v1.types.reservation.SearchAllAssignmentsRequest, response: google.cloud.bigquery_reservation_v1.types.reservation.SearchAllAssignmentsResponse, *, retry: Optional[Union[google.api_core.retry.retry_unary.Retry, google.api_core.gapic_v1.method._MethodDefault]] = _MethodDefault._DEFAULT_VALUE, timeout: Union[float, object] = _MethodDefault._DEFAULT_VALUE, metadata: Sequence[Tuple[str, str]] = ())[source]

A pager for iterating through search_all_assignments requests.

This class thinly wraps an initial google.cloud.bigquery_reservation_v1.types.SearchAllAssignmentsResponse object, and provides an __iter__ method to iterate through its assignments field.

If there are more pages, the __iter__ method will make additional SearchAllAssignments requests and continue to iterate through the assignments field on the corresponding responses.

All the usual google.cloud.bigquery_reservation_v1.types.SearchAllAssignmentsResponse attributes are available on the pager. If multiple requests are made, only the most recent response is retained, and thus used for attribute lookup.

Instantiate the pager.

Parameters
class google.cloud.bigquery_reservation_v1.services.reservation_service.pagers.SearchAssignmentsAsyncPager(method: Callable[[...], Awaitable[google.cloud.bigquery_reservation_v1.types.reservation.SearchAssignmentsResponse]], request: google.cloud.bigquery_reservation_v1.types.reservation.SearchAssignmentsRequest, response: google.cloud.bigquery_reservation_v1.types.reservation.SearchAssignmentsResponse, *, retry: Optional[Union[google.api_core.retry.retry_unary_async.AsyncRetry, google.api_core.gapic_v1.method._MethodDefault]] = _MethodDefault._DEFAULT_VALUE, timeout: Union[float, object] = _MethodDefault._DEFAULT_VALUE, metadata: Sequence[Tuple[str, str]] = ())[source]

A pager for iterating through search_assignments requests.

This class thinly wraps an initial google.cloud.bigquery_reservation_v1.types.SearchAssignmentsResponse object, and provides an __aiter__ method to iterate through its assignments field.

If there are more pages, the __aiter__ method will make additional SearchAssignments requests and continue to iterate through the assignments field on the corresponding responses.

All the usual google.cloud.bigquery_reservation_v1.types.SearchAssignmentsResponse attributes are available on the pager. If multiple requests are made, only the most recent response is retained, and thus used for attribute lookup.

Instantiates the pager.

Parameters
class google.cloud.bigquery_reservation_v1.services.reservation_service.pagers.SearchAssignmentsPager(method: Callable[[...], google.cloud.bigquery_reservation_v1.types.reservation.SearchAssignmentsResponse], request: google.cloud.bigquery_reservation_v1.types.reservation.SearchAssignmentsRequest, response: google.cloud.bigquery_reservation_v1.types.reservation.SearchAssignmentsResponse, *, retry: Optional[Union[google.api_core.retry.retry_unary.Retry, google.api_core.gapic_v1.method._MethodDefault]] = _MethodDefault._DEFAULT_VALUE, timeout: Union[float, object] = _MethodDefault._DEFAULT_VALUE, metadata: Sequence[Tuple[str, str]] = ())[source]

A pager for iterating through search_assignments requests.

This class thinly wraps an initial google.cloud.bigquery_reservation_v1.types.SearchAssignmentsResponse object, and provides an __iter__ method to iterate through its assignments field.

If there are more pages, the __iter__ method will make additional SearchAssignments requests and continue to iterate through the assignments field on the corresponding responses.

All the usual google.cloud.bigquery_reservation_v1.types.SearchAssignmentsResponse attributes are available on the pager. If multiple requests are made, only the most recent response is retained, and thus used for attribute lookup.

Instantiate the pager.

Parameters