-
Notifications
You must be signed in to change notification settings - Fork 2.2k
/
cloud_sql_connect.proto
125 lines (102 loc) · 4.45 KB
/
cloud_sql_connect.proto
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
// Copyright 2021 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
syntax = "proto3";
package google.cloud.sql.v1;
import "google/api/annotations.proto";
import "google/api/field_behavior.proto";
import "google/cloud/sql/v1/cloud_sql_resources.proto";
import "google/protobuf/timestamp.proto";
import "google/api/client.proto";
option go_package = "cloud.google.com/go/sql/apiv1/sqlpb;sqlpb";
option java_multiple_files = true;
option java_outer_classname = "CloudSqlConnectProto";
option java_package = "com.google.cloud.sql.v1";
// LINT: LEGACY_NAMES
// Cloud SQL connect service.
service SqlConnectService {
option (google.api.default_host) = "sqladmin.googleapis.com";
option (google.api.oauth_scopes) =
"https://www.googleapis.com/auth/cloud-platform,"
"https://www.googleapis.com/auth/sqlservice.admin";
// Retrieves connect settings about a Cloud SQL instance.
rpc GetConnectSettings(GetConnectSettingsRequest) returns (ConnectSettings) {
option (google.api.http) = {
get: "/v1/projects/{project}/instances/{instance}/connectSettings"
};
}
// Generates a short-lived X509 certificate containing the provided public key
// and signed by a private key specific to the target instance. Users may use
// the certificate to authenticate as themselves when connecting to the
// database.
rpc GenerateEphemeralCert(GenerateEphemeralCertRequest) returns (GenerateEphemeralCertResponse) {
option (google.api.http) = {
post: "/v1/projects/{project}/instances/{instance}:generateEphemeralCert"
body: "*"
};
}
}
// Connect settings retrieval request.
message GetConnectSettingsRequest {
// Cloud SQL instance ID. This does not include the project ID.
string instance = 1;
// Project ID of the project that contains the instance.
string project = 2;
// Optional. Optional snapshot read timestamp to trade freshness for performance.
google.protobuf.Timestamp read_time = 7 [(google.api.field_behavior) = OPTIONAL];
}
// Connect settings retrieval response.
message ConnectSettings {
// This is always `sql#connectSettings`.
string kind = 1;
// SSL configuration.
SslCert server_ca_cert = 2;
// The assigned IP addresses for the instance.
repeated IpMapping ip_addresses = 3;
// The cloud region for the instance. e.g. **us-central1**, **europe-west1**.
// The region cannot be changed after instance creation.
string region = 4;
// The database engine type and version. The **databaseVersion**
// field cannot be changed after instance creation.
// MySQL instances: **MYSQL_8_0**, **MYSQL_5_7** (default),
// or **MYSQL_5_6**.
// PostgreSQL instances: **POSTGRES_9_6**, **POSTGRES_10**,
// **POSTGRES_11** or **POSTGRES_12** (default).
// SQL Server instances: **SQLSERVER_2017_STANDARD** (default),
// **SQLSERVER_2017_ENTERPRISE**, **SQLSERVER_2017_EXPRESS**, or
// **SQLSERVER_2017_WEB**.
SqlDatabaseVersion database_version = 31;
// **SECOND_GEN**: Cloud SQL database instance.
// **EXTERNAL**: A database server that is not managed by Google.
// This property is read-only; use the **tier** property in the **settings**
// object to determine the database type.
SqlBackendType backend_type = 32;
}
// Ephemeral certificate creation request.
message GenerateEphemeralCertRequest {
// Cloud SQL instance ID. This does not include the project ID.
string instance = 1;
// Project ID of the project that contains the instance.
string project = 2;
// PEM encoded public key to include in the signed certificate.
string public_key = 3;
// Optional. Access token to include in the signed certificate.
string access_token = 4 [(google.api.field_behavior) = OPTIONAL];
// Optional. Optional snapshot read timestamp to trade freshness for performance.
google.protobuf.Timestamp read_time = 7 [(google.api.field_behavior) = OPTIONAL];
}
// Ephemeral certificate creation request.
message GenerateEphemeralCertResponse {
// Generated cert
SslCert ephemeral_cert = 1;
}