metastore_federation.proto 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361
  1. // Copyright 2022 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.metastore.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/longrunning/operations.proto";
  21. import "google/protobuf/field_mask.proto";
  22. import "google/protobuf/timestamp.proto";
  23. option go_package = "google.golang.org/genproto/googleapis/cloud/metastore/v1;metastore";
  24. option java_multiple_files = true;
  25. option java_outer_classname = "MetastoreFederationProto";
  26. option java_package = "com.google.cloud.metastore.v1";
  27. // Configures and manages metastore federation services.
  28. // Dataproc Metastore Federation Service allows federating a collection of
  29. // backend metastores like BigQuery, Dataplex Lakes, and other Dataproc
  30. // Metastores. The Federation Service exposes a gRPC URL through which metadata
  31. // from the backend metastores are served at query time.
  32. //
  33. // The Dataproc Metastore Federation API defines the following resource model:
  34. // * The service works with a collection of Google Cloud projects.
  35. // * Each project has a collection of available locations.
  36. // * Each location has a collection of federations.
  37. // * Dataproc Metastore Federations are resources with names of the
  38. // form:
  39. // `projects/{project_number}/locations/{location_id}/federations/{federation_id}`.
  40. service DataprocMetastoreFederation {
  41. option (google.api.default_host) = "metastore.googleapis.com";
  42. option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform";
  43. // Lists federations in a project and location.
  44. rpc ListFederations(ListFederationsRequest) returns (ListFederationsResponse) {
  45. option (google.api.http) = {
  46. get: "/v1/{parent=projects/*/locations/*}/federations"
  47. };
  48. option (google.api.method_signature) = "parent";
  49. }
  50. // Gets the details of a single federation.
  51. rpc GetFederation(GetFederationRequest) returns (Federation) {
  52. option (google.api.http) = {
  53. get: "/v1/{name=projects/*/locations/*/federations/*}"
  54. };
  55. option (google.api.method_signature) = "name";
  56. }
  57. // Creates a metastore federation in a project and location.
  58. rpc CreateFederation(CreateFederationRequest) returns (google.longrunning.Operation) {
  59. option (google.api.http) = {
  60. post: "/v1/{parent=projects/*/locations/*}/federations"
  61. body: "federation"
  62. };
  63. option (google.api.method_signature) = "parent,federation,federation_id";
  64. option (google.longrunning.operation_info) = {
  65. response_type: "Federation"
  66. metadata_type: "google.cloud.metastore.v1.OperationMetadata"
  67. };
  68. }
  69. // Updates the fields of a federation.
  70. rpc UpdateFederation(UpdateFederationRequest) returns (google.longrunning.Operation) {
  71. option (google.api.http) = {
  72. patch: "/v1/{federation.name=projects/*/locations/*/federations/*}"
  73. body: "federation"
  74. };
  75. option (google.api.method_signature) = "federation,update_mask";
  76. option (google.longrunning.operation_info) = {
  77. response_type: "Federation"
  78. metadata_type: "google.cloud.metastore.v1.OperationMetadata"
  79. };
  80. }
  81. // Deletes a single federation.
  82. rpc DeleteFederation(DeleteFederationRequest) returns (google.longrunning.Operation) {
  83. option (google.api.http) = {
  84. delete: "/v1/{name=projects/*/locations/*/federations/*}"
  85. };
  86. option (google.api.method_signature) = "name";
  87. option (google.longrunning.operation_info) = {
  88. response_type: "google.protobuf.Empty"
  89. metadata_type: "google.cloud.metastore.v1.OperationMetadata"
  90. };
  91. }
  92. }
  93. // Represents a federation of multiple backend metastores.
  94. message Federation {
  95. option (google.api.resource) = {
  96. type: "metastore.googleapis.com/Federation"
  97. pattern: "projects/{project}/locations/{location}/federations/{federation}"
  98. };
  99. // The current state of the federation.
  100. enum State {
  101. // The state of the metastore federation is unknown.
  102. STATE_UNSPECIFIED = 0;
  103. // The metastore federation is in the process of being created.
  104. CREATING = 1;
  105. // The metastore federation is running and ready to serve queries.
  106. ACTIVE = 2;
  107. // The metastore federation is being updated. It remains usable but cannot
  108. // accept additional update requests or be deleted at this time.
  109. UPDATING = 3;
  110. // The metastore federation is undergoing deletion. It cannot be used.
  111. DELETING = 4;
  112. // The metastore federation has encountered an error and cannot be used. The
  113. // metastore federation should be deleted.
  114. ERROR = 5;
  115. }
  116. // Immutable. The relative resource name of the federation, of the
  117. // form:
  118. // projects/{project_number}/locations/{location_id}/federations/{federation_id}`.
  119. string name = 1 [(google.api.field_behavior) = IMMUTABLE];
  120. // Output only. The time when the metastore federation was created.
  121. google.protobuf.Timestamp create_time = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
  122. // Output only. The time when the metastore federation was last updated.
  123. google.protobuf.Timestamp update_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
  124. // User-defined labels for the metastore federation.
  125. map<string, string> labels = 4;
  126. // Immutable. The Apache Hive metastore version of the federation. All backend metastore
  127. // versions must be compatible with the federation version.
  128. string version = 5 [(google.api.field_behavior) = IMMUTABLE];
  129. // A map from `BackendMetastore` rank to `BackendMetastore`s from which the
  130. // federation service serves metadata at query time. The map key represents
  131. // the order in which `BackendMetastore`s should be evaluated to resolve
  132. // database names at query time and should be greater than or equal to zero. A
  133. // `BackendMetastore` with a lower number will be evaluated before a
  134. // `BackendMetastore` with a higher number.
  135. map<int32, BackendMetastore> backend_metastores = 6;
  136. // Output only. The federation endpoint.
  137. string endpoint_uri = 7 [(google.api.field_behavior) = OUTPUT_ONLY];
  138. // Output only. The current state of the federation.
  139. State state = 8 [(google.api.field_behavior) = OUTPUT_ONLY];
  140. // Output only. Additional information about the current state of the metastore federation,
  141. // if available.
  142. string state_message = 9 [(google.api.field_behavior) = OUTPUT_ONLY];
  143. // Output only. The globally unique resource identifier of the metastore federation.
  144. string uid = 10 [(google.api.field_behavior) = OUTPUT_ONLY];
  145. }
  146. // Represents a backend metastore for the federation.
  147. message BackendMetastore {
  148. // The type of the backend metastore.
  149. enum MetastoreType {
  150. // The metastore type is not set.
  151. METASTORE_TYPE_UNSPECIFIED = 0;
  152. // The backend metastore is Dataproc Metastore.
  153. DATAPROC_METASTORE = 3;
  154. }
  155. // The relative resource name of the metastore that is being federated.
  156. // The formats of the relative resource names for the currently supported
  157. // metastores are listed below:
  158. //
  159. // * Dataplex
  160. // * `projects/{project_id}/locations/{location}/lakes/{lake_id}`
  161. // * BigQuery
  162. // * `projects/{project_id}`
  163. // * Dataproc Metastore
  164. // * `projects/{project_id}/locations/{location}/services/{service_id}`
  165. string name = 1;
  166. // The type of the backend metastore.
  167. MetastoreType metastore_type = 2;
  168. }
  169. // Request message for ListFederations.
  170. message ListFederationsRequest {
  171. // Required. The relative resource name of the location of metastore federations
  172. // to list, in the following form:
  173. // `projects/{project_number}/locations/{location_id}`.
  174. string parent = 1 [
  175. (google.api.field_behavior) = REQUIRED,
  176. (google.api.resource_reference) = {
  177. child_type: "metastore.googleapis.com/Federation"
  178. }
  179. ];
  180. // Optional. The maximum number of federations to return. The response may contain less
  181. // than the maximum number. If unspecified, no more than 500 services are
  182. // returned. The maximum value is 1000; values above 1000 are changed to 1000.
  183. int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL];
  184. // Optional. A page token, received from a previous ListFederationServices
  185. // call. Provide this token to retrieve the subsequent page.
  186. //
  187. // To retrieve the first page, supply an empty page token.
  188. //
  189. // When paginating, other parameters provided to
  190. // ListFederationServices must match the call that provided the
  191. // page token.
  192. string page_token = 3 [(google.api.field_behavior) = OPTIONAL];
  193. // Optional. The filter to apply to list results.
  194. string filter = 4 [(google.api.field_behavior) = OPTIONAL];
  195. // Optional. Specify the ordering of results as described in [Sorting
  196. // Order](https://cloud.google.com/apis/design/design_patterns#sorting_order).
  197. // If not specified, the results will be sorted in the default order.
  198. string order_by = 5 [(google.api.field_behavior) = OPTIONAL];
  199. }
  200. // Response message for ListFederations
  201. message ListFederationsResponse {
  202. // The services in the specified location.
  203. repeated Federation federations = 1;
  204. // A token that can be sent as `page_token` to retrieve the next page. If this
  205. // field is omitted, there are no subsequent pages.
  206. string next_page_token = 2;
  207. // Locations that could not be reached.
  208. repeated string unreachable = 3;
  209. }
  210. // Request message for GetFederation.
  211. message GetFederationRequest {
  212. // Required. The relative resource name of the metastore federation to retrieve,
  213. // in the following form:
  214. //
  215. // `projects/{project_number}/locations/{location_id}/federations/{federation_id}`.
  216. string name = 1 [
  217. (google.api.field_behavior) = REQUIRED,
  218. (google.api.resource_reference) = {
  219. type: "metastore.googleapis.com/Federation"
  220. }
  221. ];
  222. }
  223. // Request message for CreateFederation.
  224. message CreateFederationRequest {
  225. // Required. The relative resource name of the location in which to create a federation
  226. // service, in the following form:
  227. //
  228. // `projects/{project_number}/locations/{location_id}`.
  229. string parent = 1 [
  230. (google.api.field_behavior) = REQUIRED,
  231. (google.api.resource_reference) = {
  232. child_type: "metastore.googleapis.com/Federation"
  233. }
  234. ];
  235. // Required. The ID of the metastore federation, which is used as the final
  236. // component of the metastore federation's name.
  237. //
  238. // This value must be between 2 and 63 characters long inclusive, begin with a
  239. // letter, end with a letter or number, and consist of alpha-numeric
  240. // ASCII characters or hyphens.
  241. string federation_id = 2 [(google.api.field_behavior) = REQUIRED];
  242. // Required. The Metastore Federation to create. The `name` field is
  243. // ignored. The ID of the created metastore federation must be
  244. // provided in the request's `federation_id` field.
  245. Federation federation = 3 [(google.api.field_behavior) = REQUIRED];
  246. // Optional. A request ID. Specify a unique request ID to allow the server to ignore the
  247. // request if it has completed. The server will ignore subsequent requests
  248. // that provide a duplicate request ID for at least 60 minutes after the first
  249. // request.
  250. //
  251. // For example, if an initial request times out, followed by another request
  252. // with the same request ID, the server ignores the second request to prevent
  253. // the creation of duplicate commitments.
  254. //
  255. // The request ID must be a valid
  256. // [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format)
  257. // A zero UUID (00000000-0000-0000-0000-000000000000) is not supported.
  258. string request_id = 4 [(google.api.field_behavior) = OPTIONAL];
  259. }
  260. // Request message for UpdateFederation.
  261. message UpdateFederationRequest {
  262. // Required. A field mask used to specify the fields to be overwritten in the
  263. // metastore federation resource by the update.
  264. // Fields specified in the `update_mask` are relative to the resource (not
  265. // to the full request). A field is overwritten if it is in the mask.
  266. google.protobuf.FieldMask update_mask = 1 [(google.api.field_behavior) = REQUIRED];
  267. // Required. The metastore federation to update. The server only merges fields
  268. // in the service if they are specified in `update_mask`.
  269. //
  270. // The metastore federation's `name` field is used to identify the
  271. // metastore service to be updated.
  272. Federation federation = 2 [(google.api.field_behavior) = REQUIRED];
  273. // Optional. A request ID. Specify a unique request ID to allow the server to ignore the
  274. // request if it has completed. The server will ignore subsequent requests
  275. // that provide a duplicate request ID for at least 60 minutes after the first
  276. // request.
  277. //
  278. // For example, if an initial request times out, followed by another request
  279. // with the same request ID, the server ignores the second request to prevent
  280. // the creation of duplicate commitments.
  281. //
  282. // The request ID must be a valid
  283. // [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format)
  284. // A zero UUID (00000000-0000-0000-0000-000000000000) is not supported.
  285. string request_id = 3 [(google.api.field_behavior) = OPTIONAL];
  286. }
  287. // Request message for DeleteFederation.
  288. message DeleteFederationRequest {
  289. // Required. The relative resource name of the metastore federation to delete,
  290. // in the following form:
  291. //
  292. // `projects/{project_number}/locations/{location_id}/federations/{federation_id}`.
  293. string name = 1 [
  294. (google.api.field_behavior) = REQUIRED,
  295. (google.api.resource_reference) = {
  296. type: "metastore.googleapis.com/Federation"
  297. }
  298. ];
  299. // Optional. A request ID. Specify a unique request ID to allow the server to ignore the
  300. // request if it has completed. The server will ignore subsequent requests
  301. // that provide a duplicate request ID for at least 60 minutes after the first
  302. // request.
  303. //
  304. // For example, if an initial request times out, followed by another request
  305. // with the same request ID, the server ignores the second request to prevent
  306. // the creation of duplicate commitments.
  307. //
  308. // The request ID must be a valid
  309. // [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format)
  310. // A zero UUID (00000000-0000-0000-0000-000000000000) is not supported.
  311. string request_id = 2 [(google.api.field_behavior) = OPTIONAL];
  312. }