On January 1, 2020 this library will no longer support Python 2 on the latest released version. Previously released library versions will continue to be available. For more information please visit Python 2 support on Google Cloud.

Types for Google Cloud Bigquery Reservation API

class google.cloud.bigquery.reservation_v1.types.Reservation(mapping=None, **kwargs)[source]

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

name

The resource name of the reservation, e.g., projects/*/locations/*/reservations/team1-prod.

Type

str

slot_capacity

Minimum slots available to this reservation. A slot is a unit of computational power in BigQuery, and serves as the unit of parallelism.

Queries using this reservation might use more slots during runtime if ignore_idle_slots is set to false.

If the new reservation’s slot capacity exceed the parent’s slot capacity or if total slot capacity of the new reservation and its siblings exceeds the parent’s slot capacity, the request will fail with google.rpc.Code.RESOURCE_EXHAUSTED.

Type

int

ignore_idle_slots

If false, any query using this reservation will use idle slots from other reservations within the same admin project. If true, a query using this reservation will execute with the slot capacity specified above at most.

Type

bool

class google.cloud.bigquery.reservation_v1.types.CapacityCommitment(mapping=None, **kwargs)[source]

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.

name

Output only. The resource name of the capacity commitment, e.g., projects/myproject/locations/US/capacityCommitments/123

Type

str

slot_count

Number of slots in this commitment.

Type

int

plan

Capacity commitment commitment plan.

Type

CommitmentPlan

state

Output only. State of the commitment.

Type

State

commitment_end_time

Output only. The end of the current commitment period. It is applicable only for ACTIVE capacity commitments.

Type

Timestamp

failure_status

Output only. For FAILED commitment plan, provides the reason of failure.

Type

Status

renewal_plan

The plan this capacity commitment is converted to after commitment_end_time passes. Once the plan is changed, committed period is extended according to commitment plan. Only applicable for ANNUAL and TRIAL commitments.

Type

CommitmentPlan

class CommitmentPlan[source]

Commitment plan defines the current committed period. Capacity commitment cannot be deleted during it’s committed period.

class State[source]

Capacity commitment can either become ACTIVE right away or transition from PENDING to ACTIVE or FAILED.

class google.cloud.bigquery.reservation_v1.types.CreateReservationRequest(mapping=None, **kwargs)[source]

The request for [ReservationService.CreateReservation][google.cloud.bigquery.reservation.v1.ReservationService.CreateReservation].

parent

Required. Project, location. E.g., projects/myproject/locations/US

Type

str

reservation_id

The reservation ID. This field must only contain lower case alphanumeric characters or dash. Max length is 64 characters.

Type

str

reservation

Definition of the new reservation to create.

Type

Reservation

class google.cloud.bigquery.reservation_v1.types.ListReservationsRequest(mapping=None, **kwargs)[source]

The request for [ReservationService.ListReservations][google.cloud.bigquery.reservation.v1.ReservationService.ListReservations].

parent

Required. The parent resource name containing project and location, e.g.: “projects/myproject/locations/US”.

Type

str

page_size

The maximum number of items to return per page.

Type

int

page_token

The next_page_token value returned from a previous List request, if any.

Type

str

class google.cloud.bigquery.reservation_v1.types.ListReservationsResponse(mapping=None, **kwargs)[source]

The response for [ReservationService.ListReservations][google.cloud.bigquery.reservation.v1.ReservationService.ListReservations].

reservations

List of reservations visible to the user.

Type

Sequence[Reservation]

next_page_token

Token to retrieve the next page of results, or empty if there are no more results in the list.

Type

str

class google.cloud.bigquery.reservation_v1.types.GetReservationRequest(mapping=None, **kwargs)[source]

The request for [ReservationService.GetReservation][google.cloud.bigquery.reservation.v1.ReservationService.GetReservation].

name

Required. Resource name of the reservation to retrieve. E.g., projects/myproject/locations/US/reservations/team1-prod

Type

str

class google.cloud.bigquery.reservation_v1.types.DeleteReservationRequest(mapping=None, **kwargs)[source]

The request for [ReservationService.DeleteReservation][google.cloud.bigquery.reservation.v1.ReservationService.DeleteReservation].

name

Required. Resource name of the reservation to retrieve. E.g., projects/myproject/locations/US/reservations/team1-prod

Type

str

class google.cloud.bigquery.reservation_v1.types.UpdateReservationRequest(mapping=None, **kwargs)[source]

The request for [ReservationService.UpdateReservation][google.cloud.bigquery.reservation.v1.ReservationService.UpdateReservation].

reservation

Content of the reservation to update.

Type

Reservation

update_mask

Standard field mask for the set of fields to be updated.

Type

FieldMask

class google.cloud.bigquery.reservation_v1.types.CreateCapacityCommitmentRequest(mapping=None, **kwargs)[source]

The request for [ReservationService.CreateCapacityCommitment][google.cloud.bigquery.reservation.v1.ReservationService.CreateCapacityCommitment].

parent

Required. Resource name of the parent reservation. E.g., projects/myproject/locations/US

Type

str

capacity_commitment

Content of the capacity commitment to create.

Type

CapacityCommitment

enforce_single_admin_project_per_org

If true, fail the request if another project in the organization has a capacity commitment.

Type

bool

class google.cloud.bigquery.reservation_v1.types.ListCapacityCommitmentsRequest(mapping=None, **kwargs)[source]

The request for [ReservationService.ListCapacityCommitments][google.cloud.bigquery.reservation.v1.ReservationService.ListCapacityCommitments].

parent

Required. Resource name of the parent reservation. E.g., projects/myproject/locations/US

Type

str

page_size

The maximum number of items to return.

Type

int

page_token

The next_page_token value returned from a previous List request, if any.

Type

str

class google.cloud.bigquery.reservation_v1.types.ListCapacityCommitmentsResponse(mapping=None, **kwargs)[source]

The response for [ReservationService.ListCapacityCommitments][google.cloud.bigquery.reservation.v1.ReservationService.ListCapacityCommitments].

capacity_commitments

List of capacity commitments visible to the user.

Type

Sequence[CapacityCommitment]

next_page_token

Token to retrieve the next page of results, or empty if there are no more results in the list.

Type

str

class google.cloud.bigquery.reservation_v1.types.GetCapacityCommitmentRequest(mapping=None, **kwargs)[source]

The request for [ReservationService.GetCapacityCommitment][google.cloud.bigquery.reservation.v1.ReservationService.GetCapacityCommitment].

name

Required. Resource name of the capacity commitment to retrieve. E.g., projects/myproject/locations/US/capacityCommitments/123

Type

str

class google.cloud.bigquery.reservation_v1.types.DeleteCapacityCommitmentRequest(mapping=None, **kwargs)[source]

The request for [ReservationService.DeleteCapacityCommitment][google.cloud.bigquery.reservation.v1.ReservationService.DeleteCapacityCommitment].

name

Required. Resource name of the capacity commitment to delete. E.g., projects/myproject/locations/US/capacityCommitments/123

Type

str

class google.cloud.bigquery.reservation_v1.types.UpdateCapacityCommitmentRequest(mapping=None, **kwargs)[source]

The request for [ReservationService.UpdateCapacityCommitment][google.cloud.bigquery.reservation.v1.ReservationService.UpdateCapacityCommitment].

capacity_commitment

Content of the capacity commitment to update.

Type

CapacityCommitment

update_mask

Standard field mask for the set of fields to be updated.

Type

FieldMask

class google.cloud.bigquery.reservation_v1.types.SplitCapacityCommitmentRequest(mapping=None, **kwargs)[source]

The request for [ReservationService.SplitCapacityCommitment][google.cloud.bigquery.reservation.v1.ReservationService.SplitCapacityCommitment].

name

Required. The resource name e.g.,: projects/myproject/locations/US/capacityCommitments/123

Type

str

slot_count

Number of slots in the capacity commitment after the split.

Type

int

class google.cloud.bigquery.reservation_v1.types.SplitCapacityCommitmentResponse(mapping=None, **kwargs)[source]

The response for [ReservationService.SplitCapacityCommitment][google.cloud.bigquery.reservation.v1.ReservationService.SplitCapacityCommitment].

first

First capacity commitment, result of a split.

Type

CapacityCommitment

second

Second capacity commitment, result of a split.

Type

CapacityCommitment

class google.cloud.bigquery.reservation_v1.types.MergeCapacityCommitmentsRequest(mapping=None, **kwargs)[source]

The request for [ReservationService.MergeCapacityCommitments][google.cloud.bigquery.reservation.v1.ReservationService.MergeCapacityCommitments].

parent

Parent resource that identifies admin project and location e.g., projects/myproject/locations/us

Type

str

capacity_commitment_ids

Ids of capacity commitments to merge. These capacity commitments must exist under admin project and location specified in the parent.

Type

Sequence[str]

class google.cloud.bigquery.reservation_v1.types.Assignment(mapping=None, **kwargs)[source]

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

name

Output only. Name of the resource. E.g.: projects/myproject/locations/US/reservations/team1-prod/assignments/123.

Type

str

assignee

The resource which will use the reservation. E.g. projects/myproject, folders/123, or organizations/456.

Type

str

job_type

Which type of jobs will use the reservation.

Type

JobType

state

Output only. State of the assignment.

Type

State

class JobType[source]

Types of job, which could be specified when using the reservation.

class State[source]

Assignment will remain in PENDING state if no active capacity commitment is present. It will become ACTIVE when some capacity commitment becomes active.

class google.cloud.bigquery.reservation_v1.types.CreateAssignmentRequest(mapping=None, **kwargs)[source]

The request for [ReservationService.CreateAssignment][google.cloud.bigquery.reservation.v1.ReservationService.CreateAssignment]. Note: “bigquery.reservationAssignments.create” permission is required on the related assignee.

parent

Required. The parent resource name of the assignment E.g. projects/myproject/locations/US/reservations/team1-prod

Type

str

assignment

Assignment resource to create.

Type

Assignment

class google.cloud.bigquery.reservation_v1.types.ListAssignmentsRequest(mapping=None, **kwargs)[source]

The request for [ReservationService.ListAssignments][google.cloud.bigquery.reservation.v1.ReservationService.ListAssignments].

parent

Required. The parent resource name e.g.:

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

Or:

projects/myproject/locations/US/reservations/-

Type

str

page_size

The maximum number of items to return per page.

Type

int

page_token

The next_page_token value returned from a previous List request, if any.

Type

str

class google.cloud.bigquery.reservation_v1.types.ListAssignmentsResponse(mapping=None, **kwargs)[source]

The response for [ReservationService.ListAssignments][google.cloud.bigquery.reservation.v1.ReservationService.ListAssignments].

assignments

List of assignments visible to the user.

Type

Sequence[Assignment]

next_page_token

Token to retrieve the next page of results, or empty if there are no more results in the list.

Type

str

class google.cloud.bigquery.reservation_v1.types.DeleteAssignmentRequest(mapping=None, **kwargs)[source]

The request for [ReservationService.DeleteAssignment][google.cloud.bigquery.reservation.v1.ReservationService.DeleteAssignment]. Note: “bigquery.reservationAssignments.delete” permission is required on the related assignee.

name

Required. Name of the resource, e.g. projects/myproject/locations/US/reservations/team1-prod/assignments/123

Type

str

class google.cloud.bigquery.reservation_v1.types.SearchAssignmentsRequest(mapping=None, **kwargs)[source]

The request for [ReservationService.SearchAssignments][google.cloud.bigquery.reservation.v1.ReservationService.SearchAssignments]. Note: “bigquery.reservationAssignments.search” permission is required on the related assignee.

parent

Required. The resource name of the admin project(containing project and location), e.g.: “projects/myproject/locations/US”.

Type

str

query

Please specify resource name as assignee in the query.

Examples:

  • assignee=projects/myproject

  • assignee=folders/123

  • assignee=organizations/456

Type

str

page_size

The maximum number of items to return per page.

Type

int

page_token

The next_page_token value returned from a previous List request, if any.

Type

str

class google.cloud.bigquery.reservation_v1.types.SearchAssignmentsResponse(mapping=None, **kwargs)[source]

The response for [ReservationService.SearchAssignments][google.cloud.bigquery.reservation.v1.ReservationService.SearchAssignments].

assignments

List of assignments visible to the user.

Type

Sequence[Assignment]

next_page_token

Token to retrieve the next page of results, or empty if there are no more results in the list.

Type

str

class google.cloud.bigquery.reservation_v1.types.MoveAssignmentRequest(mapping=None, **kwargs)[source]

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

Required. The resource name of the assignment, e.g. projects/myproject/locations/US/reservations/team1-prod/assignments/123

Type

str

destination_id

The new reservation ID, e.g.: projects/myotherproject/locations/US/reservations/team2-prod

Type

str

class google.cloud.bigquery.reservation_v1.types.BiReservation(mapping=None, **kwargs)[source]

Represents a BI Reservation.

name

The resource name of the singleton BI reservation. Reservation names have the form projects/{project_id}/locations/{location_id}/bireservation.

Type

str

update_time

Output only. The last update timestamp of a reservation.

Type

Timestamp

size

Size of a reservation, in bytes.

Type

int

class google.cloud.bigquery.reservation_v1.types.GetBiReservationRequest(mapping=None, **kwargs)[source]

A request to get a singleton BI reservation.

name

Required. Name of the requested reservation, for example: projects/{project_id}/locations/{location_id}/bireservation

Type

str

class google.cloud.bigquery.reservation_v1.types.UpdateBiReservationRequest(mapping=None, **kwargs)[source]

A request to update a BI reservation.

bi_reservation

A reservation to update.

Type

BiReservation

update_mask

A list of fields to be updated in this request.

Type

FieldMask