datastream_resources.proto 19 KB

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