Skip to content

Commit 4743cf9

Browse files
Google APIscopybara-github
authored andcommitted
feat: Add the managed disaster recovery API(https://cloud.google.com/bigquery/docs/managed-disaster-recovery)
feat: Add a new field `is_flat_rate` to `.google.cloud.bigquery.reservation.v1.CapacityCommitment` to distinguish between flat rate and edition commitments docs: Clarify that `Autoscale.current_slots` in message `.google.cloud.bigquery.reservation.v1.Reservation` can temporarily be larger than `Autoscale.max_slots` if users reduce `Autoscale.max_slots` docs: Update comment for `slot_capacity` in message `.google.cloud.bigquery.reservation.v1.Reservation` to provide more clarity about reservation baselines, committed slots and autoscaler SKU charges when the baseline exceeds committed slots docs: Update comments for `commitment_start_time` and `commitment_end_time` in message `.google.cloud.bigquery.reservation.v1.CapacityCommitment` to provide details on how these values are affected by commitment renewal PiperOrigin-RevId: 702079972
1 parent 99a5e29 commit 4743cf9

2 files changed

Lines changed: 93 additions & 23 deletions

File tree

google/cloud/bigquery/reservation/v1/bigqueryreservation_v1.yaml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,6 @@ apis:
99
documentation:
1010
summary: 'A service to modify your BigQuery flat-rate reservations.'
1111

12-
backend:
13-
rules:
14-
- selector: 'google.cloud.bigquery.reservation.v1.ReservationService.*'
15-
deadline: 300.0
16-
1712
authentication:
1813
rules:
1914
- selector: 'google.cloud.bigquery.reservation.v1.ReservationService.*'

google/cloud/bigquery/reservation/v1/reservation.proto

Lines changed: 93 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,18 @@ service ReservationService {
9999
option (google.api.method_signature) = "reservation,update_mask";
100100
}
101101

102+
// Fail over a reservation to the secondary location. The operation should be
103+
// done in the current secondary location, which will be promoted to the
104+
// new primary location for the reservation.
105+
// Attempting to failover a reservation in the current primary location will
106+
// fail with the error code `google.rpc.Code.FAILED_PRECONDITION`.
107+
rpc FailoverReservation(FailoverReservationRequest) returns (Reservation) {
108+
option (google.api.http) = {
109+
post: "/v1/{name=projects/*/locations/*/reservations/*}:failoverReservation"
110+
body: "*"
111+
};
112+
}
113+
102114
// Creates a new capacity commitment resource.
103115
rpc CreateCapacityCommitment(CreateCapacityCommitmentRequest)
104116
returns (CapacityCommitment) {
@@ -401,7 +413,10 @@ message Reservation {
401413
// Auto scaling settings.
402414
message Autoscale {
403415
// Output only. The slot capacity added to this reservation when autoscale
404-
// happens. Will be between [0, max_slots].
416+
// happens. Will be between [0, max_slots]. Note: after users reduce
417+
// max_slots, it may take a while before it can be propagated, so
418+
// current_slots may stay in the original value and could be larger than
419+
// max_slots for that brief period (less than one minute)
405420
int64 current_slots = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
406421

407422
// Number of slots to be scaled when needed.
@@ -415,20 +430,26 @@ message Reservation {
415430
// maximum length is 64 characters.
416431
string name = 1;
417432

418-
// Minimum slots available to this reservation. A slot is a unit of
433+
// Baseline slots available to this reservation. A slot is a unit of
419434
// computational power in BigQuery, and serves as the unit of parallelism.
420435
//
421436
// Queries using this reservation might use more slots during runtime if
422-
// ignore_idle_slots is set to false.
423-
//
424-
// If total slot_capacity of the reservation and its siblings
425-
// exceeds the total slot_count of all capacity commitments, the request will
426-
// fail with `google.rpc.Code.RESOURCE_EXHAUSTED`.
437+
// ignore_idle_slots is set to false, or autoscaling is enabled.
427438
//
439+
// If edition is EDITION_UNSPECIFIED and total slot_capacity of the
440+
// reservation and its siblings exceeds the total slot_count of all capacity
441+
// commitments, the request will fail with
442+
// `google.rpc.Code.RESOURCE_EXHAUSTED`.
428443
//
429-
// NOTE: for reservations in US or EU multi-regions, slot capacity constraints
430-
// are checked separately for default and auxiliary regions. See
431-
// multi_region_auxiliary flag for more details.
444+
// If edition is any value but EDITION_UNSPECIFIED, then the above requirement
445+
// is not needed. The total slot_capacity of the reservation and its siblings
446+
// may exceed the total slot_count of capacity commitments. In that case, the
447+
// exceeding slots will be charged with the autoscale SKU. You can increase
448+
// the number of baseline slots in a reservation every few minutes. If you
449+
// want to decrease your baseline slots, you are limited to once an hour if
450+
// you have recently changed your baseline slot capacity and your baseline
451+
// slots exceed your committed slots. Otherwise, you can decrease your
452+
// baseline slots every few minutes.
432453
int64 slot_capacity = 2;
433454

434455
// If false, any query or pipeline job using this reservation will use idle
@@ -437,8 +458,7 @@ message Reservation {
437458
// capacity specified in the slot_capacity field at most.
438459
bool ignore_idle_slots = 4;
439460

440-
// The configuration parameters for the auto scaling feature. Note this is an
441-
// alpha feature.
461+
// The configuration parameters for the auto scaling feature.
442462
Autoscale autoscale = 7;
443463

444464
// Job concurrency target which sets a soft upper bound on the number of jobs
@@ -447,8 +467,8 @@ message Reservation {
447467
// queries.
448468
// Default value is 0 which means that concurrency target will be
449469
// automatically computed by the system.
450-
// NOTE: this field is exposed as `target_job_concurrency` in the Information
451-
// Schema, DDL and BQ CLI.
470+
// NOTE: this field is exposed as target job concurrency in the Information
471+
// Schema, DDL and BigQuery CLI.
452472
int64 concurrency = 16;
453473

454474
// Output only. Creation time of the reservation.
@@ -472,6 +492,38 @@ message Reservation {
472492

473493
// Edition of the reservation.
474494
Edition edition = 17;
495+
496+
// Optional. The current location of the reservation's primary replica. This
497+
// field is only set for reservations using the managed disaster recovery
498+
// feature.
499+
string primary_location = 18 [
500+
(google.api.field_behavior) = OPTIONAL,
501+
(google.api.resource_reference) = {
502+
type: "locations.googleapis.com/Location"
503+
}
504+
];
505+
506+
// Optional. The current location of the reservation's secondary replica. This
507+
// field is only set for reservations using the managed disaster recovery
508+
// feature. Users can set this in create reservation calls
509+
// to create a failover reservation or in update reservation calls to convert
510+
// a non-failover reservation to a failover reservation(or vice versa).
511+
string secondary_location = 19 [
512+
(google.api.field_behavior) = OPTIONAL,
513+
(google.api.resource_reference) = {
514+
type: "locations.googleapis.com/Location"
515+
}
516+
];
517+
518+
// Optional. The location where the reservation was originally created. This
519+
// is set only during the failover reservation's creation. All billing charges
520+
// for the failover reservation will be applied to this location.
521+
string original_primary_location = 20 [
522+
(google.api.field_behavior) = OPTIONAL,
523+
(google.api.resource_reference) = {
524+
type: "locations.googleapis.com/Location"
525+
}
526+
];
475527
}
476528

477529
// Capacity commitment is a way to purchase compute capacity for BigQuery jobs
@@ -510,7 +562,7 @@ message CapacityCommitment {
510562
// ACTIVE. After that, they are converted to a new commitment based on the
511563
// `renewal_plan`. Default `renewal_plan` for Trial commitment is Flex so
512564
// that it can be deleted right after committed period ends.
513-
TRIAL = 5;
565+
TRIAL = 5 [deprecated = true];
514566

515567
// Monthly commitments have a committed period of 30 days after becoming
516568
// ACTIVE. After that, they are not in a committed period anymore and can be
@@ -579,12 +631,17 @@ message CapacityCommitment {
579631
State state = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
580632

581633
// Output only. The start of the current commitment period. It is applicable
582-
// only for ACTIVE capacity commitments.
634+
// only for ACTIVE capacity commitments. Note after the commitment is renewed,
635+
// commitment_start_time won't be changed. It refers to the start time of the
636+
// original commitment.
583637
google.protobuf.Timestamp commitment_start_time = 9
584638
[(google.api.field_behavior) = OUTPUT_ONLY];
585639

586640
// Output only. The end of the current commitment period. It is applicable
587-
// only for ACTIVE capacity commitments.
641+
// only for ACTIVE capacity commitments. Note after renewal,
642+
// commitment_end_time is the time the renewed commitment expires. So it would
643+
// be at a time after commitment_start_time + committed period, because we
644+
// don't change commitment_start_time ,
588645
google.protobuf.Timestamp commitment_end_time = 5
589646
[(google.api.field_behavior) = OUTPUT_ONLY];
590647

@@ -610,6 +667,10 @@ message CapacityCommitment {
610667

611668
// Edition of the capacity commitment.
612669
Edition edition = 12;
670+
671+
// Output only. If true, the commitment is a flat-rate commitment, otherwise,
672+
// it's an edition commitment.
673+
bool is_flat_rate = 14 [(google.api.field_behavior) = OUTPUT_ONLY];
613674
}
614675

615676
// The request for
@@ -699,6 +760,18 @@ message UpdateReservationRequest {
699760
google.protobuf.FieldMask update_mask = 2;
700761
}
701762

763+
// The request for ReservationService.FailoverReservation.
764+
message FailoverReservationRequest {
765+
// Required. Resource name of the reservation to failover. E.g.,
766+
// `projects/myproject/locations/US/reservations/team1-prod`
767+
string name = 1 [
768+
(google.api.field_behavior) = REQUIRED,
769+
(google.api.resource_reference) = {
770+
type: "bigqueryreservation.googleapis.com/Reservation"
771+
}
772+
];
773+
}
774+
702775
// The request for
703776
// [ReservationService.CreateCapacityCommitment][google.cloud.bigquery.reservation.v1.ReservationService.CreateCapacityCommitment].
704777
message CreateCapacityCommitmentRequest {
@@ -846,6 +919,8 @@ message Assignment {
846919
option (google.api.resource) = {
847920
type: "bigqueryreservation.googleapis.com/Assignment"
848921
pattern: "projects/{project}/locations/{location}/reservations/{reservation}/assignments/{assignment}"
922+
plural: "assignments"
923+
singular: "assignment"
849924
};
850925

851926
// Types of job, which could be specified when using the reservation.
@@ -1172,6 +1247,6 @@ enum Edition {
11721247
// Enterprise edition.
11731248
ENTERPRISE = 2;
11741249

1175-
// Enterprise plus edition.
1250+
// Enterprise Plus edition.
11761251
ENTERPRISE_PLUS = 3;
11771252
}

0 commit comments

Comments
 (0)