1*d5c09012SAndroid Build Coastguard Worker// Copyright 2023 Google LLC 2*d5c09012SAndroid Build Coastguard Worker// 3*d5c09012SAndroid Build Coastguard Worker// Licensed under the Apache License, Version 2.0 (the "License"); 4*d5c09012SAndroid Build Coastguard Worker// you may not use this file except in compliance with the License. 5*d5c09012SAndroid Build Coastguard Worker// You may obtain a copy of the License at 6*d5c09012SAndroid Build Coastguard Worker// 7*d5c09012SAndroid Build Coastguard Worker// http://www.apache.org/licenses/LICENSE-2.0 8*d5c09012SAndroid Build Coastguard Worker// 9*d5c09012SAndroid Build Coastguard Worker// Unless required by applicable law or agreed to in writing, software 10*d5c09012SAndroid Build Coastguard Worker// distributed under the License is distributed on an "AS IS" BASIS, 11*d5c09012SAndroid Build Coastguard Worker// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12*d5c09012SAndroid Build Coastguard Worker// See the License for the specific language governing permissions and 13*d5c09012SAndroid Build Coastguard Worker// limitations under the License. 14*d5c09012SAndroid Build Coastguard Worker 15*d5c09012SAndroid Build Coastguard Workersyntax = "proto3"; 16*d5c09012SAndroid Build Coastguard Worker 17*d5c09012SAndroid Build Coastguard Workerpackage google.bigtable.admin.v2; 18*d5c09012SAndroid Build Coastguard Worker 19*d5c09012SAndroid Build Coastguard Workerimport "google/api/field_behavior.proto"; 20*d5c09012SAndroid Build Coastguard Workerimport "google/api/resource.proto"; 21*d5c09012SAndroid Build Coastguard Workerimport "google/bigtable/admin/v2/types.proto"; 22*d5c09012SAndroid Build Coastguard Workerimport "google/protobuf/duration.proto"; 23*d5c09012SAndroid Build Coastguard Workerimport "google/protobuf/timestamp.proto"; 24*d5c09012SAndroid Build Coastguard Workerimport "google/rpc/status.proto"; 25*d5c09012SAndroid Build Coastguard Worker 26*d5c09012SAndroid Build Coastguard Workeroption csharp_namespace = "Google.Cloud.Bigtable.Admin.V2"; 27*d5c09012SAndroid Build Coastguard Workeroption go_package = "google.golang.org/genproto/googleapis/bigtable/admin/v2;admin"; 28*d5c09012SAndroid Build Coastguard Workeroption java_multiple_files = true; 29*d5c09012SAndroid Build Coastguard Workeroption java_outer_classname = "TableProto"; 30*d5c09012SAndroid Build Coastguard Workeroption java_package = "com.google.bigtable.admin.v2"; 31*d5c09012SAndroid Build Coastguard Workeroption php_namespace = "Google\\Cloud\\Bigtable\\Admin\\V2"; 32*d5c09012SAndroid Build Coastguard Workeroption ruby_package = "Google::Cloud::Bigtable::Admin::V2"; 33*d5c09012SAndroid Build Coastguard Workeroption (google.api.resource_definition) = { 34*d5c09012SAndroid Build Coastguard Worker type: "cloudkms.googleapis.com/CryptoKeyVersion" 35*d5c09012SAndroid Build Coastguard Worker pattern: "projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version}" 36*d5c09012SAndroid Build Coastguard Worker}; 37*d5c09012SAndroid Build Coastguard Worker 38*d5c09012SAndroid Build Coastguard Worker// Information about a table restore. 39*d5c09012SAndroid Build Coastguard Workermessage RestoreInfo { 40*d5c09012SAndroid Build Coastguard Worker // The type of the restore source. 41*d5c09012SAndroid Build Coastguard Worker RestoreSourceType source_type = 1; 42*d5c09012SAndroid Build Coastguard Worker 43*d5c09012SAndroid Build Coastguard Worker // Information about the source used to restore the table. 44*d5c09012SAndroid Build Coastguard Worker oneof source_info { 45*d5c09012SAndroid Build Coastguard Worker // Information about the backup used to restore the table. The backup 46*d5c09012SAndroid Build Coastguard Worker // may no longer exist. 47*d5c09012SAndroid Build Coastguard Worker BackupInfo backup_info = 2; 48*d5c09012SAndroid Build Coastguard Worker } 49*d5c09012SAndroid Build Coastguard Worker} 50*d5c09012SAndroid Build Coastguard Worker 51*d5c09012SAndroid Build Coastguard Worker// Change stream configuration. 52*d5c09012SAndroid Build Coastguard Workermessage ChangeStreamConfig { 53*d5c09012SAndroid Build Coastguard Worker // How long the change stream should be retained. Change stream data older 54*d5c09012SAndroid Build Coastguard Worker // than the retention period will not be returned when reading the change 55*d5c09012SAndroid Build Coastguard Worker // stream from the table. 56*d5c09012SAndroid Build Coastguard Worker // Values must be at least 1 day and at most 7 days, and will be truncated to 57*d5c09012SAndroid Build Coastguard Worker // microsecond granularity. 58*d5c09012SAndroid Build Coastguard Worker google.protobuf.Duration retention_period = 1; 59*d5c09012SAndroid Build Coastguard Worker} 60*d5c09012SAndroid Build Coastguard Worker 61*d5c09012SAndroid Build Coastguard Worker// A collection of user data indexed by row, column, and timestamp. 62*d5c09012SAndroid Build Coastguard Worker// Each table is served using the resources of its parent cluster. 63*d5c09012SAndroid Build Coastguard Workermessage Table { 64*d5c09012SAndroid Build Coastguard Worker option (google.api.resource) = { 65*d5c09012SAndroid Build Coastguard Worker type: "bigtableadmin.googleapis.com/Table" 66*d5c09012SAndroid Build Coastguard Worker pattern: "projects/{project}/instances/{instance}/tables/{table}" 67*d5c09012SAndroid Build Coastguard Worker }; 68*d5c09012SAndroid Build Coastguard Worker 69*d5c09012SAndroid Build Coastguard Worker // The state of a table's data in a particular cluster. 70*d5c09012SAndroid Build Coastguard Worker message ClusterState { 71*d5c09012SAndroid Build Coastguard Worker // Table replication states. 72*d5c09012SAndroid Build Coastguard Worker enum ReplicationState { 73*d5c09012SAndroid Build Coastguard Worker // The replication state of the table is unknown in this cluster. 74*d5c09012SAndroid Build Coastguard Worker STATE_NOT_KNOWN = 0; 75*d5c09012SAndroid Build Coastguard Worker 76*d5c09012SAndroid Build Coastguard Worker // The cluster was recently created, and the table must finish copying 77*d5c09012SAndroid Build Coastguard Worker // over pre-existing data from other clusters before it can begin 78*d5c09012SAndroid Build Coastguard Worker // receiving live replication updates and serving Data API requests. 79*d5c09012SAndroid Build Coastguard Worker INITIALIZING = 1; 80*d5c09012SAndroid Build Coastguard Worker 81*d5c09012SAndroid Build Coastguard Worker // The table is temporarily unable to serve Data API requests from this 82*d5c09012SAndroid Build Coastguard Worker // cluster due to planned internal maintenance. 83*d5c09012SAndroid Build Coastguard Worker PLANNED_MAINTENANCE = 2; 84*d5c09012SAndroid Build Coastguard Worker 85*d5c09012SAndroid Build Coastguard Worker // The table is temporarily unable to serve Data API requests from this 86*d5c09012SAndroid Build Coastguard Worker // cluster due to unplanned or emergency maintenance. 87*d5c09012SAndroid Build Coastguard Worker UNPLANNED_MAINTENANCE = 3; 88*d5c09012SAndroid Build Coastguard Worker 89*d5c09012SAndroid Build Coastguard Worker // The table can serve Data API requests from this cluster. Depending on 90*d5c09012SAndroid Build Coastguard Worker // replication delay, reads may not immediately reflect the state of the 91*d5c09012SAndroid Build Coastguard Worker // table in other clusters. 92*d5c09012SAndroid Build Coastguard Worker READY = 4; 93*d5c09012SAndroid Build Coastguard Worker 94*d5c09012SAndroid Build Coastguard Worker // The table is fully created and ready for use after a restore, and is 95*d5c09012SAndroid Build Coastguard Worker // being optimized for performance. When optimizations are complete, the 96*d5c09012SAndroid Build Coastguard Worker // table will transition to `READY` state. 97*d5c09012SAndroid Build Coastguard Worker READY_OPTIMIZING = 5; 98*d5c09012SAndroid Build Coastguard Worker } 99*d5c09012SAndroid Build Coastguard Worker 100*d5c09012SAndroid Build Coastguard Worker // Output only. The state of replication for the table in this cluster. 101*d5c09012SAndroid Build Coastguard Worker ReplicationState replication_state = 1 102*d5c09012SAndroid Build Coastguard Worker [(google.api.field_behavior) = OUTPUT_ONLY]; 103*d5c09012SAndroid Build Coastguard Worker 104*d5c09012SAndroid Build Coastguard Worker // Output only. The encryption information for the table in this cluster. 105*d5c09012SAndroid Build Coastguard Worker // If the encryption key protecting this resource is customer managed, then 106*d5c09012SAndroid Build Coastguard Worker // its version can be rotated in Cloud Key Management Service (Cloud KMS). 107*d5c09012SAndroid Build Coastguard Worker // The primary version of the key and its status will be reflected here when 108*d5c09012SAndroid Build Coastguard Worker // changes propagate from Cloud KMS. 109*d5c09012SAndroid Build Coastguard Worker repeated EncryptionInfo encryption_info = 2 110*d5c09012SAndroid Build Coastguard Worker [(google.api.field_behavior) = OUTPUT_ONLY]; 111*d5c09012SAndroid Build Coastguard Worker } 112*d5c09012SAndroid Build Coastguard Worker 113*d5c09012SAndroid Build Coastguard Worker // Possible timestamp granularities to use when keeping multiple versions 114*d5c09012SAndroid Build Coastguard Worker // of data in a table. 115*d5c09012SAndroid Build Coastguard Worker enum TimestampGranularity { 116*d5c09012SAndroid Build Coastguard Worker // The user did not specify a granularity. Should not be returned. 117*d5c09012SAndroid Build Coastguard Worker // When specified during table creation, MILLIS will be used. 118*d5c09012SAndroid Build Coastguard Worker TIMESTAMP_GRANULARITY_UNSPECIFIED = 0; 119*d5c09012SAndroid Build Coastguard Worker 120*d5c09012SAndroid Build Coastguard Worker // The table keeps data versioned at a granularity of 1ms. 121*d5c09012SAndroid Build Coastguard Worker MILLIS = 1; 122*d5c09012SAndroid Build Coastguard Worker } 123*d5c09012SAndroid Build Coastguard Worker 124*d5c09012SAndroid Build Coastguard Worker // Defines a view over a table's fields. 125*d5c09012SAndroid Build Coastguard Worker enum View { 126*d5c09012SAndroid Build Coastguard Worker // Uses the default view for each method as documented in its request. 127*d5c09012SAndroid Build Coastguard Worker VIEW_UNSPECIFIED = 0; 128*d5c09012SAndroid Build Coastguard Worker 129*d5c09012SAndroid Build Coastguard Worker // Only populates `name`. 130*d5c09012SAndroid Build Coastguard Worker NAME_ONLY = 1; 131*d5c09012SAndroid Build Coastguard Worker 132*d5c09012SAndroid Build Coastguard Worker // Only populates `name` and fields related to the table's schema. 133*d5c09012SAndroid Build Coastguard Worker SCHEMA_VIEW = 2; 134*d5c09012SAndroid Build Coastguard Worker 135*d5c09012SAndroid Build Coastguard Worker // Only populates `name` and fields related to the table's replication 136*d5c09012SAndroid Build Coastguard Worker // state. 137*d5c09012SAndroid Build Coastguard Worker REPLICATION_VIEW = 3; 138*d5c09012SAndroid Build Coastguard Worker 139*d5c09012SAndroid Build Coastguard Worker // Only populates `name` and fields related to the table's encryption state. 140*d5c09012SAndroid Build Coastguard Worker ENCRYPTION_VIEW = 5; 141*d5c09012SAndroid Build Coastguard Worker 142*d5c09012SAndroid Build Coastguard Worker // Populates all fields. 143*d5c09012SAndroid Build Coastguard Worker FULL = 4; 144*d5c09012SAndroid Build Coastguard Worker } 145*d5c09012SAndroid Build Coastguard Worker 146*d5c09012SAndroid Build Coastguard Worker // Defines an automated backup policy for a table 147*d5c09012SAndroid Build Coastguard Worker message AutomatedBackupPolicy { 148*d5c09012SAndroid Build Coastguard Worker // Required. How long the automated backups should be retained. The only 149*d5c09012SAndroid Build Coastguard Worker // supported value at this time is 3 days. 150*d5c09012SAndroid Build Coastguard Worker google.protobuf.Duration retention_period = 1 151*d5c09012SAndroid Build Coastguard Worker [(google.api.field_behavior) = REQUIRED]; 152*d5c09012SAndroid Build Coastguard Worker 153*d5c09012SAndroid Build Coastguard Worker // Required. How frequently automated backups should occur. The only 154*d5c09012SAndroid Build Coastguard Worker // supported value at this time is 24 hours. 155*d5c09012SAndroid Build Coastguard Worker google.protobuf.Duration frequency = 2 156*d5c09012SAndroid Build Coastguard Worker [(google.api.field_behavior) = REQUIRED]; 157*d5c09012SAndroid Build Coastguard Worker } 158*d5c09012SAndroid Build Coastguard Worker 159*d5c09012SAndroid Build Coastguard Worker // The unique name of the table. Values are of the form 160*d5c09012SAndroid Build Coastguard Worker // `projects/{project}/instances/{instance}/tables/[_a-zA-Z0-9][-_.a-zA-Z0-9]*`. 161*d5c09012SAndroid Build Coastguard Worker // Views: `NAME_ONLY`, `SCHEMA_VIEW`, `REPLICATION_VIEW`, `FULL` 162*d5c09012SAndroid Build Coastguard Worker string name = 1; 163*d5c09012SAndroid Build Coastguard Worker 164*d5c09012SAndroid Build Coastguard Worker // Output only. Map from cluster ID to per-cluster table state. 165*d5c09012SAndroid Build Coastguard Worker // If it could not be determined whether or not the table has data in a 166*d5c09012SAndroid Build Coastguard Worker // particular cluster (for example, if its zone is unavailable), then 167*d5c09012SAndroid Build Coastguard Worker // there will be an entry for the cluster with UNKNOWN `replication_status`. 168*d5c09012SAndroid Build Coastguard Worker // Views: `REPLICATION_VIEW`, `ENCRYPTION_VIEW`, `FULL` 169*d5c09012SAndroid Build Coastguard Worker map<string, ClusterState> cluster_states = 2 170*d5c09012SAndroid Build Coastguard Worker [(google.api.field_behavior) = OUTPUT_ONLY]; 171*d5c09012SAndroid Build Coastguard Worker 172*d5c09012SAndroid Build Coastguard Worker // The column families configured for this table, mapped by column family ID. 173*d5c09012SAndroid Build Coastguard Worker // Views: `SCHEMA_VIEW`, `STATS_VIEW`, `FULL` 174*d5c09012SAndroid Build Coastguard Worker map<string, ColumnFamily> column_families = 3; 175*d5c09012SAndroid Build Coastguard Worker 176*d5c09012SAndroid Build Coastguard Worker // Immutable. The granularity (i.e. `MILLIS`) at which timestamps are stored 177*d5c09012SAndroid Build Coastguard Worker // in this table. Timestamps not matching the granularity will be rejected. If 178*d5c09012SAndroid Build Coastguard Worker // unspecified at creation time, the value will be set to `MILLIS`. Views: 179*d5c09012SAndroid Build Coastguard Worker // `SCHEMA_VIEW`, `FULL`. 180*d5c09012SAndroid Build Coastguard Worker TimestampGranularity granularity = 4 181*d5c09012SAndroid Build Coastguard Worker [(google.api.field_behavior) = IMMUTABLE]; 182*d5c09012SAndroid Build Coastguard Worker 183*d5c09012SAndroid Build Coastguard Worker // Output only. If this table was restored from another data source (e.g. a 184*d5c09012SAndroid Build Coastguard Worker // backup), this field will be populated with information about the restore. 185*d5c09012SAndroid Build Coastguard Worker RestoreInfo restore_info = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; 186*d5c09012SAndroid Build Coastguard Worker 187*d5c09012SAndroid Build Coastguard Worker // If specified, enable the change stream on this table. 188*d5c09012SAndroid Build Coastguard Worker // Otherwise, the change stream is disabled and the change stream is not 189*d5c09012SAndroid Build Coastguard Worker // retained. 190*d5c09012SAndroid Build Coastguard Worker ChangeStreamConfig change_stream_config = 8; 191*d5c09012SAndroid Build Coastguard Worker 192*d5c09012SAndroid Build Coastguard Worker // Set to true to make the table protected against data loss. i.e. deleting 193*d5c09012SAndroid Build Coastguard Worker // the following resources through Admin APIs are prohibited: 194*d5c09012SAndroid Build Coastguard Worker // 195*d5c09012SAndroid Build Coastguard Worker // * The table. 196*d5c09012SAndroid Build Coastguard Worker // * The column families in the table. 197*d5c09012SAndroid Build Coastguard Worker // * The instance containing the table. 198*d5c09012SAndroid Build Coastguard Worker // 199*d5c09012SAndroid Build Coastguard Worker // Note one can still delete the data stored in the table through Data APIs. 200*d5c09012SAndroid Build Coastguard Worker bool deletion_protection = 9; 201*d5c09012SAndroid Build Coastguard Worker 202*d5c09012SAndroid Build Coastguard Worker oneof automated_backup_config { 203*d5c09012SAndroid Build Coastguard Worker // If specified, automated backups are enabled for this table. 204*d5c09012SAndroid Build Coastguard Worker // Otherwise, automated backups are disabled. 205*d5c09012SAndroid Build Coastguard Worker AutomatedBackupPolicy automated_backup_policy = 13; 206*d5c09012SAndroid Build Coastguard Worker } 207*d5c09012SAndroid Build Coastguard Worker} 208*d5c09012SAndroid Build Coastguard Worker 209*d5c09012SAndroid Build Coastguard Worker// AuthorizedViews represent subsets of a particular Cloud Bigtable table. Users 210*d5c09012SAndroid Build Coastguard Worker// can configure access to each Authorized View independently from the table and 211*d5c09012SAndroid Build Coastguard Worker// use the existing Data APIs to access the subset of data. 212*d5c09012SAndroid Build Coastguard Workermessage AuthorizedView { 213*d5c09012SAndroid Build Coastguard Worker option (google.api.resource) = { 214*d5c09012SAndroid Build Coastguard Worker type: "bigtableadmin.googleapis.com/AuthorizedView" 215*d5c09012SAndroid Build Coastguard Worker pattern: "projects/{project}/instances/{instance}/tables/{table}/authorizedViews/{authorized_view}" 216*d5c09012SAndroid Build Coastguard Worker plural: "authorizedViews" 217*d5c09012SAndroid Build Coastguard Worker singular: "authorizedView" 218*d5c09012SAndroid Build Coastguard Worker }; 219*d5c09012SAndroid Build Coastguard Worker 220*d5c09012SAndroid Build Coastguard Worker // Subsets of a column family that are included in this AuthorizedView. 221*d5c09012SAndroid Build Coastguard Worker message FamilySubsets { 222*d5c09012SAndroid Build Coastguard Worker // Individual exact column qualifiers to be included in the AuthorizedView. 223*d5c09012SAndroid Build Coastguard Worker repeated bytes qualifiers = 1; 224*d5c09012SAndroid Build Coastguard Worker 225*d5c09012SAndroid Build Coastguard Worker // Prefixes for qualifiers to be included in the AuthorizedView. Every 226*d5c09012SAndroid Build Coastguard Worker // qualifier starting with one of these prefixes is included in the 227*d5c09012SAndroid Build Coastguard Worker // AuthorizedView. To provide access to all qualifiers, include the empty 228*d5c09012SAndroid Build Coastguard Worker // string as a prefix 229*d5c09012SAndroid Build Coastguard Worker // (""). 230*d5c09012SAndroid Build Coastguard Worker repeated bytes qualifier_prefixes = 2; 231*d5c09012SAndroid Build Coastguard Worker } 232*d5c09012SAndroid Build Coastguard Worker 233*d5c09012SAndroid Build Coastguard Worker // Defines a simple AuthorizedView that is a subset of the underlying Table. 234*d5c09012SAndroid Build Coastguard Worker message SubsetView { 235*d5c09012SAndroid Build Coastguard Worker // Row prefixes to be included in the AuthorizedView. 236*d5c09012SAndroid Build Coastguard Worker // To provide access to all rows, include the empty string as a prefix (""). 237*d5c09012SAndroid Build Coastguard Worker repeated bytes row_prefixes = 1; 238*d5c09012SAndroid Build Coastguard Worker 239*d5c09012SAndroid Build Coastguard Worker // Map from column family name to the columns in this family to be included 240*d5c09012SAndroid Build Coastguard Worker // in the AuthorizedView. 241*d5c09012SAndroid Build Coastguard Worker map<string, FamilySubsets> family_subsets = 2; 242*d5c09012SAndroid Build Coastguard Worker } 243*d5c09012SAndroid Build Coastguard Worker 244*d5c09012SAndroid Build Coastguard Worker // Defines a subset of an AuthorizedView's fields. 245*d5c09012SAndroid Build Coastguard Worker enum ResponseView { 246*d5c09012SAndroid Build Coastguard Worker // Uses the default view for each method as documented in the request. 247*d5c09012SAndroid Build Coastguard Worker RESPONSE_VIEW_UNSPECIFIED = 0; 248*d5c09012SAndroid Build Coastguard Worker 249*d5c09012SAndroid Build Coastguard Worker // Only populates `name`. 250*d5c09012SAndroid Build Coastguard Worker NAME_ONLY = 1; 251*d5c09012SAndroid Build Coastguard Worker 252*d5c09012SAndroid Build Coastguard Worker // Only populates the AuthorizedView's basic metadata. This includes: 253*d5c09012SAndroid Build Coastguard Worker // name, deletion_protection, etag. 254*d5c09012SAndroid Build Coastguard Worker BASIC = 2; 255*d5c09012SAndroid Build Coastguard Worker 256*d5c09012SAndroid Build Coastguard Worker // Populates every fields. 257*d5c09012SAndroid Build Coastguard Worker FULL = 3; 258*d5c09012SAndroid Build Coastguard Worker } 259*d5c09012SAndroid Build Coastguard Worker 260*d5c09012SAndroid Build Coastguard Worker // Identifier. The name of this AuthorizedView. 261*d5c09012SAndroid Build Coastguard Worker // Values are of the form 262*d5c09012SAndroid Build Coastguard Worker // `projects/{project}/instances/{instance}/tables/{table}/authorizedViews/{authorized_view}` 263*d5c09012SAndroid Build Coastguard Worker string name = 1 [(google.api.field_behavior) = IDENTIFIER]; 264*d5c09012SAndroid Build Coastguard Worker 265*d5c09012SAndroid Build Coastguard Worker // The type of this AuthorizedView. 266*d5c09012SAndroid Build Coastguard Worker oneof authorized_view { 267*d5c09012SAndroid Build Coastguard Worker // An AuthorizedView permitting access to an explicit subset of a Table. 268*d5c09012SAndroid Build Coastguard Worker SubsetView subset_view = 2; 269*d5c09012SAndroid Build Coastguard Worker } 270*d5c09012SAndroid Build Coastguard Worker 271*d5c09012SAndroid Build Coastguard Worker // The etag for this AuthorizedView. 272*d5c09012SAndroid Build Coastguard Worker // If this is provided on update, it must match the server's etag. The server 273*d5c09012SAndroid Build Coastguard Worker // returns ABORTED error on a mismatched etag. 274*d5c09012SAndroid Build Coastguard Worker string etag = 3; 275*d5c09012SAndroid Build Coastguard Worker 276*d5c09012SAndroid Build Coastguard Worker // Set to true to make the AuthorizedView protected against deletion. 277*d5c09012SAndroid Build Coastguard Worker // The parent Table and containing Instance cannot be deleted if an 278*d5c09012SAndroid Build Coastguard Worker // AuthorizedView has this bit set. 279*d5c09012SAndroid Build Coastguard Worker bool deletion_protection = 4; 280*d5c09012SAndroid Build Coastguard Worker} 281*d5c09012SAndroid Build Coastguard Worker 282*d5c09012SAndroid Build Coastguard Worker// A set of columns within a table which share a common configuration. 283*d5c09012SAndroid Build Coastguard Workermessage ColumnFamily { 284*d5c09012SAndroid Build Coastguard Worker // Garbage collection rule specified as a protobuf. 285*d5c09012SAndroid Build Coastguard Worker // Must serialize to at most 500 bytes. 286*d5c09012SAndroid Build Coastguard Worker // 287*d5c09012SAndroid Build Coastguard Worker // NOTE: Garbage collection executes opportunistically in the background, and 288*d5c09012SAndroid Build Coastguard Worker // so it's possible for reads to return a cell even if it matches the active 289*d5c09012SAndroid Build Coastguard Worker // GC expression for its family. 290*d5c09012SAndroid Build Coastguard Worker GcRule gc_rule = 1; 291*d5c09012SAndroid Build Coastguard Worker 292*d5c09012SAndroid Build Coastguard Worker // The type of data stored in each of this family's cell values, including its 293*d5c09012SAndroid Build Coastguard Worker // full encoding. If omitted, the family only serves raw untyped bytes. 294*d5c09012SAndroid Build Coastguard Worker // 295*d5c09012SAndroid Build Coastguard Worker // For now, only the `Aggregate` type is supported. 296*d5c09012SAndroid Build Coastguard Worker // 297*d5c09012SAndroid Build Coastguard Worker // `Aggregate` can only be set at family creation and is immutable afterwards. 298*d5c09012SAndroid Build Coastguard Worker // 299*d5c09012SAndroid Build Coastguard Worker // 300*d5c09012SAndroid Build Coastguard Worker // If `value_type` is `Aggregate`, written data must be compatible with: 301*d5c09012SAndroid Build Coastguard Worker // * `value_type.input_type` for `AddInput` mutations 302*d5c09012SAndroid Build Coastguard Worker Type value_type = 3; 303*d5c09012SAndroid Build Coastguard Worker} 304*d5c09012SAndroid Build Coastguard Worker 305*d5c09012SAndroid Build Coastguard Worker// Rule for determining which cells to delete during garbage collection. 306*d5c09012SAndroid Build Coastguard Workermessage GcRule { 307*d5c09012SAndroid Build Coastguard Worker // A GcRule which deletes cells matching all of the given rules. 308*d5c09012SAndroid Build Coastguard Worker message Intersection { 309*d5c09012SAndroid Build Coastguard Worker // Only delete cells which would be deleted by every element of `rules`. 310*d5c09012SAndroid Build Coastguard Worker repeated GcRule rules = 1; 311*d5c09012SAndroid Build Coastguard Worker } 312*d5c09012SAndroid Build Coastguard Worker 313*d5c09012SAndroid Build Coastguard Worker // A GcRule which deletes cells matching any of the given rules. 314*d5c09012SAndroid Build Coastguard Worker message Union { 315*d5c09012SAndroid Build Coastguard Worker // Delete cells which would be deleted by any element of `rules`. 316*d5c09012SAndroid Build Coastguard Worker repeated GcRule rules = 1; 317*d5c09012SAndroid Build Coastguard Worker } 318*d5c09012SAndroid Build Coastguard Worker 319*d5c09012SAndroid Build Coastguard Worker // Garbage collection rules. 320*d5c09012SAndroid Build Coastguard Worker oneof rule { 321*d5c09012SAndroid Build Coastguard Worker // Delete all cells in a column except the most recent N. 322*d5c09012SAndroid Build Coastguard Worker int32 max_num_versions = 1; 323*d5c09012SAndroid Build Coastguard Worker 324*d5c09012SAndroid Build Coastguard Worker // Delete cells in a column older than the given age. 325*d5c09012SAndroid Build Coastguard Worker // Values must be at least one millisecond, and will be truncated to 326*d5c09012SAndroid Build Coastguard Worker // microsecond granularity. 327*d5c09012SAndroid Build Coastguard Worker google.protobuf.Duration max_age = 2; 328*d5c09012SAndroid Build Coastguard Worker 329*d5c09012SAndroid Build Coastguard Worker // Delete cells that would be deleted by every nested rule. 330*d5c09012SAndroid Build Coastguard Worker Intersection intersection = 3; 331*d5c09012SAndroid Build Coastguard Worker 332*d5c09012SAndroid Build Coastguard Worker // Delete cells that would be deleted by any nested rule. 333*d5c09012SAndroid Build Coastguard Worker Union union = 4; 334*d5c09012SAndroid Build Coastguard Worker } 335*d5c09012SAndroid Build Coastguard Worker} 336*d5c09012SAndroid Build Coastguard Worker 337*d5c09012SAndroid Build Coastguard Worker// Encryption information for a given resource. 338*d5c09012SAndroid Build Coastguard Worker// If this resource is protected with customer managed encryption, the in-use 339*d5c09012SAndroid Build Coastguard Worker// Cloud Key Management Service (Cloud KMS) key version is specified along with 340*d5c09012SAndroid Build Coastguard Worker// its status. 341*d5c09012SAndroid Build Coastguard Workermessage EncryptionInfo { 342*d5c09012SAndroid Build Coastguard Worker // Possible encryption types for a resource. 343*d5c09012SAndroid Build Coastguard Worker enum EncryptionType { 344*d5c09012SAndroid Build Coastguard Worker // Encryption type was not specified, though data at rest remains encrypted. 345*d5c09012SAndroid Build Coastguard Worker ENCRYPTION_TYPE_UNSPECIFIED = 0; 346*d5c09012SAndroid Build Coastguard Worker 347*d5c09012SAndroid Build Coastguard Worker // The data backing this resource is encrypted at rest with a key that is 348*d5c09012SAndroid Build Coastguard Worker // fully managed by Google. No key version or status will be populated. 349*d5c09012SAndroid Build Coastguard Worker // This is the default state. 350*d5c09012SAndroid Build Coastguard Worker GOOGLE_DEFAULT_ENCRYPTION = 1; 351*d5c09012SAndroid Build Coastguard Worker 352*d5c09012SAndroid Build Coastguard Worker // The data backing this resource is encrypted at rest with a key that is 353*d5c09012SAndroid Build Coastguard Worker // managed by the customer. 354*d5c09012SAndroid Build Coastguard Worker // The in-use version of the key and its status are populated for 355*d5c09012SAndroid Build Coastguard Worker // CMEK-protected tables. 356*d5c09012SAndroid Build Coastguard Worker // CMEK-protected backups are pinned to the key version that was in use at 357*d5c09012SAndroid Build Coastguard Worker // the time the backup was taken. This key version is populated but its 358*d5c09012SAndroid Build Coastguard Worker // status is not tracked and is reported as `UNKNOWN`. 359*d5c09012SAndroid Build Coastguard Worker CUSTOMER_MANAGED_ENCRYPTION = 2; 360*d5c09012SAndroid Build Coastguard Worker } 361*d5c09012SAndroid Build Coastguard Worker 362*d5c09012SAndroid Build Coastguard Worker // Output only. The type of encryption used to protect this resource. 363*d5c09012SAndroid Build Coastguard Worker EncryptionType encryption_type = 3 364*d5c09012SAndroid Build Coastguard Worker [(google.api.field_behavior) = OUTPUT_ONLY]; 365*d5c09012SAndroid Build Coastguard Worker 366*d5c09012SAndroid Build Coastguard Worker // Output only. The status of encrypt/decrypt calls on underlying data for 367*d5c09012SAndroid Build Coastguard Worker // this resource. Regardless of status, the existing data is always encrypted 368*d5c09012SAndroid Build Coastguard Worker // at rest. 369*d5c09012SAndroid Build Coastguard Worker google.rpc.Status encryption_status = 4 370*d5c09012SAndroid Build Coastguard Worker [(google.api.field_behavior) = OUTPUT_ONLY]; 371*d5c09012SAndroid Build Coastguard Worker 372*d5c09012SAndroid Build Coastguard Worker // Output only. The version of the Cloud KMS key specified in the parent 373*d5c09012SAndroid Build Coastguard Worker // cluster that is in use for the data underlying this table. 374*d5c09012SAndroid Build Coastguard Worker string kms_key_version = 2 [ 375*d5c09012SAndroid Build Coastguard Worker (google.api.field_behavior) = OUTPUT_ONLY, 376*d5c09012SAndroid Build Coastguard Worker (google.api.resource_reference) = { 377*d5c09012SAndroid Build Coastguard Worker type: "cloudkms.googleapis.com/CryptoKeyVersion" 378*d5c09012SAndroid Build Coastguard Worker } 379*d5c09012SAndroid Build Coastguard Worker ]; 380*d5c09012SAndroid Build Coastguard Worker} 381*d5c09012SAndroid Build Coastguard Worker 382*d5c09012SAndroid Build Coastguard Worker// A snapshot of a table at a particular time. A snapshot can be used as a 383*d5c09012SAndroid Build Coastguard Worker// checkpoint for data restoration or a data source for a new table. 384*d5c09012SAndroid Build Coastguard Worker// 385*d5c09012SAndroid Build Coastguard Worker// Note: This is a private alpha release of Cloud Bigtable snapshots. This 386*d5c09012SAndroid Build Coastguard Worker// feature is not currently available to most Cloud Bigtable customers. This 387*d5c09012SAndroid Build Coastguard Worker// feature might be changed in backward-incompatible ways and is not recommended 388*d5c09012SAndroid Build Coastguard Worker// for production use. It is not subject to any SLA or deprecation policy. 389*d5c09012SAndroid Build Coastguard Workermessage Snapshot { 390*d5c09012SAndroid Build Coastguard Worker option (google.api.resource) = { 391*d5c09012SAndroid Build Coastguard Worker type: "bigtableadmin.googleapis.com/Snapshot" 392*d5c09012SAndroid Build Coastguard Worker pattern: "projects/{project}/instances/{instance}/clusters/{cluster}/snapshots/{snapshot}" 393*d5c09012SAndroid Build Coastguard Worker }; 394*d5c09012SAndroid Build Coastguard Worker 395*d5c09012SAndroid Build Coastguard Worker // Possible states of a snapshot. 396*d5c09012SAndroid Build Coastguard Worker enum State { 397*d5c09012SAndroid Build Coastguard Worker // The state of the snapshot could not be determined. 398*d5c09012SAndroid Build Coastguard Worker STATE_NOT_KNOWN = 0; 399*d5c09012SAndroid Build Coastguard Worker 400*d5c09012SAndroid Build Coastguard Worker // The snapshot has been successfully created and can serve all requests. 401*d5c09012SAndroid Build Coastguard Worker READY = 1; 402*d5c09012SAndroid Build Coastguard Worker 403*d5c09012SAndroid Build Coastguard Worker // The snapshot is currently being created, and may be destroyed if the 404*d5c09012SAndroid Build Coastguard Worker // creation process encounters an error. A snapshot may not be restored to a 405*d5c09012SAndroid Build Coastguard Worker // table while it is being created. 406*d5c09012SAndroid Build Coastguard Worker CREATING = 2; 407*d5c09012SAndroid Build Coastguard Worker } 408*d5c09012SAndroid Build Coastguard Worker 409*d5c09012SAndroid Build Coastguard Worker // The unique name of the snapshot. 410*d5c09012SAndroid Build Coastguard Worker // Values are of the form 411*d5c09012SAndroid Build Coastguard Worker // `projects/{project}/instances/{instance}/clusters/{cluster}/snapshots/{snapshot}`. 412*d5c09012SAndroid Build Coastguard Worker string name = 1; 413*d5c09012SAndroid Build Coastguard Worker 414*d5c09012SAndroid Build Coastguard Worker // Output only. The source table at the time the snapshot was taken. 415*d5c09012SAndroid Build Coastguard Worker Table source_table = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; 416*d5c09012SAndroid Build Coastguard Worker 417*d5c09012SAndroid Build Coastguard Worker // Output only. The size of the data in the source table at the time the 418*d5c09012SAndroid Build Coastguard Worker // snapshot was taken. In some cases, this value may be computed 419*d5c09012SAndroid Build Coastguard Worker // asynchronously via a background process and a placeholder of 0 will be used 420*d5c09012SAndroid Build Coastguard Worker // in the meantime. 421*d5c09012SAndroid Build Coastguard Worker int64 data_size_bytes = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; 422*d5c09012SAndroid Build Coastguard Worker 423*d5c09012SAndroid Build Coastguard Worker // Output only. The time when the snapshot is created. 424*d5c09012SAndroid Build Coastguard Worker google.protobuf.Timestamp create_time = 4 425*d5c09012SAndroid Build Coastguard Worker [(google.api.field_behavior) = OUTPUT_ONLY]; 426*d5c09012SAndroid Build Coastguard Worker 427*d5c09012SAndroid Build Coastguard Worker // The time when the snapshot will be deleted. The maximum amount of time a 428*d5c09012SAndroid Build Coastguard Worker // snapshot can stay active is 365 days. If 'ttl' is not specified, 429*d5c09012SAndroid Build Coastguard Worker // the default maximum of 365 days will be used. 430*d5c09012SAndroid Build Coastguard Worker google.protobuf.Timestamp delete_time = 5; 431*d5c09012SAndroid Build Coastguard Worker 432*d5c09012SAndroid Build Coastguard Worker // Output only. The current state of the snapshot. 433*d5c09012SAndroid Build Coastguard Worker State state = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; 434*d5c09012SAndroid Build Coastguard Worker 435*d5c09012SAndroid Build Coastguard Worker // Description of the snapshot. 436*d5c09012SAndroid Build Coastguard Worker string description = 7; 437*d5c09012SAndroid Build Coastguard Worker} 438*d5c09012SAndroid Build Coastguard Worker 439*d5c09012SAndroid Build Coastguard Worker// A backup of a Cloud Bigtable table. 440*d5c09012SAndroid Build Coastguard Workermessage Backup { 441*d5c09012SAndroid Build Coastguard Worker option (google.api.resource) = { 442*d5c09012SAndroid Build Coastguard Worker type: "bigtableadmin.googleapis.com/Backup" 443*d5c09012SAndroid Build Coastguard Worker pattern: "projects/{project}/instances/{instance}/clusters/{cluster}/backups/{backup}" 444*d5c09012SAndroid Build Coastguard Worker }; 445*d5c09012SAndroid Build Coastguard Worker 446*d5c09012SAndroid Build Coastguard Worker // Indicates the current state of the backup. 447*d5c09012SAndroid Build Coastguard Worker enum State { 448*d5c09012SAndroid Build Coastguard Worker // Not specified. 449*d5c09012SAndroid Build Coastguard Worker STATE_UNSPECIFIED = 0; 450*d5c09012SAndroid Build Coastguard Worker 451*d5c09012SAndroid Build Coastguard Worker // The pending backup is still being created. Operations on the 452*d5c09012SAndroid Build Coastguard Worker // backup may fail with `FAILED_PRECONDITION` in this state. 453*d5c09012SAndroid Build Coastguard Worker CREATING = 1; 454*d5c09012SAndroid Build Coastguard Worker 455*d5c09012SAndroid Build Coastguard Worker // The backup is complete and ready for use. 456*d5c09012SAndroid Build Coastguard Worker READY = 2; 457*d5c09012SAndroid Build Coastguard Worker } 458*d5c09012SAndroid Build Coastguard Worker 459*d5c09012SAndroid Build Coastguard Worker // A globally unique identifier for the backup which cannot be 460*d5c09012SAndroid Build Coastguard Worker // changed. Values are of the form 461*d5c09012SAndroid Build Coastguard Worker // `projects/{project}/instances/{instance}/clusters/{cluster}/ 462*d5c09012SAndroid Build Coastguard Worker // backups/[_a-zA-Z0-9][-_.a-zA-Z0-9]*` 463*d5c09012SAndroid Build Coastguard Worker // The final segment of the name must be between 1 and 50 characters 464*d5c09012SAndroid Build Coastguard Worker // in length. 465*d5c09012SAndroid Build Coastguard Worker // 466*d5c09012SAndroid Build Coastguard Worker // The backup is stored in the cluster identified by the prefix of the backup 467*d5c09012SAndroid Build Coastguard Worker // name of the form 468*d5c09012SAndroid Build Coastguard Worker // `projects/{project}/instances/{instance}/clusters/{cluster}`. 469*d5c09012SAndroid Build Coastguard Worker string name = 1; 470*d5c09012SAndroid Build Coastguard Worker 471*d5c09012SAndroid Build Coastguard Worker // Required. Immutable. Name of the table from which this backup was created. 472*d5c09012SAndroid Build Coastguard Worker // This needs to be in the same instance as the backup. Values are of the form 473*d5c09012SAndroid Build Coastguard Worker // `projects/{project}/instances/{instance}/tables/{source_table}`. 474*d5c09012SAndroid Build Coastguard Worker string source_table = 2 [ 475*d5c09012SAndroid Build Coastguard Worker (google.api.field_behavior) = IMMUTABLE, 476*d5c09012SAndroid Build Coastguard Worker (google.api.field_behavior) = REQUIRED 477*d5c09012SAndroid Build Coastguard Worker ]; 478*d5c09012SAndroid Build Coastguard Worker 479*d5c09012SAndroid Build Coastguard Worker // Output only. Name of the backup from which this backup was copied. If a 480*d5c09012SAndroid Build Coastguard Worker // backup is not created by copying a backup, this field will be empty. Values 481*d5c09012SAndroid Build Coastguard Worker // are of the form: projects/<project>/instances/<instance>/backups/<backup>. 482*d5c09012SAndroid Build Coastguard Worker string source_backup = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; 483*d5c09012SAndroid Build Coastguard Worker 484*d5c09012SAndroid Build Coastguard Worker // Required. The expiration time of the backup, with microseconds 485*d5c09012SAndroid Build Coastguard Worker // granularity that must be at least 6 hours and at most 90 days 486*d5c09012SAndroid Build Coastguard Worker // from the time the request is received. Once the `expire_time` 487*d5c09012SAndroid Build Coastguard Worker // has passed, Cloud Bigtable will delete the backup and free the 488*d5c09012SAndroid Build Coastguard Worker // resources used by the backup. 489*d5c09012SAndroid Build Coastguard Worker google.protobuf.Timestamp expire_time = 3 490*d5c09012SAndroid Build Coastguard Worker [(google.api.field_behavior) = REQUIRED]; 491*d5c09012SAndroid Build Coastguard Worker 492*d5c09012SAndroid Build Coastguard Worker // Output only. `start_time` is the time that the backup was started 493*d5c09012SAndroid Build Coastguard Worker // (i.e. approximately the time the 494*d5c09012SAndroid Build Coastguard Worker // [CreateBackup][google.bigtable.admin.v2.BigtableTableAdmin.CreateBackup] 495*d5c09012SAndroid Build Coastguard Worker // request is received). The row data in this backup will be no older than 496*d5c09012SAndroid Build Coastguard Worker // this timestamp. 497*d5c09012SAndroid Build Coastguard Worker google.protobuf.Timestamp start_time = 4 498*d5c09012SAndroid Build Coastguard Worker [(google.api.field_behavior) = OUTPUT_ONLY]; 499*d5c09012SAndroid Build Coastguard Worker 500*d5c09012SAndroid Build Coastguard Worker // Output only. `end_time` is the time that the backup was finished. The row 501*d5c09012SAndroid Build Coastguard Worker // data in the backup will be no newer than this timestamp. 502*d5c09012SAndroid Build Coastguard Worker google.protobuf.Timestamp end_time = 5 503*d5c09012SAndroid Build Coastguard Worker [(google.api.field_behavior) = OUTPUT_ONLY]; 504*d5c09012SAndroid Build Coastguard Worker 505*d5c09012SAndroid Build Coastguard Worker // Output only. Size of the backup in bytes. 506*d5c09012SAndroid Build Coastguard Worker int64 size_bytes = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; 507*d5c09012SAndroid Build Coastguard Worker 508*d5c09012SAndroid Build Coastguard Worker // Output only. The current state of the backup. 509*d5c09012SAndroid Build Coastguard Worker State state = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; 510*d5c09012SAndroid Build Coastguard Worker 511*d5c09012SAndroid Build Coastguard Worker // Output only. The encryption information for the backup. 512*d5c09012SAndroid Build Coastguard Worker EncryptionInfo encryption_info = 9 513*d5c09012SAndroid Build Coastguard Worker [(google.api.field_behavior) = OUTPUT_ONLY]; 514*d5c09012SAndroid Build Coastguard Worker} 515*d5c09012SAndroid Build Coastguard Worker 516*d5c09012SAndroid Build Coastguard Worker// Information about a backup. 517*d5c09012SAndroid Build Coastguard Workermessage BackupInfo { 518*d5c09012SAndroid Build Coastguard Worker // Output only. Name of the backup. 519*d5c09012SAndroid Build Coastguard Worker string backup = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; 520*d5c09012SAndroid Build Coastguard Worker 521*d5c09012SAndroid Build Coastguard Worker // Output only. The time that the backup was started. Row data in the backup 522*d5c09012SAndroid Build Coastguard Worker // will be no older than this timestamp. 523*d5c09012SAndroid Build Coastguard Worker google.protobuf.Timestamp start_time = 2 524*d5c09012SAndroid Build Coastguard Worker [(google.api.field_behavior) = OUTPUT_ONLY]; 525*d5c09012SAndroid Build Coastguard Worker 526*d5c09012SAndroid Build Coastguard Worker // Output only. This time that the backup was finished. Row data in the 527*d5c09012SAndroid Build Coastguard Worker // backup will be no newer than this timestamp. 528*d5c09012SAndroid Build Coastguard Worker google.protobuf.Timestamp end_time = 3 529*d5c09012SAndroid Build Coastguard Worker [(google.api.field_behavior) = OUTPUT_ONLY]; 530*d5c09012SAndroid Build Coastguard Worker 531*d5c09012SAndroid Build Coastguard Worker // Output only. Name of the table the backup was created from. 532*d5c09012SAndroid Build Coastguard Worker string source_table = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; 533*d5c09012SAndroid Build Coastguard Worker 534*d5c09012SAndroid Build Coastguard Worker // Output only. Name of the backup from which this backup was copied. If a 535*d5c09012SAndroid Build Coastguard Worker // backup is not created by copying a backup, this field will be empty. Values 536*d5c09012SAndroid Build Coastguard Worker // are of the form: projects/<project>/instances/<instance>/backups/<backup>. 537*d5c09012SAndroid Build Coastguard Worker string source_backup = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; 538*d5c09012SAndroid Build Coastguard Worker} 539*d5c09012SAndroid Build Coastguard Worker 540*d5c09012SAndroid Build Coastguard Worker// Indicates the type of the restore source. 541*d5c09012SAndroid Build Coastguard Workerenum RestoreSourceType { 542*d5c09012SAndroid Build Coastguard Worker // No restore associated. 543*d5c09012SAndroid Build Coastguard Worker RESTORE_SOURCE_TYPE_UNSPECIFIED = 0; 544*d5c09012SAndroid Build Coastguard Worker 545*d5c09012SAndroid Build Coastguard Worker // A backup was used as the source of the restore. 546*d5c09012SAndroid Build Coastguard Worker BACKUP = 1; 547*d5c09012SAndroid Build Coastguard Worker} 548