common.proto 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  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.spanner.admin.database.v1;
  16. import "google/api/field_behavior.proto";
  17. import "google/api/resource.proto";
  18. import "google/protobuf/timestamp.proto";
  19. import "google/rpc/status.proto";
  20. option csharp_namespace = "Google.Cloud.Spanner.Admin.Database.V1";
  21. option go_package = "google.golang.org/genproto/googleapis/spanner/admin/database/v1;database";
  22. option java_multiple_files = true;
  23. option java_outer_classname = "CommonProto";
  24. option java_package = "com.google.spanner.admin.database.v1";
  25. option php_namespace = "Google\\Cloud\\Spanner\\Admin\\Database\\V1";
  26. option ruby_package = "Google::Cloud::Spanner::Admin::Database::V1";
  27. option (google.api.resource_definition) = {
  28. type: "cloudkms.googleapis.com/CryptoKey"
  29. pattern: "projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}"
  30. };
  31. option (google.api.resource_definition) = {
  32. type: "cloudkms.googleapis.com/CryptoKeyVersion"
  33. pattern: "projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version}"
  34. };
  35. // Encapsulates progress related information for a Cloud Spanner long
  36. // running operation.
  37. message OperationProgress {
  38. // Percent completion of the operation.
  39. // Values are between 0 and 100 inclusive.
  40. int32 progress_percent = 1;
  41. // Time the request was received.
  42. google.protobuf.Timestamp start_time = 2;
  43. // If set, the time at which this operation failed or was completed
  44. // successfully.
  45. google.protobuf.Timestamp end_time = 3;
  46. }
  47. // Encryption configuration for a Cloud Spanner database.
  48. message EncryptionConfig {
  49. // The Cloud KMS key to be used for encrypting and decrypting
  50. // the database. Values are of the form
  51. // `projects/<project>/locations/<location>/keyRings/<key_ring>/cryptoKeys/<kms_key_name>`.
  52. string kms_key_name = 2 [(google.api.resource_reference) = {
  53. type: "cloudkms.googleapis.com/CryptoKey"
  54. }];
  55. }
  56. // Encryption information for a Cloud Spanner database or backup.
  57. message EncryptionInfo {
  58. // Possible encryption types.
  59. enum Type {
  60. // Encryption type was not specified, though data at rest remains encrypted.
  61. TYPE_UNSPECIFIED = 0;
  62. // The data is encrypted at rest with a key that is
  63. // fully managed by Google. No key version or status will be populated.
  64. // This is the default state.
  65. GOOGLE_DEFAULT_ENCRYPTION = 1;
  66. // The data is encrypted at rest with a key that is
  67. // managed by the customer. The active version of the key. `kms_key_version`
  68. // will be populated, and `encryption_status` may be populated.
  69. CUSTOMER_MANAGED_ENCRYPTION = 2;
  70. }
  71. // Output only. The type of encryption.
  72. Type encryption_type = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
  73. // Output only. If present, the status of a recent encrypt/decrypt call on underlying data
  74. // for this database or backup. Regardless of status, data is always encrypted
  75. // at rest.
  76. google.rpc.Status encryption_status = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
  77. // Output only. A Cloud KMS key version that is being used to protect the database or
  78. // backup.
  79. string kms_key_version = 2 [
  80. (google.api.field_behavior) = OUTPUT_ONLY,
  81. (google.api.resource_reference) = {
  82. type: "cloudkms.googleapis.com/CryptoKeyVersion"
  83. }
  84. ];
  85. }
  86. // Indicates the dialect type of a database.
  87. enum DatabaseDialect {
  88. // Default value. This value will create a database with the
  89. // GOOGLE_STANDARD_SQL dialect.
  90. DATABASE_DIALECT_UNSPECIFIED = 0;
  91. // Google standard SQL.
  92. GOOGLE_STANDARD_SQL = 1;
  93. // PostgreSQL supported SQL.
  94. POSTGRESQL = 2;
  95. }