xref: /aosp_15_r20/external/googleapis/google/cloud/clouddms/v1/clouddms_resources.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.clouddms.v1;
18
19import "google/api/field_behavior.proto";
20import "google/api/resource.proto";
21import "google/protobuf/duration.proto";
22import "google/protobuf/timestamp.proto";
23import "google/protobuf/wrappers.proto";
24import "google/rpc/status.proto";
25
26option csharp_namespace = "Google.Cloud.CloudDms.V1";
27option go_package = "cloud.google.com/go/clouddms/apiv1/clouddmspb;clouddmspb";
28option java_multiple_files = true;
29option java_outer_classname = "ClouddmsResourcesProto";
30option java_package = "com.google.cloud.clouddms.v1";
31option php_namespace = "Google\\Cloud\\CloudDms\\V1";
32option ruby_package = "Google::Cloud::CloudDMS::V1";
33option (google.api.resource_definition) = {
34  type: "compute.googleapis.com/Networks"
35  pattern: "projects/{project}/global/networks/{network}"
36};
37
38// SSL configuration information.
39message SslConfig {
40  // Specifies The kind of ssl configuration used.
41  enum SslType {
42    // Unspecified.
43    SSL_TYPE_UNSPECIFIED = 0;
44
45    // Only 'ca_certificate' specified.
46    SERVER_ONLY = 1;
47
48    // Both server ('ca_certificate'), and client ('client_key',
49    // 'client_certificate') specified.
50    SERVER_CLIENT = 2;
51  }
52
53  // Output only. The ssl config type according to 'client_key',
54  // 'client_certificate' and 'ca_certificate'.
55  SslType type = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
56
57  // Input only. The unencrypted PKCS#1 or PKCS#8 PEM-encoded private key
58  // associated with the Client Certificate. If this field is used then the
59  // 'client_certificate' field is mandatory.
60  string client_key = 2 [(google.api.field_behavior) = INPUT_ONLY];
61
62  // Input only. The x509 PEM-encoded certificate that will be used by the
63  // replica to authenticate against the source database server.If this field is
64  // used then the 'client_key' field is mandatory.
65  string client_certificate = 3 [(google.api.field_behavior) = INPUT_ONLY];
66
67  // Required. Input only. The x509 PEM-encoded certificate of the CA that
68  // signed the source database server's certificate. The replica will use this
69  // certificate to verify it's connecting to the right host.
70  string ca_certificate = 4 [
71    (google.api.field_behavior) = INPUT_ONLY,
72    (google.api.field_behavior) = REQUIRED
73  ];
74}
75
76// Specifies connection parameters required specifically for MySQL databases.
77message MySqlConnectionProfile {
78  // Required. The IP or hostname of the source MySQL database.
79  string host = 1 [(google.api.field_behavior) = REQUIRED];
80
81  // Required. The network port of the source MySQL database.
82  int32 port = 2 [(google.api.field_behavior) = REQUIRED];
83
84  // Required. The username that Database Migration Service will use to connect
85  // to the database. The value is encrypted when stored in Database Migration
86  // Service.
87  string username = 3 [(google.api.field_behavior) = REQUIRED];
88
89  // Required. Input only. The password for the user that Database Migration
90  // Service will be using to connect to the database. This field is not
91  // returned on request, and the value is encrypted when stored in Database
92  // Migration Service.
93  string password = 4 [
94    (google.api.field_behavior) = INPUT_ONLY,
95    (google.api.field_behavior) = REQUIRED
96  ];
97
98  // Output only. Indicates If this connection profile password is stored.
99  bool password_set = 5 [(google.api.field_behavior) = OUTPUT_ONLY];
100
101  // SSL configuration for the destination to connect to the source database.
102  SslConfig ssl = 6;
103
104  // If the source is a Cloud SQL database, use this field to
105  // provide the Cloud SQL instance ID of the source.
106  string cloud_sql_id = 7;
107}
108
109enum NetworkArchitecture {
110  NETWORK_ARCHITECTURE_UNSPECIFIED = 0;
111
112  // Instance is in Cloud SQL's old producer network architecture.
113  NETWORK_ARCHITECTURE_OLD_CSQL_PRODUCER = 1;
114
115  // Instance is in Cloud SQL's new producer network architecture.
116  NETWORK_ARCHITECTURE_NEW_CSQL_PRODUCER = 2;
117}
118
119// Specifies connection parameters required specifically for PostgreSQL
120// databases.
121message PostgreSqlConnectionProfile {
122  // Required. The IP or hostname of the source PostgreSQL database.
123  string host = 1 [(google.api.field_behavior) = REQUIRED];
124
125  // Required. The network port of the source PostgreSQL database.
126  int32 port = 2 [(google.api.field_behavior) = REQUIRED];
127
128  // Required. The username that Database Migration Service will use to connect
129  // to the database. The value is encrypted when stored in Database Migration
130  // Service.
131  string username = 3 [(google.api.field_behavior) = REQUIRED];
132
133  // Required. Input only. The password for the user that Database Migration
134  // Service will be using to connect to the database. This field is not
135  // returned on request, and the value is encrypted when stored in Database
136  // Migration Service.
137  string password = 4 [
138    (google.api.field_behavior) = INPUT_ONLY,
139    (google.api.field_behavior) = REQUIRED
140  ];
141
142  // Output only. Indicates If this connection profile password is stored.
143  bool password_set = 5 [(google.api.field_behavior) = OUTPUT_ONLY];
144
145  // SSL configuration for the destination to connect to the source database.
146  SslConfig ssl = 6;
147
148  // If the source is a Cloud SQL database, use this field to
149  // provide the Cloud SQL instance ID of the source.
150  string cloud_sql_id = 7;
151
152  // Output only. If the source is a Cloud SQL database, this field indicates
153  // the network architecture it's associated with.
154  NetworkArchitecture network_architecture = 8
155      [(google.api.field_behavior) = OUTPUT_ONLY];
156
157  // Connectivity options used to establish a connection to the database server.
158  oneof connectivity {
159    // Static ip connectivity data (default, no additional details needed).
160    StaticIpConnectivity static_ip_connectivity = 100;
161
162    // Private service connect connectivity.
163    PrivateServiceConnectConnectivity private_service_connect_connectivity =
164        101;
165  }
166}
167
168// Specifies connection parameters required specifically for Oracle
169// databases.
170message OracleConnectionProfile {
171  // Required. The IP or hostname of the source Oracle database.
172  string host = 1 [(google.api.field_behavior) = REQUIRED];
173
174  // Required. The network port of the source Oracle database.
175  int32 port = 2 [(google.api.field_behavior) = REQUIRED];
176
177  // Required. The username that Database Migration Service will use to connect
178  // to the database. The value is encrypted when stored in Database Migration
179  // Service.
180  string username = 3 [(google.api.field_behavior) = REQUIRED];
181
182  // Required. Input only. The password for the user that Database Migration
183  // Service will be using to connect to the database. This field is not
184  // returned on request, and the value is encrypted when stored in Database
185  // Migration Service.
186  string password = 4 [
187    (google.api.field_behavior) = INPUT_ONLY,
188    (google.api.field_behavior) = REQUIRED
189  ];
190
191  // Output only. Indicates whether a new password is included in the request.
192  bool password_set = 5 [(google.api.field_behavior) = OUTPUT_ONLY];
193
194  // Required. Database service for the Oracle connection.
195  string database_service = 6 [(google.api.field_behavior) = REQUIRED];
196
197  // SSL configuration for the connection to the source Oracle database.
198  //
199  //  * Only `SERVER_ONLY` configuration is supported for Oracle SSL.
200  //  * SSL is supported for Oracle versions 12 and above.
201  SslConfig ssl = 7;
202
203  // Connectivity options used to establish a connection to the database server.
204  oneof connectivity {
205    // Static Service IP connectivity.
206    StaticServiceIpConnectivity static_service_ip_connectivity = 100;
207
208    // Forward SSH tunnel connectivity.
209    ForwardSshTunnelConnectivity forward_ssh_connectivity = 101;
210
211    // Private connectivity.
212    PrivateConnectivity private_connectivity = 102;
213  }
214}
215
216// Specifies required connection parameters, and, optionally, the parameters
217// required to create a Cloud SQL destination database instance.
218message CloudSqlConnectionProfile {
219  // Output only. The Cloud SQL instance ID that this connection profile is
220  // associated with.
221  string cloud_sql_id = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
222
223  // Immutable. Metadata used to create the destination Cloud SQL database.
224  CloudSqlSettings settings = 2 [(google.api.field_behavior) = IMMUTABLE];
225
226  // Output only. The Cloud SQL database instance's private IP.
227  string private_ip = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
228
229  // Output only. The Cloud SQL database instance's public IP.
230  string public_ip = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
231
232  // Output only. The Cloud SQL database instance's additional (outgoing) public
233  // IP. Used when the Cloud SQL database availability type is REGIONAL (i.e.
234  // multiple zones / highly available).
235  string additional_public_ip = 5 [(google.api.field_behavior) = OUTPUT_ONLY];
236}
237
238// Specifies required connection parameters, and the parameters
239// required to create an AlloyDB destination cluster.
240message AlloyDbConnectionProfile {
241  // Required. The AlloyDB cluster ID that this connection profile is associated
242  // with.
243  string cluster_id = 1 [(google.api.field_behavior) = REQUIRED];
244
245  // Immutable. Metadata used to create the destination AlloyDB cluster.
246  AlloyDbSettings settings = 2 [(google.api.field_behavior) = IMMUTABLE];
247}
248
249// An entry for an Access Control list.
250message SqlAclEntry {
251  // The allowlisted value for the access control list.
252  string value = 1;
253
254  // The access control entry entry expiration.
255  oneof expiration {
256    // The time when this access control entry expires in
257    // [RFC 3339](https://tools.ietf.org/html/rfc3339) format, for example:
258    // `2012-11-15T16:19:00.094Z`.
259    google.protobuf.Timestamp expire_time = 10;
260
261    // Input only. The time-to-leave of this access control entry.
262    google.protobuf.Duration ttl = 11
263        [(google.api.field_behavior) = INPUT_ONLY];
264  }
265
266  // A label to identify this entry.
267  string label = 3;
268}
269
270// IP Management configuration.
271message SqlIpConfig {
272  // Whether the instance should be assigned an IPv4 address or not.
273  google.protobuf.BoolValue enable_ipv4 = 1;
274
275  // The resource link for the VPC network from which the Cloud SQL instance is
276  // accessible for private IP. For example,
277  // `projects/myProject/global/networks/default`. This setting can
278  // be updated, but it cannot be removed after it is set.
279  string private_network = 2;
280
281  // Optional. The name of the allocated IP address range for the private IP
282  // Cloud SQL instance. This name refers to an already allocated IP range
283  // address. If set, the instance IP address will be created in the allocated
284  // range. Note that this IP address range can't be modified after the instance
285  // is created. If you change the VPC when configuring connectivity settings
286  // for the migration job, this field is not relevant.
287  string allocated_ip_range = 5 [(google.api.field_behavior) = OPTIONAL];
288
289  // Whether SSL connections over IP should be enforced or not.
290  google.protobuf.BoolValue require_ssl = 3;
291
292  // The list of external networks that are allowed to connect to the instance
293  // using the IP. See
294  // https://en.wikipedia.org/wiki/CIDR_notation#CIDR_notation, also known as
295  // 'slash' notation (e.g. `192.168.100.0/24`).
296  repeated SqlAclEntry authorized_networks = 4;
297}
298
299// Settings for creating a Cloud SQL database instance.
300message CloudSqlSettings {
301  // Specifies when the instance should be activated.
302  enum SqlActivationPolicy {
303    // unspecified policy.
304    SQL_ACTIVATION_POLICY_UNSPECIFIED = 0;
305
306    // The instance is always up and running.
307    ALWAYS = 1;
308
309    // The instance should never spin up.
310    NEVER = 2;
311  }
312
313  // The storage options for Cloud SQL databases.
314  enum SqlDataDiskType {
315    // Unspecified.
316    SQL_DATA_DISK_TYPE_UNSPECIFIED = 0;
317
318    // SSD disk.
319    PD_SSD = 1;
320
321    // HDD disk.
322    PD_HDD = 2;
323  }
324
325  // The database engine type and version.
326  enum SqlDatabaseVersion {
327    // Unspecified version.
328    SQL_DATABASE_VERSION_UNSPECIFIED = 0;
329
330    // MySQL 5.6.
331    MYSQL_5_6 = 1;
332
333    // MySQL 5.7.
334    MYSQL_5_7 = 2;
335
336    // PostgreSQL 9.6.
337    POSTGRES_9_6 = 3;
338
339    // PostgreSQL 11.
340    POSTGRES_11 = 4;
341
342    // PostgreSQL 10.
343    POSTGRES_10 = 5;
344
345    // MySQL 8.0.
346    MYSQL_8_0 = 6;
347
348    // PostgreSQL 12.
349    POSTGRES_12 = 7;
350
351    // PostgreSQL 13.
352    POSTGRES_13 = 8;
353
354    // PostgreSQL 14.
355    POSTGRES_14 = 17;
356
357    // PostgreSQL 15.
358    POSTGRES_15 = 18;
359  }
360
361  // The availability type of the given Cloud SQL instance.
362  enum SqlAvailabilityType {
363    // This is an unknown Availability type.
364    SQL_AVAILABILITY_TYPE_UNSPECIFIED = 0;
365
366    // Zonal availablility instance.
367    ZONAL = 1;
368
369    // Regional availability instance.
370    REGIONAL = 2;
371  }
372
373  // The edition of the given Cloud SQL instance.
374  // Can be ENTERPRISE or ENTERPRISE_PLUS.
375  enum Edition {
376    // The instance did not specify the edition.
377    EDITION_UNSPECIFIED = 0;
378
379    // The instance is an enterprise edition.
380    ENTERPRISE = 2;
381
382    // The instance is an enterprise plus edition.
383    ENTERPRISE_PLUS = 3;
384  }
385
386  // The database engine type and version.
387  SqlDatabaseVersion database_version = 1;
388
389  // The resource labels for a Cloud SQL instance to use to annotate any related
390  // underlying resources such as Compute Engine VMs.
391  // An object containing a list of "key": "value" pairs.
392  //
393  // Example: `{ "name": "wrench", "mass": "18kg", "count": "3" }`.
394  map<string, string> user_labels = 2;
395
396  // The tier (or machine type) for this instance, for example:
397  // `db-n1-standard-1` (MySQL instances) or
398  // `db-custom-1-3840` (PostgreSQL instances).
399  // For more information, see
400  // [Cloud SQL Instance
401  // Settings](https://cloud.google.com/sql/docs/mysql/instance-settings).
402  string tier = 3;
403
404  // The maximum size to which storage capacity can be automatically increased.
405  // The default value is 0, which specifies that there is no limit.
406  google.protobuf.Int64Value storage_auto_resize_limit = 4;
407
408  // The activation policy specifies when the instance is activated; it is
409  // applicable only when the instance state is 'RUNNABLE'. Valid values:
410  //
411  // 'ALWAYS': The instance is on, and remains so even in
412  // the absence of connection requests.
413  //
414  // `NEVER`: The instance is off; it is not activated, even if a
415  // connection request arrives.
416  SqlActivationPolicy activation_policy = 5;
417
418  // The settings for IP Management. This allows to enable or disable the
419  // instance IP and manage which external networks can connect to the instance.
420  // The IPv4 address cannot be disabled.
421  SqlIpConfig ip_config = 6;
422
423  // [default: ON] If you enable this setting, Cloud SQL checks your available
424  // storage every 30 seconds. If the available storage falls below a threshold
425  // size, Cloud SQL automatically adds additional storage capacity. If the
426  // available storage repeatedly falls below the threshold size, Cloud SQL
427  // continues to add storage until it reaches the maximum of 30 TB.
428  google.protobuf.BoolValue auto_storage_increase = 7;
429
430  // The database flags passed to the Cloud SQL instance at startup.
431  // An object containing a list of "key": value pairs.
432  // Example: { "name": "wrench", "mass": "1.3kg", "count": "3" }.
433  map<string, string> database_flags = 8;
434
435  // The type of storage: `PD_SSD` (default) or `PD_HDD`.
436  SqlDataDiskType data_disk_type = 9;
437
438  // The storage capacity available to the database, in GB.
439  // The minimum (and default) size is 10GB.
440  google.protobuf.Int64Value data_disk_size_gb = 10;
441
442  // The Google Cloud Platform zone where your Cloud SQL database instance is
443  // located.
444  string zone = 11;
445
446  // Optional. The Google Cloud Platform zone where the failover Cloud SQL
447  // database instance is located. Used when the Cloud SQL database availability
448  // type is REGIONAL (i.e. multiple zones / highly available).
449  string secondary_zone = 18 [(google.api.field_behavior) = OPTIONAL];
450
451  // The Database Migration Service source connection profile ID,
452  // in the format:
453  // `projects/my_project_name/locations/us-central1/connectionProfiles/connection_profile_ID`
454  string source_id = 12;
455
456  // Input only. Initial root password.
457  string root_password = 13 [(google.api.field_behavior) = INPUT_ONLY];
458
459  // Output only. Indicates If this connection profile root password is stored.
460  bool root_password_set = 14 [(google.api.field_behavior) = OUTPUT_ONLY];
461
462  // The Cloud SQL default instance level collation.
463  string collation = 15;
464
465  // The KMS key name used for the csql instance.
466  string cmek_key_name = 16;
467
468  // Optional. Availability type. Potential values:
469  // *  `ZONAL`: The instance serves data from only one zone. Outages in that
470  // zone affect data availability.
471  // *  `REGIONAL`: The instance can serve data from more than one zone in a
472  // region (it is highly available).
473  SqlAvailabilityType availability_type = 17
474      [(google.api.field_behavior) = OPTIONAL];
475
476  // Optional. The edition of the given Cloud SQL instance.
477  Edition edition = 19 [(google.api.field_behavior) = OPTIONAL];
478}
479
480// Settings for creating an AlloyDB cluster.
481message AlloyDbSettings {
482  // The username/password for a database user. Used for specifying initial
483  // users at cluster creation time.
484  message UserPassword {
485    // The database username.
486    string user = 1;
487
488    // The initial password for the user.
489    string password = 2;
490
491    // Output only. Indicates if the initial_user.password field has been set.
492    bool password_set = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
493  }
494
495  // Settings for the cluster's primary instance
496  message PrimaryInstanceSettings {
497    // MachineConfig describes the configuration of a machine.
498    message MachineConfig {
499      // The number of CPU's in the VM instance.
500      int32 cpu_count = 1;
501    }
502
503    // Required. The ID of the AlloyDB primary instance. The ID must satisfy the
504    // regex expression "[a-z0-9-]+".
505    string id = 1 [(google.api.field_behavior) = REQUIRED];
506
507    // Configuration for the machines that host the underlying
508    // database engine.
509    MachineConfig machine_config = 2;
510
511    // Database flags to pass to AlloyDB when DMS is creating the AlloyDB
512    // cluster and instances. See the AlloyDB documentation for how these can be
513    // used.
514    map<string, string> database_flags = 6;
515
516    // Labels for the AlloyDB primary instance created by DMS. An object
517    // containing a list of 'key', 'value' pairs.
518    map<string, string> labels = 7;
519
520    // Output only. The private IP address for the Instance.
521    // This is the connection endpoint for an end-user application.
522    string private_ip = 8 [(google.api.field_behavior) = OUTPUT_ONLY];
523  }
524
525  // EncryptionConfig describes the encryption config of a cluster that is
526  // encrypted with a CMEK (customer-managed encryption key).
527  message EncryptionConfig {
528    // The fully-qualified resource name of the KMS key.
529    // Each Cloud KMS key is regionalized and has the following format:
530    // projects/[PROJECT]/locations/[REGION]/keyRings/[RING]/cryptoKeys/[KEY_NAME]
531    string kms_key_name = 1;
532  }
533
534  // Required. Input only. Initial user to setup during cluster creation.
535  // Required.
536  UserPassword initial_user = 1 [
537    (google.api.field_behavior) = REQUIRED,
538    (google.api.field_behavior) = INPUT_ONLY
539  ];
540
541  // Required. The resource link for the VPC network in which cluster resources
542  // are created and from which they are accessible via Private IP. The network
543  // must belong to the same project as the cluster. It is specified in the
544  // form: "projects/{project_number}/global/networks/{network_id}". This is
545  // required to create a cluster.
546  string vpc_network = 2 [(google.api.field_behavior) = REQUIRED];
547
548  // Labels for the AlloyDB cluster created by DMS. An object containing a list
549  // of 'key', 'value' pairs.
550  map<string, string> labels = 3;
551
552  PrimaryInstanceSettings primary_instance_settings = 4;
553
554  // Optional. The encryption config can be specified to encrypt the data disks
555  // and other persistent data resources of a cluster with a
556  // customer-managed encryption key (CMEK). When this field is not
557  // specified, the cluster will then use default encryption scheme to
558  // protect the user data.
559  EncryptionConfig encryption_config = 5
560      [(google.api.field_behavior) = OPTIONAL];
561}
562
563// The source database will allow incoming connections from the public IP of the
564// destination database. You can retrieve the public IP of the Cloud SQL
565// instance from the Cloud SQL console or using Cloud SQL APIs. No additional
566// configuration is required.
567message StaticIpConnectivity {}
568
569// [Private Service Connect
570// connectivity](https://cloud.google.com/vpc/docs/private-service-connect#service-attachments)
571message PrivateServiceConnectConnectivity {
572  // Required. A service attachment that exposes a database, and has the
573  // following format:
574  // projects/{project}/regions/{region}/serviceAttachments/{service_attachment_name}
575  string service_attachment = 1 [(google.api.field_behavior) = REQUIRED];
576}
577
578// The details needed to configure a reverse SSH tunnel between the source and
579// destination databases. These details will be used when calling the
580// generateSshScript method (see
581// https://cloud.google.com/database-migration/docs/reference/rest/v1/projects.locations.migrationJobs/generateSshScript)
582// to produce the script that will help set up the reverse SSH tunnel, and to
583// set up the VPC peering between the Cloud SQL private network and the VPC.
584message ReverseSshConnectivity {
585  // Required. The IP of the virtual machine (Compute Engine) used as the
586  // bastion server for the SSH tunnel.
587  string vm_ip = 1 [(google.api.field_behavior) = REQUIRED];
588
589  // Required. The forwarding port of the virtual machine (Compute Engine) used
590  // as the bastion server for the SSH tunnel.
591  int32 vm_port = 2 [(google.api.field_behavior) = REQUIRED];
592
593  // The name of the virtual machine (Compute Engine) used as the bastion server
594  // for the SSH tunnel.
595  string vm = 3;
596
597  // The name of the VPC to peer with the Cloud SQL private network.
598  string vpc = 4;
599}
600
601// The details of the VPC where the source database is located in Google Cloud.
602// We will use this information to set up the VPC peering connection between
603// Cloud SQL and this VPC.
604message VpcPeeringConnectivity {
605  // The name of the VPC network to peer with the Cloud SQL private network.
606  string vpc = 1;
607}
608
609// Forward SSH Tunnel connectivity.
610message ForwardSshTunnelConnectivity {
611  // Required. Hostname for the SSH tunnel.
612  string hostname = 1 [(google.api.field_behavior) = REQUIRED];
613
614  // Required. Username for the SSH tunnel.
615  string username = 2 [(google.api.field_behavior) = REQUIRED];
616
617  // Port for the SSH tunnel, default value is 22.
618  int32 port = 3;
619
620  oneof authentication_method {
621    // Input only. SSH password.
622    string password = 100 [(google.api.field_behavior) = INPUT_ONLY];
623
624    // Input only. SSH private key.
625    string private_key = 101 [(google.api.field_behavior) = INPUT_ONLY];
626  }
627}
628
629// Static IP address connectivity configured on service project.
630message StaticServiceIpConnectivity {}
631
632// Private Connectivity.
633message PrivateConnectivity {
634  // Required. The resource name (URI) of the private connection.
635  string private_connection = 1 [(google.api.field_behavior) = REQUIRED];
636}
637
638// A message defining the database engine and provider.
639message DatabaseType {
640  // The database provider.
641  DatabaseProvider provider = 1;
642
643  // The database engine.
644  DatabaseEngine engine = 2;
645}
646
647// Represents a Database Migration Service migration job object.
648message MigrationJob {
649  option (google.api.resource) = {
650    type: "datamigration.googleapis.com/MigrationJob"
651    pattern: "projects/{project}/locations/{location}/migrationJobs/{migration_job}"
652  };
653
654  // The current migration job states.
655  enum State {
656    // The state of the migration job is unknown.
657    STATE_UNSPECIFIED = 0;
658
659    // The migration job is down for maintenance.
660    MAINTENANCE = 1;
661
662    // The migration job is in draft mode and no resources are created.
663    DRAFT = 2;
664
665    // The migration job is being created.
666    CREATING = 3;
667
668    // The migration job is created and not started.
669    NOT_STARTED = 4;
670
671    // The migration job is running.
672    RUNNING = 5;
673
674    // The migration job failed.
675    FAILED = 6;
676
677    // The migration job has been completed.
678    COMPLETED = 7;
679
680    // The migration job is being deleted.
681    DELETING = 8;
682
683    // The migration job is being stopped.
684    STOPPING = 9;
685
686    // The migration job is currently stopped.
687    STOPPED = 10;
688
689    // The migration job has been deleted.
690    DELETED = 11;
691
692    // The migration job is being updated.
693    UPDATING = 12;
694
695    // The migration job is starting.
696    STARTING = 13;
697
698    // The migration job is restarting.
699    RESTARTING = 14;
700
701    // The migration job is resuming.
702    RESUMING = 15;
703  }
704
705  // The current migration job phase.
706  enum Phase {
707    // The phase of the migration job is unknown.
708    PHASE_UNSPECIFIED = 0;
709
710    // The migration job is in the full dump phase.
711    FULL_DUMP = 1;
712
713    // The migration job is CDC phase.
714    CDC = 2;
715
716    // The migration job is running the promote phase.
717    PROMOTE_IN_PROGRESS = 3;
718
719    // Only RDS flow - waiting for source writes to stop
720    WAITING_FOR_SOURCE_WRITES_TO_STOP = 4;
721
722    // Only RDS flow - the sources writes stopped, waiting for dump to begin
723    PREPARING_THE_DUMP = 5;
724  }
725
726  // The type of migration job (one-time or continuous).
727  enum Type {
728    // The type of the migration job is unknown.
729    TYPE_UNSPECIFIED = 0;
730
731    // The migration job is a one time migration.
732    ONE_TIME = 1;
733
734    // The migration job is a continuous migration.
735    CONTINUOUS = 2;
736  }
737
738  // Dump flag definition.
739  message DumpFlag {
740    // The name of the flag
741    string name = 1;
742
743    // The value of the flag.
744    string value = 2;
745  }
746
747  // Dump flags definition.
748  message DumpFlags {
749    // The flags for the initial dump.
750    repeated DumpFlag dump_flags = 1;
751  }
752
753  // Performance configuration definition.
754  message PerformanceConfig {
755    // Describes the parallelism level during initial dump.
756    enum DumpParallelLevel {
757      // Unknown dump parallel level. Will be defaulted to OPTIMAL.
758      DUMP_PARALLEL_LEVEL_UNSPECIFIED = 0;
759
760      // Minimal parallel level.
761      MIN = 1;
762
763      // Optimal parallel level.
764      OPTIMAL = 2;
765
766      // Maximum parallel level.
767      MAX = 3;
768    }
769
770    // Initial dump parallelism level.
771    DumpParallelLevel dump_parallel_level = 1;
772  }
773
774  // The name (URI) of this migration job resource, in the form of:
775  // projects/{project}/locations/{location}/migrationJobs/{migrationJob}.
776  string name = 1;
777
778  // Output only. The timestamp when the migration job resource was created.
779  // A timestamp in RFC3339 UTC "Zulu" format, accurate to nanoseconds.
780  // Example: "2014-10-02T15:01:23.045123456Z".
781  google.protobuf.Timestamp create_time = 2
782      [(google.api.field_behavior) = OUTPUT_ONLY];
783
784  // Output only. The timestamp when the migration job resource was last
785  // updated. A timestamp in RFC3339 UTC "Zulu" format, accurate to nanoseconds.
786  // Example: "2014-10-02T15:01:23.045123456Z".
787  google.protobuf.Timestamp update_time = 3
788      [(google.api.field_behavior) = OUTPUT_ONLY];
789
790  // The resource labels for migration job to use to annotate any related
791  // underlying resources such as Compute Engine VMs. An object containing a
792  // list of "key": "value" pairs.
793  //
794  // Example: `{ "name": "wrench", "mass": "1.3kg", "count": "3" }`.
795  map<string, string> labels = 4;
796
797  // The migration job display name.
798  string display_name = 5;
799
800  // The current migration job state.
801  State state = 6;
802
803  // Output only. The current migration job phase.
804  Phase phase = 7 [(google.api.field_behavior) = OUTPUT_ONLY];
805
806  // Required. The migration job type.
807  Type type = 8 [(google.api.field_behavior) = REQUIRED];
808
809  // The path to the dump file in Google Cloud Storage,
810  // in the format: (gs://[BUCKET_NAME]/[OBJECT_NAME]).
811  // This field and the "dump_flags" field are mutually exclusive.
812  string dump_path = 9;
813
814  // The initial dump flags.
815  // This field and the "dump_path" field are mutually exclusive.
816  DumpFlags dump_flags = 17;
817
818  // Required. The resource name (URI) of the source connection profile.
819  string source = 10 [(google.api.field_behavior) = REQUIRED];
820
821  // Required. The resource name (URI) of the destination connection profile.
822  string destination = 11 [(google.api.field_behavior) = REQUIRED];
823
824  // The connectivity method.
825  oneof connectivity {
826    // The details needed to communicate to the source over Reverse SSH
827    // tunnel connectivity.
828    ReverseSshConnectivity reverse_ssh_connectivity = 101;
829
830    // The details of the VPC network that the source database is located in.
831    VpcPeeringConnectivity vpc_peering_connectivity = 102;
832
833    // static ip connectivity data (default, no additional details needed).
834    StaticIpConnectivity static_ip_connectivity = 103;
835  }
836
837  // Output only. The duration of the migration job (in seconds). A duration in
838  // seconds with up to nine fractional digits, terminated by 's'. Example:
839  // "3.5s".
840  google.protobuf.Duration duration = 12
841      [(google.api.field_behavior) = OUTPUT_ONLY];
842
843  // Output only. The error details in case of state FAILED.
844  google.rpc.Status error = 13 [(google.api.field_behavior) = OUTPUT_ONLY];
845
846  // The database engine type and provider of the source.
847  DatabaseType source_database = 14;
848
849  // The database engine type and provider of the destination.
850  DatabaseType destination_database = 15;
851
852  // Output only. If the migration job is completed, the time when it was
853  // completed.
854  google.protobuf.Timestamp end_time = 16
855      [(google.api.field_behavior) = OUTPUT_ONLY];
856
857  // The conversion workspace used by the migration.
858  ConversionWorkspaceInfo conversion_workspace = 18;
859
860  // This field can be used to select the entities to migrate as part of
861  // the migration job. It uses AIP-160 notation to select a subset of the
862  // entities configured on the associated conversion-workspace. This field
863  // should not be set on migration-jobs that are not associated with a
864  // conversion workspace.
865  string filter = 20;
866
867  // The CMEK (customer-managed encryption key) fully qualified key name used
868  // for the migration job.
869  // This field supports all migration jobs types except for:
870  // * Mysql to Mysql (use the cmek field in the cloudsql connection profile
871  // instead).
872  // * PostrgeSQL to PostgreSQL (use the cmek field in the cloudsql
873  // connection profile instead).
874  // * PostgreSQL to AlloyDB (use the kms_key_name field in the alloydb
875  // connection profile instead).
876  // Each Cloud CMEK key has the following format:
877  // projects/[PROJECT]/locations/[REGION]/keyRings/[RING]/cryptoKeys/[KEY_NAME]
878  string cmek_key_name = 21;
879
880  // Optional. Data dump parallelism settings used by the migration.
881  // Currently applicable only for MySQL to Cloud SQL for MySQL migrations only.
882  PerformanceConfig performance_config = 22
883      [(google.api.field_behavior) = OPTIONAL];
884}
885
886// A conversion workspace's version.
887message ConversionWorkspaceInfo {
888  // The resource name (URI) of the conversion workspace.
889  string name = 1;
890
891  // The commit ID of the conversion workspace.
892  string commit_id = 2;
893}
894
895// A connection profile definition.
896message ConnectionProfile {
897  option (google.api.resource) = {
898    type: "datamigration.googleapis.com/ConnectionProfile"
899    pattern: "projects/{project}/locations/{location}/connectionProfiles/{connection_profile}"
900  };
901
902  // The current connection profile state (e.g. DRAFT, READY, or FAILED).
903  enum State {
904    // The state of the connection profile is unknown.
905    STATE_UNSPECIFIED = 0;
906
907    // The connection profile is in draft mode and fully editable.
908    DRAFT = 1;
909
910    // The connection profile is being created.
911    CREATING = 2;
912
913    // The connection profile is ready.
914    READY = 3;
915
916    // The connection profile is being updated.
917    UPDATING = 4;
918
919    // The connection profile is being deleted.
920    DELETING = 5;
921
922    // The connection profile has been deleted.
923    DELETED = 6;
924
925    // The last action on the connection profile failed.
926    FAILED = 7;
927  }
928
929  // The name of this connection profile resource in the form of
930  // projects/{project}/locations/{location}/connectionProfiles/{connectionProfile}.
931  string name = 1;
932
933  // Output only. The timestamp when the resource was created.
934  // A timestamp in RFC3339 UTC "Zulu" format, accurate to nanoseconds.
935  // Example: "2014-10-02T15:01:23.045123456Z".
936  google.protobuf.Timestamp create_time = 2
937      [(google.api.field_behavior) = OUTPUT_ONLY];
938
939  // Output only. The timestamp when the resource was last updated.
940  // A timestamp in RFC3339 UTC "Zulu" format, accurate to nanoseconds.
941  // Example: "2014-10-02T15:01:23.045123456Z".
942  google.protobuf.Timestamp update_time = 3
943      [(google.api.field_behavior) = OUTPUT_ONLY];
944
945  // The resource labels for connection profile to use to annotate any related
946  // underlying resources such as Compute Engine VMs. An object containing a
947  // list of "key": "value" pairs.
948  //
949  // Example: `{ "name": "wrench", "mass": "1.3kg", "count": "3" }`.
950  map<string, string> labels = 4;
951
952  // The current connection profile state (e.g. DRAFT, READY, or FAILED).
953  State state = 5;
954
955  // The connection profile display name.
956  string display_name = 6;
957
958  // The connection profile definition.
959  oneof connection_profile {
960    // A MySQL database connection profile.
961    MySqlConnectionProfile mysql = 100;
962
963    // A PostgreSQL database connection profile.
964    PostgreSqlConnectionProfile postgresql = 101;
965
966    // An Oracle database connection profile.
967    OracleConnectionProfile oracle = 104;
968
969    // A CloudSQL database connection profile.
970    CloudSqlConnectionProfile cloudsql = 102;
971
972    // An AlloyDB cluster connection profile.
973    AlloyDbConnectionProfile alloydb = 105;
974  }
975
976  // Output only. The error details in case of state FAILED.
977  google.rpc.Status error = 7 [(google.api.field_behavior) = OUTPUT_ONLY];
978
979  // The database provider.
980  DatabaseProvider provider = 8;
981}
982
983// Error message of a verification Migration job.
984message MigrationJobVerificationError {
985  // A general error code describing the type of error that occurred.
986  enum ErrorCode {
987    // An unknown error occurred
988    ERROR_CODE_UNSPECIFIED = 0;
989
990    // We failed to connect to one of the connection profile.
991    CONNECTION_FAILURE = 1;
992
993    // We failed to authenticate to one of the connection profile.
994    AUTHENTICATION_FAILURE = 2;
995
996    // One of the involved connection profiles has an invalid configuration.
997    INVALID_CONNECTION_PROFILE_CONFIG = 3;
998
999    // The versions of the source and the destination are incompatible.
1000    VERSION_INCOMPATIBILITY = 4;
1001
1002    // The types of the source and the destination are incompatible.
1003    CONNECTION_PROFILE_TYPES_INCOMPATIBILITY = 5;
1004
1005    // No pglogical extension installed on databases, applicable for postgres.
1006    NO_PGLOGICAL_INSTALLED = 7;
1007
1008    // pglogical node already exists on databases, applicable for postgres.
1009    PGLOGICAL_NODE_ALREADY_EXISTS = 8;
1010
1011    // The value of parameter wal_level is not set to logical.
1012    INVALID_WAL_LEVEL = 9;
1013
1014    // The value of parameter shared_preload_libraries does not include
1015    // pglogical.
1016    INVALID_SHARED_PRELOAD_LIBRARY = 10;
1017
1018    // The value of parameter max_replication_slots is not sufficient.
1019    INSUFFICIENT_MAX_REPLICATION_SLOTS = 11;
1020
1021    // The value of parameter max_wal_senders is not sufficient.
1022    INSUFFICIENT_MAX_WAL_SENDERS = 12;
1023
1024    // The value of parameter max_worker_processes is not sufficient.
1025    INSUFFICIENT_MAX_WORKER_PROCESSES = 13;
1026
1027    // Extensions installed are either not supported or having unsupported
1028    // versions.
1029    UNSUPPORTED_EXTENSIONS = 14;
1030
1031    // Unsupported migration type.
1032    UNSUPPORTED_MIGRATION_TYPE = 15;
1033
1034    // Invalid RDS logical replication.
1035    INVALID_RDS_LOGICAL_REPLICATION = 16;
1036
1037    // The gtid_mode is not supported, applicable for MySQL.
1038    UNSUPPORTED_GTID_MODE = 17;
1039
1040    // The table definition is not support due to missing primary key or replica
1041    // identity.
1042    UNSUPPORTED_TABLE_DEFINITION = 18;
1043
1044    // The definer is not supported.
1045    UNSUPPORTED_DEFINER = 19;
1046
1047    // Migration is already running at the time of restart request.
1048    CANT_RESTART_RUNNING_MIGRATION = 21;
1049
1050    // The source already has a replication setup.
1051    SOURCE_ALREADY_SETUP = 23;
1052
1053    // The source has tables with limited support.
1054    // E.g. PostgreSQL tables without primary keys.
1055    TABLES_WITH_LIMITED_SUPPORT = 24;
1056
1057    // The source uses an unsupported locale.
1058    UNSUPPORTED_DATABASE_LOCALE = 25;
1059
1060    // The source uses an unsupported Foreign Data Wrapper configuration.
1061    UNSUPPORTED_DATABASE_FDW_CONFIG = 26;
1062
1063    // There was an underlying RDBMS error.
1064    ERROR_RDBMS = 27;
1065
1066    // The source DB size in Bytes exceeds a certain threshold. The migration
1067    // might require an increase of quota, or might not be supported.
1068    SOURCE_SIZE_EXCEEDS_THRESHOLD = 28;
1069
1070    // The destination DB contains existing databases that are conflicting with
1071    // those in the source DB.
1072    EXISTING_CONFLICTING_DATABASES = 29;
1073
1074    // Insufficient privilege to enable the parallelism configuration.
1075    PARALLEL_IMPORT_INSUFFICIENT_PRIVILEGE = 30;
1076  }
1077
1078  // Output only. An instance of ErrorCode specifying the error that occurred.
1079  ErrorCode error_code = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
1080
1081  // Output only. A formatted message with further details about the error and a
1082  // CTA.
1083  string error_message = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
1084
1085  // Output only. A specific detailed error message, if supplied by the engine.
1086  string error_detail_message = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
1087}
1088
1089// The database engine types.
1090enum DatabaseEngine {
1091  // The source database engine of the migration job is unknown.
1092  DATABASE_ENGINE_UNSPECIFIED = 0;
1093
1094  // The source engine is MySQL.
1095  MYSQL = 1;
1096
1097  // The source engine is PostgreSQL.
1098  POSTGRESQL = 2;
1099
1100  // The source engine is Oracle.
1101  ORACLE = 4;
1102}
1103
1104// The database providers.
1105enum DatabaseProvider {
1106  // The database provider is unknown.
1107  DATABASE_PROVIDER_UNSPECIFIED = 0;
1108
1109  // CloudSQL runs the database.
1110  CLOUDSQL = 1;
1111
1112  // RDS runs the database.
1113  RDS = 2;
1114
1115  // Amazon Aurora.
1116  AURORA = 3;
1117
1118  // AlloyDB.
1119  ALLOYDB = 4;
1120}
1121
1122// The PrivateConnection resource is used to establish private connectivity
1123// with the customer's network.
1124message PrivateConnection {
1125  option (google.api.resource) = {
1126    type: "datamigration.googleapis.com/PrivateConnection"
1127    pattern: "projects/{project}/locations/{location}/privateConnections/{private_connection}"
1128  };
1129
1130  // Private Connection state.
1131  enum State {
1132    STATE_UNSPECIFIED = 0;
1133
1134    // The private connection is in creation state - creating resources.
1135    CREATING = 1;
1136
1137    // The private connection has been created with all of its resources.
1138    CREATED = 2;
1139
1140    // The private connection creation has failed.
1141    FAILED = 3;
1142
1143    // The private connection is being deleted.
1144    DELETING = 4;
1145
1146    // Delete request has failed, resource is in invalid state.
1147    FAILED_TO_DELETE = 5;
1148
1149    // The private connection has been deleted.
1150    DELETED = 6;
1151  }
1152
1153  // The name of the resource.
1154  string name = 1;
1155
1156  // Output only. The create time of the resource.
1157  google.protobuf.Timestamp create_time = 2
1158      [(google.api.field_behavior) = OUTPUT_ONLY];
1159
1160  // Output only. The last update time of the resource.
1161  google.protobuf.Timestamp update_time = 3
1162      [(google.api.field_behavior) = OUTPUT_ONLY];
1163
1164  // The resource labels for private connections to use to annotate any related
1165  // underlying resources such as Compute Engine VMs. An object containing a
1166  // list of "key": "value" pairs.
1167  //
1168  // Example: `{ "name": "wrench", "mass": "1.3kg", "count": "3" }`.
1169  map<string, string> labels = 4;
1170
1171  // The private connection display name.
1172  string display_name = 5;
1173
1174  // Output only. The state of the private connection.
1175  State state = 6 [(google.api.field_behavior) = OUTPUT_ONLY];
1176
1177  // Output only. The error details in case of state FAILED.
1178  google.rpc.Status error = 7 [(google.api.field_behavior) = OUTPUT_ONLY];
1179
1180  oneof connectivity {
1181    // VPC peering configuration.
1182    VpcPeeringConfig vpc_peering_config = 100;
1183  }
1184}
1185
1186// The VPC peering configuration is used to create VPC peering with the
1187// consumer's VPC.
1188message VpcPeeringConfig {
1189  // Required. Fully qualified name of the VPC that Database Migration Service
1190  // will peer to.
1191  string vpc_name = 1 [
1192    (google.api.field_behavior) = REQUIRED,
1193    (google.api.resource_reference) = {
1194      type: "compute.googleapis.com/Networks"
1195    }
1196  ];
1197
1198  // Required. A free subnet for peering. (CIDR of /29)
1199  string subnet = 2 [(google.api.field_behavior) = REQUIRED];
1200}
1201