@google-cloud/dms 2.2.2 → 2.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,606 @@
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
+
15
+ syntax = "proto3";
16
+
17
+ package google.cloud.clouddms.v1;
18
+
19
+ import "google/api/field_behavior.proto";
20
+ import "google/api/resource.proto";
21
+ import "google/cloud/clouddms/v1/clouddms_resources.proto";
22
+ import "google/protobuf/struct.proto";
23
+ import "google/protobuf/timestamp.proto";
24
+
25
+ option csharp_namespace = "Google.Cloud.CloudDms.V1";
26
+ option go_package = "cloud.google.com/go/clouddms/apiv1/clouddmspb;clouddmspb";
27
+ option java_multiple_files = true;
28
+ option java_outer_classname = "ConversionWorkspaceResourcesProto";
29
+ option java_package = "com.google.cloud.clouddms.v1";
30
+ option php_namespace = "Google\\Cloud\\CloudDms\\V1";
31
+ option ruby_package = "Google::Cloud::CloudDMS::V1";
32
+
33
+ // The type and version of a source or destination database.
34
+ message DatabaseEngineInfo {
35
+ // Required. Engine type.
36
+ DatabaseEngine engine = 1 [(google.api.field_behavior) = REQUIRED];
37
+
38
+ // Required. Engine named version, for example 12.c.1.
39
+ string version = 2 [(google.api.field_behavior) = REQUIRED];
40
+ }
41
+
42
+ // The main conversion workspace resource entity.
43
+ message ConversionWorkspace {
44
+ option (google.api.resource) = {
45
+ type: "datamigration.googleapis.com/ConversionWorkspace"
46
+ pattern: "projects/{project}/locations/{location}/conversionWorkspaces/{conversion_workspace}"
47
+ };
48
+
49
+ // Full name of the workspace resource, in the form of:
50
+ // projects/{project}/locations/{location}/conversionWorkspaces/{conversion_workspace}.
51
+ string name = 1;
52
+
53
+ // Required. The source engine details.
54
+ DatabaseEngineInfo source = 2 [(google.api.field_behavior) = REQUIRED];
55
+
56
+ // Required. The destination engine details.
57
+ DatabaseEngineInfo destination = 3 [(google.api.field_behavior) = REQUIRED];
58
+
59
+ // A generic list of settings for the workspace.
60
+ // The settings are database pair dependant and can indicate default behavior
61
+ // for the mapping rules engine or turn on or off specific features.
62
+ // Such examples can be: convert_foreign_key_to_interleave=true,
63
+ // skip_triggers=false, ignore_non_table_synonyms=true
64
+ map<string, string> global_settings = 4;
65
+
66
+ // Output only. Whether the workspace has uncommitted changes (changes which
67
+ // were made after the workspace was committed).
68
+ bool has_uncommitted_changes = 5 [(google.api.field_behavior) = OUTPUT_ONLY];
69
+
70
+ // Output only. The latest commit ID.
71
+ string latest_commit_id = 6 [(google.api.field_behavior) = OUTPUT_ONLY];
72
+
73
+ // Output only. The timestamp when the workspace was committed.
74
+ google.protobuf.Timestamp latest_commit_time = 7
75
+ [(google.api.field_behavior) = OUTPUT_ONLY];
76
+
77
+ // Output only. The timestamp when the workspace resource was created.
78
+ google.protobuf.Timestamp create_time = 9
79
+ [(google.api.field_behavior) = OUTPUT_ONLY];
80
+
81
+ // Output only. The timestamp when the workspace resource was last updated.
82
+ google.protobuf.Timestamp update_time = 10
83
+ [(google.api.field_behavior) = OUTPUT_ONLY];
84
+
85
+ // The display name for the workspace.
86
+ string display_name = 11;
87
+ }
88
+
89
+ // Execution log of a background job.
90
+ message BackgroundJobLogEntry {
91
+ // Final state after a job completes.
92
+ enum JobCompletionState {
93
+ // The status is not specified. This state is used when job is not yet
94
+ // finished.
95
+ JOB_COMPLETION_STATE_UNSPECIFIED = 0;
96
+
97
+ // Success.
98
+ SUCCEEDED = 1;
99
+
100
+ // Error.
101
+ FAILED = 2;
102
+ }
103
+
104
+ // Details regarding a Seed background job.
105
+ message SeedJobDetails {
106
+ // The connection profile which was used for the seed job.
107
+ string connection_profile = 1;
108
+ }
109
+
110
+ // Details regarding an Import Rules background job.
111
+ message ImportRulesJobDetails {
112
+ // File names used for the import rules job.
113
+ repeated string files = 1;
114
+
115
+ // The requested file format.
116
+ ImportRulesFileFormat file_format = 2;
117
+ }
118
+
119
+ // Details regarding a Convert background job.
120
+ message ConvertJobDetails {
121
+ // AIP-160 based filter used to specify the entities to convert
122
+ string filter = 1;
123
+ }
124
+
125
+ // Details regarding an Apply background job.
126
+ message ApplyJobDetails {
127
+ // The connection profile which was used for the apply job.
128
+ string connection_profile = 1;
129
+
130
+ // AIP-160 based filter used to specify the entities to apply
131
+ string filter = 2;
132
+ }
133
+
134
+ // The background job log entry ID.
135
+ string id = 1;
136
+
137
+ // The type of job that was executed.
138
+ BackgroundJobType job_type = 2;
139
+
140
+ // The timestamp when the background job was started.
141
+ google.protobuf.Timestamp start_time = 3;
142
+
143
+ // The timestamp when the background job was finished.
144
+ google.protobuf.Timestamp finish_time = 4;
145
+
146
+ // Job completion state, i.e. the final state after the job completed.
147
+ JobCompletionState completion_state = 5;
148
+
149
+ // Job completion comment, such as how many entities were seeded,
150
+ // how many warnings were found during conversion, and similar information.
151
+ string completion_comment = 6;
152
+
153
+ // Whether the client requested the conversion workspace to be committed after
154
+ // a successful completion of the job.
155
+ bool request_autocommit = 7;
156
+
157
+ oneof job_details {
158
+ // Seed job details.
159
+ SeedJobDetails seed_job_details = 100;
160
+
161
+ // Import rules job details.
162
+ ImportRulesJobDetails import_rules_job_details = 101;
163
+
164
+ // Convert job details.
165
+ ConvertJobDetails convert_job_details = 102;
166
+
167
+ // Apply job details.
168
+ ApplyJobDetails apply_job_details = 103;
169
+ }
170
+ }
171
+
172
+ // The base entity type for all the database related entities.
173
+ // The message contains the entity name, the name of its parent, the entity
174
+ // type, and the specific details per entity type.
175
+ message DatabaseEntity {
176
+ // The type of database entities tree.
177
+ enum TreeType {
178
+ // Tree type unspecified.
179
+ TREE_TYPE_UNSPECIFIED = 0;
180
+
181
+ // Tree of entities loaded from a source database.
182
+ SOURCE = 1;
183
+
184
+ // Tree of entities converted from the source tree using the mapping rules.
185
+ DRAFT = 2;
186
+
187
+ // Tree of entities observed on the destination database.
188
+ DESTINATION = 3;
189
+ }
190
+
191
+ // The short name (e.g. table name) of the entity.
192
+ string short_name = 1;
193
+
194
+ // The full name of the parent entity (e.g. schema name).
195
+ string parent_entity = 2;
196
+
197
+ // The type of tree the entity belongs to.
198
+ TreeType tree = 3;
199
+
200
+ // The type of the database entity (table, view, index, ...).
201
+ DatabaseEntityType entity_type = 4;
202
+
203
+ // Details about entity mappings.
204
+ // For source tree entities, this holds the draft entities which were
205
+ // generated by the mapping rules.
206
+ // For draft tree entities, this holds the source entities which were
207
+ // converted to form the draft entity.
208
+ // Destination entities will have no mapping details.
209
+ repeated EntityMapping mappings = 5;
210
+
211
+ // The specific body for each entity type.
212
+ oneof entity_body {
213
+ // Schema.
214
+ SchemaEntity schema = 102;
215
+
216
+ // Table.
217
+ TableEntity table = 103;
218
+
219
+ // View.
220
+ ViewEntity view = 104;
221
+
222
+ // Sequence.
223
+ SequenceEntity sequence = 105;
224
+
225
+ // Stored procedure.
226
+ StoredProcedureEntity stored_procedure = 106;
227
+
228
+ // Function.
229
+ FunctionEntity database_function = 107;
230
+
231
+ // Synonym.
232
+ SynonymEntity synonym = 108;
233
+
234
+ // Package.
235
+ PackageEntity database_package = 109;
236
+ }
237
+ }
238
+
239
+ // Schema typically has no parent entity, but can have a parent entity
240
+ // DatabaseInstance (for database engines which support it). For some database
241
+ // engines, the terms schema and user can be used interchangeably when they
242
+ // refer to a namespace or a collection of other database entities. Can store
243
+ // additional information which is schema specific.
244
+ message SchemaEntity {
245
+ // Custom engine specific features.
246
+ google.protobuf.Struct custom_features = 1;
247
+ }
248
+
249
+ // Table's parent is a schema.
250
+ message TableEntity {
251
+ // Table columns.
252
+ repeated ColumnEntity columns = 1;
253
+
254
+ // Table constraints.
255
+ repeated ConstraintEntity constraints = 2;
256
+
257
+ // Table indices.
258
+ repeated IndexEntity indices = 3;
259
+
260
+ // Table triggers.
261
+ repeated TriggerEntity triggers = 4;
262
+
263
+ // Custom engine specific features.
264
+ google.protobuf.Struct custom_features = 5;
265
+
266
+ // Comment associated with the table.
267
+ string comment = 6;
268
+ }
269
+
270
+ // Column is not used as an independent entity, it is retrieved as part of a
271
+ // Table entity.
272
+ message ColumnEntity {
273
+ // Column name.
274
+ string name = 1;
275
+
276
+ // Column data type.
277
+ string data_type = 2;
278
+
279
+ // Charset override - instead of table level charset.
280
+ string charset = 3;
281
+
282
+ // Collation override - instead of table level collation.
283
+ string collation = 4;
284
+
285
+ // Column length - e.g. varchar (50).
286
+ int64 length = 5;
287
+
288
+ // Column precision - when relevant.
289
+ int32 precision = 6;
290
+
291
+ // Column scale - when relevant.
292
+ int32 scale = 7;
293
+
294
+ // Column fractional second precision - used for timestamp based datatypes.
295
+ int32 fractional_seconds_precision = 8;
296
+
297
+ // Is the column of array type.
298
+ bool array = 9;
299
+
300
+ // If the column is array, of which length.
301
+ int32 array_length = 10;
302
+
303
+ // Is the column nullable.
304
+ bool nullable = 11;
305
+
306
+ // Is the column auto-generated/identity.
307
+ bool auto_generated = 12;
308
+
309
+ // Is the column a UDT.
310
+ bool udt = 13;
311
+
312
+ // Custom engine specific features.
313
+ google.protobuf.Struct custom_features = 14;
314
+
315
+ // Specifies the list of values allowed in the column.
316
+ // Only used for set data type.
317
+ repeated string set_values = 15;
318
+
319
+ // Comment associated with the column.
320
+ string comment = 16;
321
+
322
+ // Column order in the table.
323
+ int32 ordinal_position = 17;
324
+
325
+ // Default value of the column.
326
+ string default_value = 18;
327
+ }
328
+
329
+ // Constraint is not used as an independent entity, it is retrieved
330
+ // as part of another entity such as Table or View.
331
+ message ConstraintEntity {
332
+ // The name of the table constraint.
333
+ string name = 1;
334
+
335
+ // Type of constraint, for example unique, primary key, foreign key (currently
336
+ // only primary key is supported).
337
+ string type = 2;
338
+
339
+ // Table columns used as part of the Constraint, for example primary key
340
+ // constraint should list the columns which constitutes the key.
341
+ repeated string table_columns = 3;
342
+
343
+ // Custom engine specific features.
344
+ google.protobuf.Struct custom_features = 4;
345
+
346
+ // Reference columns which may be associated with the constraint. For example,
347
+ // if the constraint is a FOREIGN_KEY, this represents the list of full names
348
+ // of referenced columns by the foreign key.
349
+ repeated string reference_columns = 5;
350
+
351
+ // Reference table which may be associated with the constraint. For example,
352
+ // if the constraint is a FOREIGN_KEY, this represents the list of full name
353
+ // of the referenced table by the foreign key.
354
+ string reference_table = 6;
355
+
356
+ // Table which is associated with the constraint. In case the constraint
357
+ // is defined on a table, this field is left empty as this information is
358
+ // stored in parent_name. However, if constraint is defined on a view, this
359
+ // field stores the table name on which the view is defined.
360
+ string table_name = 7;
361
+ }
362
+
363
+ // Index is not used as an independent entity, it is retrieved as part of a
364
+ // Table entity.
365
+ message IndexEntity {
366
+ // The name of the index.
367
+ string name = 1;
368
+
369
+ // Type of index, for example B-TREE.
370
+ string type = 2;
371
+
372
+ // Table columns used as part of the Index, for example B-TREE index should
373
+ // list the columns which constitutes the index.
374
+ repeated string table_columns = 3;
375
+
376
+ // Boolean value indicating whether the index is unique.
377
+ bool unique = 4;
378
+
379
+ // Custom engine specific features.
380
+ google.protobuf.Struct custom_features = 5;
381
+ }
382
+
383
+ // Trigger is not used as an independent entity, it is retrieved as part of a
384
+ // Table entity.
385
+ message TriggerEntity {
386
+ // The name of the trigger.
387
+ string name = 1;
388
+
389
+ // The DML, DDL, or database events that fire the trigger, for example
390
+ // INSERT, UPDATE.
391
+ repeated string triggering_events = 2;
392
+
393
+ // Indicates when the trigger fires, for example BEFORE STATEMENT, AFTER EACH
394
+ // ROW.
395
+ string trigger_type = 3;
396
+
397
+ // The SQL code which creates the trigger.
398
+ string sql_code = 4;
399
+
400
+ // Custom engine specific features.
401
+ google.protobuf.Struct custom_features = 5;
402
+ }
403
+
404
+ // View's parent is a schema.
405
+ message ViewEntity {
406
+ // The SQL code which creates the view.
407
+ string sql_code = 1;
408
+
409
+ // Custom engine specific features.
410
+ google.protobuf.Struct custom_features = 2;
411
+
412
+ // View constraints.
413
+ repeated ConstraintEntity constraints = 3;
414
+ }
415
+
416
+ // Sequence's parent is a schema.
417
+ message SequenceEntity {
418
+ // Increment value for the sequence.
419
+ int64 increment = 1;
420
+
421
+ // Start number for the sequence represented as bytes to accommodate large.
422
+ // numbers
423
+ bytes start_value = 2;
424
+
425
+ // Maximum number for the sequence represented as bytes to accommodate large.
426
+ // numbers
427
+ bytes max_value = 3;
428
+
429
+ // Minimum number for the sequence represented as bytes to accommodate large.
430
+ // numbers
431
+ bytes min_value = 4;
432
+
433
+ // Indicates whether the sequence value should cycle through.
434
+ bool cycle = 5;
435
+
436
+ // Indicates number of entries to cache / precreate.
437
+ int64 cache = 6;
438
+
439
+ // Custom engine specific features.
440
+ google.protobuf.Struct custom_features = 7;
441
+ }
442
+
443
+ // Stored procedure's parent is a schema.
444
+ message StoredProcedureEntity {
445
+ // The SQL code which creates the stored procedure.
446
+ string sql_code = 1;
447
+
448
+ // Custom engine specific features.
449
+ google.protobuf.Struct custom_features = 2;
450
+ }
451
+
452
+ // Function's parent is a schema.
453
+ message FunctionEntity {
454
+ // The SQL code which creates the function.
455
+ string sql_code = 1;
456
+
457
+ // Custom engine specific features.
458
+ google.protobuf.Struct custom_features = 2;
459
+ }
460
+
461
+ // Synonym's parent is a schema.
462
+ message SynonymEntity {
463
+ // The name of the entity for which the synonym is being created (the source).
464
+ string source_entity = 1;
465
+
466
+ // The type of the entity for which the synonym is being created
467
+ // (usually a table or a sequence).
468
+ DatabaseEntityType source_type = 2;
469
+
470
+ // Custom engine specific features.
471
+ google.protobuf.Struct custom_features = 3;
472
+ }
473
+
474
+ // Package's parent is a schema.
475
+ message PackageEntity {
476
+ // The SQL code which creates the package.
477
+ string package_sql_code = 1;
478
+
479
+ // The SQL code which creates the package body. If the package specification
480
+ // has cursors or subprograms, then the package body is mandatory.
481
+ string package_body = 2;
482
+
483
+ // Custom engine specific features.
484
+ google.protobuf.Struct custom_features = 3;
485
+ }
486
+
487
+ // Details of the mappings of a database entity.
488
+ message EntityMapping {
489
+ // Source entity full name.
490
+ // The source entity can also be a column, index or constraint using the
491
+ // same naming notation schema.table.column.
492
+ string source_entity = 1;
493
+
494
+ // Target entity full name.
495
+ // The draft entity can also include a column, index or constraint using the
496
+ // same naming notation schema.table.column.
497
+ string draft_entity = 2;
498
+
499
+ // Type of source entity.
500
+ DatabaseEntityType source_type = 4;
501
+
502
+ // Type of draft entity.
503
+ DatabaseEntityType draft_type = 5;
504
+
505
+ // Entity mapping log entries.
506
+ // Multiple rules can be effective and contribute changes to a converted
507
+ // entity, such as a rule can handle the entity name, another rule can handle
508
+ // an entity type. In addition, rules which did not change the entity are also
509
+ // logged along with the reason preventing them to do so.
510
+ repeated EntityMappingLogEntry mapping_log = 3;
511
+ }
512
+
513
+ // A single record of a rule which was used for a mapping.
514
+ message EntityMappingLogEntry {
515
+ // Which rule caused this log entry.
516
+ string rule_id = 1;
517
+
518
+ // Rule revision ID.
519
+ string rule_revision_id = 2;
520
+
521
+ // Comment.
522
+ string mapping_comment = 3;
523
+ }
524
+
525
+ // The type of database entities supported,
526
+ enum DatabaseEntityType {
527
+ // Unspecified database entity type.
528
+ DATABASE_ENTITY_TYPE_UNSPECIFIED = 0;
529
+
530
+ // Schema.
531
+ DATABASE_ENTITY_TYPE_SCHEMA = 1;
532
+
533
+ // Table.
534
+ DATABASE_ENTITY_TYPE_TABLE = 2;
535
+
536
+ // Column.
537
+ DATABASE_ENTITY_TYPE_COLUMN = 3;
538
+
539
+ // Constraint.
540
+ DATABASE_ENTITY_TYPE_CONSTRAINT = 4;
541
+
542
+ // Index.
543
+ DATABASE_ENTITY_TYPE_INDEX = 5;
544
+
545
+ // Trigger.
546
+ DATABASE_ENTITY_TYPE_TRIGGER = 6;
547
+
548
+ // View.
549
+ DATABASE_ENTITY_TYPE_VIEW = 7;
550
+
551
+ // Sequence.
552
+ DATABASE_ENTITY_TYPE_SEQUENCE = 8;
553
+
554
+ // Stored Procedure.
555
+ DATABASE_ENTITY_TYPE_STORED_PROCEDURE = 9;
556
+
557
+ // Function.
558
+ DATABASE_ENTITY_TYPE_FUNCTION = 10;
559
+
560
+ // Synonym.
561
+ DATABASE_ENTITY_TYPE_SYNONYM = 11;
562
+
563
+ // Package.
564
+ DATABASE_ENTITY_TYPE_DATABASE_PACKAGE = 12;
565
+
566
+ // UDT.
567
+ DATABASE_ENTITY_TYPE_UDT = 13;
568
+
569
+ // Materialized View.
570
+ DATABASE_ENTITY_TYPE_MATERIALIZED_VIEW = 14;
571
+
572
+ // Database.
573
+ DATABASE_ENTITY_TYPE_DATABASE = 15;
574
+ }
575
+
576
+ // The types of jobs that can be executed in the background.
577
+ enum BackgroundJobType {
578
+ // Unspecified background job type.
579
+ BACKGROUND_JOB_TYPE_UNSPECIFIED = 0;
580
+
581
+ // Job to seed from the source database.
582
+ BACKGROUND_JOB_TYPE_SOURCE_SEED = 1;
583
+
584
+ // Job to convert the source database into a draft of the destination
585
+ // database.
586
+ BACKGROUND_JOB_TYPE_CONVERT = 2;
587
+
588
+ // Job to apply the draft tree onto the destination.
589
+ BACKGROUND_JOB_TYPE_APPLY_DESTINATION = 3;
590
+
591
+ // Job to import and convert mapping rules from an external source such as an
592
+ // ora2pg config file.
593
+ BACKGROUND_JOB_TYPE_IMPORT_RULES_FILE = 5;
594
+ }
595
+
596
+ // The format for the import rules file.
597
+ enum ImportRulesFileFormat {
598
+ // Unspecified rules format.
599
+ IMPORT_RULES_FILE_FORMAT_UNSPECIFIED = 0;
600
+
601
+ // HarbourBridge session file.
602
+ IMPORT_RULES_FILE_FORMAT_HARBOUR_BRIDGE_SESSION_FILE = 1;
603
+
604
+ // Ora2Pg configuration file.
605
+ IMPORT_RULES_FILE_FORMAT_ORATOPG_CONFIG_FILE = 2;
606
+ }