1- // Copyright 2021 Google LLC
1+ // Copyright 2022 Google LLC
22//
33// Licensed under the Apache License, Version 2.0 (the "License");
44// you may not use this file except in compliance with the License.
@@ -154,7 +154,7 @@ service ReservationService {
154154 //
155155 // For example, in order to downgrade from 10000 slots to 8000, you might
156156 // split a 10000 capacity commitment into commitments of 2000 and 8000. Then,
157- // you would change the plan of the first one to `FLEX` and then delete it .
157+ // you delete the first one after the commitment end time passes .
158158 rpc SplitCapacityCommitment (SplitCapacityCommitmentRequest ) returns (SplitCapacityCommitmentResponse ) {
159159 option (google.api.http ) = {
160160 post : "/v1/{name=projects/*/locations/*/capacityCommitments/*}:split"
@@ -271,8 +271,8 @@ service ReservationService {
271271 option (google.api.method_signature ) = "name" ;
272272 }
273273
274- // Deprecated: Looks up assignments for a specified resource for a particular region.
275- // If the request is about a project:
274+ // Deprecated: Looks up assignments for a specified resource for a particular
275+ // region. If the request is about a project:
276276 //
277277 // 1. Assignments created on the project will be returned if they exist.
278278 // 2. Otherwise assignments created on the closest ancestor will be
@@ -342,6 +342,17 @@ service ReservationService {
342342 option (google.api.method_signature ) = "name,destination_id" ;
343343 }
344344
345+ // Updates an existing assignment.
346+ //
347+ // Only the `priority` field can be updated.
348+ rpc UpdateAssignment (UpdateAssignmentRequest ) returns (Assignment ) {
349+ option (google.api.http ) = {
350+ patch : "/v1/{assignment.name=projects/*/locations/*/reservations/*/assignments/*}"
351+ body : "assignment"
352+ };
353+ option (google.api.method_signature ) = "assignment,update_mask" ;
354+ }
355+
345356 // Retrieves a BI reservation.
346357 rpc GetBiReservation (GetBiReservationRequest ) returns (BiReservation ) {
347358 option (google.api.http ) = {
@@ -376,6 +387,9 @@ message Reservation {
376387
377388 // The resource name of the reservation, e.g.,
378389 // `projects/*/locations/*/reservations/team1-prod`.
390+ // The reservation_id must only contain lower case alphanumeric characters or
391+ // dashes. It must start with a letter and must not end with a dash. Its
392+ // maximum length is 64 characters.
379393 string name = 1 ;
380394
381395 // Minimum slots available to this reservation. A slot is a unit of
@@ -384,10 +398,14 @@ message Reservation {
384398 // Queries using this reservation might use more slots during runtime if
385399 // ignore_idle_slots is set to false.
386400 //
387- // If the new reservation's slot capacity exceed the parent 's slot capacity or
388- // if total slot capacity of the new reservation and its siblings exceeds the
389- // parent 's slot capacity, the request will fail with
401+ // If the new reservation's slot capacity exceeds the project 's slot capacity
402+ // or if total slot capacity of the new reservation and its siblings exceeds
403+ // the project 's slot capacity, the request will fail with
390404 // `google.rpc.Code.RESOURCE_EXHAUSTED`.
405+ //
406+ // NOTE: for reservations in US or EU multi-regions, slot capacity constraints
407+ // are checked separately for default and auxiliary regions. See
408+ // multi_region_auxiliary flag for more details.
391409 int64 slot_capacity = 2 ;
392410
393411 // If false, any query or pipeline job using this reservation will use idle
@@ -396,11 +414,26 @@ message Reservation {
396414 // capacity specified in the slot_capacity field at most.
397415 bool ignore_idle_slots = 4 ;
398416
417+ // Maximum number of queries that are allowed to run concurrently in this
418+ // reservation. This is a soft limit due to asynchronous nature of the system
419+ // and various optimizations for small queries.
420+ // Default value is 0 which means that concurrency will be automatically set
421+ // based on the reservation size.
422+ int64 concurrency = 16 ;
423+
399424 // Output only. Creation time of the reservation.
400425 google.protobuf.Timestamp creation_time = 8 [(google.api.field_behavior ) = OUTPUT_ONLY ];
401426
402427 // Output only. Last update time of the reservation.
403428 google.protobuf.Timestamp update_time = 9 [(google.api.field_behavior ) = OUTPUT_ONLY ];
429+
430+ // Applicable only for reservations located within one of the BigQuery
431+ // multi-regions (US or EU).
432+ //
433+ // If set to true, this reservation is placed in the organization's
434+ // secondary region which is designated for disaster recovery purposes.
435+ // If false, this reservation is placed in the organization's default region.
436+ bool multi_region_auxiliary = 14 ;
404437}
405438
406439// Capacity commitment is a way to purchase compute capacity for BigQuery jobs
@@ -455,11 +488,11 @@ message CapacityCommitment {
455488 STATE_UNSPECIFIED = 0 ;
456489
457490 // Capacity commitment is pending provisioning. Pending capacity commitment
458- // does not contribute to the parent 's slot_capacity.
491+ // does not contribute to the project 's slot_capacity.
459492 PENDING = 1 ;
460493
461494 // Once slots are provisioned, capacity commitment becomes active.
462- // slot_count is added to the parent 's slot_capacity.
495+ // slot_count is added to the project 's slot_capacity.
463496 ACTIVE = 2 ;
464497
465498 // Capacity commitment is failed to be activated by the backend.
@@ -468,6 +501,9 @@ message CapacityCommitment {
468501
469502 // Output only. The resource name of the capacity commitment, e.g.,
470503 // `projects/myproject/locations/US/capacityCommitments/123`
504+ // The commitment_id must only contain lower case alphanumeric characters or
505+ // dashes. It must start with a letter and must not end
506+ // with a dash. Its maximum length is 64 characters.
471507 string name = 1 [(google.api.field_behavior ) = OUTPUT_ONLY ];
472508
473509 // Number of slots in this commitment.
@@ -494,6 +530,14 @@ message CapacityCommitment {
494530 // passes. Once the plan is changed, committed period is extended according to
495531 // commitment plan. Only applicable for ANNUAL and TRIAL commitments.
496532 CommitmentPlan renewal_plan = 8 ;
533+
534+ // Applicable only for commitments located within one of the BigQuery
535+ // multi-regions (US or EU).
536+ //
537+ // If set to true, this commitment is placed in the organization's
538+ // secondary region which is designated for disaster recovery purposes.
539+ // If false, this commitment is placed in the organization's default region.
540+ bool multi_region_auxiliary = 10 ;
497541}
498542
499543// The request for [ReservationService.CreateReservation][google.cloud.bigquery.reservation.v1.ReservationService.CreateReservation].
@@ -507,8 +551,9 @@ message CreateReservationRequest {
507551 }
508552 ];
509553
510- // The reservation ID. This field must only contain lower case alphanumeric
511- // characters or dash. Max length is 64 characters.
554+ // The reservation ID. It must only contain lower case alphanumeric
555+ // characters or dashes. It must start with a letter and must not end
556+ // with a dash. Its maximum length is 64 characters.
512557 string reservation_id = 2 ;
513558
514559 // Definition of the new reservation to create.
@@ -596,8 +641,8 @@ message CreateCapacityCommitmentRequest {
596641
597642 // The optional capacity commitment ID. Capacity commitment name will be
598643 // generated automatically if this field is empty.
599- // This field must only contain lower case alphanumeric characters or dash .
600- // Max length is 64 characters.
644+ // This field must only contain lower case alphanumeric characters or dashes .
645+ // The first and last character cannot be a dash. Max length is 64 characters.
601646 // NOTE: this ID won't be kept if the capacity commitment is split or merged.
602647 string capacity_commitment_id = 5 ;
603648}
@@ -708,7 +753,7 @@ message MergeCapacityCommitmentsRequest {
708753 repeated string capacity_commitment_ids = 2 ;
709754}
710755
711- // A Assignment allows a project to submit jobs
756+ // An assignment allows a project to submit jobs
712757// of a certain type using slots from the specified reservation.
713758message Assignment {
714759 option (google.api.resource ) = {
@@ -750,6 +795,8 @@ message Assignment {
750795
751796 // Output only. Name of the resource. E.g.:
752797 // `projects/myproject/locations/US/reservations/team1-prod/assignments/123`.
798+ // The assignment_id must only contain lower case alphanumeric characters or
799+ // dashes and the max length is 64 characters.
753800 string name = 1 [(google.api.field_behavior ) = OUTPUT_ONLY ];
754801
755802 // The resource which will use the reservation. E.g.
@@ -781,7 +828,7 @@ message CreateAssignmentRequest {
781828
782829 // The optional assignment ID. Assignment name will be generated automatically
783830 // if this field is empty.
784- // This field must only contain lower case alphanumeric characters or dash .
831+ // This field must only contain lower case alphanumeric characters or dashes .
785832 // Max length is 64 characters.
786833 string assignment_id = 4 ;
787834}
@@ -942,6 +989,28 @@ message MoveAssignmentRequest {
942989 }];
943990}
944991
992+ // The request for [ReservationService.UpdateAssignment][google.cloud.bigquery.reservation.v1.ReservationService.UpdateAssignment].
993+ message UpdateAssignmentRequest {
994+ // Content of the assignment to update.
995+ Assignment assignment = 1 ;
996+
997+ // Standard field mask for the set of fields to be updated.
998+ google.protobuf.FieldMask update_mask = 2 ;
999+ }
1000+
1001+ // Fully qualified reference to BigQuery table.
1002+ // Internally stored as google.cloud.bi.v1.BqTableReference.
1003+ message TableReference {
1004+ // The assigned project ID of the project.
1005+ string project_id = 1 ;
1006+
1007+ // The ID of the dataset in the above project.
1008+ string dataset_id = 2 ;
1009+
1010+ // The ID of the table in the above dataset.
1011+ string table_id = 3 ;
1012+ }
1013+
9451014// Represents a BI Reservation.
9461015message BiReservation {
9471016 option (google.api.resource ) = {
@@ -959,6 +1028,9 @@ message BiReservation {
9591028
9601029 // Size of a reservation, in bytes.
9611030 int64 size = 4 ;
1031+
1032+ // Preferred tables to use BI capacity for.
1033+ repeated TableReference preferred_tables = 5 ;
9621034}
9631035
9641036// A request to get a singleton BI reservation.
0 commit comments