connection.proto 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596
  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.connectors.v1;
  16. import "google/api/field_behavior.proto";
  17. import "google/api/resource.proto";
  18. import "google/cloud/connectors/v1/authconfig.proto";
  19. import "google/cloud/connectors/v1/common.proto";
  20. import "google/cloud/connectors/v1/destination_config.proto";
  21. import "google/protobuf/field_mask.proto";
  22. import "google/protobuf/struct.proto";
  23. import "google/protobuf/timestamp.proto";
  24. option go_package = "google.golang.org/genproto/googleapis/cloud/connectors/v1;connectors";
  25. option java_multiple_files = true;
  26. option java_outer_classname = "ConnectionProto";
  27. option java_package = "com.google.cloud.connectors.v1";
  28. // Connection represents an instance of connector.
  29. message Connection {
  30. option (google.api.resource) = {
  31. type: "connectors.googleapis.com/Connection"
  32. pattern: "projects/{project}/locations/{location}/connections/{connection}"
  33. };
  34. // Output only. Resource name of the Connection.
  35. // Format: projects/{project}/locations/{location}/connections/{connection}
  36. string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
  37. // Output only. Created time.
  38. google.protobuf.Timestamp create_time = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
  39. // Output only. Updated time.
  40. google.protobuf.Timestamp update_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
  41. // Optional. Resource labels to represent user-provided metadata.
  42. // Refer to cloud documentation on labels for more details.
  43. // https://cloud.google.com/compute/docs/labeling-resources
  44. map<string, string> labels = 4 [(google.api.field_behavior) = OPTIONAL];
  45. // Optional. Description of the resource.
  46. string description = 5 [(google.api.field_behavior) = OPTIONAL];
  47. // Required. Connector version on which the connection is created.
  48. // The format is:
  49. // projects/*/locations/*/providers/*/connectors/*/versions/*
  50. // Only global location is supported for ConnectorVersion resource.
  51. string connector_version = 6 [
  52. (google.api.field_behavior) = REQUIRED,
  53. (google.api.resource_reference) = {
  54. type: "connectors.googleapis.com/ConnectorVersion"
  55. }
  56. ];
  57. // Output only. Current status of the connection.
  58. ConnectionStatus status = 7 [(google.api.field_behavior) = OUTPUT_ONLY];
  59. // Optional. Configuration for configuring the connection with an external system.
  60. repeated ConfigVariable config_variables = 8 [(google.api.field_behavior) = OPTIONAL];
  61. // Optional. Configuration for establishing the connection's authentication with an
  62. // external system.
  63. AuthConfig auth_config = 9 [(google.api.field_behavior) = OPTIONAL];
  64. // Optional. Configuration that indicates whether or not the Connection can be edited.
  65. LockConfig lock_config = 10 [(google.api.field_behavior) = OPTIONAL];
  66. // Optional. Configuration of the Connector's destination. Only accepted for Connectors
  67. // that accepts user defined destination(s).
  68. repeated DestinationConfig destination_configs = 18 [(google.api.field_behavior) = OPTIONAL];
  69. // Output only. GCR location where the runtime image is stored.
  70. // formatted like: gcr.io/{bucketName}/{imageName}
  71. string image_location = 11 [(google.api.field_behavior) = OUTPUT_ONLY];
  72. // Optional. Service account needed for runtime plane to access GCP resources.
  73. string service_account = 12 [(google.api.field_behavior) = OPTIONAL];
  74. // Output only. The name of the Service Directory service name. Used for
  75. // Private Harpoon to resolve the ILB address.
  76. // e.g.
  77. // "projects/cloud-connectors-e2e-testing/locations/us-central1/namespaces/istio-system/services/istio-ingressgateway-connectors"
  78. string service_directory = 13 [(google.api.field_behavior) = OUTPUT_ONLY];
  79. // Output only. GCR location where the envoy image is stored.
  80. // formatted like: gcr.io/{bucketName}/{imageName}
  81. string envoy_image_location = 15 [(google.api.field_behavior) = OUTPUT_ONLY];
  82. // Optional. Suspended indicates if a user has suspended a connection or not.
  83. bool suspended = 17 [(google.api.field_behavior) = OPTIONAL];
  84. // Optional. Configuration for the connection.
  85. NodeConfig node_config = 19 [(google.api.field_behavior) = OPTIONAL];
  86. }
  87. // Configuration for the connection.
  88. message NodeConfig {
  89. // Minimum number of nodes in the runtime nodes.
  90. int32 min_node_count = 1;
  91. // Maximum number of nodes in the runtime nodes.
  92. int32 max_node_count = 2;
  93. }
  94. // Metadata of connection schema.
  95. message ConnectionSchemaMetadata {
  96. // Output only. List of entity names.
  97. repeated string entities = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
  98. // Output only. List of actions.
  99. repeated string actions = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
  100. }
  101. // Schema of a runtime entity.
  102. message RuntimeEntitySchema {
  103. // Metadata of an entity field.
  104. message Field {
  105. // Name of the Field.
  106. string field = 1;
  107. // A brief description of the Field.
  108. string description = 2;
  109. // The data type of the Field.
  110. DataType data_type = 3;
  111. // The following boolean field specifies if the current Field acts
  112. // as a primary key or id if the parent is of type entity.
  113. bool key = 4;
  114. // Specifies if the Field is readonly.
  115. bool readonly = 5;
  116. // Specifies whether a null value is allowed.
  117. bool nullable = 6;
  118. // The following field specifies the default value of the Field provided
  119. // by the external system if a value is not provided.
  120. google.protobuf.Value default_value = 7;
  121. // The following map contains fields that are not explicitly mentioned
  122. // above,this give connectors the flexibility to add new metadata
  123. // fields.
  124. google.protobuf.Struct additional_details = 8;
  125. }
  126. // Output only. Name of the entity.
  127. string entity = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
  128. // Output only. List of fields in the entity.
  129. repeated Field fields = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
  130. }
  131. // Schema of a runtime action.
  132. message RuntimeActionSchema {
  133. // Metadata of an input parameter.
  134. message InputParameter {
  135. // Name of the Parameter.
  136. string parameter = 1;
  137. // A brief description of the Parameter.
  138. string description = 2;
  139. // The data type of the Parameter.
  140. DataType data_type = 3;
  141. // Specifies whether a null value is allowed.
  142. bool nullable = 4;
  143. // The following field specifies the default value of the Parameter
  144. // provided by the external system if a value is not provided.
  145. google.protobuf.Value default_value = 5;
  146. }
  147. // Metadata of result field.
  148. message ResultMetadata {
  149. // Name of the result field.
  150. string field = 1;
  151. // A brief description of the field.
  152. string description = 2;
  153. // The data type of the field.
  154. DataType data_type = 3;
  155. }
  156. // Output only. Name of the action.
  157. string action = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
  158. // Output only. List of input parameter metadata for the action.
  159. repeated InputParameter input_parameters = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
  160. // Output only. List of result field metadata.
  161. repeated ResultMetadata result_metadata = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
  162. }
  163. // Determines whether or no a connection is locked. If locked, a reason must be
  164. // specified.
  165. message LockConfig {
  166. // Indicates whether or not the connection is locked.
  167. bool locked = 1;
  168. // Describes why a connection is locked.
  169. string reason = 2;
  170. }
  171. // Request message for ConnectorsService.ListConnections
  172. message ListConnectionsRequest {
  173. // Required. Parent resource of the Connection, of the form:
  174. // `projects/*/locations/*`
  175. string parent = 1 [
  176. (google.api.field_behavior) = REQUIRED,
  177. (google.api.resource_reference) = {
  178. child_type: "connectors.googleapis.com/Connection"
  179. }
  180. ];
  181. // Page size.
  182. int32 page_size = 2;
  183. // Page token.
  184. string page_token = 3;
  185. // Filter.
  186. string filter = 4;
  187. // Order by parameters.
  188. string order_by = 5;
  189. // Specifies which fields of the Connection are returned in the response.
  190. // Defaults to `BASIC` view.
  191. ConnectionView view = 6;
  192. }
  193. // Response message for ConnectorsService.ListConnections
  194. message ListConnectionsResponse {
  195. // Connections.
  196. repeated Connection connections = 1;
  197. // Next page token.
  198. string next_page_token = 2;
  199. // Locations that could not be reached.
  200. repeated string unreachable = 3;
  201. }
  202. // Request message for ConnectorsService.GetConnection
  203. message GetConnectionRequest {
  204. // Required. Resource name of the form:
  205. // `projects/*/locations/*/connections/*`
  206. string name = 1 [
  207. (google.api.field_behavior) = REQUIRED,
  208. (google.api.resource_reference) = {
  209. type: "connectors.googleapis.com/Connection"
  210. }
  211. ];
  212. // Specifies which fields of the Connection are returned in the response.
  213. // Defaults to `BASIC` view.
  214. ConnectionView view = 2;
  215. }
  216. // Request message for ConnectorsService.CreateConnection
  217. message CreateConnectionRequest {
  218. // Required. Parent resource of the Connection, of the form:
  219. // `projects/*/locations/*`
  220. string parent = 1 [
  221. (google.api.field_behavior) = REQUIRED,
  222. (google.api.resource_reference) = {
  223. child_type: "connectors.googleapis.com/Connection"
  224. }
  225. ];
  226. // Required. Identifier to assign to the Connection. Must be unique within scope of
  227. // the parent resource.
  228. string connection_id = 2 [(google.api.field_behavior) = REQUIRED];
  229. // Required. Connection resource.
  230. Connection connection = 3 [(google.api.field_behavior) = REQUIRED];
  231. }
  232. // Request message for ConnectorsService.UpdateConnection
  233. message UpdateConnectionRequest {
  234. // Required. Connection resource.
  235. Connection connection = 1 [(google.api.field_behavior) = REQUIRED];
  236. // Required. Field mask is used to specify the fields to be overwritten in the
  237. // Connection resource by the update.
  238. // The fields specified in the update_mask are relative to the resource, not
  239. // the full request. A field will be overwritten if it is in the mask. If the
  240. // user does not provide a mask then all fields will be overwritten.
  241. google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED];
  242. }
  243. // Request message for ConnectorsService.DeleteConnection.
  244. message DeleteConnectionRequest {
  245. // Required. Resource name of the form:
  246. // `projects/*/locations/*/connections/*`
  247. string name = 1 [
  248. (google.api.field_behavior) = REQUIRED,
  249. (google.api.resource_reference) = {
  250. type: "connectors.googleapis.com/Connection"
  251. }
  252. ];
  253. }
  254. // Request message for ConnectorsService.GetConnectionSchemaMetadata.
  255. message GetConnectionSchemaMetadataRequest {
  256. // Required. Connection name
  257. // Format:
  258. // projects/{project}/locations/{location}/connections/{connection}/connectionSchemaMetadata
  259. string name = 1 [
  260. (google.api.field_behavior) = REQUIRED,
  261. (google.api.resource_reference) = {
  262. type: "connectors.googleapis.com/Connection"
  263. }
  264. ];
  265. }
  266. // Request message for ConnectorsService.ListRuntimeEntitySchemas.
  267. // For filter, only entity field is supported with literal equality operator.
  268. // Accepted filter example: entity="Order"
  269. // Wildcards are not supported in the filter currently.
  270. message ListRuntimeEntitySchemasRequest {
  271. // Required. Parent resource of RuntimeEntitySchema
  272. // Format:
  273. // projects/{project}/locations/{location}/connections/{connection}
  274. string parent = 1 [
  275. (google.api.field_behavior) = REQUIRED,
  276. (google.api.resource_reference) = {
  277. type: "connectors.googleapis.com/Connection"
  278. }
  279. ];
  280. // Page size.
  281. int32 page_size = 2;
  282. // Page token.
  283. string page_token = 3;
  284. // Required. Filter
  285. // Format:
  286. // entity="{entityId}"
  287. // Only entity field is supported with literal equality operator.
  288. // Accepted filter example: entity="Order"
  289. // Wildcards are not supported in the filter currently.
  290. string filter = 4 [(google.api.field_behavior) = REQUIRED];
  291. }
  292. // Response message for ConnectorsService.ListRuntimeEntitySchemas.
  293. message ListRuntimeEntitySchemasResponse {
  294. // Runtime entity schemas.
  295. repeated RuntimeEntitySchema runtime_entity_schemas = 1;
  296. // Next page token.
  297. string next_page_token = 2;
  298. }
  299. // Request message for ConnectorsService.ListRuntimeActionSchemas.
  300. // For filter, only action field is supported with literal equality operator.
  301. // Accepted filter example: action="approveOrder"
  302. // Wildcards are not supported in the filter currently.
  303. message ListRuntimeActionSchemasRequest {
  304. // Required. Parent resource of RuntimeActionSchema
  305. // Format:
  306. // projects/{project}/locations/{location}/connections/{connection}
  307. string parent = 1 [
  308. (google.api.field_behavior) = REQUIRED,
  309. (google.api.resource_reference) = {
  310. type: "connectors.googleapis.com/Connection"
  311. }
  312. ];
  313. // Page size.
  314. int32 page_size = 2;
  315. // Page token.
  316. string page_token = 3;
  317. // Required. Filter
  318. // Format:
  319. // action="{actionId}"
  320. // Only action field is supported with literal equality operator.
  321. // Accepted filter example: action="CancelOrder"
  322. // Wildcards are not supported in the filter currently.
  323. string filter = 4 [(google.api.field_behavior) = REQUIRED];
  324. }
  325. // Response message for ConnectorsService.ListRuntimeActionSchemas.
  326. message ListRuntimeActionSchemasResponse {
  327. // Runtime action schemas.
  328. repeated RuntimeActionSchema runtime_action_schemas = 1;
  329. // Next page token.
  330. string next_page_token = 2;
  331. }
  332. // ConnectionStatus indicates the state of the connection.
  333. message ConnectionStatus {
  334. // All the possible Connection State.
  335. enum State {
  336. // Connection does not have a state yet.
  337. STATE_UNSPECIFIED = 0;
  338. // Connection is being created.
  339. CREATING = 1;
  340. // Connection is running and ready for requests.
  341. ACTIVE = 2;
  342. // Connection is stopped.
  343. INACTIVE = 3;
  344. // Connection is being deleted.
  345. DELETING = 4;
  346. // Connection is being updated.
  347. UPDATING = 5;
  348. // Connection is not running due to an error.
  349. ERROR = 6;
  350. }
  351. // State.
  352. State state = 1;
  353. // Description.
  354. string description = 2;
  355. // Status provides detailed information for the state.
  356. string status = 3;
  357. }
  358. // All possible data types of a entity or action field.
  359. enum DataType {
  360. // Data type is not specified.
  361. DATA_TYPE_UNSPECIFIED = 0;
  362. // DEPRECATED! Use DATA_TYPE_INTEGER.
  363. DATA_TYPE_INT = 1 [deprecated = true];
  364. // Short integer(int16) data type.
  365. DATA_TYPE_SMALLINT = 2;
  366. // Double data type.
  367. DATA_TYPE_DOUBLE = 3;
  368. // Date data type.
  369. DATA_TYPE_DATE = 4;
  370. // DEPRECATED! Use DATA_TYPE_TIMESTAMP.
  371. DATA_TYPE_DATETIME = 5 [deprecated = true];
  372. // Time data type.
  373. DATA_TYPE_TIME = 6;
  374. // DEPRECATED! Use DATA_TYPE_VARCHAR.
  375. DATA_TYPE_STRING = 7 [deprecated = true];
  376. // DEPRECATED! Use DATA_TYPE_BIGINT.
  377. DATA_TYPE_LONG = 8 [deprecated = true];
  378. // Boolean data type.
  379. DATA_TYPE_BOOLEAN = 9;
  380. // Decimal data type.
  381. DATA_TYPE_DECIMAL = 10;
  382. // DEPRECATED! Use DATA_TYPE_VARCHAR.
  383. DATA_TYPE_UUID = 11 [deprecated = true];
  384. // UNSUPPORTED! Binary data type.
  385. DATA_TYPE_BLOB = 12;
  386. // Bit data type.
  387. DATA_TYPE_BIT = 13;
  388. // Small integer(int8) data type.
  389. DATA_TYPE_TINYINT = 14;
  390. // Integer(int32) data type.
  391. DATA_TYPE_INTEGER = 15;
  392. // Long integer(int64) data type.
  393. DATA_TYPE_BIGINT = 16;
  394. // Float data type.
  395. DATA_TYPE_FLOAT = 17;
  396. // Real data type.
  397. DATA_TYPE_REAL = 18;
  398. // Numeric data type.
  399. DATA_TYPE_NUMERIC = 19;
  400. // Char data type.
  401. DATA_TYPE_CHAR = 20;
  402. // Varchar data type.
  403. DATA_TYPE_VARCHAR = 21;
  404. // Longvarchar data type.
  405. DATA_TYPE_LONGVARCHAR = 22;
  406. // Timestamp data type.
  407. DATA_TYPE_TIMESTAMP = 23;
  408. // Nchar data type.
  409. DATA_TYPE_NCHAR = 24;
  410. // Nvarchar data type.
  411. DATA_TYPE_NVARCHAR = 25;
  412. // Longnvarchar data type.
  413. DATA_TYPE_LONGNVARCHAR = 26;
  414. // Null data type.
  415. DATA_TYPE_NULL = 27;
  416. // UNSUPPORTED! Binary data type.
  417. DATA_TYPE_OTHER = 28;
  418. // UNSUPPORTED! Binary data type.
  419. DATA_TYPE_JAVA_OBJECT = 29;
  420. // UNSUPPORTED! Binary data type.
  421. DATA_TYPE_DISTINCT = 30;
  422. // UNSUPPORTED! Binary data type.
  423. DATA_TYPE_STRUCT = 31;
  424. // UNSUPPORTED! Binary data type.
  425. DATA_TYPE_ARRAY = 32;
  426. // UNSUPPORTED! Binary data type.
  427. DATA_TYPE_CLOB = 33;
  428. // UNSUPPORTED! Binary data type.
  429. DATA_TYPE_REF = 34;
  430. // UNSUPPORTED! Binary data type.
  431. DATA_TYPE_DATALINK = 35;
  432. // UNSUPPORTED! Row id data type.
  433. DATA_TYPE_ROWID = 36;
  434. // UNSUPPORTED! Binary data type.
  435. DATA_TYPE_BINARY = 37;
  436. // UNSUPPORTED! Variable binary data type.
  437. DATA_TYPE_VARBINARY = 38;
  438. // UNSUPPORTED! Long variable binary data type.
  439. DATA_TYPE_LONGVARBINARY = 39;
  440. // UNSUPPORTED! NCLOB data type.
  441. DATA_TYPE_NCLOB = 40;
  442. // UNSUPPORTED! SQL XML data type is not supported.
  443. DATA_TYPE_SQLXML = 41;
  444. // UNSUPPORTED! Cursor reference type is not supported.
  445. DATA_TYPE_REF_CURSOR = 42;
  446. // UNSUPPORTED! Use TIME or TIMESTAMP instead.
  447. DATA_TYPE_TIME_WITH_TIMEZONE = 43;
  448. // UNSUPPORTED! Use TIMESTAMP instead.
  449. DATA_TYPE_TIMESTAMP_WITH_TIMEZONE = 44;
  450. }
  451. // Enum to control which fields should be included in the response.
  452. enum ConnectionView {
  453. // CONNECTION_UNSPECIFIED.
  454. CONNECTION_VIEW_UNSPECIFIED = 0;
  455. // Do not include runtime required configs.
  456. BASIC = 1;
  457. // Include runtime required configs.
  458. FULL = 2;
  459. }