1- // Copyright 2020 Google LLC
1+ // Copyright 2021 Google LLC
22//
33// Licensed under the Apache License, Version 2.0 (the "License");
44// you may not use this file except in compliance with the License.
@@ -20,6 +20,7 @@ import "google/api/field_behavior.proto";
2020import "google/api/resource.proto" ;
2121import "google/protobuf/duration.proto" ;
2222import "google/protobuf/timestamp.proto" ;
23+ import "google/rpc/status.proto" ;
2324
2425option csharp_namespace = "Google.Cloud.Bigtable.Admin.V2" ;
2526option go_package = "google.golang.org/genproto/googleapis/bigtable/admin/v2;admin" ;
@@ -28,6 +29,10 @@ option java_outer_classname = "TableProto";
2829option java_package = "com.google.bigtable.admin.v2" ;
2930option php_namespace = "Google\\Cloud\\Bigtable\\Admin\\V2" ;
3031option ruby_package = "Google::Cloud::Bigtable::Admin::V2" ;
32+ option (google.api.resource_definition ) = {
33+ type : "cloudkms.googleapis.com/CryptoKeyVersion"
34+ pattern : "projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version}"
35+ };
3136
3237// Indicates the type of the restore source.
3338enum RestoreSourceType {
@@ -92,6 +97,14 @@ message Table {
9297
9398 // Output only. The state of replication for the table in this cluster.
9499 ReplicationState replication_state = 1 ;
100+
101+ // Output only. The encryption information for the table in this cluster.
102+ // If the encryption key protecting this resource is customer managed, then
103+ // its version can be rotated in Cloud Key Management Service (Cloud KMS).
104+ // The primary version of the key and its status will be reflected here when
105+ // changes propagate from Cloud KMS.
106+ repeated EncryptionInfo encryption_info = 2
107+ [(google.api.field_behavior ) = OUTPUT_ONLY ];
95108 }
96109
97110 // Possible timestamp granularities to use when keeping multiple versions
@@ -120,20 +133,23 @@ message Table {
120133 // state.
121134 REPLICATION_VIEW = 3 ;
122135
136+ // Only populates 'name' and fields related to the table's encryption state.
137+ ENCRYPTION_VIEW = 5 ;
138+
123139 // Populates all fields.
124140 FULL = 4 ;
125141 }
126142
127- // Output only. The unique name of the table. Values are of the form
128- // `projects/< project> /instances/< instance> /tables/[_a-zA-Z0-9][-_.a-zA-Z0-9]*`.
143+ // The unique name of the table. Values are of the form
144+ // `projects/{ project} /instances/{ instance} /tables/[_a-zA-Z0-9][-_.a-zA-Z0-9]*`.
129145 // Views: `NAME_ONLY`, `SCHEMA_VIEW`, `REPLICATION_VIEW`, `FULL`
130146 string name = 1 ;
131147
132148 // Output only. Map from cluster ID to per-cluster table state.
133149 // If it could not be determined whether or not the table has data in a
134150 // particular cluster (for example, if its zone is unavailable), then
135151 // there will be an entry for the cluster with UNKNOWN `replication_status`.
136- // Views: `REPLICATION_VIEW`, `FULL`
152+ // Views: `REPLICATION_VIEW`, `ENCRYPTION_VIEW`, ` FULL`
137153 map <string , ClusterState > cluster_states = 2 ;
138154
139155 // (`CreationOnly`)
@@ -196,6 +212,51 @@ message GcRule {
196212 }
197213}
198214
215+ // Encryption information for a given resource.
216+ // If this resource is protected with customer managed encryption, the in-use
217+ // Cloud Key Management Service (Cloud KMS) key version is specified along with
218+ // its status.
219+ message EncryptionInfo {
220+ // Possible encryption types for a resource.
221+ enum EncryptionType {
222+ // Encryption type was not specified, though data at rest remains encrypted.
223+ ENCRYPTION_TYPE_UNSPECIFIED = 0 ;
224+
225+ // The data backing this resource is encrypted at rest with a key that is
226+ // fully managed by Google. No key version or status will be populated.
227+ // This is the default state.
228+ GOOGLE_DEFAULT_ENCRYPTION = 1 ;
229+
230+ // The data backing this resource is encrypted at rest with a key that is
231+ // managed by the customer.
232+ // The in-use version of the key and its status are populated for
233+ // CMEK-protected tables.
234+ // CMEK-protected backups are pinned to the key version that was in use at
235+ // the time the backup was taken. This key version is populated but its
236+ // status is not tracked and is reported as `UNKNOWN`.
237+ CUSTOMER_MANAGED_ENCRYPTION = 2 ;
238+ }
239+
240+ // Output only. The type of encryption used to protect this resource.
241+ EncryptionType encryption_type = 3
242+ [(google.api.field_behavior ) = OUTPUT_ONLY ];
243+
244+ // Output only. The status of encrypt/decrypt calls on underlying data for
245+ // this resource. Regardless of status, the existing data is always encrypted
246+ // at rest.
247+ google.rpc.Status encryption_status = 4
248+ [(google.api.field_behavior ) = OUTPUT_ONLY ];
249+
250+ // Output only. The version of the Cloud KMS key specified in the parent
251+ // cluster that is in use for the data underlying this table.
252+ string kms_key_version = 2 [
253+ (google.api.field_behavior ) = OUTPUT_ONLY ,
254+ (google.api.resource_reference ) = {
255+ type : "cloudkms.googleapis.com/CryptoKeyVersion"
256+ }
257+ ];
258+ }
259+
199260// A snapshot of a table at a particular time. A snapshot can be used as a
200261// checkpoint for data restoration or a data source for a new table.
201262//
@@ -225,7 +286,7 @@ message Snapshot {
225286
226287 // Output only. The unique name of the snapshot.
227288 // Values are of the form
228- // `projects/< project> /instances/< instance> /clusters/< cluster> /snapshots/< snapshot> `.
289+ // `projects/{ project} /instances/{ instance} /clusters/{ cluster} /snapshots/{ snapshot} `.
229290 string name = 1 ;
230291
231292 // Output only. The source table at the time the snapshot was taken.
@@ -318,6 +379,10 @@ message Backup {
318379
319380 // Output only. The current state of the backup.
320381 State state = 7 [(google.api.field_behavior ) = OUTPUT_ONLY ];
382+
383+ // Output only. The encryption information for the backup.
384+ EncryptionInfo encryption_info = 9
385+ [(google.api.field_behavior ) = OUTPUT_ONLY ];
321386}
322387
323388// Information about a backup.
0 commit comments