cloud_sql_ssl_certs.proto 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. // Copyright 2021 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.v1;
  16. import "google/api/annotations.proto";
  17. import "google/cloud/sql/v1/cloud_sql_resources.proto";
  18. import "google/api/client.proto";
  19. option go_package = "google.golang.org/genproto/googleapis/cloud/sql/v1;sql";
  20. option java_multiple_files = true;
  21. option java_outer_classname = "CloudSqlSslCertsProto";
  22. option java_package = "com.google.cloud.sql.v1";
  23. // LINT: LEGACY_NAMES
  24. // Service to manage SSL certs for Cloud SQL instances.
  25. service SqlSslCertsService {
  26. option (google.api.default_host) = "sqladmin.googleapis.com";
  27. option (google.api.oauth_scopes) =
  28. "https://www.googleapis.com/auth/cloud-platform,"
  29. "https://www.googleapis.com/auth/sqlservice.admin";
  30. // Deletes the SSL certificate. For First Generation instances, the
  31. // certificate remains valid until the instance is restarted.
  32. rpc Delete(SqlSslCertsDeleteRequest) returns (Operation) {
  33. option (google.api.http) = {
  34. delete: "/v1/projects/{project}/instances/{instance}/sslCerts/{sha1_fingerprint}"
  35. };
  36. }
  37. // Retrieves a particular SSL certificate. Does not include the private key
  38. // (required for usage). The private key must be saved from the response to
  39. // initial creation.
  40. rpc Get(SqlSslCertsGetRequest) returns (SslCert) {
  41. option (google.api.http) = {
  42. get: "/v1/projects/{project}/instances/{instance}/sslCerts/{sha1_fingerprint}"
  43. };
  44. }
  45. // Creates an SSL certificate and returns it along with the private key and
  46. // server certificate authority. The new certificate will not be usable until
  47. // the instance is restarted.
  48. rpc Insert(SqlSslCertsInsertRequest) returns (SslCertsInsertResponse) {
  49. option (google.api.http) = {
  50. post: "/v1/projects/{project}/instances/{instance}/sslCerts"
  51. body: "body"
  52. };
  53. }
  54. // Lists all of the current SSL certificates for the instance.
  55. rpc List(SqlSslCertsListRequest) returns (SslCertsListResponse) {
  56. option (google.api.http) = {
  57. get: "/v1/projects/{project}/instances/{instance}/sslCerts"
  58. };
  59. }
  60. }
  61. message SqlSslCertsDeleteRequest {
  62. // Cloud SQL instance ID. This does not include the project ID.
  63. string instance = 1;
  64. // Project ID of the project that contains the instance.
  65. string project = 2;
  66. // Sha1 FingerPrint.
  67. string sha1_fingerprint = 3;
  68. }
  69. message SqlSslCertsGetRequest {
  70. // Cloud SQL instance ID. This does not include the project ID.
  71. string instance = 1;
  72. // Project ID of the project that contains the instance.
  73. string project = 2;
  74. // Sha1 FingerPrint.
  75. string sha1_fingerprint = 3;
  76. }
  77. message SqlSslCertsInsertRequest {
  78. // Cloud SQL instance ID. This does not include the project ID.
  79. string instance = 1;
  80. // Project ID of the project that contains the instance.
  81. string project = 2;
  82. SslCertsInsertRequest body = 100;
  83. }
  84. message SqlSslCertsListRequest {
  85. // Cloud SQL instance ID. This does not include the project ID.
  86. string instance = 1;
  87. // Project ID of the project that contains the instance.
  88. string project = 2;
  89. }
  90. // SslCerts insert request.
  91. message SslCertsInsertRequest {
  92. // User supplied name. Must be a distinct name from the other certificates
  93. // for this instance.
  94. string common_name = 1;
  95. }
  96. // SslCert insert response.
  97. message SslCertsInsertResponse {
  98. // This is always **sql#sslCertsInsert**.
  99. string kind = 1;
  100. // The operation to track the ssl certs insert request.
  101. Operation operation = 2;
  102. // The server Certificate Authority's certificate. If this is missing you can
  103. // force a new one to be generated by calling resetSslConfig method on
  104. // instances resource.
  105. SslCert server_ca_cert = 3;
  106. // The new client certificate and private key.
  107. SslCertDetail client_cert = 4;
  108. }
  109. // SslCerts list response.
  110. message SslCertsListResponse {
  111. // This is always **sql#sslCertsList**.
  112. string kind = 1;
  113. // List of client certificates for the instance.
  114. repeated SslCert items = 2;
  115. }