1- // Copyright 2020 Google LLC
1+ // Copyright 2021 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.
@@ -202,6 +202,11 @@ service ReservationService {
202202 // `project2`) could all be created and mapped to the same or different
203203 // reservations.
204204 //
205+ // "None" assignments represent an absence of the assignment. Projects
206+ // assigned to None use on-demand pricing. To create a "None" assignment, use
207+ // "none" as a reservation_id in the parent. Example parent:
208+ // `projects/myproject/locations/US/reservations/none`.
209+ //
205210 // Returns `google.rpc.Code.PERMISSION_DENIED` if user does not have
206211 // 'bigquery.admin' permissions on the project using the reservation
207212 // and the project that owns this reservation.
@@ -266,7 +271,7 @@ service ReservationService {
266271 option (google.api.method_signature ) = "name" ;
267272 }
268273
269- // Looks up assignments for a specified resource for a particular region.
274+ // Deprecated: Looks up assignments for a specified resource for a particular region.
270275 // If the request is about a project:
271276 //
272277 // 1. Assignments created on the project will be returned if they exist.
@@ -290,12 +295,40 @@ service ReservationService {
290295 // **Note** "-" cannot be used for projects
291296 // nor locations.
292297 rpc SearchAssignments (SearchAssignmentsRequest ) returns (SearchAssignmentsResponse ) {
298+ option deprecated = true ;
293299 option (google.api.http ) = {
294300 get : "/v1/{parent=projects/*/locations/*}:searchAssignments"
295301 };
296302 option (google.api.method_signature ) = "parent,query" ;
297303 }
298304
305+ // Looks up assignments for a specified resource for a particular region.
306+ // If the request is about a project:
307+ //
308+ // 1. Assignments created on the project will be returned if they exist.
309+ // 2. Otherwise assignments created on the closest ancestor will be
310+ // returned.
311+ // 3. Assignments for different JobTypes will all be returned.
312+ //
313+ // The same logic applies if the request is about a folder.
314+ //
315+ // If the request is about an organization, then assignments created on the
316+ // organization will be returned (organization doesn't have ancestors).
317+ //
318+ // Comparing to ListAssignments, there are some behavior
319+ // differences:
320+ //
321+ // 1. permission on the assignee will be verified in this API.
322+ // 2. Hierarchy lookup (project->folder->organization) happens in this API.
323+ // 3. Parent here is `projects/*/locations/*`, instead of
324+ // `projects/*/locations/*reservations/*`.
325+ rpc SearchAllAssignments (SearchAllAssignmentsRequest ) returns (SearchAllAssignmentsResponse ) {
326+ option (google.api.http ) = {
327+ get : "/v1/{parent=projects/*/locations/*}:searchAllAssignments"
328+ };
329+ option (google.api.method_signature ) = "parent,query" ;
330+ }
331+
299332 // Moves an assignment under a new reservation.
300333 //
301334 // This differs from removing an existing assignment and recreating a new one
@@ -357,10 +390,17 @@ message Reservation {
357390 // `google.rpc.Code.RESOURCE_EXHAUSTED`.
358391 int64 slot_capacity = 2 ;
359392
360- // If false, any query using this reservation will use idle slots from other
361- // reservations within the same admin project. If true, a query using this
362- // reservation will execute with the slot capacity specified above at most.
393+ // If false, any query or pipeline job using this reservation will use idle
394+ // slots from other reservations within the same admin project. If true, a
395+ // query or pipeline job using this reservation will execute with the slot
396+ // capacity specified in the slot_capacity field at most.
363397 bool ignore_idle_slots = 4 ;
398+
399+ // Output only. Creation time of the reservation.
400+ google.protobuf.Timestamp creation_time = 8 [(google.api.field_behavior ) = OUTPUT_ONLY ];
401+
402+ // Output only. Last update time of the reservation.
403+ google.protobuf.Timestamp update_time = 9 [(google.api.field_behavior ) = OUTPUT_ONLY ];
364404}
365405
366406// Capacity commitment is a way to purchase compute capacity for BigQuery jobs
@@ -439,6 +479,10 @@ message CapacityCommitment {
439479 // Output only. State of the commitment.
440480 State state = 4 [(google.api.field_behavior ) = OUTPUT_ONLY ];
441481
482+ // Output only. The start of the current commitment period. It is applicable only for
483+ // ACTIVE capacity commitments.
484+ google.protobuf.Timestamp commitment_start_time = 9 [(google.api.field_behavior ) = OUTPUT_ONLY ];
485+
442486 // Output only. The end of the current commitment period. It is applicable only for ACTIVE
443487 // capacity commitments.
444488 google.protobuf.Timestamp commitment_end_time = 5 [(google.api.field_behavior ) = OUTPUT_ONLY ];
@@ -549,6 +593,13 @@ message CreateCapacityCommitmentRequest {
549593 // If true, fail the request if another project in the organization has a
550594 // capacity commitment.
551595 bool enforce_single_admin_project_per_org = 4 ;
596+
597+ // The optional capacity commitment ID. Capacity commitment name will be
598+ // 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.
601+ // NOTE: this ID won't be kept if the capacity commitment is split or merged.
602+ string capacity_commitment_id = 5 ;
552603}
553604
554605// The request for [ReservationService.ListCapacityCommitments][google.cloud.bigquery.reservation.v1.ReservationService.ListCapacityCommitments].
@@ -601,6 +652,11 @@ message DeleteCapacityCommitmentRequest {
601652 type : "bigqueryreservation.googleapis.com/CapacityCommitment"
602653 }
603654 ];
655+
656+ // Can be used to force delete commitments even if assignments exist. Deleting
657+ // commitments with assignments may cause queries to fail if they no longer
658+ // have access to slots.
659+ bool force = 3 ;
604660}
605661
606662// The request for [ReservationService.UpdateCapacityCommitment][google.cloud.bigquery.reservation.v1.ReservationService.UpdateCapacityCommitment].
@@ -671,6 +727,10 @@ message Assignment {
671727
672728 // Query jobs from the project will use the reservation.
673729 QUERY = 2 ;
730+
731+ // BigQuery ML jobs that use services external to BigQuery for model
732+ // training. These jobs will not utilize idle slots from other reservations.
733+ ML_EXTERNAL = 3 ;
674734 }
675735
676736 // Assignment will remain in PENDING state if no active capacity commitment is
@@ -718,6 +778,12 @@ message CreateAssignmentRequest {
718778
719779 // Assignment resource to create.
720780 Assignment assignment = 2 ;
781+
782+ // The optional assignment ID. Assignment name will be generated automatically
783+ // if this field is empty.
784+ // This field must only contain lower case alphanumeric characters or dash.
785+ // Max length is 64 characters.
786+ string assignment_id = 4 ;
721787}
722788
723789// The request for [ReservationService.ListAssignments][google.cloud.bigquery.reservation.v1.ReservationService.ListAssignments].
@@ -798,6 +864,37 @@ message SearchAssignmentsRequest {
798864 string page_token = 4 ;
799865}
800866
867+ // The request for
868+ // [ReservationService.SearchAllAssignments][google.cloud.bigquery.reservation.v1.ReservationService.SearchAllAssignments].
869+ // Note: "bigquery.reservationAssignments.search" permission is required on the
870+ // related assignee.
871+ message SearchAllAssignmentsRequest {
872+ // Required. The resource name with location (project name could be the wildcard '-'),
873+ // e.g.:
874+ // `projects/-/locations/US`.
875+ string parent = 1 [
876+ (google.api.field_behavior ) = REQUIRED ,
877+ (google.api.resource_reference ) = {
878+ type : "locations.googleapis.com/Location"
879+ }
880+ ];
881+
882+ // Please specify resource name as assignee in the query.
883+ //
884+ // Examples:
885+ //
886+ // * `assignee=projects/myproject`
887+ // * `assignee=folders/123`
888+ // * `assignee=organizations/456`
889+ string query = 2 ;
890+
891+ // The maximum number of items to return per page.
892+ int32 page_size = 3 ;
893+
894+ // The next_page_token value returned from a previous List request, if any.
895+ string page_token = 4 ;
896+ }
897+
801898// The response for [ReservationService.SearchAssignments][google.cloud.bigquery.reservation.v1.ReservationService.SearchAssignments].
802899message SearchAssignmentsResponse {
803900 // List of assignments visible to the user.
@@ -808,6 +905,16 @@ message SearchAssignmentsResponse {
808905 string next_page_token = 2 ;
809906}
810907
908+ // The response for [ReservationService.SearchAllAssignments][google.cloud.bigquery.reservation.v1.ReservationService.SearchAllAssignments].
909+ message SearchAllAssignmentsResponse {
910+ // List of assignments visible to the user.
911+ repeated Assignment assignments = 1 ;
912+
913+ // Token to retrieve the next page of results, or empty if there are no
914+ // more results in the list.
915+ string next_page_token = 2 ;
916+ }
917+
811918// The request for
812919// [ReservationService.MoveAssignment][google.cloud.bigquery.reservation.v1.ReservationService.MoveAssignment].
813920//
@@ -839,12 +946,12 @@ message MoveAssignmentRequest {
839946message BiReservation {
840947 option (google.api.resource ) = {
841948 type : "bigqueryreservation.googleapis.com/BiReservation"
842- pattern : "projects/{project}/locations/{location}/bireservation "
949+ pattern : "projects/{project}/locations/{location}/biReservation "
843950 };
844951
845952 // The resource name of the singleton BI reservation.
846953 // Reservation names have the form
847- // `projects/{project_id}/locations/{location_id}/bireservation `.
954+ // `projects/{project_id}/locations/{location_id}/biReservation `.
848955 string name = 1 ;
849956
850957 // Output only. The last update timestamp of a reservation.
@@ -857,7 +964,7 @@ message BiReservation {
857964// A request to get a singleton BI reservation.
858965message GetBiReservationRequest {
859966 // Required. Name of the requested reservation, for example:
860- // `projects/{project_id}/locations/{location_id}/bireservation `
967+ // `projects/{project_id}/locations/{location_id}/biReservation `
861968 string name = 1 [
862969 (google.api.field_behavior ) = REQUIRED ,
863970 (google.api.resource_reference ) = {
0 commit comments