1// Copyright 2023 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 15syntax = "proto3"; 16 17package google.cloud.connectors.v1; 18 19import "google/api/field_behavior.proto"; 20import "google/api/resource.proto"; 21import "google/cloud/connectors/v1/authconfig.proto"; 22import "google/cloud/connectors/v1/common.proto"; 23import "google/cloud/connectors/v1/destination_config.proto"; 24import "google/cloud/connectors/v1/ssl_config.proto"; 25import "google/protobuf/field_mask.proto"; 26import "google/protobuf/struct.proto"; 27import "google/protobuf/timestamp.proto"; 28 29option go_package = "cloud.google.com/go/connectors/apiv1/connectorspb;connectorspb"; 30option java_multiple_files = true; 31option java_outer_classname = "ConnectionProto"; 32option java_package = "com.google.cloud.connectors.v1"; 33 34// Connection represents an instance of connector. 35message Connection { 36 option (google.api.resource) = { 37 type: "connectors.googleapis.com/Connection" 38 pattern: "projects/{project}/locations/{location}/connections/{connection}" 39 }; 40 41 // Output only. Resource name of the Connection. 42 // Format: projects/{project}/locations/{location}/connections/{connection} 43 string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; 44 45 // Output only. Created time. 46 google.protobuf.Timestamp create_time = 2 47 [(google.api.field_behavior) = OUTPUT_ONLY]; 48 49 // Output only. Updated time. 50 google.protobuf.Timestamp update_time = 3 51 [(google.api.field_behavior) = OUTPUT_ONLY]; 52 53 // Optional. Resource labels to represent user-provided metadata. 54 // Refer to cloud documentation on labels for more details. 55 // https://cloud.google.com/compute/docs/labeling-resources 56 map<string, string> labels = 4 [(google.api.field_behavior) = OPTIONAL]; 57 58 // Optional. Description of the resource. 59 string description = 5 [(google.api.field_behavior) = OPTIONAL]; 60 61 // Required. Connector version on which the connection is created. 62 // The format is: 63 // projects/*/locations/*/providers/*/connectors/*/versions/* 64 // Only global location is supported for ConnectorVersion resource. 65 string connector_version = 6 [ 66 (google.api.field_behavior) = REQUIRED, 67 (google.api.resource_reference) = { 68 type: "connectors.googleapis.com/ConnectorVersion" 69 } 70 ]; 71 72 // Output only. Current status of the connection. 73 ConnectionStatus status = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; 74 75 // Optional. Configuration for configuring the connection with an external 76 // system. 77 repeated ConfigVariable config_variables = 8 78 [(google.api.field_behavior) = OPTIONAL]; 79 80 // Optional. Configuration for establishing the connection's authentication 81 // with an external system. 82 AuthConfig auth_config = 9 [(google.api.field_behavior) = OPTIONAL]; 83 84 // Optional. Configuration that indicates whether or not the Connection can be 85 // edited. 86 LockConfig lock_config = 10 [(google.api.field_behavior) = OPTIONAL]; 87 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]; 92 93 // Output only. GCR location where the runtime image is stored. 94 // formatted like: gcr.io/{bucketName}/{imageName} 95 string image_location = 11 [(google.api.field_behavior) = OUTPUT_ONLY]; 96 97 // Optional. Service account needed for runtime plane to access GCP resources. 98 string service_account = 12 [(google.api.field_behavior) = OPTIONAL]; 99 100 // Output only. The name of the Service Directory service name. Used for 101 // Private Harpoon to resolve the ILB address. 102 // e.g. 103 // "projects/cloud-connectors-e2e-testing/locations/us-central1/namespaces/istio-system/services/istio-ingressgateway-connectors" 104 string service_directory = 13 [(google.api.field_behavior) = OUTPUT_ONLY]; 105 106 // Output only. GCR location where the envoy image is stored. 107 // formatted like: gcr.io/{bucketName}/{imageName} 108 string envoy_image_location = 15 [(google.api.field_behavior) = OUTPUT_ONLY]; 109 110 // Optional. Suspended indicates if a user has suspended a connection or not. 111 bool suspended = 17 [(google.api.field_behavior) = OPTIONAL]; 112 113 // Optional. Node configuration for the connection. 114 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]; 118} 119 120// Node configuration for the connection. 121message NodeConfig { 122 // Minimum number of nodes in the runtime nodes. 123 int32 min_node_count = 1; 124 125 // Maximum number of nodes in the runtime nodes. 126 int32 max_node_count = 2; 127} 128 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. 132message 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 150 // Output only. List of entity names. 151 repeated string entities = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; 152 153 // Output only. List of actions. 154 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]; 172} 173 174// Schema of a runtime entity. 175message RuntimeEntitySchema { 176 // Metadata of an entity field. 177 message Field { 178 // Name of the Field. 179 string field = 1; 180 181 // A brief description of the Field. 182 string description = 2; 183 184 // The data type of the Field. 185 DataType data_type = 3; 186 187 // The following boolean field specifies if the current Field acts 188 // as a primary key or id if the parent is of type entity. 189 bool key = 4; 190 191 // Specifies if the Field is readonly. 192 bool readonly = 5; 193 194 // Specifies whether a null value is allowed. 195 bool nullable = 6; 196 197 // The following field specifies the default value of the Field provided 198 // by the external system if a value is not provided. 199 google.protobuf.Value default_value = 7; 200 201 // The following map contains fields that are not explicitly mentioned 202 // above,this give connectors the flexibility to add new metadata 203 // fields. 204 google.protobuf.Struct additional_details = 8; 205 } 206 207 // Output only. Name of the entity. 208 string entity = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; 209 210 // Output only. List of fields in the entity. 211 repeated Field fields = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; 212} 213 214// Schema of a runtime action. 215message RuntimeActionSchema { 216 // Metadata of an input parameter. 217 message InputParameter { 218 // Name of the Parameter. 219 string parameter = 1; 220 221 // A brief description of the Parameter. 222 string description = 2; 223 224 // The data type of the Parameter. 225 DataType data_type = 3; 226 227 // Specifies whether a null value is allowed. 228 bool nullable = 4; 229 230 // The following field specifies the default value of the Parameter 231 // provided by the external system if a value is not provided. 232 google.protobuf.Value default_value = 5; 233 } 234 235 // Metadata of result field. 236 message ResultMetadata { 237 // Name of the result field. 238 string field = 1; 239 240 // A brief description of the field. 241 string description = 2; 242 243 // The data type of the field. 244 DataType data_type = 3; 245 } 246 247 // Output only. Name of the action. 248 string action = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; 249 250 // Output only. List of input parameter metadata for the action. 251 repeated InputParameter input_parameters = 2 252 [(google.api.field_behavior) = OUTPUT_ONLY]; 253 254 // Output only. List of result field metadata. 255 repeated ResultMetadata result_metadata = 3 256 [(google.api.field_behavior) = OUTPUT_ONLY]; 257} 258 259// Determines whether or no a connection is locked. If locked, a reason must be 260// specified. 261message LockConfig { 262 // Indicates whether or not the connection is locked. 263 bool locked = 1; 264 265 // Describes why a connection is locked. 266 string reason = 2; 267} 268 269// Request message for ConnectorsService.ListConnections 270message ListConnectionsRequest { 271 // Required. Parent resource of the Connection, of the form: 272 // `projects/*/locations/*` 273 string parent = 1 [ 274 (google.api.field_behavior) = REQUIRED, 275 (google.api.resource_reference) = { 276 child_type: "connectors.googleapis.com/Connection" 277 } 278 ]; 279 280 // Page size. 281 int32 page_size = 2; 282 283 // Page token. 284 string page_token = 3; 285 286 // Filter. 287 string filter = 4; 288 289 // Order by parameters. 290 string order_by = 5; 291 292 // Specifies which fields of the Connection are returned in the response. 293 // Defaults to `BASIC` view. 294 ConnectionView view = 6; 295} 296 297// Response message for ConnectorsService.ListConnections 298message ListConnectionsResponse { 299 // Connections. 300 repeated Connection connections = 1; 301 302 // Next page token. 303 string next_page_token = 2; 304 305 // Locations that could not be reached. 306 repeated string unreachable = 3; 307} 308 309// Request message for ConnectorsService.GetConnection 310message GetConnectionRequest { 311 // Required. Resource name of the form: 312 // `projects/*/locations/*/connections/*` 313 string name = 1 [ 314 (google.api.field_behavior) = REQUIRED, 315 (google.api.resource_reference) = { 316 type: "connectors.googleapis.com/Connection" 317 } 318 ]; 319 320 // Specifies which fields of the Connection are returned in the response. 321 // Defaults to `BASIC` view. 322 ConnectionView view = 2; 323} 324 325// Request message for ConnectorsService.CreateConnection 326message CreateConnectionRequest { 327 // Required. Parent resource of the Connection, of the form: 328 // `projects/*/locations/*` 329 string parent = 1 [ 330 (google.api.field_behavior) = REQUIRED, 331 (google.api.resource_reference) = { 332 child_type: "connectors.googleapis.com/Connection" 333 } 334 ]; 335 336 // Required. Identifier to assign to the Connection. Must be unique within 337 // scope of the parent resource. 338 string connection_id = 2 [(google.api.field_behavior) = REQUIRED]; 339 340 // Required. Connection resource. 341 Connection connection = 3 [(google.api.field_behavior) = REQUIRED]; 342} 343 344// Request message for ConnectorsService.UpdateConnection 345message UpdateConnectionRequest { 346 // Required. Connection resource. 347 Connection connection = 1 [(google.api.field_behavior) = REQUIRED]; 348 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]; 367} 368 369// Request message for ConnectorsService.DeleteConnection. 370message DeleteConnectionRequest { 371 // Required. Resource name of the form: 372 // `projects/*/locations/*/connections/*` 373 string name = 1 [ 374 (google.api.field_behavior) = REQUIRED, 375 (google.api.resource_reference) = { 376 type: "connectors.googleapis.com/Connection" 377 } 378 ]; 379} 380 381// Request message for ConnectorsService.GetConnectionSchemaMetadata. 382message GetConnectionSchemaMetadataRequest { 383 // Required. Connection name 384 // Format: 385 // projects/{project}/locations/{location}/connections/{connection}/connectionSchemaMetadata 386 string name = 1 [ 387 (google.api.field_behavior) = REQUIRED, 388 (google.api.resource_reference) = { 389 type: "connectors.googleapis.com/ConnectionSchemaMetadata" 390 } 391 ]; 392} 393 394// Request message for ConnectorsService.RefreshConnectionSchemaMetadata. 395message 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" 403 } 404 ]; 405} 406 407// Request message for ConnectorsService.ListRuntimeEntitySchemas. 408// For filter, only entity field is supported with literal equality operator. 409// Accepted filter example: entity="Order" 410// Wildcards are not supported in the filter currently. 411message ListRuntimeEntitySchemasRequest { 412 // Required. Parent resource of RuntimeEntitySchema 413 // Format: 414 // projects/{project}/locations/{location}/connections/{connection} 415 string parent = 1 [ 416 (google.api.field_behavior) = REQUIRED, 417 (google.api.resource_reference) = { 418 type: "connectors.googleapis.com/Connection" 419 } 420 ]; 421 422 // Page size. 423 int32 page_size = 2; 424 425 // Page token. 426 string page_token = 3; 427 428 // Required. Filter 429 // Format: 430 // entity="{entityId}" 431 // Only entity field is supported with literal equality operator. 432 // Accepted filter example: entity="Order" 433 // Wildcards are not supported in the filter currently. 434 string filter = 4 [(google.api.field_behavior) = REQUIRED]; 435} 436 437// Response message for ConnectorsService.ListRuntimeEntitySchemas. 438message ListRuntimeEntitySchemasResponse { 439 // Runtime entity schemas. 440 repeated RuntimeEntitySchema runtime_entity_schemas = 1; 441 442 // Next page token. 443 string next_page_token = 2; 444} 445 446// Request message for ConnectorsService.ListRuntimeActionSchemas. 447// For filter, only action field is supported with literal equality operator. 448// Accepted filter example: action="approveOrder" 449// Wildcards are not supported in the filter currently. 450message ListRuntimeActionSchemasRequest { 451 // Required. Parent resource of RuntimeActionSchema 452 // Format: 453 // projects/{project}/locations/{location}/connections/{connection} 454 string parent = 1 [ 455 (google.api.field_behavior) = REQUIRED, 456 (google.api.resource_reference) = { 457 type: "connectors.googleapis.com/Connection" 458 } 459 ]; 460 461 // Page size. 462 int32 page_size = 2; 463 464 // Page token. 465 string page_token = 3; 466 467 // Required. Filter 468 // Format: 469 // action="{actionId}" 470 // Only action field is supported with literal equality operator. 471 // Accepted filter example: action="CancelOrder" 472 // Wildcards are not supported in the filter currently. 473 string filter = 4 [(google.api.field_behavior) = REQUIRED]; 474} 475 476// Response message for ConnectorsService.ListRuntimeActionSchemas. 477message ListRuntimeActionSchemasResponse { 478 // Runtime action schemas. 479 repeated RuntimeActionSchema runtime_action_schemas = 1; 480 481 // Next page token. 482 string next_page_token = 2; 483} 484 485// ConnectionStatus indicates the state of the connection. 486message ConnectionStatus { 487 // All the possible Connection State. 488 enum State { 489 // Connection does not have a state yet. 490 STATE_UNSPECIFIED = 0; 491 492 // Connection is being created. 493 CREATING = 1; 494 495 // Connection is running and ready for requests. 496 ACTIVE = 2; 497 498 // Connection is stopped. 499 INACTIVE = 3; 500 501 // Connection is being deleted. 502 DELETING = 4; 503 504 // Connection is being updated. 505 UPDATING = 5; 506 507 // Connection is not running due to an error. 508 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; 513 } 514 515 // State. 516 State state = 1; 517 518 // Description. 519 string description = 2; 520 521 // Status provides detailed information for the state. 522 string status = 3; 523} 524 525// All possible data types of a entity or action field. 526enum DataType { 527 // Data type is not specified. 528 DATA_TYPE_UNSPECIFIED = 0; 529 530 // DEPRECATED! Use DATA_TYPE_INTEGER. 531 DATA_TYPE_INT = 1 [deprecated = true]; 532 533 // Short integer(int16) data type. 534 DATA_TYPE_SMALLINT = 2; 535 536 // Double data type. 537 DATA_TYPE_DOUBLE = 3; 538 539 // Date data type. 540 DATA_TYPE_DATE = 4; 541 542 // DEPRECATED! Use DATA_TYPE_TIMESTAMP. 543 DATA_TYPE_DATETIME = 5 [deprecated = true]; 544 545 // Time data type. 546 DATA_TYPE_TIME = 6; 547 548 // DEPRECATED! Use DATA_TYPE_VARCHAR. 549 DATA_TYPE_STRING = 7 [deprecated = true]; 550 551 // DEPRECATED! Use DATA_TYPE_BIGINT. 552 DATA_TYPE_LONG = 8 [deprecated = true]; 553 554 // Boolean data type. 555 DATA_TYPE_BOOLEAN = 9; 556 557 // Decimal data type. 558 DATA_TYPE_DECIMAL = 10; 559 560 // DEPRECATED! Use DATA_TYPE_VARCHAR. 561 DATA_TYPE_UUID = 11 [deprecated = true]; 562 563 // UNSUPPORTED! Binary data type. 564 DATA_TYPE_BLOB = 12; 565 566 // Bit data type. 567 DATA_TYPE_BIT = 13; 568 569 // Small integer(int8) data type. 570 DATA_TYPE_TINYINT = 14; 571 572 // Integer(int32) data type. 573 DATA_TYPE_INTEGER = 15; 574 575 // Long integer(int64) data type. 576 DATA_TYPE_BIGINT = 16; 577 578 // Float data type. 579 DATA_TYPE_FLOAT = 17; 580 581 // Real data type. 582 DATA_TYPE_REAL = 18; 583 584 // Numeric data type. 585 DATA_TYPE_NUMERIC = 19; 586 587 // Char data type. 588 DATA_TYPE_CHAR = 20; 589 590 // Varchar data type. 591 DATA_TYPE_VARCHAR = 21; 592 593 // Longvarchar data type. 594 DATA_TYPE_LONGVARCHAR = 22; 595 596 // Timestamp data type. 597 DATA_TYPE_TIMESTAMP = 23; 598 599 // Nchar data type. 600 DATA_TYPE_NCHAR = 24; 601 602 // Nvarchar data type. 603 DATA_TYPE_NVARCHAR = 25; 604 605 // Longnvarchar data type. 606 DATA_TYPE_LONGNVARCHAR = 26; 607 608 // Null data type. 609 DATA_TYPE_NULL = 27; 610 611 // UNSUPPORTED! Binary data type. 612 DATA_TYPE_OTHER = 28; 613 614 // UNSUPPORTED! Binary data type. 615 DATA_TYPE_JAVA_OBJECT = 29; 616 617 // UNSUPPORTED! Binary data type. 618 DATA_TYPE_DISTINCT = 30; 619 620 // UNSUPPORTED! Binary data type. 621 DATA_TYPE_STRUCT = 31; 622 623 // UNSUPPORTED! Binary data type. 624 DATA_TYPE_ARRAY = 32; 625 626 // UNSUPPORTED! Binary data type. 627 DATA_TYPE_CLOB = 33; 628 629 // UNSUPPORTED! Binary data type. 630 DATA_TYPE_REF = 34; 631 632 // UNSUPPORTED! Binary data type. 633 DATA_TYPE_DATALINK = 35; 634 635 // UNSUPPORTED! Row id data type. 636 DATA_TYPE_ROWID = 36; 637 638 // UNSUPPORTED! Binary data type. 639 DATA_TYPE_BINARY = 37; 640 641 // UNSUPPORTED! Variable binary data type. 642 DATA_TYPE_VARBINARY = 38; 643 644 // UNSUPPORTED! Long variable binary data type. 645 DATA_TYPE_LONGVARBINARY = 39; 646 647 // UNSUPPORTED! NCLOB data type. 648 DATA_TYPE_NCLOB = 40; 649 650 // UNSUPPORTED! SQL XML data type is not supported. 651 DATA_TYPE_SQLXML = 41; 652 653 // UNSUPPORTED! Cursor reference type is not supported. 654 DATA_TYPE_REF_CURSOR = 42; 655 656 // UNSUPPORTED! Use TIME or TIMESTAMP instead. 657 DATA_TYPE_TIME_WITH_TIMEZONE = 43; 658 659 // UNSUPPORTED! Use TIMESTAMP instead. 660 DATA_TYPE_TIMESTAMP_WITH_TIMEZONE = 44; 661} 662 663// Enum to control which fields should be included in the response. 664enum ConnectionView { 665 // CONNECTION_UNSPECIFIED. 666 CONNECTION_VIEW_UNSPECIFIED = 0; 667 668 // Do not include runtime required configs. 669 BASIC = 1; 670 671 // Include runtime required configs. 672 FULL = 2; 673} 674