cloud_sql_connect.proto 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  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.sql.v1beta4;
  16. import "google/api/annotations.proto";
  17. import "google/api/client.proto";
  18. import "google/api/field_behavior.proto";
  19. import "google/cloud/sql/v1beta4/cloud_sql_resources.proto";
  20. import "google/protobuf/duration.proto";
  21. import "google/protobuf/timestamp.proto";
  22. option go_package = "google.golang.org/genproto/googleapis/cloud/sql/v1beta4;sql";
  23. option java_multiple_files = true;
  24. option java_outer_classname = "CloudSqlConnectProto";
  25. option java_package = "com.google.cloud.sql.v1beta4";
  26. // LINT: LEGACY_NAMES
  27. // Cloud SQL connect service.
  28. service SqlConnectService {
  29. option (google.api.default_host) = "sqladmin.googleapis.com";
  30. option (google.api.oauth_scopes) =
  31. "https://www.googleapis.com/auth/cloud-platform,"
  32. "https://www.googleapis.com/auth/sqlservice.admin";
  33. // Retrieves connect settings about a Cloud SQL instance.
  34. rpc GetConnectSettings(GetConnectSettingsRequest) returns (ConnectSettings) {
  35. option (google.api.http) = {
  36. get: "/sql/v1beta4/projects/{project}/instances/{instance}/connectSettings"
  37. };
  38. }
  39. // Generates a short-lived X509 certificate containing the provided public key
  40. // and signed by a private key specific to the target instance. Users may use
  41. // the certificate to authenticate as themselves when connecting to the
  42. // database.
  43. rpc GenerateEphemeralCert(GenerateEphemeralCertRequest) returns (GenerateEphemeralCertResponse) {
  44. option (google.api.http) = {
  45. post: "/sql/v1beta4/projects/{project}/instances/{instance}:generateEphemeralCert"
  46. body: "*"
  47. };
  48. }
  49. }
  50. // Connect settings retrieval request.
  51. message GetConnectSettingsRequest {
  52. // Cloud SQL instance ID. This does not include the project ID.
  53. string instance = 1;
  54. // Project ID of the project that contains the instance.
  55. string project = 2;
  56. // Optional. Optional snapshot read timestamp to trade freshness for performance.
  57. google.protobuf.Timestamp read_time = 7 [(google.api.field_behavior) = OPTIONAL];
  58. }
  59. // Connect settings retrieval response.
  60. message ConnectSettings {
  61. // This is always `sql#connectSettings`.
  62. string kind = 1;
  63. // SSL configuration.
  64. SslCert server_ca_cert = 2;
  65. // The assigned IP addresses for the instance.
  66. repeated IpMapping ip_addresses = 3;
  67. // The cloud region for the instance. e.g. `us-central1`, `europe-west1`.
  68. // The region cannot be changed after instance creation.
  69. string region = 4;
  70. // The database engine type and version. The `databaseVersion`
  71. // field cannot be changed after instance creation.
  72. // MySQL instances: `MYSQL_8_0`, `MYSQL_5_7` (default),
  73. // or `MYSQL_5_6`.
  74. // PostgreSQL instances: `POSTGRES_9_6`, `POSTGRES_10`,
  75. // `POSTGRES_11` or `POSTGRES_12` (default), `POSTGRES_13`, or `POSTGRES_14`.
  76. // SQL Server instances: `SQLSERVER_2017_STANDARD` (default),
  77. // `SQLSERVER_2017_ENTERPRISE`, `SQLSERVER_2017_EXPRESS`,
  78. // `SQLSERVER_2017_WEB`, `SQLSERVER_2019_STANDARD`,
  79. // `SQLSERVER_2019_ENTERPRISE`, `SQLSERVER_2019_EXPRESS`, or
  80. // `SQLSERVER_2019_WEB`.
  81. SqlDatabaseVersion database_version = 31;
  82. // `SECOND_GEN`: Cloud SQL database instance.
  83. // `EXTERNAL`: A database server that is not managed by Google.
  84. // This property is read-only; use the `tier` property in the `settings`
  85. // object to determine the database type.
  86. SqlBackendType backend_type = 32;
  87. }
  88. // Ephemeral certificate creation request.
  89. message GenerateEphemeralCertRequest {
  90. // Cloud SQL instance ID. This does not include the project ID.
  91. string instance = 1;
  92. // Project ID of the project that contains the instance.
  93. string project = 2;
  94. // PEM encoded public key to include in the signed certificate.
  95. string public_key = 3;
  96. // Optional. Access token to include in the signed certificate.
  97. string access_token = 4 [(google.api.field_behavior) = OPTIONAL];
  98. // Optional. Optional snapshot read timestamp to trade freshness for performance.
  99. google.protobuf.Timestamp read_time = 7 [(google.api.field_behavior) = OPTIONAL];
  100. // Optional. If set, it will contain the cert valid duration.
  101. google.protobuf.Duration valid_duration = 12 [(google.api.field_behavior) = OPTIONAL];
  102. }
  103. // Ephemeral certificate creation request.
  104. message GenerateEphemeralCertResponse {
  105. // Generated cert
  106. SslCert ephemeral_cert = 1;
  107. }