123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913 |
- // Copyright 2020 Google LLC
- //
- // Licensed under the Apache License, Version 2.0 (the "License");
- // you may not use this file except in compliance with the License.
- // You may obtain a copy of the License at
- //
- // http://www.apache.org/licenses/LICENSE-2.0
- //
- // Unless required by applicable law or agreed to in writing, software
- // distributed under the License is distributed on an "AS IS" BASIS,
- // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- // See the License for the specific language governing permissions and
- // limitations under the License.
- syntax = "proto3";
- package google.cloud.bigquery.reservation.v1beta1;
- import "google/api/annotations.proto";
- import "google/api/client.proto";
- import "google/api/field_behavior.proto";
- import "google/api/resource.proto";
- import "google/protobuf/empty.proto";
- import "google/protobuf/field_mask.proto";
- import "google/protobuf/timestamp.proto";
- import "google/rpc/status.proto";
- option go_package = "google.golang.org/genproto/googleapis/cloud/bigquery/reservation/v1beta1;reservation";
- option java_multiple_files = true;
- option java_package = "com.google.cloud.bigquery.reservation.v1beta1";
- option php_namespace = "Google\\Cloud\\BigQuery\\Reservation\\V1beta1";
- // This API allows users to manage their flat-rate BigQuery reservations.
- //
- // A reservation provides computational resource guarantees, in the form of
- // [slots](https://cloud.google.com/bigquery/docs/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`.
- service ReservationService {
- option (google.api.default_host) = "bigqueryreservation.googleapis.com";
- option (google.api.oauth_scopes) =
- "https://www.googleapis.com/auth/bigquery,"
- "https://www.googleapis.com/auth/cloud-platform";
- // Creates a new reservation resource.
- rpc CreateReservation(CreateReservationRequest) returns (Reservation) {
- option (google.api.http) = {
- post: "/v1beta1/{parent=projects/*/locations/*}/reservations"
- body: "reservation"
- };
- option (google.api.method_signature) = "parent,reservation,reservation_id";
- }
- // Lists all the reservations for the project in the specified location.
- rpc ListReservations(ListReservationsRequest)
- returns (ListReservationsResponse) {
- option (google.api.http) = {
- get: "/v1beta1/{parent=projects/*/locations/*}/reservations"
- };
- option (google.api.method_signature) = "parent";
- }
- // Returns information about the reservation.
- rpc GetReservation(GetReservationRequest) returns (Reservation) {
- option (google.api.http) = {
- get: "/v1beta1/{name=projects/*/locations/*/reservations/*}"
- };
- option (google.api.method_signature) = "name";
- }
- // Deletes a reservation.
- // Returns `google.rpc.Code.FAILED_PRECONDITION` when reservation has
- // assignments.
- rpc DeleteReservation(DeleteReservationRequest)
- returns (google.protobuf.Empty) {
- option (google.api.http) = {
- delete: "/v1beta1/{name=projects/*/locations/*/reservations/*}"
- };
- option (google.api.method_signature) = "name";
- }
- // Updates an existing reservation resource.
- rpc UpdateReservation(UpdateReservationRequest) returns (Reservation) {
- option (google.api.http) = {
- patch: "/v1beta1/{reservation.name=projects/*/locations/*/reservations/*}"
- body: "reservation"
- };
- option (google.api.method_signature) = "reservation,update_mask";
- }
- // Creates a new capacity commitment resource.
- rpc CreateCapacityCommitment(CreateCapacityCommitmentRequest)
- returns (CapacityCommitment) {
- option (google.api.http) = {
- post: "/v1beta1/{parent=projects/*/locations/*}/capacityCommitments"
- body: "capacity_commitment"
- };
- option (google.api.method_signature) = "parent,capacity_commitment";
- }
- // Lists all the capacity commitments for the admin project.
- rpc ListCapacityCommitments(ListCapacityCommitmentsRequest)
- returns (ListCapacityCommitmentsResponse) {
- option (google.api.http) = {
- get: "/v1beta1/{parent=projects/*/locations/*}/capacityCommitments"
- };
- }
- // Returns information about the capacity commitment.
- rpc GetCapacityCommitment(GetCapacityCommitmentRequest)
- returns (CapacityCommitment) {
- option (google.api.http) = {
- get: "/v1beta1/{name=projects/*/locations/*/capacityCommitments/*}"
- };
- option (google.api.method_signature) = "name";
- }
- // 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`.
- rpc DeleteCapacityCommitment(DeleteCapacityCommitmentRequest)
- returns (google.protobuf.Empty) {
- option (google.api.http) = {
- delete: "/v1beta1/{name=projects/*/locations/*/capacityCommitments/*}"
- };
- option (google.api.method_signature) = "name";
- }
- // 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`.
- rpc UpdateCapacityCommitment(UpdateCapacityCommitmentRequest)
- returns (CapacityCommitment) {
- option (google.api.http) = {
- patch: "/v1beta1/{capacity_commitment.name=projects/*/locations/*/capacityCommitments/*}"
- body: "capacity_commitment"
- };
- option (google.api.method_signature) = "capacity_commitment,update_mask";
- }
- // 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 would change the plan of the first one to `FLEX` and then delete it.
- rpc SplitCapacityCommitment(SplitCapacityCommitmentRequest)
- returns (SplitCapacityCommitmentResponse) {
- option (google.api.http) = {
- post: "/v1beta1/{name=projects/*/locations/*/capacityCommitments/*}:split"
- body: "*"
- };
- option (google.api.method_signature) = "name,slot_count";
- }
- // 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`.
- rpc MergeCapacityCommitments(MergeCapacityCommitmentsRequest)
- returns (CapacityCommitment) {
- option (google.api.http) = {
- post: "/v1beta1/{parent=projects/*/locations/*}/capacityCommitments:merge"
- body: "*"
- };
- option (google.api.method_signature) = "parent,capacity_commitment_ids";
- }
- // 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.
- //
- // 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.
- rpc CreateAssignment(CreateAssignmentRequest) returns (Assignment) {
- option (google.api.http) = {
- post: "/v1beta1/{parent=projects/*/locations/*/reservations/*}/assignments"
- body: "assignment"
- };
- option (google.api.method_signature) = "parent,assignment";
- }
- // 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.
- rpc ListAssignments(ListAssignmentsRequest)
- returns (ListAssignmentsResponse) {
- option (google.api.http) = {
- get: "/v1beta1/{parent=projects/*/locations/*/reservations/*}/assignments"
- };
- option (google.api.method_signature) = "parent";
- }
- // 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.
- rpc DeleteAssignment(DeleteAssignmentRequest)
- returns (google.protobuf.Empty) {
- option (google.api.http) = {
- delete: "/v1beta1/{name=projects/*/locations/*/reservations/*/assignments/*}"
- };
- option (google.api.method_signature) = "name";
- }
- // 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.
- rpc SearchAssignments(SearchAssignmentsRequest)
- returns (SearchAssignmentsResponse) {
- option (google.api.http) = {
- get: "/v1beta1/{parent=projects/*/locations/*}:searchAssignments"
- };
- option (google.api.method_signature) = "parent,query";
- }
- // 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.
- rpc MoveAssignment(MoveAssignmentRequest) returns (Assignment) {
- option (google.api.http) = {
- post: "/v1beta1/{name=projects/*/locations/*/reservations/*/assignments/*}:move"
- body: "*"
- };
- option (google.api.method_signature) = "name,destination_id";
- }
- // Retrieves a BI reservation.
- rpc GetBiReservation(GetBiReservationRequest) returns (BiReservation) {
- option (google.api.http) = {
- get: "/v1beta1/{name=projects/*/locations/*/biReservation}"
- };
- option (google.api.method_signature) = "name";
- }
- // 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.
- rpc UpdateBiReservation(UpdateBiReservationRequest) returns (BiReservation) {
- option (google.api.http) = {
- patch: "/v1beta1/{reservation.name=projects/*/locations/*/biReservation}"
- body: "reservation"
- };
- option (google.api.method_signature) = "reservation,update_mask";
- }
- }
- // A reservation is a mechanism used to guarantee slots to users.
- message Reservation {
- option (google.api.resource) = {
- type: "bigqueryreservation.googleapis.com/Reservation"
- pattern: "projects/{project}/locations/{location}/reservations/{reservation}"
- };
- // The resource name of the reservation, e.g.,
- // `projects/*/locations/*/reservations/team1-prod`.
- string name = 1;
- // 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`.
- int64 slot_capacity = 2;
- // 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.
- bool ignore_idle_slots = 4;
- }
- // 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.
- message CapacityCommitment {
- option (google.api.resource) = {
- type: "bigqueryreservation.googleapis.com/CapacityCommitment"
- pattern: "projects/{project}/locations/{location}/capacityCommitments/{capacity_commitment}"
- };
- // Commitment plan defines the current committed period. Capacity commitment
- // cannot be deleted during it's committed period.
- enum CommitmentPlan {
- // Invalid plan value. Requests with this value will be rejected with
- // error code `google.rpc.Code.INVALID_ARGUMENT`.
- COMMITMENT_PLAN_UNSPECIFIED = 0;
- // Flex commitments have committed period of 1 minute after becoming ACTIVE.
- // After that, they are not in a committed period anymore and can be removed
- // any time.
- FLEX = 3;
- // Trial commitments have a committed period of 182 days after becoming
- // ACTIVE. After that, they are converted to a new commitment based on the
- // `renewal_plan`. Default `renewal_plan` for Trial commitment is Flex so
- // that it can be deleted right after committed period ends.
- TRIAL = 5;
- // Monthly commitments have a committed period of 30 days after becoming
- // ACTIVE. After that, they are not in a committed period anymore and can be
- // removed any time.
- MONTHLY = 2;
- // Annual commitments have a committed period of 365 days after becoming
- // ACTIVE. After that they are converted to a new commitment based on the
- // renewal_plan.
- ANNUAL = 4;
- }
- // Capacity commitment can either become ACTIVE right away or transition
- // from PENDING to ACTIVE or FAILED.
- enum State {
- // Invalid state value.
- STATE_UNSPECIFIED = 0;
- // Capacity commitment is pending provisioning. Pending capacity commitment
- // does not contribute to the parent's slot_capacity.
- PENDING = 1;
- // Once slots are provisioned, capacity commitment becomes active.
- // slot_count is added to the parent's slot_capacity.
- ACTIVE = 2;
- // Capacity commitment is failed to be activated by the backend.
- FAILED = 3;
- }
- // Output only. The resource name of the capacity commitment, e.g.,
- // `projects/myproject/locations/US/capacityCommitments/123`
- string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
- // Number of slots in this commitment.
- int64 slot_count = 2;
- // Capacity commitment commitment plan.
- CommitmentPlan plan = 3;
- // Output only. State of the commitment.
- State state = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
- // Output only. The end of the current commitment period. It is applicable
- // only for ACTIVE capacity commitments.
- google.protobuf.Timestamp commitment_end_time = 5
- [(google.api.field_behavior) = OUTPUT_ONLY];
- // Output only. For FAILED commitment plan, provides the reason of failure.
- google.rpc.Status failure_status = 7
- [(google.api.field_behavior) = OUTPUT_ONLY];
- // 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 commitments.
- CommitmentPlan renewal_plan = 8;
- }
- // The request for
- // [ReservationService.CreateReservation][google.cloud.bigquery.reservation.v1beta1.ReservationService.CreateReservation].
- message CreateReservationRequest {
- // Required. Project, location. E.g.,
- // `projects/myproject/locations/US`
- string parent = 1 [
- (google.api.field_behavior) = REQUIRED,
- (google.api.resource_reference) = {
- child_type: "bigqueryreservation.googleapis.com/Reservation"
- }
- ];
- // The reservation ID. This field must only contain lower case alphanumeric
- // characters or dash. Max length is 64 characters.
- string reservation_id = 2;
- // Content of the new reservation to create.
- Reservation reservation = 3;
- }
- // The request for
- // [ReservationService.ListReservations][google.cloud.bigquery.reservation.v1beta1.ReservationService.ListReservations].
- message ListReservationsRequest {
- // Required. The parent resource name containing project and location, e.g.:
- // `projects/myproject/locations/US`
- string parent = 1 [
- (google.api.field_behavior) = REQUIRED,
- (google.api.resource_reference) = {
- child_type: "bigqueryreservation.googleapis.com/Reservation"
- }
- ];
- // The maximum number of items to return.
- int32 page_size = 2;
- // The next_page_token value returned from a previous List request, if any.
- string page_token = 3;
- // Can be used to filter out reservations based on names, capacity, etc, e.g.:
- // filter="reservation.slot_capacity > 200"
- // filter="reservation.name = \"*dev/*\""
- // Advanced filtering syntax can be
- // [here](https://cloud.google.com/logging/docs/view/advanced-filters).
- string filter = 4;
- }
- // The response for
- // [ReservationService.ListReservations][google.cloud.bigquery.reservation.v1beta1.ReservationService.ListReservations].
- message ListReservationsResponse {
- // List of reservations visible to the user.
- repeated Reservation reservations = 1;
- // Token to retrieve the next page of results, or empty if there are no
- // more results in the list.
- string next_page_token = 2;
- }
- // The request for
- // [ReservationService.GetReservation][google.cloud.bigquery.reservation.v1beta1.ReservationService.GetReservation].
- message GetReservationRequest {
- // Required. Resource name of the reservation to retrieve. E.g.,
- // `projects/myproject/locations/US/reservations/team1-prod`
- string name = 1 [
- (google.api.field_behavior) = REQUIRED,
- (google.api.resource_reference) = {
- type: "bigqueryreservation.googleapis.com/Reservation"
- }
- ];
- }
- // The request for
- // [ReservationService.DeleteReservation][google.cloud.bigquery.reservation.v1beta1.ReservationService.DeleteReservation].
- message DeleteReservationRequest {
- // Required. Resource name of the reservation to retrieve. E.g.,
- // `projects/myproject/locations/US/reservations/team1-prod`
- string name = 1 [
- (google.api.field_behavior) = REQUIRED,
- (google.api.resource_reference) = {
- type: "bigqueryreservation.googleapis.com/Reservation"
- }
- ];
- }
- // The request for
- // [ReservationService.UpdateReservation][google.cloud.bigquery.reservation.v1beta1.ReservationService.UpdateReservation].
- message UpdateReservationRequest {
- // Content of the reservation to update.
- Reservation reservation = 1;
- // Standard field mask for the set of fields to be updated.
- google.protobuf.FieldMask update_mask = 2;
- }
- // The request for
- // [ReservationService.CreateCapacityCommitment][google.cloud.bigquery.reservation.v1beta1.ReservationService.CreateCapacityCommitment].
- message CreateCapacityCommitmentRequest {
- // Required. Resource name of the parent reservation. E.g.,
- // `projects/myproject/locations/US`
- string parent = 1 [
- (google.api.field_behavior) = REQUIRED,
- (google.api.resource_reference) = {
- child_type: "bigqueryreservation.googleapis.com/CapacityCommitment"
- }
- ];
- // Content of the capacity commitment to create.
- CapacityCommitment capacity_commitment = 2;
- // If true, fail the request if another project in the organization has a
- // capacity commitment.
- bool enforce_single_admin_project_per_org = 4;
- }
- // The request for
- // [ReservationService.ListCapacityCommitments][google.cloud.bigquery.reservation.v1beta1.ReservationService.ListCapacityCommitments].
- message ListCapacityCommitmentsRequest {
- // Required. Resource name of the parent reservation. E.g.,
- // `projects/myproject/locations/US`
- string parent = 1 [
- (google.api.field_behavior) = REQUIRED,
- (google.api.resource_reference) = {
- child_type: "bigqueryreservation.googleapis.com/CapacityCommitment"
- }
- ];
- // The maximum number of items to return.
- int32 page_size = 2;
- // The next_page_token value returned from a previous List request, if any.
- string page_token = 3;
- }
- // The response for
- // [ReservationService.ListCapacityCommitments][google.cloud.bigquery.reservation.v1beta1.ReservationService.ListCapacityCommitments].
- message ListCapacityCommitmentsResponse {
- // List of capacity commitments visible to the user.
- repeated CapacityCommitment capacity_commitments = 1;
- // Token to retrieve the next page of results, or empty if there are no
- // more results in the list.
- string next_page_token = 2;
- }
- // The request for
- // [ReservationService.GetCapacityCommitment][google.cloud.bigquery.reservation.v1beta1.ReservationService.GetCapacityCommitment].
- message GetCapacityCommitmentRequest {
- // Required. Resource name of the capacity commitment to retrieve. E.g.,
- // `projects/myproject/locations/US/capacityCommitments/123`
- string name = 1 [
- (google.api.field_behavior) = REQUIRED,
- (google.api.resource_reference) = {
- type: "bigqueryreservation.googleapis.com/CapacityCommitment"
- }
- ];
- }
- // The request for
- // [ReservationService.DeleteCapacityCommitment][google.cloud.bigquery.reservation.v1beta1.ReservationService.DeleteCapacityCommitment].
- message DeleteCapacityCommitmentRequest {
- // Required. Resource name of the capacity commitment to delete. E.g.,
- // `projects/myproject/locations/US/capacityCommitments/123`
- string name = 1 [
- (google.api.field_behavior) = REQUIRED,
- (google.api.resource_reference) = {
- type: "bigqueryreservation.googleapis.com/CapacityCommitment"
- }
- ];
- }
- // The request for
- // [ReservationService.UpdateCapacityCommitment][google.cloud.bigquery.reservation.v1beta1.ReservationService.UpdateCapacityCommitment].
- message UpdateCapacityCommitmentRequest {
- // Content of the capacity commitment to update.
- CapacityCommitment capacity_commitment = 1;
- // Standard field mask for the set of fields to be updated.
- google.protobuf.FieldMask update_mask = 2;
- }
- // The request for
- // [ReservationService.SplitCapacityCommitment][google.cloud.bigquery.reservation.v1beta1.ReservationService.SplitCapacityCommitment].
- message SplitCapacityCommitmentRequest {
- // Required. The resource name e.g.,:
- // `projects/myproject/locations/US/capacityCommitments/123`
- string name = 1 [
- (google.api.field_behavior) = REQUIRED,
- (google.api.resource_reference) = {
- type: "bigqueryreservation.googleapis.com/CapacityCommitment"
- }
- ];
- // Number of slots in the capacity commitment after the split.
- int64 slot_count = 2;
- }
- // The response for
- // [ReservationService.SplitCapacityCommitment][google.cloud.bigquery.reservation.v1beta1.ReservationService.SplitCapacityCommitment].
- message SplitCapacityCommitmentResponse {
- // First capacity commitment, result of a split.
- CapacityCommitment first = 1;
- // Second capacity commitment, result of a split.
- CapacityCommitment second = 2;
- }
- // The request for
- // [ReservationService.MergeCapacityCommitments][google.cloud.bigquery.reservation.v1beta1.ReservationService.MergeCapacityCommitments].
- message MergeCapacityCommitmentsRequest {
- // Parent resource that identifies admin project and location e.g.,
- // `projects/myproject/locations/us`
- string parent = 1 [(google.api.resource_reference) = {
- child_type: "bigqueryreservation.googleapis.com/CapacityCommitment"
- }];
- // Ids of capacity commitments to merge.
- // These capacity commitments must exist under admin project and location
- // specified in the parent.
- repeated string capacity_commitment_ids = 2;
- }
- // A Assignment allows a project to submit jobs
- // of a certain type using slots from the specified reservation.
- message Assignment {
- option (google.api.resource) = {
- type: "bigqueryreservation.googleapis.com/Assignment"
- pattern: "projects/{project}/locations/{location}/reservations/{reservation}/assignments/{assignment}"
- };
- // Types of job, which could be specified when using the reservation.
- enum JobType {
- // Invalid type. Requests with this value will be rejected with
- // error code `google.rpc.Code.INVALID_ARGUMENT`.
- JOB_TYPE_UNSPECIFIED = 0;
- // Pipeline (load/export) jobs from the project will use the reservation.
- PIPELINE = 1;
- // Query jobs from the project will use the reservation.
- QUERY = 2;
- }
- // Assignment will remain in PENDING state if no active capacity commitment is
- // present. It will become ACTIVE when some capacity commitment becomes
- // active.
- enum State {
- // Invalid state value.
- STATE_UNSPECIFIED = 0;
- // Queries from assignee will be executed as on-demand, if related
- // assignment is pending.
- PENDING = 1;
- // Assignment is ready.
- ACTIVE = 2;
- }
- // Output only. Name of the resource. E.g.:
- // `projects/myproject/locations/US/reservations/team1-prod/assignments/123`.
- string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
- // The resource which will use the reservation. E.g.
- // `projects/myproject`, `folders/123`, or `organizations/456`.
- string assignee = 4;
- // Which type of jobs will use the reservation.
- JobType job_type = 3;
- // Output only. State of the assignment.
- State state = 6 [(google.api.field_behavior) = OUTPUT_ONLY];
- }
- // The request for
- // [ReservationService.CreateAssignment][google.cloud.bigquery.reservation.v1beta1.ReservationService.CreateAssignment].
- // Note: "bigquery.reservationAssignments.create" permission is required on the
- // related assignee.
- message CreateAssignmentRequest {
- // Required. The parent resource name of the assignment
- // E.g. `projects/myproject/locations/US/reservations/team1-prod`
- string parent = 1 [
- (google.api.field_behavior) = REQUIRED,
- (google.api.resource_reference) = {
- child_type: "bigqueryreservation.googleapis.com/Assignment"
- }
- ];
- // Assignment resource to create.
- Assignment assignment = 2;
- }
- // The request for
- // [ReservationService.ListAssignments][google.cloud.bigquery.reservation.v1beta1.ReservationService.ListAssignments].
- message ListAssignmentsRequest {
- // Required. The parent resource name e.g.:
- //
- // `projects/myproject/locations/US/reservations/team1-prod`
- //
- // Or:
- //
- // `projects/myproject/locations/US/reservations/-`
- string parent = 1 [
- (google.api.field_behavior) = REQUIRED,
- (google.api.resource_reference) = {
- child_type: "bigqueryreservation.googleapis.com/Assignment"
- }
- ];
- // The maximum number of items to return.
- int32 page_size = 2;
- // The next_page_token value returned from a previous List request, if any.
- string page_token = 3;
- }
- // The response for
- // [ReservationService.ListAssignments][google.cloud.bigquery.reservation.v1beta1.ReservationService.ListAssignments].
- message ListAssignmentsResponse {
- // List of assignments visible to the user.
- repeated Assignment assignments = 1;
- // Token to retrieve the next page of results, or empty if there are no
- // more results in the list.
- string next_page_token = 2;
- }
- // The request for
- // [ReservationService.DeleteAssignment][google.cloud.bigquery.reservation.v1beta1.ReservationService.DeleteAssignment].
- // Note: "bigquery.reservationAssignments.delete" permission is required on the
- // related assignee.
- message DeleteAssignmentRequest {
- // Required. Name of the resource, e.g.
- // `projects/myproject/locations/US/reservations/team1-prod/assignments/123`
- string name = 1 [
- (google.api.field_behavior) = REQUIRED,
- (google.api.resource_reference) = {
- type: "bigqueryreservation.googleapis.com/Assignment"
- }
- ];
- }
- // The request for
- // [ReservationService.SearchAssignments][google.cloud.bigquery.reservation.v1beta1.ReservationService.SearchAssignments].
- // Note: "bigquery.reservationAssignments.search" permission is required on the
- // related assignee.
- message SearchAssignmentsRequest {
- // Required. The resource name of the admin project(containing project and
- // location), e.g.:
- // `projects/myproject/locations/US`.
- string parent = 1 [
- (google.api.field_behavior) = REQUIRED,
- (google.api.resource_reference) = {
- type: "locations.googleapis.com/Location"
- }
- ];
- // Please specify resource name as assignee in the query.
- //
- // Examples:
- //
- // * `assignee=projects/myproject`
- // * `assignee=folders/123`
- // * `assignee=organizations/456`
- string query = 2;
- // The maximum number of items to return.
- int32 page_size = 3;
- // The next_page_token value returned from a previous List request, if any.
- string page_token = 4;
- }
- // The response for
- // [ReservationService.SearchAssignments][google.cloud.bigquery.reservation.v1beta1.ReservationService.SearchAssignments].
- message SearchAssignmentsResponse {
- // List of assignments visible to the user.
- repeated Assignment assignments = 1;
- // Token to retrieve the next page of results, or empty if there are no
- // more results in the list.
- string next_page_token = 2;
- }
- // The request for
- // [ReservationService.MoveAssignment][google.cloud.bigquery.reservation.v1beta1.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.
- message MoveAssignmentRequest {
- // Required. The resource name of the assignment,
- // e.g.
- // `projects/myproject/locations/US/reservations/team1-prod/assignments/123`
- string name = 1 [
- (google.api.field_behavior) = REQUIRED,
- (google.api.resource_reference) = {
- type: "bigqueryreservation.googleapis.com/Assignment"
- }
- ];
- // The new reservation ID, e.g.:
- // `projects/myotherproject/locations/US/reservations/team2-prod`
- string destination_id = 3 [(google.api.resource_reference) = {
- child_type: "bigqueryreservation.googleapis.com/Assignment"
- }];
- }
- // Represents a BI Reservation.
- message BiReservation {
- option (google.api.resource) = {
- type: "bigqueryreservation.googleapis.com/BiReservation"
- pattern: "projects/{project}/locations/{location}/bireservation/{bireservation}"
- };
- // The resource name of the singleton BI reservation.
- // Reservation names have the form
- // `projects/{project_id}/locations/{location_id}/bireservation`.
- string name = 1;
- // Output only. The last update timestamp of a reservation.
- google.protobuf.Timestamp update_time = 3
- [(google.api.field_behavior) = OUTPUT_ONLY];
- // Size of a reservation, in bytes.
- int64 size = 4;
- }
- // A request to get a singleton BI reservation.
- message GetBiReservationRequest {
- // Required. Name of the requested reservation, for example:
- // `projects/{project_id}/locations/{location_id}/bireservation`
- string name = 1 [
- (google.api.field_behavior) = REQUIRED,
- (google.api.resource_reference) = {
- type: "bigqueryreservation.googleapis.com/BiReservation"
- }
- ];
- }
- // A request to update a BI reservation.
- message UpdateBiReservationRequest {
- // A reservation to update.
- BiReservation reservation = 1;
- // A list of fields to be updated in this request.
- google.protobuf.FieldMask update_mask = 2;
- }
|