reservation.proto 34 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876
  1. // Copyright 2020 Google LLC
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. //
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. syntax = "proto3";
  15. package google.cloud.bigquery.reservation.v1;
  16. import "google/api/annotations.proto";
  17. import "google/api/client.proto";
  18. import "google/api/field_behavior.proto";
  19. import "google/api/resource.proto";
  20. import "google/protobuf/empty.proto";
  21. import "google/protobuf/field_mask.proto";
  22. import "google/protobuf/timestamp.proto";
  23. import "google/rpc/status.proto";
  24. option csharp_namespace = "Google.Cloud.BigQuery.Reservation.V1";
  25. option go_package = "google.golang.org/genproto/googleapis/cloud/bigquery/reservation/v1;reservation";
  26. option java_multiple_files = true;
  27. option java_outer_classname = "ReservationProto";
  28. option java_package = "com.google.cloud.bigquery.reservation.v1";
  29. option php_namespace = "Google\\Cloud\\BigQuery\\Reservation\\V1";
  30. // This API allows users to manage their flat-rate BigQuery reservations.
  31. //
  32. // A reservation provides computational resource guarantees, in the form of
  33. // [slots](https://cloud.google.com/bigquery/docs/slots), to users. A slot is a
  34. // unit of computational power in BigQuery, and serves as the basic unit of
  35. // parallelism. In a scan of a multi-partitioned table, a single slot operates
  36. // on a single partition of the table. A reservation resource exists as a child
  37. // resource of the admin project and location, e.g.:
  38. // `projects/myproject/locations/US/reservations/reservationName`.
  39. //
  40. // A capacity commitment is a way to purchase compute capacity for BigQuery jobs
  41. // (in the form of slots) with some committed period of usage. A capacity
  42. // commitment resource exists as a child resource of the admin project and
  43. // location, e.g.:
  44. // `projects/myproject/locations/US/capacityCommitments/id`.
  45. service ReservationService {
  46. option (google.api.default_host) = "bigqueryreservation.googleapis.com";
  47. option (google.api.oauth_scopes) =
  48. "https://www.googleapis.com/auth/bigquery,"
  49. "https://www.googleapis.com/auth/cloud-platform";
  50. // Creates a new reservation resource.
  51. rpc CreateReservation(CreateReservationRequest) returns (Reservation) {
  52. option (google.api.http) = {
  53. post: "/v1/{parent=projects/*/locations/*}/reservations"
  54. body: "reservation"
  55. };
  56. option (google.api.method_signature) = "parent,reservation,reservation_id";
  57. }
  58. // Lists all the reservations for the project in the specified location.
  59. rpc ListReservations(ListReservationsRequest) returns (ListReservationsResponse) {
  60. option (google.api.http) = {
  61. get: "/v1/{parent=projects/*/locations/*}/reservations"
  62. };
  63. option (google.api.method_signature) = "parent";
  64. }
  65. // Returns information about the reservation.
  66. rpc GetReservation(GetReservationRequest) returns (Reservation) {
  67. option (google.api.http) = {
  68. get: "/v1/{name=projects/*/locations/*/reservations/*}"
  69. };
  70. option (google.api.method_signature) = "name";
  71. }
  72. // Deletes a reservation.
  73. // Returns `google.rpc.Code.FAILED_PRECONDITION` when reservation has
  74. // assignments.
  75. rpc DeleteReservation(DeleteReservationRequest) returns (google.protobuf.Empty) {
  76. option (google.api.http) = {
  77. delete: "/v1/{name=projects/*/locations/*/reservations/*}"
  78. };
  79. option (google.api.method_signature) = "name";
  80. }
  81. // Updates an existing reservation resource.
  82. rpc UpdateReservation(UpdateReservationRequest) returns (Reservation) {
  83. option (google.api.http) = {
  84. patch: "/v1/{reservation.name=projects/*/locations/*/reservations/*}"
  85. body: "reservation"
  86. };
  87. option (google.api.method_signature) = "reservation,update_mask";
  88. }
  89. // Creates a new capacity commitment resource.
  90. rpc CreateCapacityCommitment(CreateCapacityCommitmentRequest) returns (CapacityCommitment) {
  91. option (google.api.http) = {
  92. post: "/v1/{parent=projects/*/locations/*}/capacityCommitments"
  93. body: "capacity_commitment"
  94. };
  95. option (google.api.method_signature) = "parent,capacity_commitment";
  96. }
  97. // Lists all the capacity commitments for the admin project.
  98. rpc ListCapacityCommitments(ListCapacityCommitmentsRequest) returns (ListCapacityCommitmentsResponse) {
  99. option (google.api.http) = {
  100. get: "/v1/{parent=projects/*/locations/*}/capacityCommitments"
  101. };
  102. option (google.api.method_signature) = "parent";
  103. }
  104. // Returns information about the capacity commitment.
  105. rpc GetCapacityCommitment(GetCapacityCommitmentRequest) returns (CapacityCommitment) {
  106. option (google.api.http) = {
  107. get: "/v1/{name=projects/*/locations/*/capacityCommitments/*}"
  108. };
  109. option (google.api.method_signature) = "name";
  110. }
  111. // Deletes a capacity commitment. Attempting to delete capacity commitment
  112. // before its commitment_end_time will fail with the error code
  113. // `google.rpc.Code.FAILED_PRECONDITION`.
  114. rpc DeleteCapacityCommitment(DeleteCapacityCommitmentRequest) returns (google.protobuf.Empty) {
  115. option (google.api.http) = {
  116. delete: "/v1/{name=projects/*/locations/*/capacityCommitments/*}"
  117. };
  118. option (google.api.method_signature) = "name";
  119. }
  120. // Updates an existing capacity commitment.
  121. //
  122. // Only `plan` and `renewal_plan` fields can be updated.
  123. //
  124. // Plan can only be changed to a plan of a longer commitment period.
  125. // Attempting to change to a plan with shorter commitment period will fail
  126. // with the error code `google.rpc.Code.FAILED_PRECONDITION`.
  127. rpc UpdateCapacityCommitment(UpdateCapacityCommitmentRequest) returns (CapacityCommitment) {
  128. option (google.api.http) = {
  129. patch: "/v1/{capacity_commitment.name=projects/*/locations/*/capacityCommitments/*}"
  130. body: "capacity_commitment"
  131. };
  132. option (google.api.method_signature) = "capacity_commitment,update_mask";
  133. }
  134. // Splits capacity commitment to two commitments of the same plan and
  135. // `commitment_end_time`.
  136. //
  137. // A common use case is to enable downgrading commitments.
  138. //
  139. // For example, in order to downgrade from 10000 slots to 8000, you might
  140. // split a 10000 capacity commitment into commitments of 2000 and 8000. Then,
  141. // you would change the plan of the first one to `FLEX` and then delete it.
  142. rpc SplitCapacityCommitment(SplitCapacityCommitmentRequest) returns (SplitCapacityCommitmentResponse) {
  143. option (google.api.http) = {
  144. post: "/v1/{name=projects/*/locations/*/capacityCommitments/*}:split"
  145. body: "*"
  146. };
  147. option (google.api.method_signature) = "name,slot_count";
  148. }
  149. // Merges capacity commitments of the same plan into a single commitment.
  150. //
  151. // The resulting capacity commitment has the greater commitment_end_time
  152. // out of the to-be-merged capacity commitments.
  153. //
  154. // Attempting to merge capacity commitments of different plan will fail
  155. // with the error code `google.rpc.Code.FAILED_PRECONDITION`.
  156. rpc MergeCapacityCommitments(MergeCapacityCommitmentsRequest) returns (CapacityCommitment) {
  157. option (google.api.http) = {
  158. post: "/v1/{parent=projects/*/locations/*}/capacityCommitments:merge"
  159. body: "*"
  160. };
  161. option (google.api.method_signature) = "parent,capacity_commitment_ids";
  162. }
  163. // Creates an assignment object which allows the given project to submit jobs
  164. // of a certain type using slots from the specified reservation.
  165. //
  166. // Currently a
  167. // resource (project, folder, organization) can only have one assignment per
  168. // each (job_type, location) combination, and that reservation will be used
  169. // for all jobs of the matching type.
  170. //
  171. // Different assignments can be created on different levels of the
  172. // projects, folders or organization hierarchy. During query execution,
  173. // the assignment is looked up at the project, folder and organization levels
  174. // in that order. The first assignment found is applied to the query.
  175. //
  176. // When creating assignments, it does not matter if other assignments exist at
  177. // higher levels.
  178. //
  179. // Example:
  180. //
  181. // * The organization `organizationA` contains two projects, `project1`
  182. // and `project2`.
  183. // * Assignments for all three entities (`organizationA`, `project1`, and
  184. // `project2`) could all be created and mapped to the same or different
  185. // reservations.
  186. //
  187. // Returns `google.rpc.Code.PERMISSION_DENIED` if user does not have
  188. // 'bigquery.admin' permissions on the project using the reservation
  189. // and the project that owns this reservation.
  190. //
  191. // Returns `google.rpc.Code.INVALID_ARGUMENT` when location of the assignment
  192. // does not match location of the reservation.
  193. rpc CreateAssignment(CreateAssignmentRequest) returns (Assignment) {
  194. option (google.api.http) = {
  195. post: "/v1/{parent=projects/*/locations/*/reservations/*}/assignments"
  196. body: "assignment"
  197. };
  198. option (google.api.method_signature) = "parent,assignment";
  199. }
  200. // Lists assignments.
  201. //
  202. // Only explicitly created assignments will be returned.
  203. //
  204. // Example:
  205. //
  206. // * Organization `organizationA` contains two projects, `project1` and
  207. // `project2`.
  208. // * Reservation `res1` exists and was created previously.
  209. // * CreateAssignment was used previously to define the following
  210. // associations between entities and reservations: `<organizationA, res1>`
  211. // and `<project1, res1>`
  212. //
  213. // In this example, ListAssignments will just return the above two assignments
  214. // for reservation `res1`, and no expansion/merge will happen.
  215. //
  216. // The wildcard "-" can be used for
  217. // reservations in the request. In that case all assignments belongs to the
  218. // specified project and location will be listed.
  219. //
  220. // **Note** "-" cannot be used for projects nor locations.
  221. rpc ListAssignments(ListAssignmentsRequest) returns (ListAssignmentsResponse) {
  222. option (google.api.http) = {
  223. get: "/v1/{parent=projects/*/locations/*/reservations/*}/assignments"
  224. };
  225. option (google.api.method_signature) = "parent";
  226. }
  227. // Deletes a assignment. No expansion will happen.
  228. //
  229. // Example:
  230. //
  231. // * Organization `organizationA` contains two projects, `project1` and
  232. // `project2`.
  233. // * Reservation `res1` exists and was created previously.
  234. // * CreateAssignment was used previously to define the following
  235. // associations between entities and reservations: `<organizationA, res1>`
  236. // and `<project1, res1>`
  237. //
  238. // In this example, deletion of the `<organizationA, res1>` assignment won't
  239. // affect the other assignment `<project1, res1>`. After said deletion,
  240. // queries from `project1` will still use `res1` while queries from
  241. // `project2` will switch to use on-demand mode.
  242. rpc DeleteAssignment(DeleteAssignmentRequest) returns (google.protobuf.Empty) {
  243. option (google.api.http) = {
  244. delete: "/v1/{name=projects/*/locations/*/reservations/*/assignments/*}"
  245. };
  246. option (google.api.method_signature) = "name";
  247. }
  248. // Looks up assignments for a specified resource for a particular region.
  249. // If the request is about a project:
  250. //
  251. // 1. Assignments created on the project will be returned if they exist.
  252. // 2. Otherwise assignments created on the closest ancestor will be
  253. // returned.
  254. // 3. Assignments for different JobTypes will all be returned.
  255. //
  256. // The same logic applies if the request is about a folder.
  257. //
  258. // If the request is about an organization, then assignments created on the
  259. // organization will be returned (organization doesn't have ancestors).
  260. //
  261. // Comparing to ListAssignments, there are some behavior
  262. // differences:
  263. //
  264. // 1. permission on the assignee will be verified in this API.
  265. // 2. Hierarchy lookup (project->folder->organization) happens in this API.
  266. // 3. Parent here is `projects/*/locations/*`, instead of
  267. // `projects/*/locations/*reservations/*`.
  268. //
  269. // **Note** "-" cannot be used for projects
  270. // nor locations.
  271. rpc SearchAssignments(SearchAssignmentsRequest) returns (SearchAssignmentsResponse) {
  272. option (google.api.http) = {
  273. get: "/v1/{parent=projects/*/locations/*}:searchAssignments"
  274. };
  275. option (google.api.method_signature) = "parent,query";
  276. }
  277. // Moves an assignment under a new reservation.
  278. //
  279. // This differs from removing an existing assignment and recreating a new one
  280. // by providing a transactional change that ensures an assignee always has an
  281. // associated reservation.
  282. rpc MoveAssignment(MoveAssignmentRequest) returns (Assignment) {
  283. option (google.api.http) = {
  284. post: "/v1/{name=projects/*/locations/*/reservations/*/assignments/*}:move"
  285. body: "*"
  286. };
  287. option (google.api.method_signature) = "name,destination_id";
  288. }
  289. // Retrieves a BI reservation.
  290. rpc GetBiReservation(GetBiReservationRequest) returns (BiReservation) {
  291. option (google.api.http) = {
  292. get: "/v1/{name=projects/*/locations/*/biReservation}"
  293. };
  294. option (google.api.method_signature) = "name";
  295. }
  296. // Updates a BI reservation.
  297. //
  298. // Only fields specified in the `field_mask` are updated.
  299. //
  300. // A singleton BI reservation always exists with default size 0.
  301. // In order to reserve BI capacity it needs to be updated to an amount
  302. // greater than 0. In order to release BI capacity reservation size
  303. // must be set to 0.
  304. rpc UpdateBiReservation(UpdateBiReservationRequest) returns (BiReservation) {
  305. option (google.api.http) = {
  306. patch: "/v1/{bi_reservation.name=projects/*/locations/*/biReservation}"
  307. body: "bi_reservation"
  308. };
  309. option (google.api.method_signature) = "bi_reservation,update_mask";
  310. }
  311. }
  312. // A reservation is a mechanism used to guarantee slots to users.
  313. message Reservation {
  314. option (google.api.resource) = {
  315. type: "bigqueryreservation.googleapis.com/Reservation"
  316. pattern: "projects/{project}/locations/{location}/reservations/{reservation}"
  317. };
  318. // The resource name of the reservation, e.g.,
  319. // `projects/*/locations/*/reservations/team1-prod`.
  320. string name = 1;
  321. // Minimum slots available to this reservation. A slot is a unit of
  322. // computational power in BigQuery, and serves as the unit of parallelism.
  323. //
  324. // Queries using this reservation might use more slots during runtime if
  325. // ignore_idle_slots is set to false.
  326. //
  327. // If the new reservation's slot capacity exceed the parent's slot capacity or
  328. // if total slot capacity of the new reservation and its siblings exceeds the
  329. // parent's slot capacity, the request will fail with
  330. // `google.rpc.Code.RESOURCE_EXHAUSTED`.
  331. int64 slot_capacity = 2;
  332. // If false, any query using this reservation will use idle slots from other
  333. // reservations within the same admin project. If true, a query using this
  334. // reservation will execute with the slot capacity specified above at most.
  335. bool ignore_idle_slots = 4;
  336. }
  337. // Capacity commitment is a way to purchase compute capacity for BigQuery jobs
  338. // (in the form of slots) with some committed period of usage. Annual
  339. // commitments renew by default. Commitments can be removed after their
  340. // commitment end time passes.
  341. //
  342. // In order to remove annual commitment, its plan needs to be changed
  343. // to monthly or flex first.
  344. //
  345. // A capacity commitment resource exists as a child resource of the admin
  346. // project.
  347. message CapacityCommitment {
  348. option (google.api.resource) = {
  349. type: "bigqueryreservation.googleapis.com/CapacityCommitment"
  350. pattern: "projects/{project}/locations/{location}/capacityCommitments/{capacity_commitment}"
  351. };
  352. // Commitment plan defines the current committed period. Capacity commitment
  353. // cannot be deleted during it's committed period.
  354. enum CommitmentPlan {
  355. // Invalid plan value. Requests with this value will be rejected with
  356. // error code `google.rpc.Code.INVALID_ARGUMENT`.
  357. COMMITMENT_PLAN_UNSPECIFIED = 0;
  358. // Flex commitments have committed period of 1 minute after becoming ACTIVE.
  359. // After that, they are not in a committed period anymore and can be removed
  360. // any time.
  361. FLEX = 3;
  362. // Trial commitments have a committed period of 182 days after becoming
  363. // ACTIVE. After that, they are converted to a new commitment based on the
  364. // `renewal_plan`. Default `renewal_plan` for Trial commitment is Flex so
  365. // that it can be deleted right after committed period ends.
  366. TRIAL = 5;
  367. // Monthly commitments have a committed period of 30 days after becoming
  368. // ACTIVE. After that, they are not in a committed period anymore and can be
  369. // removed any time.
  370. MONTHLY = 2;
  371. // Annual commitments have a committed period of 365 days after becoming
  372. // ACTIVE. After that they are converted to a new commitment based on the
  373. // renewal_plan.
  374. ANNUAL = 4;
  375. }
  376. // Capacity commitment can either become ACTIVE right away or transition
  377. // from PENDING to ACTIVE or FAILED.
  378. enum State {
  379. // Invalid state value.
  380. STATE_UNSPECIFIED = 0;
  381. // Capacity commitment is pending provisioning. Pending capacity commitment
  382. // does not contribute to the parent's slot_capacity.
  383. PENDING = 1;
  384. // Once slots are provisioned, capacity commitment becomes active.
  385. // slot_count is added to the parent's slot_capacity.
  386. ACTIVE = 2;
  387. // Capacity commitment is failed to be activated by the backend.
  388. FAILED = 3;
  389. }
  390. // Output only. The resource name of the capacity commitment, e.g.,
  391. // `projects/myproject/locations/US/capacityCommitments/123`
  392. string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
  393. // Number of slots in this commitment.
  394. int64 slot_count = 2;
  395. // Capacity commitment commitment plan.
  396. CommitmentPlan plan = 3;
  397. // Output only. State of the commitment.
  398. State state = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
  399. // Output only. The end of the current commitment period. It is applicable only for ACTIVE
  400. // capacity commitments.
  401. google.protobuf.Timestamp commitment_end_time = 5 [(google.api.field_behavior) = OUTPUT_ONLY];
  402. // Output only. For FAILED commitment plan, provides the reason of failure.
  403. google.rpc.Status failure_status = 7 [(google.api.field_behavior) = OUTPUT_ONLY];
  404. // The plan this capacity commitment is converted to after commitment_end_time
  405. // passes. Once the plan is changed, committed period is extended according to
  406. // commitment plan. Only applicable for ANNUAL and TRIAL commitments.
  407. CommitmentPlan renewal_plan = 8;
  408. }
  409. // The request for [ReservationService.CreateReservation][google.cloud.bigquery.reservation.v1.ReservationService.CreateReservation].
  410. message CreateReservationRequest {
  411. // Required. Project, location. E.g.,
  412. // `projects/myproject/locations/US`
  413. string parent = 1 [
  414. (google.api.field_behavior) = REQUIRED,
  415. (google.api.resource_reference) = {
  416. child_type: "bigqueryreservation.googleapis.com/Reservation"
  417. }
  418. ];
  419. // The reservation ID. This field must only contain lower case alphanumeric
  420. // characters or dash. Max length is 64 characters.
  421. string reservation_id = 2;
  422. // Definition of the new reservation to create.
  423. Reservation reservation = 3;
  424. }
  425. // The request for [ReservationService.ListReservations][google.cloud.bigquery.reservation.v1.ReservationService.ListReservations].
  426. message ListReservationsRequest {
  427. // Required. The parent resource name containing project and location, e.g.:
  428. // `projects/myproject/locations/US`
  429. string parent = 1 [
  430. (google.api.field_behavior) = REQUIRED,
  431. (google.api.resource_reference) = {
  432. child_type: "bigqueryreservation.googleapis.com/Reservation"
  433. }
  434. ];
  435. // The maximum number of items to return per page.
  436. int32 page_size = 2;
  437. // The next_page_token value returned from a previous List request, if any.
  438. string page_token = 3;
  439. }
  440. // The response for [ReservationService.ListReservations][google.cloud.bigquery.reservation.v1.ReservationService.ListReservations].
  441. message ListReservationsResponse {
  442. // List of reservations visible to the user.
  443. repeated Reservation reservations = 1;
  444. // Token to retrieve the next page of results, or empty if there are no
  445. // more results in the list.
  446. string next_page_token = 2;
  447. }
  448. // The request for [ReservationService.GetReservation][google.cloud.bigquery.reservation.v1.ReservationService.GetReservation].
  449. message GetReservationRequest {
  450. // Required. Resource name of the reservation to retrieve. E.g.,
  451. // `projects/myproject/locations/US/reservations/team1-prod`
  452. string name = 1 [
  453. (google.api.field_behavior) = REQUIRED,
  454. (google.api.resource_reference) = {
  455. type: "bigqueryreservation.googleapis.com/Reservation"
  456. }
  457. ];
  458. }
  459. // The request for [ReservationService.DeleteReservation][google.cloud.bigquery.reservation.v1.ReservationService.DeleteReservation].
  460. message DeleteReservationRequest {
  461. // Required. Resource name of the reservation to retrieve. E.g.,
  462. // `projects/myproject/locations/US/reservations/team1-prod`
  463. string name = 1 [
  464. (google.api.field_behavior) = REQUIRED,
  465. (google.api.resource_reference) = {
  466. type: "bigqueryreservation.googleapis.com/Reservation"
  467. }
  468. ];
  469. }
  470. // The request for [ReservationService.UpdateReservation][google.cloud.bigquery.reservation.v1.ReservationService.UpdateReservation].
  471. message UpdateReservationRequest {
  472. // Content of the reservation to update.
  473. Reservation reservation = 1;
  474. // Standard field mask for the set of fields to be updated.
  475. google.protobuf.FieldMask update_mask = 2;
  476. }
  477. // The request for [ReservationService.CreateCapacityCommitment][google.cloud.bigquery.reservation.v1.ReservationService.CreateCapacityCommitment].
  478. message CreateCapacityCommitmentRequest {
  479. // Required. Resource name of the parent reservation. E.g.,
  480. // `projects/myproject/locations/US`
  481. string parent = 1 [
  482. (google.api.field_behavior) = REQUIRED,
  483. (google.api.resource_reference) = {
  484. child_type: "bigqueryreservation.googleapis.com/CapacityCommitment"
  485. }
  486. ];
  487. // Content of the capacity commitment to create.
  488. CapacityCommitment capacity_commitment = 2;
  489. // If true, fail the request if another project in the organization has a
  490. // capacity commitment.
  491. bool enforce_single_admin_project_per_org = 4;
  492. }
  493. // The request for [ReservationService.ListCapacityCommitments][google.cloud.bigquery.reservation.v1.ReservationService.ListCapacityCommitments].
  494. message ListCapacityCommitmentsRequest {
  495. // Required. Resource name of the parent reservation. E.g.,
  496. // `projects/myproject/locations/US`
  497. string parent = 1 [
  498. (google.api.field_behavior) = REQUIRED,
  499. (google.api.resource_reference) = {
  500. child_type: "bigqueryreservation.googleapis.com/CapacityCommitment"
  501. }
  502. ];
  503. // The maximum number of items to return.
  504. int32 page_size = 2;
  505. // The next_page_token value returned from a previous List request, if any.
  506. string page_token = 3;
  507. }
  508. // The response for [ReservationService.ListCapacityCommitments][google.cloud.bigquery.reservation.v1.ReservationService.ListCapacityCommitments].
  509. message ListCapacityCommitmentsResponse {
  510. // List of capacity commitments visible to the user.
  511. repeated CapacityCommitment capacity_commitments = 1;
  512. // Token to retrieve the next page of results, or empty if there are no
  513. // more results in the list.
  514. string next_page_token = 2;
  515. }
  516. // The request for [ReservationService.GetCapacityCommitment][google.cloud.bigquery.reservation.v1.ReservationService.GetCapacityCommitment].
  517. message GetCapacityCommitmentRequest {
  518. // Required. Resource name of the capacity commitment to retrieve. E.g.,
  519. // `projects/myproject/locations/US/capacityCommitments/123`
  520. string name = 1 [
  521. (google.api.field_behavior) = REQUIRED,
  522. (google.api.resource_reference) = {
  523. type: "bigqueryreservation.googleapis.com/CapacityCommitment"
  524. }
  525. ];
  526. }
  527. // The request for [ReservationService.DeleteCapacityCommitment][google.cloud.bigquery.reservation.v1.ReservationService.DeleteCapacityCommitment].
  528. message DeleteCapacityCommitmentRequest {
  529. // Required. Resource name of the capacity commitment to delete. E.g.,
  530. // `projects/myproject/locations/US/capacityCommitments/123`
  531. string name = 1 [
  532. (google.api.field_behavior) = REQUIRED,
  533. (google.api.resource_reference) = {
  534. type: "bigqueryreservation.googleapis.com/CapacityCommitment"
  535. }
  536. ];
  537. }
  538. // The request for [ReservationService.UpdateCapacityCommitment][google.cloud.bigquery.reservation.v1.ReservationService.UpdateCapacityCommitment].
  539. message UpdateCapacityCommitmentRequest {
  540. // Content of the capacity commitment to update.
  541. CapacityCommitment capacity_commitment = 1;
  542. // Standard field mask for the set of fields to be updated.
  543. google.protobuf.FieldMask update_mask = 2;
  544. }
  545. // The request for [ReservationService.SplitCapacityCommitment][google.cloud.bigquery.reservation.v1.ReservationService.SplitCapacityCommitment].
  546. message SplitCapacityCommitmentRequest {
  547. // Required. The resource name e.g.,:
  548. // `projects/myproject/locations/US/capacityCommitments/123`
  549. string name = 1 [
  550. (google.api.field_behavior) = REQUIRED,
  551. (google.api.resource_reference) = {
  552. type: "bigqueryreservation.googleapis.com/CapacityCommitment"
  553. }
  554. ];
  555. // Number of slots in the capacity commitment after the split.
  556. int64 slot_count = 2;
  557. }
  558. // The response for [ReservationService.SplitCapacityCommitment][google.cloud.bigquery.reservation.v1.ReservationService.SplitCapacityCommitment].
  559. message SplitCapacityCommitmentResponse {
  560. // First capacity commitment, result of a split.
  561. CapacityCommitment first = 1;
  562. // Second capacity commitment, result of a split.
  563. CapacityCommitment second = 2;
  564. }
  565. // The request for [ReservationService.MergeCapacityCommitments][google.cloud.bigquery.reservation.v1.ReservationService.MergeCapacityCommitments].
  566. message MergeCapacityCommitmentsRequest {
  567. // Parent resource that identifies admin project and location e.g.,
  568. // `projects/myproject/locations/us`
  569. string parent = 1 [(google.api.resource_reference) = {
  570. child_type: "bigqueryreservation.googleapis.com/CapacityCommitment"
  571. }];
  572. // Ids of capacity commitments to merge.
  573. // These capacity commitments must exist under admin project and location
  574. // specified in the parent.
  575. // ID is the last portion of capacity commitment name e.g., 'abc' for
  576. // projects/myproject/locations/US/capacityCommitments/abc
  577. repeated string capacity_commitment_ids = 2;
  578. }
  579. // A Assignment allows a project to submit jobs
  580. // of a certain type using slots from the specified reservation.
  581. message Assignment {
  582. option (google.api.resource) = {
  583. type: "bigqueryreservation.googleapis.com/Assignment"
  584. pattern: "projects/{project}/locations/{location}/reservations/{reservation}/assignments/{assignment}"
  585. };
  586. // Types of job, which could be specified when using the reservation.
  587. enum JobType {
  588. // Invalid type. Requests with this value will be rejected with
  589. // error code `google.rpc.Code.INVALID_ARGUMENT`.
  590. JOB_TYPE_UNSPECIFIED = 0;
  591. // Pipeline (load/export) jobs from the project will use the reservation.
  592. PIPELINE = 1;
  593. // Query jobs from the project will use the reservation.
  594. QUERY = 2;
  595. }
  596. // Assignment will remain in PENDING state if no active capacity commitment is
  597. // present. It will become ACTIVE when some capacity commitment becomes
  598. // active.
  599. enum State {
  600. // Invalid state value.
  601. STATE_UNSPECIFIED = 0;
  602. // Queries from assignee will be executed as on-demand, if related
  603. // assignment is pending.
  604. PENDING = 1;
  605. // Assignment is ready.
  606. ACTIVE = 2;
  607. }
  608. // Output only. Name of the resource. E.g.:
  609. // `projects/myproject/locations/US/reservations/team1-prod/assignments/123`.
  610. string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
  611. // The resource which will use the reservation. E.g.
  612. // `projects/myproject`, `folders/123`, or `organizations/456`.
  613. string assignee = 4;
  614. // Which type of jobs will use the reservation.
  615. JobType job_type = 3;
  616. // Output only. State of the assignment.
  617. State state = 6 [(google.api.field_behavior) = OUTPUT_ONLY];
  618. }
  619. // The request for [ReservationService.CreateAssignment][google.cloud.bigquery.reservation.v1.ReservationService.CreateAssignment].
  620. // Note: "bigquery.reservationAssignments.create" permission is required on the
  621. // related assignee.
  622. message CreateAssignmentRequest {
  623. // Required. The parent resource name of the assignment
  624. // E.g. `projects/myproject/locations/US/reservations/team1-prod`
  625. string parent = 1 [
  626. (google.api.field_behavior) = REQUIRED,
  627. (google.api.resource_reference) = {
  628. child_type: "bigqueryreservation.googleapis.com/Assignment"
  629. }
  630. ];
  631. // Assignment resource to create.
  632. Assignment assignment = 2;
  633. }
  634. // The request for [ReservationService.ListAssignments][google.cloud.bigquery.reservation.v1.ReservationService.ListAssignments].
  635. message ListAssignmentsRequest {
  636. // Required. The parent resource name e.g.:
  637. //
  638. // `projects/myproject/locations/US/reservations/team1-prod`
  639. //
  640. // Or:
  641. //
  642. // `projects/myproject/locations/US/reservations/-`
  643. string parent = 1 [
  644. (google.api.field_behavior) = REQUIRED,
  645. (google.api.resource_reference) = {
  646. child_type: "bigqueryreservation.googleapis.com/Assignment"
  647. }
  648. ];
  649. // The maximum number of items to return per page.
  650. int32 page_size = 2;
  651. // The next_page_token value returned from a previous List request, if any.
  652. string page_token = 3;
  653. }
  654. // The response for [ReservationService.ListAssignments][google.cloud.bigquery.reservation.v1.ReservationService.ListAssignments].
  655. message ListAssignmentsResponse {
  656. // List of assignments visible to the user.
  657. repeated Assignment assignments = 1;
  658. // Token to retrieve the next page of results, or empty if there are no
  659. // more results in the list.
  660. string next_page_token = 2;
  661. }
  662. // The request for [ReservationService.DeleteAssignment][google.cloud.bigquery.reservation.v1.ReservationService.DeleteAssignment].
  663. // Note: "bigquery.reservationAssignments.delete" permission is required on the
  664. // related assignee.
  665. message DeleteAssignmentRequest {
  666. // Required. Name of the resource, e.g.
  667. // `projects/myproject/locations/US/reservations/team1-prod/assignments/123`
  668. string name = 1 [
  669. (google.api.field_behavior) = REQUIRED,
  670. (google.api.resource_reference) = {
  671. type: "bigqueryreservation.googleapis.com/Assignment"
  672. }
  673. ];
  674. }
  675. // The request for
  676. // [ReservationService.SearchAssignments][google.cloud.bigquery.reservation.v1.ReservationService.SearchAssignments].
  677. // Note: "bigquery.reservationAssignments.search" permission is required on the
  678. // related assignee.
  679. message SearchAssignmentsRequest {
  680. // Required. The resource name of the admin project(containing project and location),
  681. // e.g.:
  682. // `projects/myproject/locations/US`.
  683. string parent = 1 [
  684. (google.api.field_behavior) = REQUIRED,
  685. (google.api.resource_reference) = {
  686. type: "locations.googleapis.com/Location"
  687. }
  688. ];
  689. // Please specify resource name as assignee in the query.
  690. //
  691. // Examples:
  692. //
  693. // * `assignee=projects/myproject`
  694. // * `assignee=folders/123`
  695. // * `assignee=organizations/456`
  696. string query = 2;
  697. // The maximum number of items to return per page.
  698. int32 page_size = 3;
  699. // The next_page_token value returned from a previous List request, if any.
  700. string page_token = 4;
  701. }
  702. // The response for [ReservationService.SearchAssignments][google.cloud.bigquery.reservation.v1.ReservationService.SearchAssignments].
  703. message SearchAssignmentsResponse {
  704. // List of assignments visible to the user.
  705. repeated Assignment assignments = 1;
  706. // Token to retrieve the next page of results, or empty if there are no
  707. // more results in the list.
  708. string next_page_token = 2;
  709. }
  710. // The request for
  711. // [ReservationService.MoveAssignment][google.cloud.bigquery.reservation.v1.ReservationService.MoveAssignment].
  712. //
  713. // **Note**: "bigquery.reservationAssignments.create" permission is required on
  714. // the destination_id.
  715. //
  716. // **Note**: "bigquery.reservationAssignments.create" and
  717. // "bigquery.reservationAssignments.delete" permission are required on the
  718. // related assignee.
  719. message MoveAssignmentRequest {
  720. // Required. The resource name of the assignment,
  721. // e.g.
  722. // `projects/myproject/locations/US/reservations/team1-prod/assignments/123`
  723. string name = 1 [
  724. (google.api.field_behavior) = REQUIRED,
  725. (google.api.resource_reference) = {
  726. type: "bigqueryreservation.googleapis.com/Assignment"
  727. }
  728. ];
  729. // The new reservation ID, e.g.:
  730. // `projects/myotherproject/locations/US/reservations/team2-prod`
  731. string destination_id = 3 [(google.api.resource_reference) = {
  732. child_type: "bigqueryreservation.googleapis.com/Assignment"
  733. }];
  734. }
  735. // Represents a BI Reservation.
  736. message BiReservation {
  737. option (google.api.resource) = {
  738. type: "bigqueryreservation.googleapis.com/BiReservation"
  739. pattern: "projects/{project}/locations/{location}/bireservation"
  740. };
  741. // The resource name of the singleton BI reservation.
  742. // Reservation names have the form
  743. // `projects/{project_id}/locations/{location_id}/bireservation`.
  744. string name = 1;
  745. // Output only. The last update timestamp of a reservation.
  746. google.protobuf.Timestamp update_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
  747. // Size of a reservation, in bytes.
  748. int64 size = 4;
  749. }
  750. // A request to get a singleton BI reservation.
  751. message GetBiReservationRequest {
  752. // Required. Name of the requested reservation, for example:
  753. // `projects/{project_id}/locations/{location_id}/bireservation`
  754. string name = 1 [
  755. (google.api.field_behavior) = REQUIRED,
  756. (google.api.resource_reference) = {
  757. type: "bigqueryreservation.googleapis.com/BiReservation"
  758. }
  759. ];
  760. }
  761. // A request to update a BI reservation.
  762. message UpdateBiReservationRequest {
  763. // A reservation to update.
  764. BiReservation bi_reservation = 1;
  765. // A list of fields to be updated in this request.
  766. google.protobuf.FieldMask update_mask = 2;
  767. }