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