metastore_federation.proto 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364
  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.v1alpha;
  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/v1alpha;metastore";
  24. option java_multiple_files = true;
  25. option java_outer_classname = "MetastoreFederationProto";
  26. option java_package = "com.google.cloud.metastore.v1alpha";
  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: "/v1alpha/{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: "/v1alpha/{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: "/v1alpha/{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.v1alpha.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: "/v1alpha/{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.v1alpha.OperationMetadata"
  79. };
  80. }
  81. // Deletes a single federation.
  82. rpc DeleteFederation(DeleteFederationRequest) returns (google.longrunning.Operation) {
  83. option (google.api.http) = {
  84. delete: "/v1alpha/{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.v1alpha.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 BigQuery.
  153. BIGQUERY = 2;
  154. // The backend metastore is Dataproc Metastore.
  155. DATAPROC_METASTORE = 3;
  156. }
  157. // The relative resource name of the metastore that is being federated.
  158. // The formats of the relative resource names for the currently supported
  159. // metastores are listed below:
  160. //
  161. // * Dataplex
  162. // * `projects/{project_id}/locations/{location}/lakes/{lake_id}`
  163. // * BigQuery
  164. // * `projects/{project_id}`
  165. // * Dataproc Metastore
  166. // * `projects/{project_id}/locations/{location}/services/{service_id}`
  167. string name = 1;
  168. // The type of the backend metastore.
  169. MetastoreType metastore_type = 2;
  170. }
  171. // Request message for ListFederations.
  172. message ListFederationsRequest {
  173. // Required. The relative resource name of the location of metastore federations
  174. // to list, in the following form:
  175. // `projects/{project_number}/locations/{location_id}`.
  176. string parent = 1 [
  177. (google.api.field_behavior) = REQUIRED,
  178. (google.api.resource_reference) = {
  179. child_type: "metastore.googleapis.com/Federation"
  180. }
  181. ];
  182. // Optional. The maximum number of federations to return. The response may contain less
  183. // than the maximum number. If unspecified, no more than 500 services are
  184. // returned. The maximum value is 1000; values above 1000 are changed to 1000.
  185. int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL];
  186. // Optional. A page token, received from a previous ListFederationServices
  187. // call. Provide this token to retrieve the subsequent page.
  188. //
  189. // To retrieve the first page, supply an empty page token.
  190. //
  191. // When paginating, other parameters provided to
  192. // ListFederationServices must match the call that provided the
  193. // page token.
  194. string page_token = 3 [(google.api.field_behavior) = OPTIONAL];
  195. // Optional. The filter to apply to list results.
  196. string filter = 4 [(google.api.field_behavior) = OPTIONAL];
  197. // Optional. Specify the ordering of results as described in [Sorting
  198. // Order](https://cloud.google.com/apis/design/design_patterns#sorting_order).
  199. // If not specified, the results will be sorted in the default order.
  200. string order_by = 5 [(google.api.field_behavior) = OPTIONAL];
  201. }
  202. // Response message for ListFederations
  203. message ListFederationsResponse {
  204. // The services in the specified location.
  205. repeated Federation federations = 1;
  206. // A token that can be sent as `page_token` to retrieve the next page. If this
  207. // field is omitted, there are no subsequent pages.
  208. string next_page_token = 2;
  209. // Locations that could not be reached.
  210. repeated string unreachable = 3;
  211. }
  212. // Request message for GetFederation.
  213. message GetFederationRequest {
  214. // Required. The relative resource name of the metastore federation to retrieve,
  215. // in the following form:
  216. //
  217. // `projects/{project_number}/locations/{location_id}/federations/{federation_id}`.
  218. string name = 1 [
  219. (google.api.field_behavior) = REQUIRED,
  220. (google.api.resource_reference) = {
  221. type: "metastore.googleapis.com/Federation"
  222. }
  223. ];
  224. }
  225. // Request message for CreateFederation.
  226. message CreateFederationRequest {
  227. // Required. The relative resource name of the location in which to create a federation
  228. // service, in the following form:
  229. //
  230. // `projects/{project_number}/locations/{location_id}`.
  231. string parent = 1 [
  232. (google.api.field_behavior) = REQUIRED,
  233. (google.api.resource_reference) = {
  234. child_type: "metastore.googleapis.com/Federation"
  235. }
  236. ];
  237. // Required. The ID of the metastore federation, which is used as the final
  238. // component of the metastore federation's name.
  239. //
  240. // This value must be between 2 and 63 characters long inclusive, begin with a
  241. // letter, end with a letter or number, and consist of alpha-numeric
  242. // ASCII characters or hyphens.
  243. string federation_id = 2 [(google.api.field_behavior) = REQUIRED];
  244. // Required. The Metastore Federation to create. The `name` field is
  245. // ignored. The ID of the created metastore federation must be
  246. // provided in the request's `federation_id` field.
  247. Federation federation = 3 [(google.api.field_behavior) = REQUIRED];
  248. // Optional. A request ID. Specify a unique request ID to allow the server to ignore the
  249. // request if it has completed. The server will ignore subsequent requests
  250. // that provide a duplicate request ID for at least 60 minutes after the first
  251. // request.
  252. //
  253. // For example, if an initial request times out, followed by another request
  254. // with the same request ID, the server ignores the second request to prevent
  255. // the creation of duplicate commitments.
  256. //
  257. // The request ID must be a valid
  258. // [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format)
  259. // A zero UUID (00000000-0000-0000-0000-000000000000) is not supported.
  260. string request_id = 4 [(google.api.field_behavior) = OPTIONAL];
  261. }
  262. // Request message for UpdateFederation.
  263. message UpdateFederationRequest {
  264. // Required. A field mask used to specify the fields to be overwritten in the
  265. // metastore federation resource by the update.
  266. // Fields specified in the `update_mask` are relative to the resource (not
  267. // to the full request). A field is overwritten if it is in the mask.
  268. google.protobuf.FieldMask update_mask = 1 [(google.api.field_behavior) = REQUIRED];
  269. // Required. The metastore federation to update. The server only merges fields
  270. // in the service if they are specified in `update_mask`.
  271. //
  272. // The metastore federation's `name` field is used to identify the
  273. // metastore service to be updated.
  274. Federation federation = 2 [(google.api.field_behavior) = REQUIRED];
  275. // Optional. A request ID. Specify a unique request ID to allow the server to ignore the
  276. // request if it has completed. The server will ignore subsequent requests
  277. // that provide a duplicate request ID for at least 60 minutes after the first
  278. // request.
  279. //
  280. // For example, if an initial request times out, followed by another request
  281. // with the same request ID, the server ignores the second request to prevent
  282. // the creation of duplicate commitments.
  283. //
  284. // The request ID must be a valid
  285. // [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format)
  286. // A zero UUID (00000000-0000-0000-0000-000000000000) is not supported.
  287. string request_id = 3 [(google.api.field_behavior) = OPTIONAL];
  288. }
  289. // Request message for DeleteFederation.
  290. message DeleteFederationRequest {
  291. // Required. The relative resource name of the metastore federation to delete,
  292. // in the following form:
  293. //
  294. // `projects/{project_number}/locations/{location_id}/federations/{federation_id}`.
  295. string name = 1 [
  296. (google.api.field_behavior) = REQUIRED,
  297. (google.api.resource_reference) = {
  298. type: "metastore.googleapis.com/Federation"
  299. }
  300. ];
  301. // Optional. A request ID. Specify a unique request ID to allow the server to ignore the
  302. // request if it has completed. The server will ignore subsequent requests
  303. // that provide a duplicate request ID for at least 60 minutes after the first
  304. // request.
  305. //
  306. // For example, if an initial request times out, followed by another request
  307. // with the same request ID, the server ignores the second request to prevent
  308. // the creation of duplicate commitments.
  309. //
  310. // The request ID must be a valid
  311. // [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format)
  312. // A zero UUID (00000000-0000-0000-0000-000000000000) is not supported.
  313. string request_id = 2 [(google.api.field_behavior) = OPTIONAL];
  314. }