1- // Copyright 2022 Google LLC
1+ // Copyright 2023 Google LLC
22//
33// Licensed under the Apache License, Version 2.0 (the "License");
44// you may not use this file except in compliance with the License.
@@ -21,6 +21,7 @@ import "google/api/resource.proto";
2121import "google/cloud/connectors/v1/authconfig.proto" ;
2222import "google/cloud/connectors/v1/common.proto" ;
2323import "google/cloud/connectors/v1/destination_config.proto" ;
24+ import "google/cloud/connectors/v1/ssl_config.proto" ;
2425import "google/protobuf/field_mask.proto" ;
2526import "google/protobuf/struct.proto" ;
2627import "google/protobuf/timestamp.proto" ;
@@ -42,10 +43,12 @@ message Connection {
4243 string name = 1 [(google.api.field_behavior ) = OUTPUT_ONLY ];
4344
4445 // Output only. Created time.
45- google.protobuf.Timestamp create_time = 2 [(google.api.field_behavior ) = OUTPUT_ONLY ];
46+ google.protobuf.Timestamp create_time = 2
47+ [(google.api.field_behavior ) = OUTPUT_ONLY ];
4648
4749 // Output only. Updated time.
48- google.protobuf.Timestamp update_time = 3 [(google.api.field_behavior ) = OUTPUT_ONLY ];
50+ google.protobuf.Timestamp update_time = 3
51+ [(google.api.field_behavior ) = OUTPUT_ONLY ];
4952
5053 // Optional. Resource labels to represent user-provided metadata.
5154 // Refer to cloud documentation on labels for more details.
@@ -69,19 +72,23 @@ message Connection {
6972 // Output only. Current status of the connection.
7073 ConnectionStatus status = 7 [(google.api.field_behavior ) = OUTPUT_ONLY ];
7174
72- // Optional. Configuration for configuring the connection with an external system.
73- repeated ConfigVariable config_variables = 8 [(google.api.field_behavior ) = OPTIONAL ];
75+ // Optional. Configuration for configuring the connection with an external
76+ // system.
77+ repeated ConfigVariable config_variables = 8
78+ [(google.api.field_behavior ) = OPTIONAL ];
7479
75- // Optional. Configuration for establishing the connection's authentication with an
76- // external system.
80+ // Optional. Configuration for establishing the connection's authentication
81+ // with an external system.
7782 AuthConfig auth_config = 9 [(google.api.field_behavior ) = OPTIONAL ];
7883
79- // Optional. Configuration that indicates whether or not the Connection can be edited.
84+ // Optional. Configuration that indicates whether or not the Connection can be
85+ // edited.
8086 LockConfig lock_config = 10 [(google.api.field_behavior ) = OPTIONAL ];
8187
82- // Optional. Configuration of the Connector's destination. Only accepted for Connectors
83- // that accepts user defined destination(s).
84- repeated DestinationConfig destination_configs = 18 [(google.api.field_behavior ) = OPTIONAL ];
88+ // Optional. Configuration of the Connector's destination. Only accepted for
89+ // Connectors that accepts user defined destination(s).
90+ repeated DestinationConfig destination_configs = 18
91+ [(google.api.field_behavior ) = OPTIONAL ];
8592
8693 // Output only. GCR location where the runtime image is stored.
8794 // formatted like: gcr.io/{bucketName}/{imageName}
@@ -103,11 +110,14 @@ message Connection {
103110 // Optional. Suspended indicates if a user has suspended a connection or not.
104111 bool suspended = 17 [(google.api.field_behavior ) = OPTIONAL ];
105112
106- // Optional. Configuration for the connection.
113+ // Optional. Node configuration for the connection.
107114 NodeConfig node_config = 19 [(google.api.field_behavior ) = OPTIONAL ];
115+
116+ // Optional. Ssl config of a connection
117+ SslConfig ssl_config = 21 [(google.api.field_behavior ) = OPTIONAL ];
108118}
109119
110- // Configuration for the connection.
120+ // Node configuration for the connection.
111121message NodeConfig {
112122 // Minimum number of nodes in the runtime nodes.
113123 int32 min_node_count = 1 ;
@@ -116,13 +126,49 @@ message NodeConfig {
116126 int32 max_node_count = 2 ;
117127}
118128
119- // Metadata of connection schema.
129+ // ConnectionSchemaMetadata is the singleton resource of each connection.
130+ // It includes the entity and action names of runtime resources exposed
131+ // by a connection backend.
120132message ConnectionSchemaMetadata {
133+ option (google.api.resource ) = {
134+ type : "connectors.googleapis.com/ConnectionSchemaMetadata"
135+ pattern : "projects/{project}/locations/{location}/connections/{connection}/connectionSchemaMetadata"
136+ };
137+
138+ // State of connection runtime schema.
139+ enum State {
140+ // Default state.
141+ STATE_UNSPECIFIED = 0 ;
142+
143+ // Schema refresh is in progress.
144+ REFRESHING = 1 ;
145+
146+ // Schema has been updated.
147+ UPDATED = 2 ;
148+ }
149+
121150 // Output only. List of entity names.
122151 repeated string entities = 1 [(google.api.field_behavior ) = OUTPUT_ONLY ];
123152
124153 // Output only. List of actions.
125154 repeated string actions = 2 [(google.api.field_behavior ) = OUTPUT_ONLY ];
155+
156+ // Output only. Resource name.
157+ // Format:
158+ // projects/{project}/locations/{location}/connections/{connection}/connectionSchemaMetadata
159+ string name = 3 [(google.api.field_behavior ) = OUTPUT_ONLY ];
160+
161+ // Output only. Timestamp when the connection runtime schema was updated.
162+ google.protobuf.Timestamp update_time = 4
163+ [(google.api.field_behavior ) = OUTPUT_ONLY ];
164+
165+ // Output only. Timestamp when the connection runtime schema refresh was
166+ // triggered.
167+ google.protobuf.Timestamp refresh_time = 5
168+ [(google.api.field_behavior ) = OUTPUT_ONLY ];
169+
170+ // Output only. The current state of runtime schema.
171+ State state = 6 [(google.api.field_behavior ) = OUTPUT_ONLY ];
126172}
127173
128174// Schema of a runtime entity.
@@ -202,10 +248,12 @@ message RuntimeActionSchema {
202248 string action = 1 [(google.api.field_behavior ) = OUTPUT_ONLY ];
203249
204250 // Output only. List of input parameter metadata for the action.
205- repeated InputParameter input_parameters = 2 [(google.api.field_behavior ) = OUTPUT_ONLY ];
251+ repeated InputParameter input_parameters = 2
252+ [(google.api.field_behavior ) = OUTPUT_ONLY ];
206253
207254 // Output only. List of result field metadata.
208- repeated ResultMetadata result_metadata = 3 [(google.api.field_behavior ) = OUTPUT_ONLY ];
255+ repeated ResultMetadata result_metadata = 3
256+ [(google.api.field_behavior ) = OUTPUT_ONLY ];
209257}
210258
211259// Determines whether or no a connection is locked. If locked, a reason must be
@@ -285,8 +333,8 @@ message CreateConnectionRequest {
285333 }
286334 ];
287335
288- // Required. Identifier to assign to the Connection. Must be unique within scope of
289- // the parent resource.
336+ // Required. Identifier to assign to the Connection. Must be unique within
337+ // scope of the parent resource.
290338 string connection_id = 2 [(google.api.field_behavior ) = REQUIRED ];
291339
292340 // Required. Connection resource.
@@ -298,12 +346,24 @@ message UpdateConnectionRequest {
298346 // Required. Connection resource.
299347 Connection connection = 1 [(google.api.field_behavior ) = REQUIRED ];
300348
301- // Required. Field mask is used to specify the fields to be overwritten in the
302- // Connection resource by the update.
303- // The fields specified in the update_mask are relative to the resource, not
304- // the full request. A field will be overwritten if it is in the mask. If the
305- // user does not provide a mask then all fields will be overwritten.
306- google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior ) = REQUIRED ];
349+ // Required. You can modify only the fields listed below.
350+ //
351+ // To lock/unlock a connection:
352+ // * `lock_config`
353+ //
354+ // To suspend/resume a connection:
355+ // * `suspended`
356+ //
357+ // To update the connection details:
358+ // * `description`
359+ // * `labels`
360+ // * `connector_version`
361+ // * `config_variables`
362+ // * `auth_config`
363+ // * `destination_configs`
364+ // * `node_config`
365+ google.protobuf.FieldMask update_mask = 2
366+ [(google.api.field_behavior ) = REQUIRED ];
307367}
308368
309369// Request message for ConnectorsService.DeleteConnection.
@@ -326,7 +386,20 @@ message GetConnectionSchemaMetadataRequest {
326386 string name = 1 [
327387 (google.api.field_behavior ) = REQUIRED ,
328388 (google.api.resource_reference ) = {
329- type : "connectors.googleapis.com/Connection"
389+ type : "connectors.googleapis.com/ConnectionSchemaMetadata"
390+ }
391+ ];
392+ }
393+
394+ // Request message for ConnectorsService.RefreshConnectionSchemaMetadata.
395+ message RefreshConnectionSchemaMetadataRequest {
396+ // Required. Resource name.
397+ // Format:
398+ // projects/{project}/locations/{location}/connections/{connection}/connectionSchemaMetadata
399+ string name = 1 [
400+ (google.api.field_behavior ) = REQUIRED ,
401+ (google.api.resource_reference ) = {
402+ type : "connectors.googleapis.com/ConnectionSchemaMetadata"
330403 }
331404 ];
332405}
@@ -433,6 +506,10 @@ message ConnectionStatus {
433506
434507 // Connection is not running due to an error.
435508 ERROR = 6 ;
509+
510+ // Connection is not running due to an auth error for the Oauth2 Auth Code
511+ // based connector.
512+ AUTHORIZATION_REQUIRED = 7 ;
436513 }
437514
438515 // State.
0 commit comments