1 // Copyright 2018 Google LLC.
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
7 // http://www.apache.org/licenses/LICENSE-2.0
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.
18 package google.bigtable.admin.v2;
20 import "google/api/annotations.proto";
21 import "google/protobuf/duration.proto";
22 import "google/protobuf/timestamp.proto";
24 option csharp_namespace = "Google.Cloud.Bigtable.Admin.V2";
25 option go_package = "google.golang.org/genproto/googleapis/bigtable/admin/v2;admin";
26 option java_multiple_files = true;
27 option java_outer_classname = "TableProto";
28 option java_package = "com.google.bigtable.admin.v2";
29 option php_namespace = "Google\\Cloud\\Bigtable\\Admin\\V2";
31 // A collection of user data indexed by row, column, and timestamp.
32 // Each table is served using the resources of its parent cluster.
34 // The state of a table's data in a particular cluster.
35 message ClusterState {
36 // Table replication states.
37 enum ReplicationState {
38 // The replication state of the table is unknown in this cluster.
41 // The cluster was recently created, and the table must finish copying
42 // over pre-existing data from other clusters before it can begin
43 // receiving live replication updates and serving Data API requests.
46 // The table is temporarily unable to serve Data API requests from this
47 // cluster due to planned internal maintenance.
48 PLANNED_MAINTENANCE = 2;
50 // The table is temporarily unable to serve Data API requests from this
51 // cluster due to unplanned or emergency maintenance.
52 UNPLANNED_MAINTENANCE = 3;
54 // The table can serve Data API requests from this cluster. Depending on
55 // replication delay, reads may not immediately reflect the state of the
56 // table in other clusters.
61 // The state of replication for the table in this cluster.
62 ReplicationState replication_state = 1;
65 // Possible timestamp granularities to use when keeping multiple versions
66 // of data in a table.
67 enum TimestampGranularity {
68 // The user did not specify a granularity. Should not be returned.
69 // When specified during table creation, MILLIS will be used.
70 TIMESTAMP_GRANULARITY_UNSPECIFIED = 0;
72 // The table keeps data versioned at a granularity of 1ms.
76 // Defines a view over a table's fields.
78 // Uses the default view for each method as documented in its request.
81 // Only populates `name`.
84 // Only populates `name` and fields related to the table's schema.
87 // Only populates `name` and fields related to the table's
91 // Populates all fields.
96 // The unique name of the table. Values are of the form
97 // `projects/<project>/instances/<instance>/tables/[_a-zA-Z0-9][-_.a-zA-Z0-9]*`.
98 // Views: `NAME_ONLY`, `SCHEMA_VIEW`, `REPLICATION_VIEW`, `FULL`
102 // Map from cluster ID to per-cluster table state.
103 // If it could not be determined whether or not the table has data in a
104 // particular cluster (for example, if its zone is unavailable), then
105 // there will be an entry for the cluster with UNKNOWN `replication_status`.
106 // Views: `REPLICATION_VIEW`, `FULL`
107 map<string, ClusterState> cluster_states = 2;
110 // The column families configured for this table, mapped by column family ID.
111 // Views: `SCHEMA_VIEW`, `FULL`
112 map<string, ColumnFamily> column_families = 3;
115 // The granularity (i.e. `MILLIS`) at which timestamps are stored in
116 // this table. Timestamps not matching the granularity will be rejected.
117 // If unspecified at creation time, the value will be set to `MILLIS`.
118 // Views: `SCHEMA_VIEW`, `FULL`
119 TimestampGranularity granularity = 4;
122 // A set of columns within a table which share a common configuration.
123 message ColumnFamily {
124 // Garbage collection rule specified as a protobuf.
125 // Must serialize to at most 500 bytes.
127 // NOTE: Garbage collection executes opportunistically in the background, and
128 // so it's possible for reads to return a cell even if it matches the active
129 // GC expression for its family.
133 // Rule for determining which cells to delete during garbage collection.
135 // A GcRule which deletes cells matching all of the given rules.
136 message Intersection {
137 // Only delete cells which would be deleted by every element of `rules`.
138 repeated GcRule rules = 1;
141 // A GcRule which deletes cells matching any of the given rules.
143 // Delete cells which would be deleted by any element of `rules`.
144 repeated GcRule rules = 1;
147 // Garbage collection rules.
149 // Delete all cells in a column except the most recent N.
150 int32 max_num_versions = 1;
152 // Delete cells in a column older than the given age.
153 // Values must be at least one millisecond, and will be truncated to
154 // microsecond granularity.
155 google.protobuf.Duration max_age = 2;
157 // Delete cells that would be deleted by every nested rule.
158 Intersection intersection = 3;
160 // Delete cells that would be deleted by any nested rule.
165 // A snapshot of a table at a particular time. A snapshot can be used as a
166 // checkpoint for data restoration or a data source for a new table.
168 // Note: This is a private alpha release of Cloud Bigtable snapshots. This
169 // feature is not currently available to most Cloud Bigtable customers. This
170 // feature might be changed in backward-incompatible ways and is not recommended
171 // for production use. It is not subject to any SLA or deprecation policy.
173 // Possible states of a snapshot.
175 // The state of the snapshot could not be determined.
178 // The snapshot has been successfully created and can serve all requests.
181 // The snapshot is currently being created, and may be destroyed if the
182 // creation process encounters an error. A snapshot may not be restored to a
183 // table while it is being created.
188 // The unique name of the snapshot.
189 // Values are of the form
190 // `projects/<project>/instances/<instance>/clusters/<cluster>/snapshots/<snapshot>`.
194 // The source table at the time the snapshot was taken.
195 Table source_table = 2;
198 // The size of the data in the source table at the time the snapshot was
199 // taken. In some cases, this value may be computed asynchronously via a
200 // background process and a placeholder of 0 will be used in the meantime.
201 int64 data_size_bytes = 3;
204 // The time when the snapshot is created.
205 google.protobuf.Timestamp create_time = 4;
208 // The time when the snapshot will be deleted. The maximum amount of time a
209 // snapshot can stay active is 365 days. If 'ttl' is not specified,
210 // the default maximum of 365 days will be used.
211 google.protobuf.Timestamp delete_time = 5;
214 // The current state of the snapshot.
218 // Description of the snapshot.
219 string description = 7;