Built motion from commit 6a09e18b.|2.6.11
[motion2.git] / legacy-libs / google-proto-files / google / bigtable / admin / v2 / table.proto
1 // Copyright 2018 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 //
15
16 syntax = "proto3";
17
18 package google.bigtable.admin.v2;
19
20 import "google/api/annotations.proto";
21 import "google/protobuf/duration.proto";
22 import "google/protobuf/timestamp.proto";
23
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";
30
31 // A collection of user data indexed by row, column, and timestamp.
32 // Each table is served using the resources of its parent cluster.
33 message Table {
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.
39       STATE_NOT_KNOWN = 0;
40
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.
44       INITIALIZING = 1;
45
46       // The table is temporarily unable to serve Data API requests from this
47       // cluster due to planned internal maintenance.
48       PLANNED_MAINTENANCE = 2;
49
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;
53
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.
57       READY = 4;
58     }
59
60     // (`OutputOnly`)
61     // The state of replication for the table in this cluster.
62     ReplicationState replication_state = 1;
63   }
64
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;
71
72     // The table keeps data versioned at a granularity of 1ms.
73     MILLIS = 1;
74   }
75
76   // Defines a view over a table's fields.
77   enum View {
78     // Uses the default view for each method as documented in its request.
79     VIEW_UNSPECIFIED = 0;
80
81     // Only populates `name`.
82     NAME_ONLY = 1;
83
84     // Only populates `name` and fields related to the table's schema.
85     SCHEMA_VIEW = 2;
86
87     // Only populates `name` and fields related to the table's
88     // replication state.
89     REPLICATION_VIEW = 3;
90
91     // Populates all fields.
92     FULL = 4;
93   }
94
95   // (`OutputOnly`)
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`
99   string name = 1;
100
101   // (`OutputOnly`)
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;
108
109   // (`CreationOnly`)
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;
113
114   // (`CreationOnly`)
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;
120 }
121
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.
126   //
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.
130   GcRule gc_rule = 1;
131 }
132
133 // Rule for determining which cells to delete during garbage collection.
134 message GcRule {
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;
139   }
140
141   // A GcRule which deletes cells matching any of the given rules.
142   message Union {
143     // Delete cells which would be deleted by any element of `rules`.
144     repeated GcRule rules = 1;
145   }
146
147   // Garbage collection rules.
148   oneof rule {
149     // Delete all cells in a column except the most recent N.
150     int32 max_num_versions = 1;
151
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;
156
157     // Delete cells that would be deleted by every nested rule.
158     Intersection intersection = 3;
159
160     // Delete cells that would be deleted by any nested rule.
161     Union union = 4;
162   }
163 }
164
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.
167 //
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.
172 message Snapshot {
173   // Possible states of a snapshot.
174   enum State {
175     // The state of the snapshot could not be determined.
176     STATE_NOT_KNOWN = 0;
177
178     // The snapshot has been successfully created and can serve all requests.
179     READY = 1;
180
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.
184     CREATING = 2;
185   }
186
187   // (`OutputOnly`)
188   // The unique name of the snapshot.
189   // Values are of the form
190   // `projects/<project>/instances/<instance>/clusters/<cluster>/snapshots/<snapshot>`.
191   string name = 1;
192
193   // (`OutputOnly`)
194   // The source table at the time the snapshot was taken.
195   Table source_table = 2;
196
197   // (`OutputOnly`)
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;
202
203   // (`OutputOnly`)
204   // The time when the snapshot is created.
205   google.protobuf.Timestamp create_time = 4;
206
207   // (`OutputOnly`)
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;
212
213   // (`OutputOnly`)
214   // The current state of the snapshot.
215   State state = 6;
216
217   // (`OutputOnly`)
218   // Description of the snapshot.
219   string description = 7;
220 }