reservation.proto 34 KB

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