xref: /aosp_15_r20/external/googleapis/google/cloud/metastore/v1/metastore.proto (revision d5c09012810ac0c9f33fe448fb6da8260d444cc9)
1// Copyright 2023 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
15syntax = "proto3";
16
17package google.cloud.metastore.v1;
18
19import "google/api/annotations.proto";
20import "google/api/client.proto";
21import "google/api/field_behavior.proto";
22import "google/api/resource.proto";
23import "google/longrunning/operations.proto";
24import "google/protobuf/empty.proto";
25import "google/protobuf/field_mask.proto";
26import "google/protobuf/timestamp.proto";
27import "google/protobuf/wrappers.proto";
28import "google/type/dayofweek.proto";
29
30option go_package = "cloud.google.com/go/metastore/apiv1/metastorepb;metastorepb";
31option java_multiple_files = true;
32option java_outer_classname = "MetastoreProto";
33option java_package = "com.google.cloud.metastore.v1";
34option php_namespace = "Google\\Cloud\\Metastore\\V1";
35option (google.api.resource_definition) = {
36  type: "compute.googleapis.com/Network"
37  pattern: "projects/{project}/global/networks/{network}"
38};
39option (google.api.resource_definition) = {
40  type: "compute.googleapis.com/Subnetwork"
41  pattern: "projects/{project}/regions/{region}/subnetworks/{subnetwork}"
42};
43option (google.api.resource_definition) = {
44  type: "dataplex.googleapis.com/Lake"
45  pattern: "projects/{project}/locations/{location}/lakes/{lake}"
46};
47
48// Configures and manages metastore services.
49// Metastore services are fully managed, highly available, autoscaled,
50// autohealing, OSS-native deployments of technical metadata management
51// software. Each metastore service exposes a network endpoint through which
52// metadata queries are served. Metadata queries can originate from a variety
53// of sources, including Apache Hive, Apache Presto, and Apache Spark.
54//
55// The Dataproc Metastore API defines the following resource model:
56//
57// * The service works with a collection of Google Cloud projects, named:
58// `/projects/*`
59// * Each project has a collection of available locations, named: `/locations/*`
60//   (a location must refer to a Google Cloud `region`)
61// * Each location has a collection of services, named: `/services/*`
62// * Dataproc Metastore services are resources with names of the form:
63//
64//   `/projects/{project_number}/locations/{location_id}/services/{service_id}`.
65service DataprocMetastore {
66  option (google.api.default_host) = "metastore.googleapis.com";
67  option (google.api.oauth_scopes) =
68      "https://www.googleapis.com/auth/cloud-platform";
69
70  // Lists services in a project and location.
71  rpc ListServices(ListServicesRequest) returns (ListServicesResponse) {
72    option (google.api.http) = {
73      get: "/v1/{parent=projects/*/locations/*}/services"
74    };
75    option (google.api.method_signature) = "parent";
76  }
77
78  // Gets the details of a single service.
79  rpc GetService(GetServiceRequest) returns (Service) {
80    option (google.api.http) = {
81      get: "/v1/{name=projects/*/locations/*/services/*}"
82    };
83    option (google.api.method_signature) = "name";
84  }
85
86  // Creates a metastore service in a project and location.
87  rpc CreateService(CreateServiceRequest)
88      returns (google.longrunning.Operation) {
89    option (google.api.http) = {
90      post: "/v1/{parent=projects/*/locations/*}/services"
91      body: "service"
92    };
93    option (google.api.method_signature) = "parent,service,service_id";
94    option (google.longrunning.operation_info) = {
95      response_type: "Service"
96      metadata_type: "google.cloud.metastore.v1.OperationMetadata"
97    };
98  }
99
100  // Updates the parameters of a single service.
101  rpc UpdateService(UpdateServiceRequest)
102      returns (google.longrunning.Operation) {
103    option (google.api.http) = {
104      patch: "/v1/{service.name=projects/*/locations/*/services/*}"
105      body: "service"
106    };
107    option (google.api.method_signature) = "service,update_mask";
108    option (google.longrunning.operation_info) = {
109      response_type: "Service"
110      metadata_type: "google.cloud.metastore.v1.OperationMetadata"
111    };
112  }
113
114  // Deletes a single service.
115  rpc DeleteService(DeleteServiceRequest)
116      returns (google.longrunning.Operation) {
117    option (google.api.http) = {
118      delete: "/v1/{name=projects/*/locations/*/services/*}"
119    };
120    option (google.api.method_signature) = "name";
121    option (google.longrunning.operation_info) = {
122      response_type: "google.protobuf.Empty"
123      metadata_type: "google.cloud.metastore.v1.OperationMetadata"
124    };
125  }
126
127  // Lists imports in a service.
128  rpc ListMetadataImports(ListMetadataImportsRequest)
129      returns (ListMetadataImportsResponse) {
130    option (google.api.http) = {
131      get: "/v1/{parent=projects/*/locations/*/services/*}/metadataImports"
132    };
133    option (google.api.method_signature) = "parent";
134  }
135
136  // Gets details of a single import.
137  rpc GetMetadataImport(GetMetadataImportRequest) returns (MetadataImport) {
138    option (google.api.http) = {
139      get: "/v1/{name=projects/*/locations/*/services/*/metadataImports/*}"
140    };
141    option (google.api.method_signature) = "name";
142  }
143
144  // Creates a new MetadataImport in a given project and location.
145  rpc CreateMetadataImport(CreateMetadataImportRequest)
146      returns (google.longrunning.Operation) {
147    option (google.api.http) = {
148      post: "/v1/{parent=projects/*/locations/*/services/*}/metadataImports"
149      body: "metadata_import"
150    };
151    option (google.api.method_signature) =
152        "parent,metadata_import,metadata_import_id";
153    option (google.longrunning.operation_info) = {
154      response_type: "MetadataImport"
155      metadata_type: "google.cloud.metastore.v1.OperationMetadata"
156    };
157  }
158
159  // Updates a single import.
160  // Only the description field of MetadataImport is supported to be updated.
161  rpc UpdateMetadataImport(UpdateMetadataImportRequest)
162      returns (google.longrunning.Operation) {
163    option (google.api.http) = {
164      patch: "/v1/{metadata_import.name=projects/*/locations/*/services/*/metadataImports/*}"
165      body: "metadata_import"
166    };
167    option (google.api.method_signature) = "metadata_import,update_mask";
168    option (google.longrunning.operation_info) = {
169      response_type: "MetadataImport"
170      metadata_type: "google.cloud.metastore.v1.OperationMetadata"
171    };
172  }
173
174  // Exports metadata from a service.
175  rpc ExportMetadata(ExportMetadataRequest)
176      returns (google.longrunning.Operation) {
177    option (google.api.http) = {
178      post: "/v1/{service=projects/*/locations/*/services/*}:exportMetadata"
179      body: "*"
180    };
181    option (google.longrunning.operation_info) = {
182      response_type: "MetadataExport"
183      metadata_type: "google.cloud.metastore.v1.OperationMetadata"
184    };
185  }
186
187  // Restores a service from a backup.
188  rpc RestoreService(RestoreServiceRequest)
189      returns (google.longrunning.Operation) {
190    option (google.api.http) = {
191      post: "/v1/{service=projects/*/locations/*/services/*}:restore"
192      body: "*"
193    };
194    option (google.api.method_signature) = "service,backup";
195    option (google.longrunning.operation_info) = {
196      response_type: "Restore"
197      metadata_type: "google.cloud.metastore.v1.OperationMetadata"
198    };
199  }
200
201  // Lists backups in a service.
202  rpc ListBackups(ListBackupsRequest) returns (ListBackupsResponse) {
203    option (google.api.http) = {
204      get: "/v1/{parent=projects/*/locations/*/services/*}/backups"
205    };
206    option (google.api.method_signature) = "parent";
207  }
208
209  // Gets details of a single backup.
210  rpc GetBackup(GetBackupRequest) returns (Backup) {
211    option (google.api.http) = {
212      get: "/v1/{name=projects/*/locations/*/services/*/backups/*}"
213    };
214    option (google.api.method_signature) = "name";
215  }
216
217  // Creates a new backup in a given project and location.
218  rpc CreateBackup(CreateBackupRequest) returns (google.longrunning.Operation) {
219    option (google.api.http) = {
220      post: "/v1/{parent=projects/*/locations/*/services/*}/backups"
221      body: "backup"
222    };
223    option (google.api.method_signature) = "parent,backup,backup_id";
224    option (google.longrunning.operation_info) = {
225      response_type: "Backup"
226      metadata_type: "google.cloud.metastore.v1.OperationMetadata"
227    };
228  }
229
230  // Deletes a single backup.
231  rpc DeleteBackup(DeleteBackupRequest) returns (google.longrunning.Operation) {
232    option (google.api.http) = {
233      delete: "/v1/{name=projects/*/locations/*/services/*/backups/*}"
234    };
235    option (google.api.method_signature) = "name";
236    option (google.longrunning.operation_info) = {
237      response_type: "google.protobuf.Empty"
238      metadata_type: "google.cloud.metastore.v1.OperationMetadata"
239    };
240  }
241
242  // Query DPMS metadata.
243  rpc QueryMetadata(QueryMetadataRequest)
244      returns (google.longrunning.Operation) {
245    option (google.api.http) = {
246      post: "/v1/{service=projects/*/locations/*/services/*}:queryMetadata"
247      body: "*"
248    };
249    option (google.longrunning.operation_info) = {
250      response_type: "QueryMetadataResponse"
251      metadata_type: "google.cloud.metastore.v1.OperationMetadata"
252    };
253  }
254
255  // Move a table to another database.
256  rpc MoveTableToDatabase(MoveTableToDatabaseRequest)
257      returns (google.longrunning.Operation) {
258    option (google.api.http) = {
259      post: "/v1/{service=projects/*/locations/*/services/*}:moveTableToDatabase"
260      body: "*"
261    };
262    option (google.longrunning.operation_info) = {
263      response_type: "MoveTableToDatabaseResponse"
264      metadata_type: "google.cloud.metastore.v1.OperationMetadata"
265    };
266  }
267
268  // Alter metadata resource location. The metadata resource can be a database,
269  // table, or partition. This functionality only updates the parent directory
270  // for the respective metadata resource and does not transfer any existing
271  // data to the new location.
272  rpc AlterMetadataResourceLocation(AlterMetadataResourceLocationRequest)
273      returns (google.longrunning.Operation) {
274    option (google.api.http) = {
275      post: "/v1/{service=projects/*/locations/*/services/*}:alterLocation"
276      body: "*"
277    };
278    option (google.longrunning.operation_info) = {
279      response_type: "AlterMetadataResourceLocationResponse"
280      metadata_type: "google.cloud.metastore.v1.OperationMetadata"
281    };
282  }
283}
284
285// A managed metastore service that serves metadata queries.
286message Service {
287  option (google.api.resource) = {
288    type: "metastore.googleapis.com/Service"
289    pattern: "projects/{project}/locations/{location}/services/{service}"
290  };
291
292  // The current state of the metastore service.
293  enum State {
294    // The state of the metastore service is unknown.
295    STATE_UNSPECIFIED = 0;
296
297    // The metastore service is in the process of being created.
298    CREATING = 1;
299
300    // The metastore service is running and ready to serve queries.
301    ACTIVE = 2;
302
303    // The metastore service is entering suspension. Its query-serving
304    // availability may cease unexpectedly.
305    SUSPENDING = 3;
306
307    // The metastore service is suspended and unable to serve queries.
308    SUSPENDED = 4;
309
310    // The metastore service is being updated. It remains usable but cannot
311    // accept additional update requests or be deleted at this time.
312    UPDATING = 5;
313
314    // The metastore service is undergoing deletion. It cannot be used.
315    DELETING = 6;
316
317    // The metastore service has encountered an error and cannot be used. The
318    // metastore service should be deleted.
319    ERROR = 7;
320  }
321
322  // Available service tiers.
323  enum Tier {
324    // The tier is not set.
325    TIER_UNSPECIFIED = 0;
326
327    // The developer tier provides limited scalability and no fault tolerance.
328    // Good for low-cost proof-of-concept.
329    DEVELOPER = 1;
330
331    // The enterprise tier provides multi-zone high availability, and sufficient
332    // scalability for enterprise-level Dataproc Metastore workloads.
333    ENTERPRISE = 3;
334  }
335
336  // Release channels bundle features of varying levels of stability. Newer
337  // features may be introduced initially into less stable release channels and
338  // can be automatically promoted into more stable release channels.
339  enum ReleaseChannel {
340    // Release channel is not specified.
341    RELEASE_CHANNEL_UNSPECIFIED = 0;
342
343    // The `CANARY` release channel contains the newest features, which may be
344    // unstable and subject to unresolved issues with no known workarounds.
345    // Services using the `CANARY` release channel are not subject to any SLAs.
346    CANARY = 1;
347
348    // The `STABLE` release channel contains features that are considered stable
349    // and have been validated for production use.
350    STABLE = 2;
351  }
352
353  // The backend database type for the metastore service.
354  enum DatabaseType {
355    // The DATABASE_TYPE is not set.
356    DATABASE_TYPE_UNSPECIFIED = 0;
357
358    // MySQL is used to persist the metastore data.
359    MYSQL = 1;
360
361    // Spanner is used to persist the metastore data.
362    SPANNER = 2;
363  }
364
365  // Configuration properties specific to the underlying metastore service
366  // technology (the software that serves metastore queries).
367  oneof metastore_config {
368    // Configuration information specific to running Hive metastore
369    // software as the metastore service.
370    HiveMetastoreConfig hive_metastore_config = 5;
371  }
372
373  // Immutable. The relative resource name of the metastore service, in the
374  // following format:
375  //
376  // `projects/{project_number}/locations/{location_id}/services/{service_id}`.
377  string name = 1 [(google.api.field_behavior) = IMMUTABLE];
378
379  // Output only. The time when the metastore service was created.
380  google.protobuf.Timestamp create_time = 2
381      [(google.api.field_behavior) = OUTPUT_ONLY];
382
383  // Output only. The time when the metastore service was last updated.
384  google.protobuf.Timestamp update_time = 3
385      [(google.api.field_behavior) = OUTPUT_ONLY];
386
387  // User-defined labels for the metastore service.
388  map<string, string> labels = 4;
389
390  // Immutable. The relative resource name of the VPC network on which the
391  // instance can be accessed. It is specified in the following form:
392  //
393  // `projects/{project_number}/global/networks/{network_id}`.
394  string network = 7 [
395    (google.api.field_behavior) = IMMUTABLE,
396    (google.api.resource_reference) = { type: "compute.googleapis.com/Network" }
397  ];
398
399  // Output only. The URI of the endpoint used to access the metastore service.
400  string endpoint_uri = 8 [(google.api.field_behavior) = OUTPUT_ONLY];
401
402  // The TCP port at which the metastore service is reached. Default: 9083.
403  int32 port = 9;
404
405  // Output only. The current state of the metastore service.
406  State state = 10 [(google.api.field_behavior) = OUTPUT_ONLY];
407
408  // Output only. Additional information about the current state of the
409  // metastore service, if available.
410  string state_message = 11 [(google.api.field_behavior) = OUTPUT_ONLY];
411
412  // Output only. A Cloud Storage URI (starting with `gs://`) that specifies
413  // where artifacts related to the metastore service are stored.
414  string artifact_gcs_uri = 12 [(google.api.field_behavior) = OUTPUT_ONLY];
415
416  // The tier of the service.
417  Tier tier = 13;
418
419  // The one hour maintenance window of the metastore service. This specifies
420  // when the service can be restarted for maintenance purposes in UTC time.
421  // Maintenance window is not needed for services with the SPANNER
422  // database type.
423  MaintenanceWindow maintenance_window = 15;
424
425  // Output only. The globally unique resource identifier of the metastore
426  // service.
427  string uid = 16 [(google.api.field_behavior) = OUTPUT_ONLY];
428
429  // Output only. The metadata management activities of the metastore service.
430  MetadataManagementActivity metadata_management_activity = 17
431      [(google.api.field_behavior) = OUTPUT_ONLY];
432
433  // Immutable. The release channel of the service.
434  // If unspecified, defaults to `STABLE`.
435  ReleaseChannel release_channel = 19 [(google.api.field_behavior) = IMMUTABLE];
436
437  // Immutable. Information used to configure the Dataproc Metastore service to
438  // encrypt customer data at rest. Cannot be updated.
439  EncryptionConfig encryption_config = 20
440      [(google.api.field_behavior) = IMMUTABLE];
441
442  // The configuration specifying the network settings for the
443  // Dataproc Metastore service.
444  NetworkConfig network_config = 21;
445
446  // Immutable. The database type that the Metastore service stores its data.
447  DatabaseType database_type = 22 [(google.api.field_behavior) = IMMUTABLE];
448
449  // The configuration specifying telemetry settings for the Dataproc Metastore
450  // service. If unspecified defaults to `JSON`.
451  TelemetryConfig telemetry_config = 23;
452
453  // Scaling configuration of the metastore service.
454  ScalingConfig scaling_config = 24;
455}
456
457// Maintenance window. This specifies when Dataproc Metastore
458// may perform system maintenance operation to the service.
459message MaintenanceWindow {
460  // The hour of day (0-23) when the window starts.
461  google.protobuf.Int32Value hour_of_day = 1;
462
463  // The day of week, when the window starts.
464  google.type.DayOfWeek day_of_week = 2;
465}
466
467// Specifies configuration information specific to running Hive metastore
468// software as the metastore service.
469message HiveMetastoreConfig {
470  // Protocols available for serving the metastore service endpoint.
471  enum EndpointProtocol {
472    // The protocol is not set.
473    ENDPOINT_PROTOCOL_UNSPECIFIED = 0;
474
475    // Use the legacy Apache Thrift protocol for the metastore service endpoint.
476    THRIFT = 1;
477
478    // Use the modernized gRPC protocol for the metastore service endpoint.
479    GRPC = 2;
480  }
481
482  // Immutable. The Hive metastore schema version.
483  string version = 1 [(google.api.field_behavior) = IMMUTABLE];
484
485  // A mapping of Hive metastore configuration key-value pairs to apply to the
486  // Hive metastore (configured in `hive-site.xml`). The mappings
487  // override system defaults (some keys cannot be overridden). These
488  // overrides are also applied to auxiliary versions and can be further
489  // customized in the auxiliary version's `AuxiliaryVersionConfig`.
490  map<string, string> config_overrides = 2;
491
492  // Information used to configure the Hive metastore service as a service
493  // principal in a Kerberos realm. To disable Kerberos, use the `UpdateService`
494  // method and specify this field's path
495  // (`hive_metastore_config.kerberos_config`) in the request's `update_mask`
496  // while omitting this field from the request's `service`.
497  KerberosConfig kerberos_config = 3;
498
499  // The protocol to use for the metastore service endpoint. If unspecified,
500  // defaults to `THRIFT`.
501  EndpointProtocol endpoint_protocol = 4;
502
503  // A mapping of Hive metastore version to the auxiliary version
504  // configuration. When specified, a secondary Hive metastore service is
505  // created along with the primary service. All auxiliary versions must be less
506  // than the service's primary version. The key is the auxiliary service name
507  // and it must match the regular expression [a-z]([-a-z0-9]*[a-z0-9])?. This
508  // means that the first character must be a lowercase letter, and all the
509  // following characters must be hyphens, lowercase letters, or digits, except
510  // the last character, which cannot be a hyphen.
511  map<string, AuxiliaryVersionConfig> auxiliary_versions = 5;
512}
513
514// Configuration information for a Kerberos principal.
515message KerberosConfig {
516  // A Kerberos keytab file that can be used to authenticate a service principal
517  // with a Kerberos Key Distribution Center (KDC).
518  Secret keytab = 1;
519
520  // A Kerberos principal that exists in the both the keytab the KDC
521  // to authenticate as. A typical principal is of the form
522  // `primary/instance@REALM`, but there is no exact format.
523  string principal = 2;
524
525  // A Cloud Storage URI that specifies the path to a
526  // krb5.conf file. It is of the form `gs://{bucket_name}/path/to/krb5.conf`,
527  // although the file does not need to be named krb5.conf explicitly.
528  string krb5_config_gcs_uri = 3;
529}
530
531// A securely stored value.
532message Secret {
533  oneof value {
534    // The relative resource name of a Secret Manager secret version, in the
535    // following form:
536    //
537    // `projects/{project_number}/secrets/{secret_id}/versions/{version_id}`.
538    string cloud_secret = 2;
539  }
540}
541
542// Encryption settings for the service.
543message EncryptionConfig {
544  // The fully qualified customer provided Cloud KMS key name to use for
545  // customer data encryption, in the following form:
546  //
547  // `projects/{project_number}/locations/{location_id}/keyRings/{key_ring_id}/cryptoKeys/{crypto_key_id}`.
548  string kms_key = 1;
549}
550
551// Configuration information for the auxiliary service versions.
552message AuxiliaryVersionConfig {
553  // The Hive metastore version of the auxiliary service. It must be less
554  // than the primary Hive metastore service's version.
555  string version = 1;
556
557  // A mapping of Hive metastore configuration key-value pairs to apply to the
558  // auxiliary Hive metastore (configured in `hive-site.xml`) in addition to
559  // the primary version's overrides. If keys are present in both the auxiliary
560  // version's overrides and the primary version's overrides, the value from
561  // the auxiliary version's overrides takes precedence.
562  map<string, string> config_overrides = 2;
563
564  // Output only. The network configuration contains the endpoint URI(s) of the
565  // auxiliary Hive metastore service.
566  NetworkConfig network_config = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
567}
568
569// Network configuration for the Dataproc Metastore service.
570//
571// Next available ID: 4
572message NetworkConfig {
573  // Contains information of the customer's network configurations.
574  //
575  // Next available ID: 5
576  message Consumer {
577    oneof vpc_resource {
578      // Immutable. The subnetwork of the customer project from which an IP
579      // address is reserved and used as the Dataproc Metastore service's
580      // endpoint. It is accessible to hosts in the subnet and to all
581      // hosts in a subnet in the same region and same network. There must
582      // be at least one IP address available in the subnet's primary range. The
583      // subnet is specified in the following form:
584      //
585      // `projects/{project_number}/regions/{region_id}/subnetworks/{subnetwork_id}`
586      string subnetwork = 1 [
587        (google.api.field_behavior) = IMMUTABLE,
588        (google.api.resource_reference) = {
589          type: "compute.googleapis.com/Subnetwork"
590        }
591      ];
592    }
593
594    // Output only. The URI of the endpoint used to access the metastore
595    // service.
596    string endpoint_uri = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
597
598    // Output only. The location of the endpoint URI. Format:
599    // `projects/{project}/locations/{location}`.
600    string endpoint_location = 4 [
601      (google.api.field_behavior) = OUTPUT_ONLY,
602      (google.api.resource_reference) = {
603        type: "locations.googleapis.com/Location"
604      }
605    ];
606  }
607
608  // Immutable. The consumer-side network configuration for the Dataproc
609  // Metastore instance.
610  repeated Consumer consumers = 1 [(google.api.field_behavior) = IMMUTABLE];
611}
612
613// Telemetry Configuration for the Dataproc Metastore service.
614message TelemetryConfig {
615  enum LogFormat {
616    // The LOG_FORMAT is not set.
617    LOG_FORMAT_UNSPECIFIED = 0;
618
619    // Logging output uses the legacy `textPayload` format.
620    LEGACY = 1;
621
622    // Logging output uses the `jsonPayload` format.
623    JSON = 2;
624  }
625
626  // The output format of the Dataproc Metastore service's logs.
627  LogFormat log_format = 1;
628}
629
630// The metadata management activities of the metastore service.
631message MetadataManagementActivity {
632  // Output only. The latest metadata exports of the metastore service.
633  repeated MetadataExport metadata_exports = 1
634      [(google.api.field_behavior) = OUTPUT_ONLY];
635
636  // Output only. The latest restores of the metastore service.
637  repeated Restore restores = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
638}
639
640// A metastore resource that imports metadata.
641message MetadataImport {
642  option (google.api.resource) = {
643    type: "metastore.googleapis.com/MetadataImport"
644    pattern: "projects/{project}/locations/{location}/services/{service}/metadataImports/{metadata_import}"
645  };
646
647  // A specification of the location of and metadata about a database dump from
648  // a relational database management system.
649  message DatabaseDump {
650    // The type of the database.
651    enum DatabaseType {
652      // The type of the source database is unknown.
653      DATABASE_TYPE_UNSPECIFIED = 0;
654
655      // The type of the source database is MySQL.
656      MYSQL = 1;
657    }
658
659    // The type of the database.
660    DatabaseType database_type = 1 [deprecated = true];
661
662    // A Cloud Storage object or folder URI that specifies the source from which
663    // to import metadata. It must begin with `gs://`.
664    string gcs_uri = 2;
665
666    // The name of the source database.
667    string source_database = 3 [deprecated = true];
668
669    // Optional. The type of the database dump. If unspecified, defaults to
670    // `MYSQL`.
671    DatabaseDumpSpec.Type type = 4 [(google.api.field_behavior) = OPTIONAL];
672  }
673
674  // The current state of the metadata import.
675  enum State {
676    // The state of the metadata import is unknown.
677    STATE_UNSPECIFIED = 0;
678
679    // The metadata import is running.
680    RUNNING = 1;
681
682    // The metadata import completed successfully.
683    SUCCEEDED = 2;
684
685    // The metadata import is being updated.
686    UPDATING = 3;
687
688    // The metadata import failed, and attempted metadata changes were rolled
689    // back.
690    FAILED = 4;
691  }
692
693  // The metadata to be imported.
694  oneof metadata {
695    // Immutable. A database dump from a pre-existing metastore's database.
696    DatabaseDump database_dump = 6 [(google.api.field_behavior) = IMMUTABLE];
697  }
698
699  // Immutable. The relative resource name of the metadata import, of the form:
700  //
701  // `projects/{project_number}/locations/{location_id}/services/{service_id}/metadataImports/{metadata_import_id}`.
702  string name = 1 [(google.api.field_behavior) = IMMUTABLE];
703
704  // The description of the metadata import.
705  string description = 2;
706
707  // Output only. The time when the metadata import was started.
708  google.protobuf.Timestamp create_time = 3
709      [(google.api.field_behavior) = OUTPUT_ONLY];
710
711  // Output only. The time when the metadata import was last updated.
712  google.protobuf.Timestamp update_time = 4
713      [(google.api.field_behavior) = OUTPUT_ONLY];
714
715  // Output only. The time when the metadata import finished.
716  google.protobuf.Timestamp end_time = 7
717      [(google.api.field_behavior) = OUTPUT_ONLY];
718
719  // Output only. The current state of the metadata import.
720  State state = 5 [(google.api.field_behavior) = OUTPUT_ONLY];
721}
722
723// The details of a metadata export operation.
724message MetadataExport {
725  // The current state of the metadata export.
726  enum State {
727    // The state of the metadata export is unknown.
728    STATE_UNSPECIFIED = 0;
729
730    // The metadata export is running.
731    RUNNING = 1;
732
733    // The metadata export completed successfully.
734    SUCCEEDED = 2;
735
736    // The metadata export failed.
737    FAILED = 3;
738
739    // The metadata export is cancelled.
740    CANCELLED = 4;
741  }
742
743  oneof destination {
744    // Output only. A Cloud Storage URI of a folder that metadata are exported
745    // to, in the form of
746    // `gs://<bucket_name>/<path_inside_bucket>/<export_folder>`, where
747    // `<export_folder>` is automatically generated.
748    string destination_gcs_uri = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
749  }
750
751  // Output only. The time when the export started.
752  google.protobuf.Timestamp start_time = 1
753      [(google.api.field_behavior) = OUTPUT_ONLY];
754
755  // Output only. The time when the export ended.
756  google.protobuf.Timestamp end_time = 2
757      [(google.api.field_behavior) = OUTPUT_ONLY];
758
759  // Output only. The current state of the export.
760  State state = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
761
762  // Output only. The type of the database dump.
763  DatabaseDumpSpec.Type database_dump_type = 5
764      [(google.api.field_behavior) = OUTPUT_ONLY];
765}
766
767// The details of a backup resource.
768message Backup {
769  option (google.api.resource) = {
770    type: "metastore.googleapis.com/Backup"
771    pattern: "projects/{project}/locations/{location}/services/{service}/backups/{backup}"
772  };
773
774  // The current state of the backup.
775  enum State {
776    // The state of the backup is unknown.
777    STATE_UNSPECIFIED = 0;
778
779    // The backup is being created.
780    CREATING = 1;
781
782    // The backup is being deleted.
783    DELETING = 2;
784
785    // The backup is active and ready to use.
786    ACTIVE = 3;
787
788    // The backup failed.
789    FAILED = 4;
790
791    // The backup is being restored.
792    RESTORING = 5;
793  }
794
795  // Immutable. The relative resource name of the backup, in the following form:
796  //
797  // `projects/{project_number}/locations/{location_id}/services/{service_id}/backups/{backup_id}`
798  string name = 1 [(google.api.field_behavior) = IMMUTABLE];
799
800  // Output only. The time when the backup was started.
801  google.protobuf.Timestamp create_time = 2
802      [(google.api.field_behavior) = OUTPUT_ONLY];
803
804  // Output only. The time when the backup finished creating.
805  google.protobuf.Timestamp end_time = 3
806      [(google.api.field_behavior) = OUTPUT_ONLY];
807
808  // Output only. The current state of the backup.
809  State state = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
810
811  // Output only. The revision of the service at the time of backup.
812  Service service_revision = 5 [(google.api.field_behavior) = OUTPUT_ONLY];
813
814  // The description of the backup.
815  string description = 6;
816
817  // Output only. Services that are restoring from the backup.
818  repeated string restoring_services = 7
819      [(google.api.field_behavior) = OUTPUT_ONLY];
820}
821
822// The details of a metadata restore operation.
823message Restore {
824  // The current state of the restore.
825  enum State {
826    // The state of the metadata restore is unknown.
827    STATE_UNSPECIFIED = 0;
828
829    // The metadata restore is running.
830    RUNNING = 1;
831
832    // The metadata restore completed successfully.
833    SUCCEEDED = 2;
834
835    // The metadata restore failed.
836    FAILED = 3;
837
838    // The metadata restore is cancelled.
839    CANCELLED = 4;
840  }
841
842  // The type of restore. If unspecified, defaults to `METADATA_ONLY`.
843  enum RestoreType {
844    // The restore type is unknown.
845    RESTORE_TYPE_UNSPECIFIED = 0;
846
847    // The service's metadata and configuration are restored.
848    FULL = 1;
849
850    // Only the service's metadata is restored.
851    METADATA_ONLY = 2;
852  }
853
854  // Output only. The time when the restore started.
855  google.protobuf.Timestamp start_time = 1
856      [(google.api.field_behavior) = OUTPUT_ONLY];
857
858  // Output only. The time when the restore ended.
859  google.protobuf.Timestamp end_time = 2
860      [(google.api.field_behavior) = OUTPUT_ONLY];
861
862  // Output only. The current state of the restore.
863  State state = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
864
865  // Output only. The relative resource name of the metastore service backup to
866  // restore from, in the following form:
867  //
868  // `projects/{project_id}/locations/{location_id}/services/{service_id}/backups/{backup_id}`.
869  string backup = 4 [
870    (google.api.field_behavior) = OUTPUT_ONLY,
871    (google.api.resource_reference) = {
872      type: "metastore.googleapis.com/Backup"
873    }
874  ];
875
876  // Output only. The type of restore.
877  RestoreType type = 5 [(google.api.field_behavior) = OUTPUT_ONLY];
878
879  // Output only. The restore details containing the revision of the service to
880  // be restored to, in format of JSON.
881  string details = 6 [(google.api.field_behavior) = OUTPUT_ONLY];
882}
883
884// Represents the scaling configuration of a metastore service.
885message ScalingConfig {
886  // Metastore instance sizes.
887  enum InstanceSize {
888    // Unspecified instance size
889    INSTANCE_SIZE_UNSPECIFIED = 0;
890
891    // Extra small instance size, maps to a scaling factor of 0.1.
892    EXTRA_SMALL = 1;
893
894    // Small instance size, maps to a scaling factor of 0.5.
895    SMALL = 2;
896
897    // Medium instance size, maps to a scaling factor of 1.0.
898    MEDIUM = 3;
899
900    // Large instance size, maps to a scaling factor of 3.0.
901    LARGE = 4;
902
903    // Extra large instance size, maps to a scaling factor of 6.0.
904    EXTRA_LARGE = 5;
905  }
906
907  // Represents either a predetermined instance size or a numeric
908  // scaling factor.
909  oneof scaling_model {
910    // An enum of readable instance sizes, with each instance size mapping to a
911    // float value (e.g. InstanceSize.EXTRA_SMALL = scaling_factor(0.1))
912    InstanceSize instance_size = 1;
913
914    // Scaling factor, increments of 0.1 for values less than 1.0, and
915    // increments of 1.0 for values greater than 1.0.
916    float scaling_factor = 2;
917  }
918}
919
920// Request message for
921// [DataprocMetastore.ListServices][google.cloud.metastore.v1.DataprocMetastore.ListServices].
922message ListServicesRequest {
923  // Required. The relative resource name of the location of metastore services
924  // to list, in the following form:
925  //
926  // `projects/{project_number}/locations/{location_id}`.
927  string parent = 1 [
928    (google.api.field_behavior) = REQUIRED,
929    (google.api.resource_reference) = {
930      child_type: "metastore.googleapis.com/Service"
931    }
932  ];
933
934  // Optional. The maximum number of services to return. The response may
935  // contain less than the maximum number. If unspecified, no more than 500
936  // services are returned. The maximum value is 1000; values above 1000 are
937  // changed to 1000.
938  int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL];
939
940  // Optional. A page token, received from a previous
941  // [DataprocMetastore.ListServices][google.cloud.metastore.v1.DataprocMetastore.ListServices]
942  // call. Provide this token to retrieve the subsequent page.
943  //
944  // To retrieve the first page, supply an empty page token.
945  //
946  // When paginating, other parameters provided to
947  // [DataprocMetastore.ListServices][google.cloud.metastore.v1.DataprocMetastore.ListServices]
948  // must match the call that provided the page token.
949  string page_token = 3 [(google.api.field_behavior) = OPTIONAL];
950
951  // Optional. The filter to apply to list results.
952  string filter = 4 [(google.api.field_behavior) = OPTIONAL];
953
954  // Optional. Specify the ordering of results as described in [Sorting
955  // Order](https://cloud.google.com/apis/design/design_patterns#sorting_order).
956  // If not specified, the results will be sorted in the default order.
957  string order_by = 5 [(google.api.field_behavior) = OPTIONAL];
958}
959
960// Response message for
961// [DataprocMetastore.ListServices][google.cloud.metastore.v1.DataprocMetastore.ListServices].
962message ListServicesResponse {
963  // The services in the specified location.
964  repeated Service services = 1;
965
966  // A token that can be sent as `page_token` to retrieve the next page. If this
967  // field is omitted, there are no subsequent pages.
968  string next_page_token = 2;
969
970  // Locations that could not be reached.
971  repeated string unreachable = 3;
972}
973
974// Request message for
975// [DataprocMetastore.GetService][google.cloud.metastore.v1.DataprocMetastore.GetService].
976message GetServiceRequest {
977  // Required. The relative resource name of the metastore service to retrieve,
978  // in the following form:
979  //
980  // `projects/{project_number}/locations/{location_id}/services/{service_id}`.
981  string name = 1 [
982    (google.api.field_behavior) = REQUIRED,
983    (google.api.resource_reference) = {
984      type: "metastore.googleapis.com/Service"
985    }
986  ];
987}
988
989// Request message for
990// [DataprocMetastore.CreateService][google.cloud.metastore.v1.DataprocMetastore.CreateService].
991message CreateServiceRequest {
992  // Required. The relative resource name of the location in which to create a
993  // metastore service, in the following form:
994  //
995  // `projects/{project_number}/locations/{location_id}`.
996  string parent = 1 [
997    (google.api.field_behavior) = REQUIRED,
998    (google.api.resource_reference) = {
999      child_type: "metastore.googleapis.com/Service"
1000    }
1001  ];
1002
1003  // Required. The ID of the metastore service, which is used as the final
1004  // component of the metastore service's name.
1005  //
1006  // This value must be between 2 and 63 characters long inclusive, begin with a
1007  // letter, end with a letter or number, and consist of alpha-numeric
1008  // ASCII characters or hyphens.
1009  string service_id = 2 [(google.api.field_behavior) = REQUIRED];
1010
1011  // Required. The Metastore service to create. The `name` field is
1012  // ignored. The ID of the created metastore service must be provided in
1013  // the request's `service_id` field.
1014  Service service = 3 [(google.api.field_behavior) = REQUIRED];
1015
1016  // Optional. A request ID. Specify a unique request ID to allow the server to
1017  // ignore the request if it has completed. The server will ignore subsequent
1018  // requests that provide a duplicate request ID for at least 60 minutes after
1019  // the first request.
1020  //
1021  // For example, if an initial request times out, followed by another request
1022  // with the same request ID, the server ignores the second request to prevent
1023  // the creation of duplicate commitments.
1024  //
1025  // The request ID must be a valid
1026  // [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format)
1027  // A zero UUID (00000000-0000-0000-0000-000000000000) is not supported.
1028  string request_id = 4 [(google.api.field_behavior) = OPTIONAL];
1029}
1030
1031// Request message for
1032// [DataprocMetastore.UpdateService][google.cloud.metastore.v1.DataprocMetastore.UpdateService].
1033message UpdateServiceRequest {
1034  // Required. A field mask used to specify the fields to be overwritten in the
1035  // metastore service resource by the update.
1036  // Fields specified in the `update_mask` are relative to the resource (not
1037  // to the full request). A field is overwritten if it is in the mask.
1038  google.protobuf.FieldMask update_mask = 1
1039      [(google.api.field_behavior) = REQUIRED];
1040
1041  // Required. The metastore service to update. The server only merges fields
1042  // in the service if they are specified in `update_mask`.
1043  //
1044  // The metastore service's `name` field is used to identify the metastore
1045  // service to be updated.
1046  Service service = 2 [(google.api.field_behavior) = REQUIRED];
1047
1048  // Optional. A request ID. Specify a unique request ID to allow the server to
1049  // ignore the request if it has completed. The server will ignore subsequent
1050  // requests that provide a duplicate request ID for at least 60 minutes after
1051  // the first request.
1052  //
1053  // For example, if an initial request times out, followed by another request
1054  // with the same request ID, the server ignores the second request to prevent
1055  // the creation of duplicate commitments.
1056  //
1057  // The request ID must be a valid
1058  // [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format)
1059  // A zero UUID (00000000-0000-0000-0000-000000000000) is not supported.
1060  string request_id = 3 [(google.api.field_behavior) = OPTIONAL];
1061}
1062
1063// Request message for
1064// [DataprocMetastore.DeleteService][google.cloud.metastore.v1.DataprocMetastore.DeleteService].
1065message DeleteServiceRequest {
1066  // Required. The relative resource name of the metastore service to delete, in
1067  // the following form:
1068  //
1069  // `projects/{project_number}/locations/{location_id}/services/{service_id}`.
1070  string name = 1 [
1071    (google.api.field_behavior) = REQUIRED,
1072    (google.api.resource_reference) = {
1073      type: "metastore.googleapis.com/Service"
1074    }
1075  ];
1076
1077  // Optional. A request ID. Specify a unique request ID to allow the server to
1078  // ignore the request if it has completed. The server will ignore subsequent
1079  // requests that provide a duplicate request ID for at least 60 minutes after
1080  // the first request.
1081  //
1082  // For example, if an initial request times out, followed by another request
1083  // with the same request ID, the server ignores the second request to prevent
1084  // the creation of duplicate commitments.
1085  //
1086  // The request ID must be a valid
1087  // [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format)
1088  // A zero UUID (00000000-0000-0000-0000-000000000000) is not supported.
1089  string request_id = 2 [(google.api.field_behavior) = OPTIONAL];
1090}
1091
1092// Request message for
1093// [DataprocMetastore.ListMetadataImports][google.cloud.metastore.v1.DataprocMetastore.ListMetadataImports].
1094message ListMetadataImportsRequest {
1095  // Required. The relative resource name of the service whose metadata imports
1096  // to list, in the following form:
1097  //
1098  // `projects/{project_number}/locations/{location_id}/services/{service_id}/metadataImports`.
1099  string parent = 1 [
1100    (google.api.field_behavior) = REQUIRED,
1101    (google.api.resource_reference) = {
1102      child_type: "metastore.googleapis.com/MetadataImport"
1103    }
1104  ];
1105
1106  // Optional. The maximum number of imports to return. The response may contain
1107  // less than the maximum number. If unspecified, no more than 500 imports are
1108  // returned. The maximum value is 1000; values above 1000 are changed to 1000.
1109  int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL];
1110
1111  // Optional. A page token, received from a previous
1112  // [DataprocMetastore.ListServices][google.cloud.metastore.v1.DataprocMetastore.ListServices]
1113  // call. Provide this token to retrieve the subsequent page.
1114  //
1115  // To retrieve the first page, supply an empty page token.
1116  //
1117  // When paginating, other parameters provided to
1118  // [DataprocMetastore.ListServices][google.cloud.metastore.v1.DataprocMetastore.ListServices]
1119  // must match the call that provided the page token.
1120  string page_token = 3 [(google.api.field_behavior) = OPTIONAL];
1121
1122  // Optional. The filter to apply to list results.
1123  string filter = 4 [(google.api.field_behavior) = OPTIONAL];
1124
1125  // Optional. Specify the ordering of results as described in [Sorting
1126  // Order](https://cloud.google.com/apis/design/design_patterns#sorting_order).
1127  // If not specified, the results will be sorted in the default order.
1128  string order_by = 5 [(google.api.field_behavior) = OPTIONAL];
1129}
1130
1131// Response message for
1132// [DataprocMetastore.ListMetadataImports][google.cloud.metastore.v1.DataprocMetastore.ListMetadataImports].
1133message ListMetadataImportsResponse {
1134  // The imports in the specified service.
1135  repeated MetadataImport metadata_imports = 1;
1136
1137  // A token that can be sent as `page_token` to retrieve the next page. If this
1138  // field is omitted, there are no subsequent pages.
1139  string next_page_token = 2;
1140
1141  // Locations that could not be reached.
1142  repeated string unreachable = 3;
1143}
1144
1145// Request message for
1146// [DataprocMetastore.GetMetadataImport][google.cloud.metastore.v1.DataprocMetastore.GetMetadataImport].
1147message GetMetadataImportRequest {
1148  // Required. The relative resource name of the metadata import to retrieve, in
1149  // the following form:
1150  //
1151  // `projects/{project_number}/locations/{location_id}/services/{service_id}/metadataImports/{import_id}`.
1152  string name = 1 [
1153    (google.api.field_behavior) = REQUIRED,
1154    (google.api.resource_reference) = {
1155      type: "metastore.googleapis.com/MetadataImport"
1156    }
1157  ];
1158}
1159
1160// Request message for
1161// [DataprocMetastore.CreateMetadataImport][google.cloud.metastore.v1.DataprocMetastore.CreateMetadataImport].
1162message CreateMetadataImportRequest {
1163  // Required. The relative resource name of the service in which to create a
1164  // metastore import, in the following form:
1165  //
1166  // `projects/{project_number}/locations/{location_id}/services/{service_id}`.
1167  string parent = 1 [
1168    (google.api.field_behavior) = REQUIRED,
1169    (google.api.resource_reference) = {
1170      child_type: "metastore.googleapis.com/MetadataImport"
1171    }
1172  ];
1173
1174  // Required. The ID of the metadata import, which is used as the final
1175  // component of the metadata import's name.
1176  //
1177  // This value must be between 1 and 64 characters long, begin with a letter,
1178  // end with a letter or number, and consist of alpha-numeric ASCII characters
1179  // or hyphens.
1180  string metadata_import_id = 2 [(google.api.field_behavior) = REQUIRED];
1181
1182  // Required. The metadata import to create. The `name` field is ignored. The
1183  // ID of the created metadata import must be provided in the request's
1184  // `metadata_import_id` field.
1185  MetadataImport metadata_import = 3 [(google.api.field_behavior) = REQUIRED];
1186
1187  // Optional. A request ID. Specify a unique request ID to allow the server to
1188  // ignore the request if it has completed. The server will ignore subsequent
1189  // requests that provide a duplicate request ID for at least 60 minutes after
1190  // the first request.
1191  //
1192  // For example, if an initial request times out, followed by another request
1193  // with the same request ID, the server ignores the second request to prevent
1194  // the creation of duplicate commitments.
1195  //
1196  // The request ID must be a valid
1197  // [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format)
1198  // A zero UUID (00000000-0000-0000-0000-000000000000) is not supported.
1199  string request_id = 4 [(google.api.field_behavior) = OPTIONAL];
1200}
1201
1202// Request message for
1203// [DataprocMetastore.UpdateMetadataImport][google.cloud.metastore.v1.DataprocMetastore.UpdateMetadataImport].
1204message UpdateMetadataImportRequest {
1205  // Required. A field mask used to specify the fields to be overwritten in the
1206  // metadata import resource by the update.
1207  // Fields specified in the `update_mask` are relative to the resource (not
1208  // to the full request). A field is overwritten if it is in the mask.
1209  google.protobuf.FieldMask update_mask = 1
1210      [(google.api.field_behavior) = REQUIRED];
1211
1212  // Required. The metadata import to update. The server only merges fields
1213  // in the import if they are specified in `update_mask`.
1214  //
1215  // The metadata import's `name` field is used to identify the metastore
1216  // import to be updated.
1217  MetadataImport metadata_import = 2 [(google.api.field_behavior) = REQUIRED];
1218
1219  // Optional. A request ID. Specify a unique request ID to allow the server to
1220  // ignore the request if it has completed. The server will ignore subsequent
1221  // requests that provide a duplicate request ID for at least 60 minutes after
1222  // the first request.
1223  //
1224  // For example, if an initial request times out, followed by another request
1225  // with the same request ID, the server ignores the second request to prevent
1226  // the creation of duplicate commitments.
1227  //
1228  // The request ID must be a valid
1229  // [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format)
1230  // A zero UUID (00000000-0000-0000-0000-000000000000) is not supported.
1231  string request_id = 3 [(google.api.field_behavior) = OPTIONAL];
1232}
1233
1234// Request message for
1235// [DataprocMetastore.ListBackups][google.cloud.metastore.v1.DataprocMetastore.ListBackups].
1236message ListBackupsRequest {
1237  // Required. The relative resource name of the service whose backups to
1238  // list, in the following form:
1239  //
1240  // `projects/{project_number}/locations/{location_id}/services/{service_id}/backups`.
1241  string parent = 1 [
1242    (google.api.field_behavior) = REQUIRED,
1243    (google.api.resource_reference) = {
1244      child_type: "metastore.googleapis.com/Backup"
1245    }
1246  ];
1247
1248  // Optional. The maximum number of backups to return. The response may contain
1249  // less than the maximum number. If unspecified, no more than 500 backups are
1250  // returned. The maximum value is 1000; values above 1000 are changed to 1000.
1251  int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL];
1252
1253  // Optional. A page token, received from a previous
1254  // [DataprocMetastore.ListBackups][google.cloud.metastore.v1.DataprocMetastore.ListBackups]
1255  // call. Provide this token to retrieve the subsequent page.
1256  //
1257  // To retrieve the first page, supply an empty page token.
1258  //
1259  // When paginating, other parameters provided to
1260  // [DataprocMetastore.ListBackups][google.cloud.metastore.v1.DataprocMetastore.ListBackups]
1261  // must match the call that provided the page token.
1262  string page_token = 3 [(google.api.field_behavior) = OPTIONAL];
1263
1264  // Optional. The filter to apply to list results.
1265  string filter = 4 [(google.api.field_behavior) = OPTIONAL];
1266
1267  // Optional. Specify the ordering of results as described in [Sorting
1268  // Order](https://cloud.google.com/apis/design/design_patterns#sorting_order).
1269  // If not specified, the results will be sorted in the default order.
1270  string order_by = 5 [(google.api.field_behavior) = OPTIONAL];
1271}
1272
1273// Response message for
1274// [DataprocMetastore.ListBackups][google.cloud.metastore.v1.DataprocMetastore.ListBackups].
1275message ListBackupsResponse {
1276  // The backups of the specified service.
1277  repeated Backup backups = 1;
1278
1279  // A token that can be sent as `page_token` to retrieve the next page. If this
1280  // field is omitted, there are no subsequent pages.
1281  string next_page_token = 2;
1282
1283  // Locations that could not be reached.
1284  repeated string unreachable = 3;
1285}
1286
1287// Request message for
1288// [DataprocMetastore.GetBackup][google.cloud.metastore.v1.DataprocMetastore.GetBackup].
1289message GetBackupRequest {
1290  // Required. The relative resource name of the backup to retrieve, in the
1291  // following form:
1292  //
1293  // `projects/{project_number}/locations/{location_id}/services/{service_id}/backups/{backup_id}`.
1294  string name = 1 [
1295    (google.api.field_behavior) = REQUIRED,
1296    (google.api.resource_reference) = {
1297      type: "metastore.googleapis.com/Backup"
1298    }
1299  ];
1300}
1301
1302// Request message for
1303// [DataprocMetastore.CreateBackup][google.cloud.metastore.v1.DataprocMetastore.CreateBackup].
1304message CreateBackupRequest {
1305  // Required. The relative resource name of the service in which to create a
1306  // backup of the following form:
1307  //
1308  // `projects/{project_number}/locations/{location_id}/services/{service_id}`.
1309  string parent = 1 [
1310    (google.api.field_behavior) = REQUIRED,
1311    (google.api.resource_reference) = {
1312      child_type: "metastore.googleapis.com/Backup"
1313    }
1314  ];
1315
1316  // Required. The ID of the backup, which is used as the final component of the
1317  // backup's name.
1318  //
1319  // This value must be between 1 and 64 characters long, begin with a letter,
1320  // end with a letter or number, and consist of alpha-numeric ASCII characters
1321  // or hyphens.
1322  string backup_id = 2 [(google.api.field_behavior) = REQUIRED];
1323
1324  // Required. The backup to create. The `name` field is ignored. The ID of the
1325  // created backup must be provided in the request's `backup_id` field.
1326  Backup backup = 3 [(google.api.field_behavior) = REQUIRED];
1327
1328  // Optional. A request ID. Specify a unique request ID to allow the server to
1329  // ignore the request if it has completed. The server will ignore subsequent
1330  // requests that provide a duplicate request ID for at least 60 minutes after
1331  // the first request.
1332  //
1333  // For example, if an initial request times out, followed by another request
1334  // with the same request ID, the server ignores the second request to prevent
1335  // the creation of duplicate commitments.
1336  //
1337  // The request ID must be a valid
1338  // [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format)
1339  // A zero UUID (00000000-0000-0000-0000-000000000000) is not supported.
1340  string request_id = 4 [(google.api.field_behavior) = OPTIONAL];
1341}
1342
1343// Request message for
1344// [DataprocMetastore.DeleteBackup][google.cloud.metastore.v1.DataprocMetastore.DeleteBackup].
1345message DeleteBackupRequest {
1346  // Required. The relative resource name of the backup to delete, in the
1347  // following form:
1348  //
1349  // `projects/{project_number}/locations/{location_id}/services/{service_id}/backups/{backup_id}`.
1350  string name = 1 [
1351    (google.api.field_behavior) = REQUIRED,
1352    (google.api.resource_reference) = {
1353      type: "metastore.googleapis.com/Backup"
1354    }
1355  ];
1356
1357  // Optional. A request ID. Specify a unique request ID to allow the server to
1358  // ignore the request if it has completed. The server will ignore subsequent
1359  // requests that provide a duplicate request ID for at least 60 minutes after
1360  // the first request.
1361  //
1362  // For example, if an initial request times out, followed by another request
1363  // with the same request ID, the server ignores the second request to prevent
1364  // the creation of duplicate commitments.
1365  //
1366  // The request ID must be a valid
1367  // [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format)
1368  // A zero UUID (00000000-0000-0000-0000-000000000000) is not supported.
1369  string request_id = 2 [(google.api.field_behavior) = OPTIONAL];
1370}
1371
1372// Request message for
1373// [DataprocMetastore.ExportMetadata][google.cloud.metastore.v1.DataprocMetastore.ExportMetadata].
1374message ExportMetadataRequest {
1375  // Required. Destination that metadata is exported to.
1376  oneof destination {
1377    // A Cloud Storage URI of a folder, in the format
1378    // `gs://<bucket_name>/<path_inside_bucket>`. A sub-folder
1379    // `<export_folder>` containing exported files will be created below it.
1380    string destination_gcs_folder = 2;
1381  }
1382
1383  // Required. The relative resource name of the metastore service to run
1384  // export, in the following form:
1385  //
1386  // `projects/{project_id}/locations/{location_id}/services/{service_id}`.
1387  string service = 1 [
1388    (google.api.field_behavior) = REQUIRED,
1389    (google.api.resource_reference) = {
1390      type: "metastore.googleapis.com/Service"
1391    }
1392  ];
1393
1394  // Optional. A request ID. Specify a unique request ID to allow the server to
1395  // ignore the request if it has completed. The server will ignore subsequent
1396  // requests that provide a duplicate request ID for at least 60 minutes after
1397  // the first request.
1398  //
1399  // For example, if an initial request times out, followed by another request
1400  // with the same request ID, the server ignores the second request to prevent
1401  // the creation of duplicate commitments.
1402  //
1403  // The request ID must be a valid
1404  // [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format).
1405  // A zero UUID (00000000-0000-0000-0000-000000000000) is not supported.
1406  string request_id = 3 [(google.api.field_behavior) = OPTIONAL];
1407
1408  // Optional. The type of the database dump. If unspecified, defaults to
1409  // `MYSQL`.
1410  DatabaseDumpSpec.Type database_dump_type = 4
1411      [(google.api.field_behavior) = OPTIONAL];
1412}
1413
1414// Request message for [DataprocMetastore.Restore][].
1415message RestoreServiceRequest {
1416  // Required. The relative resource name of the metastore service to run
1417  // restore, in the following form:
1418  //
1419  // `projects/{project_id}/locations/{location_id}/services/{service_id}`.
1420  string service = 1 [
1421    (google.api.field_behavior) = REQUIRED,
1422    (google.api.resource_reference) = {
1423      type: "metastore.googleapis.com/Service"
1424    }
1425  ];
1426
1427  // Required. The relative resource name of the metastore service backup to
1428  // restore from, in the following form:
1429  //
1430  // `projects/{project_id}/locations/{location_id}/services/{service_id}/backups/{backup_id}`.
1431  string backup = 2 [
1432    (google.api.field_behavior) = REQUIRED,
1433    (google.api.resource_reference) = {
1434      type: "metastore.googleapis.com/Backup"
1435    }
1436  ];
1437
1438  // Optional. The type of restore. If unspecified, defaults to `METADATA_ONLY`.
1439  Restore.RestoreType restore_type = 3 [(google.api.field_behavior) = OPTIONAL];
1440
1441  // Optional. A request ID. Specify a unique request ID to allow the server to
1442  // ignore the request if it has completed. The server will ignore subsequent
1443  // requests that provide a duplicate request ID for at least 60 minutes after
1444  // the first request.
1445  //
1446  // For example, if an initial request times out, followed by another request
1447  // with the same request ID, the server ignores the second request to prevent
1448  // the creation of duplicate commitments.
1449  //
1450  // The request ID must be a valid
1451  // [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier#Format).
1452  // A zero UUID (00000000-0000-0000-0000-000000000000) is not supported.
1453  string request_id = 4 [(google.api.field_behavior) = OPTIONAL];
1454}
1455
1456// Represents the metadata of a long-running operation.
1457message OperationMetadata {
1458  // Output only. The time the operation was created.
1459  google.protobuf.Timestamp create_time = 1
1460      [(google.api.field_behavior) = OUTPUT_ONLY];
1461
1462  // Output only. The time the operation finished running.
1463  google.protobuf.Timestamp end_time = 2
1464      [(google.api.field_behavior) = OUTPUT_ONLY];
1465
1466  // Output only. Server-defined resource path for the target of the operation.
1467  string target = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
1468
1469  // Output only. Name of the verb executed by the operation.
1470  string verb = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
1471
1472  // Output only. Human-readable status of the operation, if any.
1473  string status_message = 5 [(google.api.field_behavior) = OUTPUT_ONLY];
1474
1475  // Output only. Identifies whether the caller has requested cancellation
1476  // of the operation. Operations that have successfully been cancelled
1477  // have [Operation.error][] value with a
1478  // [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to
1479  // `Code.CANCELLED`.
1480  bool requested_cancellation = 6 [(google.api.field_behavior) = OUTPUT_ONLY];
1481
1482  // Output only. API version used to start the operation.
1483  string api_version = 7 [(google.api.field_behavior) = OUTPUT_ONLY];
1484}
1485
1486// Metadata about the service in a location.
1487message LocationMetadata {
1488  // A specification of a supported version of the Hive Metastore software.
1489  message HiveMetastoreVersion {
1490    // The semantic version of the Hive Metastore software.
1491    string version = 1;
1492
1493    // Whether `version` will be chosen by the server if a metastore service is
1494    // created with a `HiveMetastoreConfig` that omits the `version`.
1495    bool is_default = 2;
1496  }
1497
1498  // The versions of Hive Metastore that can be used when creating a new
1499  // metastore service in this location. The server guarantees that exactly one
1500  // `HiveMetastoreVersion` in the list will set `is_default`.
1501  repeated HiveMetastoreVersion supported_hive_metastore_versions = 1;
1502}
1503
1504// The specification of database dump to import from or export to.
1505message DatabaseDumpSpec {
1506  // The type of the database dump.
1507  enum Type {
1508    // The type of the database dump is unknown.
1509    TYPE_UNSPECIFIED = 0;
1510
1511    // Database dump is a MySQL dump file.
1512    MYSQL = 1;
1513
1514    // Database dump contains Avro files.
1515    AVRO = 2;
1516  }
1517}
1518
1519// Request message for
1520// [DataprocMetastore.QueryMetadata][google.cloud.metastore.v1.DataprocMetastore.QueryMetadata].
1521message QueryMetadataRequest {
1522  // Required. The relative resource name of the metastore service to query
1523  // metadata, in the following format:
1524  //
1525  // `projects/{project_id}/locations/{location_id}/services/{service_id}`.
1526  string service = 1 [
1527    (google.api.field_behavior) = REQUIRED,
1528    (google.api.resource_reference) = {
1529      type: "metastore.googleapis.com/Service"
1530    }
1531  ];
1532
1533  // Required. A read-only SQL query to execute against the metadata database.
1534  // The query cannot change or mutate the data.
1535  string query = 2 [(google.api.field_behavior) = REQUIRED];
1536}
1537
1538// Response message for
1539// [DataprocMetastore.QueryMetadata][google.cloud.metastore.v1.DataprocMetastore.QueryMetadata].
1540message QueryMetadataResponse {
1541  // The manifest URI  is link to a JSON instance in Cloud Storage.
1542  // This instance manifests immediately along with QueryMetadataResponse. The
1543  // content of the URI is not retriable until the long-running operation query
1544  // against the metadata finishes.
1545  string result_manifest_uri = 1;
1546}
1547
1548// Error details in public error message for
1549// [DataprocMetastore.QueryMetadata][google.cloud.metastore.v1.DataprocMetastore.QueryMetadata].
1550message ErrorDetails {
1551  // Additional structured details about this error.
1552  //
1553  // Keys define the failure items.
1554  // Value describes the exception or details of the item.
1555  map<string, string> details = 1;
1556}
1557
1558// Request message for
1559// [DataprocMetastore.MoveTableToDatabase][google.cloud.metastore.v1.DataprocMetastore.MoveTableToDatabase].
1560message MoveTableToDatabaseRequest {
1561  // Required. The relative resource name of the metastore service to mutate
1562  // metadata, in the following format:
1563  //
1564  // `projects/{project_id}/locations/{location_id}/services/{service_id}`.
1565  string service = 1 [
1566    (google.api.field_behavior) = REQUIRED,
1567    (google.api.resource_reference) = {
1568      type: "metastore.googleapis.com/Service"
1569    }
1570  ];
1571
1572  // Required. The name of the table to be moved.
1573  string table_name = 2 [(google.api.field_behavior) = REQUIRED];
1574
1575  // Required. The name of the database where the table resides.
1576  string db_name = 3 [(google.api.field_behavior) = REQUIRED];
1577
1578  // Required. The name of the database where the table should be moved.
1579  string destination_db_name = 4 [(google.api.field_behavior) = REQUIRED];
1580}
1581
1582// Response message for
1583// [DataprocMetastore.MoveTableToDatabase][google.cloud.metastore.v1.DataprocMetastore.MoveTableToDatabase].
1584message MoveTableToDatabaseResponse {}
1585
1586// Request message for
1587// [DataprocMetastore.AlterMetadataResourceLocation][google.cloud.metastore.v1.DataprocMetastore.AlterMetadataResourceLocation].
1588message AlterMetadataResourceLocationRequest {
1589  // Required. The relative resource name of the metastore service to mutate
1590  // metadata, in the following format:
1591  //
1592  // `projects/{project_id}/locations/{location_id}/services/{service_id}`.
1593  string service = 1 [
1594    (google.api.field_behavior) = REQUIRED,
1595    (google.api.resource_reference) = {
1596      type: "metastore.googleapis.com/Service"
1597    }
1598  ];
1599
1600  // Required. The relative metadata resource name in the following format.
1601  //
1602  // `databases/{database_id}`
1603  // or
1604  // `databases/{database_id}/tables/{table_id}`
1605  // or
1606  // `databases/{database_id}/tables/{table_id}/partitions/{partition_id}`
1607  string resource_name = 2 [(google.api.field_behavior) = REQUIRED];
1608
1609  // Required. The new location URI for the metadata resource.
1610  string location_uri = 3 [(google.api.field_behavior) = REQUIRED];
1611}
1612
1613// Response message for
1614// [DataprocMetastore.AlterMetadataResourceLocation][google.cloud.metastore.v1.DataprocMetastore.AlterMetadataResourceLocation].
1615message AlterMetadataResourceLocationResponse {}
1616