datastream_resources.proto 19 KB

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