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.datastream.v1; 18 19import "google/api/field_behavior.proto"; 20import "google/api/resource.proto"; 21import "google/protobuf/duration.proto"; 22import "google/protobuf/timestamp.proto"; 23 24option csharp_namespace = "Google.Cloud.Datastream.V1"; 25option go_package = "cloud.google.com/go/datastream/apiv1/datastreampb;datastreampb"; 26option java_multiple_files = true; 27option java_outer_classname = "DatastreamResourcesProto"; 28option java_package = "com.google.cloud.datastream.v1"; 29option php_namespace = "Google\\Cloud\\Datastream\\V1"; 30option ruby_package = "Google::Cloud::Datastream::V1"; 31option (google.api.resource_definition) = { 32 type: "compute.googleapis.com/Networks" 33 pattern: "projects/{project}/global/networks/{network}" 34}; 35 36// Oracle database profile. 37message OracleProfile { 38 // Required. Hostname for the Oracle connection. 39 string hostname = 1 [(google.api.field_behavior) = REQUIRED]; 40 41 // Port for the Oracle connection, default value is 1521. 42 int32 port = 2; 43 44 // Required. Username for the Oracle connection. 45 string username = 3 [(google.api.field_behavior) = REQUIRED]; 46 47 // Required. Password for the Oracle connection. 48 string password = 4 [(google.api.field_behavior) = REQUIRED]; 49 50 // Required. Database for the Oracle connection. 51 string database_service = 5 [(google.api.field_behavior) = REQUIRED]; 52 53 // Connection string attributes 54 map<string, string> connection_attributes = 6; 55} 56 57// MySQL database profile. 58message MysqlProfile { 59 // Required. Hostname for the MySQL connection. 60 string hostname = 1 [(google.api.field_behavior) = REQUIRED]; 61 62 // Port for the MySQL connection, default value is 3306. 63 int32 port = 2; 64 65 // Required. Username for the MySQL connection. 66 string username = 3 [(google.api.field_behavior) = REQUIRED]; 67 68 // Required. Input only. Password for the MySQL connection. 69 string password = 4 [ 70 (google.api.field_behavior) = REQUIRED, 71 (google.api.field_behavior) = INPUT_ONLY 72 ]; 73 74 // SSL configuration for the MySQL connection. 75 MysqlSslConfig ssl_config = 5; 76} 77 78// PostgreSQL database profile. 79message PostgresqlProfile { 80 // Required. Hostname for the PostgreSQL connection. 81 string hostname = 1 [(google.api.field_behavior) = REQUIRED]; 82 83 // Port for the PostgreSQL connection, default value is 5432. 84 int32 port = 2; 85 86 // Required. Username for the PostgreSQL connection. 87 string username = 3 [(google.api.field_behavior) = REQUIRED]; 88 89 // Required. Password for the PostgreSQL connection. 90 string password = 4 [(google.api.field_behavior) = REQUIRED]; 91 92 // Required. Database for the PostgreSQL connection. 93 string database = 5 [(google.api.field_behavior) = REQUIRED]; 94} 95 96// Cloud Storage bucket profile. 97message GcsProfile { 98 // Required. The Cloud Storage bucket name. 99 string bucket = 1 [(google.api.field_behavior) = REQUIRED]; 100 101 // The root path inside the Cloud Storage bucket. 102 string root_path = 2; 103} 104 105// BigQuery warehouse profile. 106message BigQueryProfile {} 107 108// Static IP address connectivity. Used when the source database is configured 109// to allow incoming connections from the Datastream public IP addresses 110// for the region specified in the connection profile. 111message StaticServiceIpConnectivity {} 112 113// Forward SSH Tunnel connectivity. 114message ForwardSshTunnelConnectivity { 115 // Required. Hostname for the SSH tunnel. 116 string hostname = 1 [(google.api.field_behavior) = REQUIRED]; 117 118 // Required. Username for the SSH tunnel. 119 string username = 2 [(google.api.field_behavior) = REQUIRED]; 120 121 // Port for the SSH tunnel, default value is 22. 122 int32 port = 3; 123 124 oneof authentication_method { 125 // Input only. SSH password. 126 string password = 100 [(google.api.field_behavior) = INPUT_ONLY]; 127 128 // Input only. SSH private key. 129 string private_key = 101 [(google.api.field_behavior) = INPUT_ONLY]; 130 } 131} 132 133// The VPC Peering configuration is used to create VPC peering between 134// Datastream and the consumer's VPC. 135message VpcPeeringConfig { 136 // Required. Fully qualified name of the VPC that Datastream will peer to. 137 // Format: `projects/{project}/global/{networks}/{name}` 138 string vpc = 1 [ 139 (google.api.field_behavior) = REQUIRED, 140 (google.api.resource_reference) = { 141 type: "compute.googleapis.com/Networks" 142 } 143 ]; 144 145 // Required. A free subnet for peering. (CIDR of /29) 146 string subnet = 2 [(google.api.field_behavior) = REQUIRED]; 147} 148 149// The PrivateConnection resource is used to establish private connectivity 150// between Datastream and a customer's network. 151message PrivateConnection { 152 option (google.api.resource) = { 153 type: "datastream.googleapis.com/PrivateConnection" 154 pattern: "projects/{project}/locations/{location}/privateConnections/{private_connection}" 155 }; 156 157 // Private Connection state. 158 enum State { 159 // Unspecified state. 160 STATE_UNSPECIFIED = 0; 161 162 // The private connection is in creation state - creating resources. 163 CREATING = 1; 164 165 // The private connection has been created with all of its resources. 166 CREATED = 2; 167 168 // The private connection creation has failed. 169 FAILED = 3; 170 171 // The private connection is being deleted. 172 DELETING = 4; 173 174 // Delete request has failed, resource is in invalid state. 175 FAILED_TO_DELETE = 5; 176 } 177 178 // Output only. The resource's name. 179 string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; 180 181 // Output only. The create time of the resource. 182 google.protobuf.Timestamp create_time = 2 183 [(google.api.field_behavior) = OUTPUT_ONLY]; 184 185 // Output only. The update time of the resource. 186 google.protobuf.Timestamp update_time = 3 187 [(google.api.field_behavior) = OUTPUT_ONLY]; 188 189 // Labels. 190 map<string, string> labels = 4; 191 192 // Required. Display name. 193 string display_name = 5 [(google.api.field_behavior) = REQUIRED]; 194 195 // Output only. The state of the Private Connection. 196 State state = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; 197 198 // Output only. In case of error, the details of the error in a user-friendly 199 // format. 200 Error error = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; 201 202 // VPC Peering Config. 203 VpcPeeringConfig vpc_peering_config = 100; 204} 205 206// Private Connectivity 207message PrivateConnectivity { 208 // Required. A reference to a private connection resource. 209 // Format: `projects/{project}/locations/{location}/privateConnections/{name}` 210 string private_connection = 1 [ 211 (google.api.field_behavior) = REQUIRED, 212 (google.api.resource_reference) = { 213 type: "datastream.googleapis.com/PrivateConnection" 214 } 215 ]; 216} 217 218// The route resource is the child of the private connection resource, 219// used for defining a route for a private connection. 220message Route { 221 option (google.api.resource) = { 222 type: "datastream.googleapis.com/Route" 223 pattern: "projects/{project}/locations/{location}/privateConnections/{private_connection}/routes/{route}" 224 }; 225 226 // Output only. The resource's name. 227 string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; 228 229 // Output only. The create time of the resource. 230 google.protobuf.Timestamp create_time = 2 231 [(google.api.field_behavior) = OUTPUT_ONLY]; 232 233 // Output only. The update time of the resource. 234 google.protobuf.Timestamp update_time = 3 235 [(google.api.field_behavior) = OUTPUT_ONLY]; 236 237 // Labels. 238 map<string, string> labels = 4; 239 240 // Required. Display name. 241 string display_name = 5 [(google.api.field_behavior) = REQUIRED]; 242 243 // Required. Destination address for connection 244 string destination_address = 6 [(google.api.field_behavior) = REQUIRED]; 245 246 // Destination port for connection 247 int32 destination_port = 7; 248} 249 250// MySQL SSL configuration information. 251message MysqlSslConfig { 252 // Input only. PEM-encoded private key associated with the Client Certificate. 253 // If this field is used then the 'client_certificate' and the 254 // 'ca_certificate' fields are mandatory. 255 string client_key = 1 [(google.api.field_behavior) = INPUT_ONLY]; 256 257 // Output only. Indicates whether the client_key field is set. 258 bool client_key_set = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; 259 260 // Input only. PEM-encoded certificate that will be used by the replica to 261 // authenticate against the source database server. If this field is used 262 // then the 'client_key' and the 'ca_certificate' fields are mandatory. 263 string client_certificate = 3 [(google.api.field_behavior) = INPUT_ONLY]; 264 265 // Output only. Indicates whether the client_certificate field is set. 266 bool client_certificate_set = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; 267 268 // Input only. PEM-encoded certificate of the CA that signed the source 269 // database server's certificate. 270 string ca_certificate = 5 [(google.api.field_behavior) = INPUT_ONLY]; 271 272 // Output only. Indicates whether the ca_certificate field is set. 273 bool ca_certificate_set = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; 274} 275 276// A set of reusable connection configurations to be used as a source or 277// destination for a stream. 278message ConnectionProfile { 279 option (google.api.resource) = { 280 type: "datastream.googleapis.com/ConnectionProfile" 281 pattern: "projects/{project}/locations/{location}/connectionProfiles/{connection_profile}" 282 }; 283 284 // Output only. The resource's name. 285 string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; 286 287 // Output only. The create time of the resource. 288 google.protobuf.Timestamp create_time = 2 289 [(google.api.field_behavior) = OUTPUT_ONLY]; 290 291 // Output only. The update time of the resource. 292 google.protobuf.Timestamp update_time = 3 293 [(google.api.field_behavior) = OUTPUT_ONLY]; 294 295 // Labels. 296 map<string, string> labels = 4; 297 298 // Required. Display name. 299 string display_name = 5 [(google.api.field_behavior) = REQUIRED]; 300 301 // Connection configuration for the ConnectionProfile. 302 oneof profile { 303 // Oracle ConnectionProfile configuration. 304 OracleProfile oracle_profile = 100; 305 306 // Cloud Storage ConnectionProfile configuration. 307 GcsProfile gcs_profile = 101; 308 309 // MySQL ConnectionProfile configuration. 310 MysqlProfile mysql_profile = 102; 311 312 // BigQuery Connection Profile configuration. 313 BigQueryProfile bigquery_profile = 103; 314 315 // PostgreSQL Connection Profile configuration. 316 PostgresqlProfile postgresql_profile = 104; 317 } 318 319 // Connectivity options used to establish a connection to the profile. 320 oneof connectivity { 321 // Static Service IP connectivity. 322 StaticServiceIpConnectivity static_service_ip_connectivity = 200; 323 324 // Forward SSH tunnel connectivity. 325 ForwardSshTunnelConnectivity forward_ssh_connectivity = 201; 326 327 // Private connectivity. 328 PrivateConnectivity private_connectivity = 202; 329 } 330} 331 332// Oracle Column. 333message OracleColumn { 334 // Column name. 335 string column = 1; 336 337 // The Oracle data type. 338 string data_type = 2; 339 340 // Column length. 341 int32 length = 3; 342 343 // Column precision. 344 int32 precision = 4; 345 346 // Column scale. 347 int32 scale = 5; 348 349 // Column encoding. 350 string encoding = 6; 351 352 // Whether or not the column represents a primary key. 353 bool primary_key = 7; 354 355 // Whether or not the column can accept a null value. 356 bool nullable = 8; 357 358 // The ordinal position of the column in the table. 359 int32 ordinal_position = 9; 360} 361 362// Oracle table. 363message OracleTable { 364 // Table name. 365 string table = 1; 366 367 // Oracle columns in the schema. 368 // When unspecified as part of include/exclude objects, includes/excludes 369 // everything. 370 repeated OracleColumn oracle_columns = 2; 371} 372 373// Oracle schema. 374message OracleSchema { 375 // Schema name. 376 string schema = 1; 377 378 // Tables in the schema. 379 repeated OracleTable oracle_tables = 2; 380} 381 382// Oracle database structure. 383message OracleRdbms { 384 // Oracle schemas/databases in the database server. 385 repeated OracleSchema oracle_schemas = 1; 386} 387 388// Oracle data source configuration 389message OracleSourceConfig { 390 // Configuration to drop large object values. 391 message DropLargeObjects {} 392 393 // Configuration to stream large object values. 394 message StreamLargeObjects {} 395 396 // Oracle objects to include in the stream. 397 OracleRdbms include_objects = 1; 398 399 // Oracle objects to exclude from the stream. 400 OracleRdbms exclude_objects = 2; 401 402 // Maximum number of concurrent CDC tasks. The number should be non-negative. 403 // If not set (or set to 0), the system's default value is used. 404 int32 max_concurrent_cdc_tasks = 3; 405 406 // Maximum number of concurrent backfill tasks. The number should be 407 // non-negative. If not set (or set to 0), the system's default value is used. 408 int32 max_concurrent_backfill_tasks = 4; 409 410 // The configuration for handle Oracle large objects. 411 oneof large_objects_handling { 412 // Drop large object values. 413 DropLargeObjects drop_large_objects = 100; 414 415 // Stream large object values. NOTE: This feature is currently experimental. 416 StreamLargeObjects stream_large_objects = 102; 417 } 418} 419 420// PostgreSQL Column. 421message PostgresqlColumn { 422 // Column name. 423 string column = 1; 424 425 // The PostgreSQL data type. 426 string data_type = 2; 427 428 // Column length. 429 int32 length = 3; 430 431 // Column precision. 432 int32 precision = 4; 433 434 // Column scale. 435 int32 scale = 5; 436 437 // Whether or not the column represents a primary key. 438 bool primary_key = 7; 439 440 // Whether or not the column can accept a null value. 441 bool nullable = 8; 442 443 // The ordinal position of the column in the table. 444 int32 ordinal_position = 9; 445} 446 447// PostgreSQL table. 448message PostgresqlTable { 449 // Table name. 450 string table = 1; 451 452 // PostgreSQL columns in the schema. 453 // When unspecified as part of include/exclude objects, 454 // includes/excludes everything. 455 repeated PostgresqlColumn postgresql_columns = 2; 456} 457 458// PostgreSQL schema. 459message PostgresqlSchema { 460 // Schema name. 461 string schema = 1; 462 463 // Tables in the schema. 464 repeated PostgresqlTable postgresql_tables = 2; 465} 466 467// PostgreSQL database structure. 468message PostgresqlRdbms { 469 // PostgreSQL schemas in the database server. 470 repeated PostgresqlSchema postgresql_schemas = 1; 471} 472 473// PostgreSQL data source configuration 474message PostgresqlSourceConfig { 475 // PostgreSQL objects to include in the stream. 476 PostgresqlRdbms include_objects = 1; 477 478 // PostgreSQL objects to exclude from the stream. 479 PostgresqlRdbms exclude_objects = 2; 480 481 // Required. Immutable. The name of the logical replication slot that's 482 // configured with the pgoutput plugin. 483 string replication_slot = 3 [ 484 (google.api.field_behavior) = REQUIRED, 485 (google.api.field_behavior) = IMMUTABLE 486 ]; 487 488 // Required. The name of the publication that includes the set of all tables 489 // that are defined in the stream's include_objects. 490 string publication = 4 [(google.api.field_behavior) = REQUIRED]; 491 492 // Maximum number of concurrent backfill tasks. The number should be non 493 // negative. If not set (or set to 0), the system's default value will be 494 // used. 495 int32 max_concurrent_backfill_tasks = 5; 496} 497 498// MySQL Column. 499message MysqlColumn { 500 // Column name. 501 string column = 1; 502 503 // The MySQL data type. Full data types list can be found here: 504 // https://dev.mysql.com/doc/refman/8.0/en/data-types.html 505 string data_type = 2; 506 507 // Column length. 508 int32 length = 3; 509 510 // Column collation. 511 string collation = 4; 512 513 // Whether or not the column represents a primary key. 514 bool primary_key = 5; 515 516 // Whether or not the column can accept a null value. 517 bool nullable = 6; 518 519 // The ordinal position of the column in the table. 520 int32 ordinal_position = 7; 521 522 // Column precision. 523 int32 precision = 8; 524 525 // Column scale. 526 int32 scale = 9; 527} 528 529// MySQL table. 530message MysqlTable { 531 // Table name. 532 string table = 1; 533 534 // MySQL columns in the database. 535 // When unspecified as part of include/exclude objects, includes/excludes 536 // everything. 537 repeated MysqlColumn mysql_columns = 2; 538} 539 540// MySQL database. 541message MysqlDatabase { 542 // Database name. 543 string database = 1; 544 545 // Tables in the database. 546 repeated MysqlTable mysql_tables = 2; 547} 548 549// MySQL database structure 550message MysqlRdbms { 551 // Mysql databases on the server 552 repeated MysqlDatabase mysql_databases = 1; 553} 554 555// MySQL source configuration 556message MysqlSourceConfig { 557 // MySQL objects to retrieve from the source. 558 MysqlRdbms include_objects = 1; 559 560 // MySQL objects to exclude from the stream. 561 MysqlRdbms exclude_objects = 2; 562 563 // Maximum number of concurrent CDC tasks. The number should be non negative. 564 // If not set (or set to 0), the system's default value will be used. 565 int32 max_concurrent_cdc_tasks = 3; 566 567 // Maximum number of concurrent backfill tasks. The number should be non 568 // negative. If not set (or set to 0), the system's default value will be 569 // used. 570 int32 max_concurrent_backfill_tasks = 4; 571} 572 573// The configuration of the stream source. 574message SourceConfig { 575 // Required. Source connection profile resoource. 576 // Format: `projects/{project}/locations/{location}/connectionProfiles/{name}` 577 string source_connection_profile = 1 [ 578 (google.api.field_behavior) = REQUIRED, 579 (google.api.resource_reference) = { 580 type: "datastream.googleapis.com/ConnectionProfile" 581 } 582 ]; 583 584 // Stream configuration that is specific to the data source type. 585 oneof source_stream_config { 586 // Oracle data source configuration. 587 OracleSourceConfig oracle_source_config = 100; 588 589 // MySQL data source configuration. 590 MysqlSourceConfig mysql_source_config = 101; 591 592 // PostgreSQL data source configuration. 593 PostgresqlSourceConfig postgresql_source_config = 102; 594 } 595} 596 597// AVRO file format configuration. 598message AvroFileFormat {} 599 600// JSON file format configuration. 601message JsonFileFormat { 602 // Schema file format. 603 enum SchemaFileFormat { 604 // Unspecified schema file format. 605 SCHEMA_FILE_FORMAT_UNSPECIFIED = 0; 606 607 // Do not attach schema file. 608 NO_SCHEMA_FILE = 1; 609 610 // Avro schema format. 611 AVRO_SCHEMA_FILE = 2; 612 } 613 614 // Json file compression. 615 enum JsonCompression { 616 // Unspecified json file compression. 617 JSON_COMPRESSION_UNSPECIFIED = 0; 618 619 // Do not compress JSON file. 620 NO_COMPRESSION = 1; 621 622 // Gzip compression. 623 GZIP = 2; 624 } 625 626 // The schema file format along JSON data files. 627 SchemaFileFormat schema_file_format = 1; 628 629 // Compression of the loaded JSON file. 630 JsonCompression compression = 2; 631} 632 633// Google Cloud Storage destination configuration 634message GcsDestinationConfig { 635 // Path inside the Cloud Storage bucket to write data to. 636 string path = 1; 637 638 // The maximum file size to be saved in the bucket. 639 int32 file_rotation_mb = 2; 640 641 // The maximum duration for which new events are added before a file is 642 // closed and a new file is created. Values within the range of 15-60 seconds 643 // are allowed. 644 google.protobuf.Duration file_rotation_interval = 3; 645 646 // File Format that the data should be written in. 647 oneof file_format { 648 // AVRO file format configuration. 649 AvroFileFormat avro_file_format = 100; 650 651 // JSON file format configuration. 652 JsonFileFormat json_file_format = 101; 653 } 654} 655 656// BigQuery destination configuration 657message BigQueryDestinationConfig { 658 // A single target dataset to which all data will be streamed. 659 message SingleTargetDataset { 660 // The dataset ID of the target dataset. 661 string dataset_id = 1; 662 } 663 664 // Destination datasets are created so that hierarchy of the destination data 665 // objects matches the source hierarchy. 666 message SourceHierarchyDatasets { 667 // Dataset template used for dynamic dataset creation. 668 message DatasetTemplate { 669 // Required. The geographic location where the dataset should reside. See 670 // https://cloud.google.com/bigquery/docs/locations for supported 671 // locations. 672 string location = 1 [(google.api.field_behavior) = REQUIRED]; 673 674 // If supplied, every created dataset will have its name prefixed by the 675 // provided value. The prefix and name will be separated by an underscore. 676 // i.e. <prefix>_<dataset_name>. 677 string dataset_id_prefix = 2; 678 679 // Describes the Cloud KMS encryption key that will be used to 680 // protect destination BigQuery table. The BigQuery Service Account 681 // associated with your project requires access to this encryption key. 682 // i.e. 683 // projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{cryptoKey}. 684 // See https://cloud.google.com/bigquery/docs/customer-managed-encryption 685 // for more information. 686 string kms_key_name = 3; 687 } 688 689 // The dataset template to use for dynamic dataset creation. 690 DatasetTemplate dataset_template = 2; 691 } 692 693 // Target dataset(s) configuration. 694 oneof dataset_config { 695 // Single destination dataset. 696 SingleTargetDataset single_target_dataset = 201; 697 698 // Source hierarchy datasets. 699 SourceHierarchyDatasets source_hierarchy_datasets = 202; 700 } 701 702 // The guaranteed data freshness (in seconds) when querying tables created by 703 // the stream. Editing this field will only affect new tables created in the 704 // future, but existing tables will not be impacted. Lower values mean that 705 // queries will return fresher data, but may result in higher cost. 706 google.protobuf.Duration data_freshness = 300; 707} 708 709// The configuration of the stream destination. 710message DestinationConfig { 711 // Required. Destination connection profile resource. 712 // Format: `projects/{project}/locations/{location}/connectionProfiles/{name}` 713 string destination_connection_profile = 1 [ 714 (google.api.field_behavior) = REQUIRED, 715 (google.api.resource_reference) = { 716 type: "datastream.googleapis.com/ConnectionProfile" 717 } 718 ]; 719 720 // Stream configuration that is specific to the data destination type. 721 oneof destination_stream_config { 722 // A configuration for how data should be loaded to Cloud Storage. 723 GcsDestinationConfig gcs_destination_config = 100; 724 725 // BigQuery destination configuration. 726 BigQueryDestinationConfig bigquery_destination_config = 101; 727 } 728} 729 730// A resource representing streaming data from a source to a destination. 731message Stream { 732 option (google.api.resource) = { 733 type: "datastream.googleapis.com/Stream" 734 pattern: "projects/{project}/locations/{location}/streams/{stream}" 735 }; 736 737 // Stream state. 738 enum State { 739 // Unspecified stream state. 740 STATE_UNSPECIFIED = 0; 741 742 // The stream has been created but has not yet started streaming data. 743 NOT_STARTED = 1; 744 745 // The stream is running. 746 RUNNING = 2; 747 748 // The stream is paused. 749 PAUSED = 3; 750 751 // The stream is in maintenance mode. 752 // 753 // Updates are rejected on the resource in this state. 754 MAINTENANCE = 4; 755 756 // The stream is experiencing an error that is preventing data from being 757 // streamed. 758 FAILED = 5; 759 760 // The stream has experienced a terminal failure. 761 FAILED_PERMANENTLY = 6; 762 763 // The stream is starting, but not yet running. 764 STARTING = 7; 765 766 // The Stream is no longer reading new events, but still writing events in 767 // the buffer. 768 DRAINING = 8; 769 } 770 771 // Backfill strategy to automatically backfill the Stream's objects. 772 // Specific objects can be excluded. 773 message BackfillAllStrategy { 774 // List of objects to exclude. 775 oneof excluded_objects { 776 // Oracle data source objects to avoid backfilling. 777 OracleRdbms oracle_excluded_objects = 1; 778 779 // MySQL data source objects to avoid backfilling. 780 MysqlRdbms mysql_excluded_objects = 2; 781 782 // PostgreSQL data source objects to avoid backfilling. 783 PostgresqlRdbms postgresql_excluded_objects = 3; 784 } 785 } 786 787 // Backfill strategy to disable automatic backfill for the Stream's objects. 788 message BackfillNoneStrategy {} 789 790 // Output only. The stream's name. 791 string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; 792 793 // Output only. The creation time of the stream. 794 google.protobuf.Timestamp create_time = 2 795 [(google.api.field_behavior) = OUTPUT_ONLY]; 796 797 // Output only. The last update time of the stream. 798 google.protobuf.Timestamp update_time = 3 799 [(google.api.field_behavior) = OUTPUT_ONLY]; 800 801 // Labels. 802 map<string, string> labels = 4; 803 804 // Required. Display name. 805 string display_name = 5 [(google.api.field_behavior) = REQUIRED]; 806 807 // Required. Source connection profile configuration. 808 SourceConfig source_config = 6 [(google.api.field_behavior) = REQUIRED]; 809 810 // Required. Destination connection profile configuration. 811 DestinationConfig destination_config = 7 812 [(google.api.field_behavior) = REQUIRED]; 813 814 // The state of the stream. 815 State state = 8; 816 817 // Stream backfill strategy. 818 oneof backfill_strategy { 819 // Automatically backfill objects included in the stream source 820 // configuration. Specific objects can be excluded. 821 BackfillAllStrategy backfill_all = 101; 822 823 // Do not automatically backfill any objects. 824 BackfillNoneStrategy backfill_none = 102; 825 } 826 827 // Output only. Errors on the Stream. 828 repeated Error errors = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; 829 830 // Immutable. A reference to a KMS encryption key. 831 // If provided, it will be used to encrypt the data. 832 // If left blank, data will be encrypted using an internal Stream-specific 833 // encryption key provisioned through KMS. 834 optional string customer_managed_encryption_key = 10 835 [(google.api.field_behavior) = IMMUTABLE]; 836} 837 838// A specific stream object (e.g a specific DB table). 839message StreamObject { 840 option (google.api.resource) = { 841 type: "datastream.googleapis.com/StreamObject" 842 pattern: "projects/{project}/locations/{location}/streams/{stream}/objects/{object}" 843 }; 844 845 // Output only. The object resource's name. 846 string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; 847 848 // Output only. The creation time of the object. 849 google.protobuf.Timestamp create_time = 2 850 [(google.api.field_behavior) = OUTPUT_ONLY]; 851 852 // Output only. The last update time of the object. 853 google.protobuf.Timestamp update_time = 3 854 [(google.api.field_behavior) = OUTPUT_ONLY]; 855 856 // Required. Display name. 857 string display_name = 5 [(google.api.field_behavior) = REQUIRED]; 858 859 // Output only. Active errors on the object. 860 repeated Error errors = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; 861 862 // The latest backfill job that was initiated for the stream object. 863 BackfillJob backfill_job = 7; 864 865 // The object identifier in the data source. 866 SourceObjectIdentifier source_object = 8; 867} 868 869// Represents an identifier of an object in the data source. 870message SourceObjectIdentifier { 871 // Oracle data source object identifier. 872 message OracleObjectIdentifier { 873 // Required. The schema name. 874 string schema = 1 [(google.api.field_behavior) = REQUIRED]; 875 876 // Required. The table name. 877 string table = 2 [(google.api.field_behavior) = REQUIRED]; 878 } 879 880 // PostgreSQL data source object identifier. 881 message PostgresqlObjectIdentifier { 882 // Required. The schema name. 883 string schema = 1 [(google.api.field_behavior) = REQUIRED]; 884 885 // Required. The table name. 886 string table = 2 [(google.api.field_behavior) = REQUIRED]; 887 } 888 889 // Mysql data source object identifier. 890 message MysqlObjectIdentifier { 891 // Required. The database name. 892 string database = 1 [(google.api.field_behavior) = REQUIRED]; 893 894 // Required. The table name. 895 string table = 2 [(google.api.field_behavior) = REQUIRED]; 896 } 897 898 // The identifier for an object in the data source. 899 oneof source_identifier { 900 // Oracle data source object identifier. 901 OracleObjectIdentifier oracle_identifier = 1; 902 903 // Mysql data source object identifier. 904 MysqlObjectIdentifier mysql_identifier = 2; 905 906 // PostgreSQL data source object identifier. 907 PostgresqlObjectIdentifier postgresql_identifier = 3; 908 } 909} 910 911// Represents a backfill job on a specific stream object. 912message BackfillJob { 913 // State of the stream object's backfill job. 914 enum State { 915 // Default value. 916 STATE_UNSPECIFIED = 0; 917 918 // Backfill job was never started for the stream object (stream has backfill 919 // strategy defined as manual or object was explicitly excluded from 920 // automatic backfill). 921 NOT_STARTED = 1; 922 923 // Backfill job will start pending available resources. 924 PENDING = 2; 925 926 // Backfill job is running. 927 ACTIVE = 3; 928 929 // Backfill job stopped (next job run will start from beginning). 930 STOPPED = 4; 931 932 // Backfill job failed (due to an error). 933 FAILED = 5; 934 935 // Backfill completed successfully. 936 COMPLETED = 6; 937 938 // Backfill job failed since the table structure is currently unsupported 939 // for backfill. 940 UNSUPPORTED = 7; 941 } 942 943 // Triggering reason for a backfill job. 944 enum Trigger { 945 // Default value. 946 TRIGGER_UNSPECIFIED = 0; 947 948 // Object backfill job was triggered automatically according to the stream's 949 // backfill strategy. 950 AUTOMATIC = 1; 951 952 // Object backfill job was triggered manually using the dedicated API. 953 MANUAL = 2; 954 } 955 956 // Backfill job state. 957 State state = 1; 958 959 // Backfill job's triggering reason. 960 Trigger trigger = 2; 961 962 // Output only. Backfill job's start time. 963 google.protobuf.Timestamp last_start_time = 3 964 [(google.api.field_behavior) = OUTPUT_ONLY]; 965 966 // Output only. Backfill job's end time. 967 google.protobuf.Timestamp last_end_time = 4 968 [(google.api.field_behavior) = OUTPUT_ONLY]; 969 970 // Output only. Errors which caused the backfill job to fail. 971 repeated Error errors = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; 972} 973 974// Represent a user-facing Error. 975message Error { 976 // A title that explains the reason for the error. 977 string reason = 1; 978 979 // A unique identifier for this specific error, 980 // allowing it to be traced throughout the system in logs and API responses. 981 string error_uuid = 2; 982 983 // A message containing more information about the error that occurred. 984 string message = 3; 985 986 // The time when the error occurred. 987 google.protobuf.Timestamp error_time = 4; 988 989 // Additional information about the error. 990 map<string, string> details = 5; 991} 992 993// Contains the current validation results. 994message ValidationResult { 995 // A list of validations (includes both executed as well as not executed 996 // validations). 997 repeated Validation validations = 1; 998} 999 1000// A validation to perform on a stream. 1001message Validation { 1002 // Validation execution state. 1003 enum State { 1004 // Unspecified state. 1005 STATE_UNSPECIFIED = 0; 1006 1007 // Validation did not execute. 1008 NOT_EXECUTED = 1; 1009 1010 // Validation failed. 1011 FAILED = 2; 1012 1013 // Validation passed. 1014 PASSED = 3; 1015 } 1016 1017 // A short description of the validation. 1018 string description = 1; 1019 1020 // Validation execution status. 1021 State state = 2; 1022 1023 // Messages reflecting the validation results. 1024 repeated ValidationMessage message = 3; 1025 1026 // A custom code identifying this validation. 1027 string code = 4; 1028} 1029 1030// Represent user-facing validation result message. 1031message ValidationMessage { 1032 // Validation message level. 1033 enum Level { 1034 // Unspecified level. 1035 LEVEL_UNSPECIFIED = 0; 1036 1037 // Potentially cause issues with the Stream. 1038 WARNING = 1; 1039 1040 // Definitely cause issues with the Stream. 1041 ERROR = 2; 1042 } 1043 1044 // The result of the validation. 1045 string message = 1; 1046 1047 // Message severity level (warning or error). 1048 Level level = 2; 1049 1050 // Additional metadata related to the result. 1051 map<string, string> metadata = 3; 1052 1053 // A custom code identifying this specific message. 1054 string code = 4; 1055} 1056