datastream_resources.proto 30 KB

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