1// Copyright 2021 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.v1alpha1; 18 19import "google/api/field_behavior.proto"; 20import "google/api/resource.proto"; 21import "google/protobuf/duration.proto"; 22import "google/protobuf/timestamp.proto"; 23 24option go_package = "cloud.google.com/go/datastream/apiv1alpha1/datastreampb;datastreampb"; 25option java_multiple_files = true; 26option java_outer_classname = "CloudDatastreamResourcesProto"; 27option java_package = "com.google.cloud.datastream.v1alpha1"; 28option csharp_namespace = "Google.Cloud.Datastream.V1Alpha1"; 29option php_namespace = "Google\\Cloud\\Datastream\\V1alpha1"; 30option ruby_package = "Google::Cloud::Datastream::V1alpha1"; 31 32// Oracle database profile. 33message OracleProfile { 34 // Required. Hostname for the Oracle connection. 35 string hostname = 1 [(google.api.field_behavior) = REQUIRED]; 36 37 // Port for the Oracle connection, default value is 1521. 38 int32 port = 2; 39 40 // Required. Username for the Oracle connection. 41 string username = 3 [(google.api.field_behavior) = REQUIRED]; 42 43 // Required. Password for the Oracle connection. 44 string password = 4 [(google.api.field_behavior) = REQUIRED]; 45 46 // Required. Database for the Oracle connection. 47 string database_service = 5 [(google.api.field_behavior) = REQUIRED]; 48 49 // Connection string attributes 50 map<string, string> connection_attributes = 6; 51} 52 53// MySQL database profile. 54message MysqlProfile { 55 // Required. Hostname for the MySQL connection. 56 string hostname = 1 [(google.api.field_behavior) = REQUIRED]; 57 58 // Port for the MySQL connection, default value is 3306. 59 int32 port = 2; 60 61 // Required. Username for the MySQL connection. 62 string username = 3 [(google.api.field_behavior) = REQUIRED]; 63 64 // Required. Input only. Password for the MySQL connection. 65 string password = 4 [ 66 (google.api.field_behavior) = REQUIRED, 67 (google.api.field_behavior) = INPUT_ONLY 68 ]; 69 70 // SSL configuration for the MySQL connection. 71 MysqlSslConfig ssl_config = 5; 72} 73 74// Cloud Storage bucket profile. 75message GcsProfile { 76 // Required. The full project and resource path for Cloud Storage bucket including the 77 // name. 78 string bucket_name = 1 [(google.api.field_behavior) = REQUIRED]; 79 80 // The root path inside the Cloud Storage bucket. 81 string root_path = 2; 82} 83 84// No connectivity settings. 85message NoConnectivitySettings { 86 87} 88 89// Static IP address connectivity. 90message StaticServiceIpConnectivity { 91 92} 93 94// Forward SSH Tunnel connectivity. 95message ForwardSshTunnelConnectivity { 96 // Required. Hostname for the SSH tunnel. 97 string hostname = 1 [(google.api.field_behavior) = REQUIRED]; 98 99 // Required. Username for the SSH tunnel. 100 string username = 2 [(google.api.field_behavior) = REQUIRED]; 101 102 // Port for the SSH tunnel, default value is 22. 103 int32 port = 3; 104 105 oneof authentication_method { 106 // Input only. SSH password. 107 string password = 100 [(google.api.field_behavior) = INPUT_ONLY]; 108 109 // Input only. SSH private key. 110 string private_key = 101 [(google.api.field_behavior) = INPUT_ONLY]; 111 } 112} 113 114// The VPC Peering configuration is used to create VPC peering between 115// Datastream and the consumer's VPC. 116message VpcPeeringConfig { 117 // Required. fully qualified name of the VPC Datastream will peer to. 118 string vpc_name = 1 [(google.api.field_behavior) = REQUIRED]; 119 120 // Required. A free subnet for peering. (CIDR of /29) 121 string subnet = 2 [(google.api.field_behavior) = REQUIRED]; 122} 123 124// The PrivateConnection resource is used to establish private connectivity 125// between Datastream and a customer's network. 126message PrivateConnection { 127 option (google.api.resource) = { 128 type: "datastream.googleapis.com/PrivateConnection" 129 pattern: "projects/{project}/locations/{location}/privateConnections/{private_connection}" 130 }; 131 132 // Private Connection state. 133 enum State { 134 STATE_UNSPECIFIED = 0; 135 136 // The private connection is in creation state - creating resources. 137 CREATING = 1; 138 139 // The private connection has been created with all of it's resources. 140 CREATED = 2; 141 142 // The private connection creation has failed. 143 FAILED = 3; 144 } 145 146 // Output only. The resource's name. 147 string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; 148 149 // Output only. The create time of the resource. 150 google.protobuf.Timestamp create_time = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; 151 152 // Output only. The update time of the resource. 153 google.protobuf.Timestamp update_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; 154 155 // Labels. 156 map<string, string> labels = 4; 157 158 // Required. Display name. 159 string display_name = 5 [(google.api.field_behavior) = REQUIRED]; 160 161 // Output only. The state of the Private Connection. 162 State state = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; 163 164 // Output only. In case of error, the details of the error in a user-friendly format. 165 Error error = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; 166 167 // VPC Peering Config 168 VpcPeeringConfig vpc_peering_config = 100; 169} 170 171// Private Connectivity 172message PrivateConnectivity { 173 string private_connection_name = 1 [(google.api.field_behavior) = REQUIRED]; 174} 175 176// The Route resource is the child of the PrivateConnection resource. 177// It used to define a route for a PrivateConnection setup. 178message Route { 179 option (google.api.resource) = { 180 type: "datastream.googleapis.com/Route" 181 pattern: "projects/{project}/locations/{location}/privateConnections/{private_connection}/routes/{route}" 182 }; 183 184 // Output only. The resource's name. 185 string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; 186 187 // Output only. The create time of the resource. 188 google.protobuf.Timestamp create_time = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; 189 190 // Output only. The update time of the resource. 191 google.protobuf.Timestamp update_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; 192 193 // Labels. 194 map<string, string> labels = 4; 195 196 // Required. Display name. 197 string display_name = 5 [(google.api.field_behavior) = REQUIRED]; 198 199 // Required. Destination address for connection 200 string destination_address = 6 [(google.api.field_behavior) = REQUIRED]; 201 202 // Destination port for connection 203 int32 destination_port = 7; 204} 205 206// MySQL SSL configuration information. 207message MysqlSslConfig { 208 // Input only. PEM-encoded private key associated with the Client Certificate. 209 // If this field is used then the 'client_certificate' and the 210 // 'ca_certificate' fields are mandatory. 211 string client_key = 11 [(google.api.field_behavior) = INPUT_ONLY]; 212 213 // Output only. Indicates whether the client_key field is set. 214 bool client_key_set = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; 215 216 // Input only. PEM-encoded certificate that will be used by the replica to 217 // authenticate against the source database server. If this field is used 218 // then the 'client_key' and the 'ca_certificate' fields are mandatory. 219 string client_certificate = 13 [(google.api.field_behavior) = INPUT_ONLY]; 220 221 // Output only. Indicates whether the client_certificate field is set. 222 bool client_certificate_set = 14 [(google.api.field_behavior) = OUTPUT_ONLY]; 223 224 // Input only. PEM-encoded certificate of the CA that signed the source database 225 // server's certificate. 226 string ca_certificate = 15 [(google.api.field_behavior) = INPUT_ONLY]; 227 228 // Output only. Indicates whether the ca_certificate field is set. 229 bool ca_certificate_set = 16 [(google.api.field_behavior) = OUTPUT_ONLY]; 230} 231 232message ConnectionProfile { 233 option (google.api.resource) = { 234 type: "datastream.googleapis.com/ConnectionProfile" 235 pattern: "projects/{project}/locations/{location}/connectionProfiles/{connection_profile}" 236 }; 237 238 // Output only. The resource's name. 239 string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; 240 241 // Output only. The create time of the resource. 242 google.protobuf.Timestamp create_time = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; 243 244 // Output only. The update time of the resource. 245 google.protobuf.Timestamp update_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; 246 247 // Labels. 248 map<string, string> labels = 4; 249 250 // Required. Display name. 251 string display_name = 5 [(google.api.field_behavior) = REQUIRED]; 252 253 // Connection configuration for the ConnectionProfile. 254 oneof profile { 255 // Oracle ConnectionProfile configuration. 256 OracleProfile oracle_profile = 100; 257 258 // Cloud Storage ConnectionProfile configuration. 259 GcsProfile gcs_profile = 101; 260 261 // MySQL ConnectionProfile configuration. 262 MysqlProfile mysql_profile = 102; 263 } 264 265 // Connectivity options used to establish a connection to the profile. 266 oneof connectivity { 267 // No connectivity option chosen. 268 NoConnectivitySettings no_connectivity = 200; 269 270 // Static Service IP connectivity. 271 StaticServiceIpConnectivity static_service_ip_connectivity = 201; 272 273 // Forward SSH tunnel connectivity. 274 ForwardSshTunnelConnectivity forward_ssh_connectivity = 202; 275 276 // Private connectivity. 277 PrivateConnectivity private_connectivity = 203; 278 } 279} 280 281// Oracle Column. 282message OracleColumn { 283 // Column name. 284 string column_name = 1; 285 286 // The Oracle data type. 287 string data_type = 2; 288 289 // Column length. 290 int32 length = 3; 291 292 // Column precision. 293 int32 precision = 4; 294 295 // Column scale. 296 int32 scale = 5; 297 298 // Column encoding. 299 string encoding = 6; 300 301 // Whether or not the column represents a primary key. 302 bool primary_key = 7; 303 304 // Whether or not the column can accept a null value. 305 bool nullable = 8; 306 307 // The ordinal position of the column in the table. 308 int32 ordinal_position = 9; 309} 310 311// Oracle table. 312message OracleTable { 313 // Table name. 314 string table_name = 1; 315 316 // Oracle columns in the schema. 317 // When unspecified as part of inclue/exclude lists, includes/excludes 318 // everything. 319 repeated OracleColumn oracle_columns = 2; 320} 321 322// Oracle schema. 323message OracleSchema { 324 // Schema name. 325 string schema_name = 1; 326 327 // Tables in the schema. 328 repeated OracleTable oracle_tables = 2; 329} 330 331// Oracle database structure. 332message OracleRdbms { 333 // Oracle schemas/databases in the database server. 334 repeated OracleSchema oracle_schemas = 1; 335} 336 337// Oracle data source configuration 338message OracleSourceConfig { 339 // Oracle objects to include in the stream. 340 OracleRdbms allowlist = 1; 341 342 // Oracle objects to exclude from the stream. 343 OracleRdbms rejectlist = 2; 344} 345 346// MySQL Column. 347message MysqlColumn { 348 // Column name. 349 string column_name = 1; 350 351 // The MySQL data type. Full data types list can be found here: 352 // https://dev.mysql.com/doc/refman/8.0/en/data-types.html 353 string data_type = 2; 354 355 // Column length. 356 int32 length = 3; 357 358 // Column collation. 359 string collation = 4; 360 361 // Whether or not the column represents a primary key. 362 bool primary_key = 5; 363 364 // Whether or not the column can accept a null value. 365 bool nullable = 6; 366 367 // The ordinal position of the column in the table. 368 int32 ordinal_position = 7; 369} 370 371// MySQL table. 372message MysqlTable { 373 // Table name. 374 string table_name = 1; 375 376 // MySQL columns in the database. 377 // When unspecified as part of include/exclude lists, includes/excludes 378 // everything. 379 repeated MysqlColumn mysql_columns = 2; 380} 381 382// MySQL database. 383message MysqlDatabase { 384 // Database name. 385 string database_name = 1; 386 387 // Tables in the database. 388 repeated MysqlTable mysql_tables = 2; 389} 390 391// MySQL database structure 392message MysqlRdbms { 393 // Mysql databases on the server 394 repeated MysqlDatabase mysql_databases = 1; 395} 396 397// MySQL source configuration 398message MysqlSourceConfig { 399 // MySQL objects to retrieve from the source. 400 MysqlRdbms allowlist = 1; 401 402 // MySQL objects to exclude from the stream. 403 MysqlRdbms rejectlist = 2; 404} 405 406// The configuration of the stream source. 407message SourceConfig { 408 // Required. Source connection profile identifier. 409 string source_connection_profile_name = 1 [(google.api.field_behavior) = REQUIRED]; 410 411 // Stream configuration that is specific to the data source type. 412 oneof source_stream_config { 413 // Oracle data source configuration 414 OracleSourceConfig oracle_source_config = 100; 415 416 // MySQL data source configuration 417 MysqlSourceConfig mysql_source_config = 101; 418 } 419} 420 421// AVRO file format configuration. 422message AvroFileFormat { 423 424} 425 426// File format in Cloud Storage. 427enum GcsFileFormat { 428 option deprecated = true; 429 430 // Unspecified Cloud Storage file format. 431 GCS_FILE_FORMAT_UNSPECIFIED = 0; 432 433 // Avro file format 434 AVRO = 1; 435} 436 437// Schema file format. 438enum SchemaFileFormat { 439 // Unspecified schema file format. 440 SCHEMA_FILE_FORMAT_UNSPECIFIED = 0; 441 442 // Do not attach schema file. 443 NO_SCHEMA_FILE = 1; 444 445 // Avro schema format. 446 AVRO_SCHEMA_FILE = 2; 447} 448 449// JSON file format configuration. 450message JsonFileFormat { 451 // Json file compression. 452 enum JsonCompression { 453 // Unspecified json file compression. 454 JSON_COMPRESSION_UNSPECIFIED = 0; 455 456 // Do not compress JSON file. 457 NO_COMPRESSION = 1; 458 459 // Gzip compression. 460 GZIP = 2; 461 } 462 463 // The schema file format along JSON data files. 464 SchemaFileFormat schema_file_format = 1; 465 466 // Compression of the loaded JSON file. 467 JsonCompression compression = 2; 468} 469 470// Google Cloud Storage destination configuration 471message GcsDestinationConfig { 472 // Path inside the Cloud Storage bucket to write data to. 473 string path = 1; 474 475 // File format that data should be written in. 476 // Deprecated field - use file_format instead. 477 GcsFileFormat gcs_file_format = 2 [deprecated = true]; 478 479 // The maximum file size to be saved in the bucket. 480 int32 file_rotation_mb = 3; 481 482 // The maximum duration for which new events are added before a file is 483 // closed and a new file is created. 484 google.protobuf.Duration file_rotation_interval = 4; 485 486 // File Format that the data should be written in. 487 oneof file_format { 488 // AVRO file format configuration. 489 AvroFileFormat avro_file_format = 100; 490 491 // JSON file format configuration. 492 JsonFileFormat json_file_format = 101; 493 } 494} 495 496// The configuration of the stream destination. 497message DestinationConfig { 498 // Required. Destination connection profile identifier. 499 string destination_connection_profile_name = 1 [(google.api.field_behavior) = REQUIRED]; 500 501 // Stream configuration that is specific to the data destination type. 502 oneof destination_stream_config { 503 GcsDestinationConfig gcs_destination_config = 100; 504 } 505} 506 507message Stream { 508 option (google.api.resource) = { 509 type: "datastream.googleapis.com/Stream" 510 pattern: "projects/{project}/locations/{location}/streams/{stream}" 511 }; 512 513 // Backfill strategy to automatically backfill the Stream's objects. 514 // Specific objects can be excluded. 515 message BackfillAllStrategy { 516 // List of objects to exclude. 517 oneof excluded_objects { 518 // Oracle data source objects to avoid backfilling. 519 OracleRdbms oracle_excluded_objects = 1; 520 521 // MySQL data source objects to avoid backfilling. 522 MysqlRdbms mysql_excluded_objects = 2; 523 } 524 } 525 526 // Backfill strategy to disable automatic backfill for the Stream's objects. 527 message BackfillNoneStrategy { 528 529 } 530 531 // Stream state. 532 enum State { 533 // Unspecified stream state. 534 STATE_UNSPECIFIED = 0; 535 536 // The stream has been created. 537 CREATED = 1; 538 539 // The stream is running. 540 RUNNING = 2; 541 542 // The stream is paused. 543 PAUSED = 3; 544 545 // The stream is in maintenance mode. 546 // 547 // Updates are rejected on the resource in this state. 548 MAINTENANCE = 4; 549 550 // The stream is experiencing an error that is preventing data from being 551 // streamed. 552 FAILED = 5; 553 554 // The stream has experienced a terminal failure. 555 FAILED_PERMANENTLY = 6; 556 557 // The stream is starting, but not yet running. 558 STARTING = 7; 559 560 // The Stream is no longer reading new events, but still writing events in 561 // the buffer. 562 DRAINING = 8; 563 } 564 565 // Output only. The stream's name. 566 string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; 567 568 // Output only. The creation time of the stream. 569 google.protobuf.Timestamp create_time = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; 570 571 // Output only. The last update time of the stream. 572 google.protobuf.Timestamp update_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; 573 574 // Labels. 575 map<string, string> labels = 4; 576 577 // Required. Display name. 578 string display_name = 5 [(google.api.field_behavior) = REQUIRED]; 579 580 // Required. Source connection profile configuration. 581 SourceConfig source_config = 6 [(google.api.field_behavior) = REQUIRED]; 582 583 // Required. Destination connection profile configuration. 584 DestinationConfig destination_config = 7 [(google.api.field_behavior) = REQUIRED]; 585 586 // The state of the stream. 587 State state = 8; 588 589 // Stream backfill strategy. 590 oneof backfill_strategy { 591 // Automatically backfill objects included in the stream source 592 // configuration. Specific objects can be excluded. 593 BackfillAllStrategy backfill_all = 101; 594 595 // Do not automatically backfill any objects. 596 BackfillNoneStrategy backfill_none = 102; 597 } 598 599 // Output only. Errors on the Stream. 600 repeated Error errors = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; 601} 602 603// Represent a user-facing Error. 604message Error { 605 // A title that explains the reason for the error. 606 string reason = 1; 607 608 // A unique identifier for this specific error, 609 // allowing it to be traced throughout the system in logs and API responses. 610 string error_uuid = 2; 611 612 // A message containing more information about the error that occurred. 613 string message = 3; 614 615 // The time when the error occurred. 616 google.protobuf.Timestamp error_time = 4; 617 618 // Additional information about the error. 619 map<string, string> details = 5; 620} 621 622// Contains the current validation results. 623message ValidationResult { 624 // A list of validations (includes both executed as well as not executed 625 // validations). 626 repeated Validation validations = 1; 627} 628 629message Validation { 630 // Validation execution status. 631 enum Status { 632 // Unspecified status. 633 STATUS_UNSPECIFIED = 0; 634 635 // Validation did not execute. 636 NOT_EXECUTED = 1; 637 638 // Validation failed. 639 FAILED = 2; 640 641 // Validation passed. 642 PASSED = 3; 643 } 644 645 // A short description of the validation. 646 string description = 1; 647 648 // Validation execution status. 649 Status status = 2; 650 651 // Messages reflecting the validation results. 652 repeated ValidationMessage message = 3; 653 654 // A custom code identifying this validation. 655 string code = 4; 656} 657 658// Represent user-facing validation result message. 659message ValidationMessage { 660 // Validation message level. 661 enum Level { 662 // Unspecified level. 663 LEVEL_UNSPECIFIED = 0; 664 665 // Potentially cause issues with the Stream. 666 WARNING = 1; 667 668 // Definitely cause issues with the Stream. 669 ERROR = 2; 670 } 671 672 // The result of the validation. 673 string message = 1; 674 675 // Message severity level (warning or error). 676 Level level = 2; 677 678 // Additional metadata related to the result. 679 map<string, string> metadata = 3; 680 681 // A custom code identifying this specific message. 682 string code = 4; 683} 684