Skip to content

Commit b98fe7f

Browse files
Google APIscopybara-github
authored andcommitted
feat: Cloud Bigtable Authorized Views admin APIs protos
PiperOrigin-RevId: 612537460
1 parent ea71fd4 commit b98fe7f

3 files changed

Lines changed: 285 additions & 0 deletions

File tree

google/bigtable/admin/v2/bigtable_table_admin.proto

Lines changed: 210 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,61 @@ service BigtableTableAdmin {
136136
};
137137
}
138138

139+
// Creates a new AuthorizedView in a table.
140+
rpc CreateAuthorizedView(CreateAuthorizedViewRequest)
141+
returns (google.longrunning.Operation) {
142+
option (google.api.http) = {
143+
post: "/v2/{parent=projects/*/instances/*/tables/*}/authorizedViews"
144+
body: "authorized_view"
145+
};
146+
option (google.api.method_signature) =
147+
"parent,authorized_view,authorized_view_id";
148+
option (google.longrunning.operation_info) = {
149+
response_type: "AuthorizedView"
150+
metadata_type: "CreateAuthorizedViewMetadata"
151+
};
152+
}
153+
154+
// Lists all AuthorizedViews from a specific table.
155+
rpc ListAuthorizedViews(ListAuthorizedViewsRequest)
156+
returns (ListAuthorizedViewsResponse) {
157+
option (google.api.http) = {
158+
get: "/v2/{parent=projects/*/instances/*/tables/*}/authorizedViews"
159+
};
160+
option (google.api.method_signature) = "parent";
161+
}
162+
163+
// Gets information from a specified AuthorizedView.
164+
rpc GetAuthorizedView(GetAuthorizedViewRequest) returns (AuthorizedView) {
165+
option (google.api.http) = {
166+
get: "/v2/{name=projects/*/instances/*/tables/*/authorizedViews/*}"
167+
};
168+
option (google.api.method_signature) = "name";
169+
}
170+
171+
// Updates an AuthorizedView in a table.
172+
rpc UpdateAuthorizedView(UpdateAuthorizedViewRequest)
173+
returns (google.longrunning.Operation) {
174+
option (google.api.http) = {
175+
patch: "/v2/{authorized_view.name=projects/*/instances/*/tables/*/authorizedViews/*}"
176+
body: "authorized_view"
177+
};
178+
option (google.api.method_signature) = "authorized_view,update_mask";
179+
option (google.longrunning.operation_info) = {
180+
response_type: "AuthorizedView"
181+
metadata_type: "UpdateAuthorizedViewMetadata"
182+
};
183+
}
184+
185+
// Permanently deletes a specified AuthorizedView.
186+
rpc DeleteAuthorizedView(DeleteAuthorizedViewRequest)
187+
returns (google.protobuf.Empty) {
188+
option (google.api.http) = {
189+
delete: "/v2/{name=projects/*/instances/*/tables/*/authorizedViews/*}"
190+
};
191+
option (google.api.method_signature) = "name";
192+
}
193+
139194
// Performs a series of column family modifications on the specified table.
140195
// Either all or none of the modifications will occur before this method
141196
// returns, but data requests received prior to that point may see a table
@@ -1194,3 +1249,158 @@ message CopyBackupMetadata {
11941249
// operation.
11951250
OperationProgress progress = 3;
11961251
}
1252+
1253+
// The request for
1254+
// [CreateAuthorizedView][google.bigtable.admin.v2.BigtableTableAdmin.CreateAuthorizedView]
1255+
message CreateAuthorizedViewRequest {
1256+
// Required. This is the name of the table the AuthorizedView belongs to.
1257+
// Values are of the form
1258+
// `projects/{project}/instances/{instance}/tables/{table}`.
1259+
string parent = 1 [
1260+
(google.api.field_behavior) = REQUIRED,
1261+
(google.api.resource_reference) = {
1262+
child_type: "bigtableadmin.googleapis.com/AuthorizedView"
1263+
}
1264+
];
1265+
1266+
// Required. The id of the AuthorizedView to create. This AuthorizedView must
1267+
// not already exist. The `authorized_view_id` appended to `parent` forms the
1268+
// full AuthorizedView name of the form
1269+
// `projects/{project}/instances/{instance}/tables/{table}/authorizedView/{authorized_view}`.
1270+
string authorized_view_id = 2 [(google.api.field_behavior) = REQUIRED];
1271+
1272+
// Required. The AuthorizedView to create.
1273+
AuthorizedView authorized_view = 3 [(google.api.field_behavior) = REQUIRED];
1274+
}
1275+
1276+
// The metadata for the Operation returned by CreateAuthorizedView.
1277+
message CreateAuthorizedViewMetadata {
1278+
// The request that prompted the initiation of this CreateInstance operation.
1279+
CreateAuthorizedViewRequest original_request = 1;
1280+
1281+
// The time at which the original request was received.
1282+
google.protobuf.Timestamp request_time = 2;
1283+
1284+
// The time at which the operation failed or was completed successfully.
1285+
google.protobuf.Timestamp finish_time = 3;
1286+
}
1287+
1288+
// Request message for
1289+
// [google.bigtable.admin.v2.BigtableTableAdmin.ListAuthorizedViews][google.bigtable.admin.v2.BigtableTableAdmin.ListAuthorizedViews]
1290+
message ListAuthorizedViewsRequest {
1291+
// Required. The unique name of the table for which AuthorizedViews should be
1292+
// listed. Values are of the form
1293+
// `projects/{project}/instances/{instance}/tables/{table}`.
1294+
string parent = 1 [
1295+
(google.api.field_behavior) = REQUIRED,
1296+
(google.api.resource_reference) = {
1297+
child_type: "bigtableadmin.googleapis.com/AuthorizedView"
1298+
}
1299+
];
1300+
1301+
// Optional. Maximum number of results per page.
1302+
//
1303+
// A page_size of zero lets the server choose the number of items to return.
1304+
// A page_size which is strictly positive will return at most that many items.
1305+
// A negative page_size will cause an error.
1306+
//
1307+
// Following the first request, subsequent paginated calls are not required
1308+
// to pass a page_size. If a page_size is set in subsequent calls, it must
1309+
// match the page_size given in the first request.
1310+
int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL];
1311+
1312+
// Optional. The value of `next_page_token` returned by a previous call.
1313+
string page_token = 3 [(google.api.field_behavior) = OPTIONAL];
1314+
1315+
// Optional. The resource_view to be applied to the returned views' fields.
1316+
// Default to NAME_ONLY.
1317+
AuthorizedView.ResponseView view = 4 [(google.api.field_behavior) = OPTIONAL];
1318+
}
1319+
1320+
// Response message for
1321+
// [google.bigtable.admin.v2.BigtableTableAdmin.ListAuthorizedViews][google.bigtable.admin.v2.BigtableTableAdmin.ListAuthorizedViews]
1322+
message ListAuthorizedViewsResponse {
1323+
// The AuthorizedViews present in the requested table.
1324+
repeated AuthorizedView authorized_views = 1;
1325+
1326+
// Set if not all tables could be returned in a single response.
1327+
// Pass this value to `page_token` in another request to get the next
1328+
// page of results.
1329+
string next_page_token = 2;
1330+
}
1331+
1332+
// Request message for
1333+
// [google.bigtable.admin.v2.BigtableTableAdmin.GetAuthorizedView][google.bigtable.admin.v2.BigtableTableAdmin.GetAuthorizedView]
1334+
message GetAuthorizedViewRequest {
1335+
// Required. The unique name of the requested AuthorizedView.
1336+
// Values are of the form
1337+
// `projects/{project}/instances/{instance}/tables/{table}/authorizedViews/{authorized_view}`.
1338+
string name = 1 [
1339+
(google.api.field_behavior) = REQUIRED,
1340+
(google.api.resource_reference) = {
1341+
type: "bigtableadmin.googleapis.com/AuthorizedView"
1342+
}
1343+
];
1344+
1345+
// Optional. The resource_view to be applied to the returned AuthorizedView's
1346+
// fields. Default to BASIC.
1347+
AuthorizedView.ResponseView view = 2 [(google.api.field_behavior) = OPTIONAL];
1348+
}
1349+
1350+
// The request for
1351+
// [UpdateAuthorizedView][google.bigtable.admin.v2.BigtableTableAdmin.UpdateAuthorizedView].
1352+
message UpdateAuthorizedViewRequest {
1353+
// Required. The AuthorizedView to update. The `name` in `authorized_view` is
1354+
// used to identify the AuthorizedView. AuthorizedView name must in this
1355+
// format
1356+
// projects/<project>/instances/<instance>/tables/<table>/authorizedViews/<authorized_view>
1357+
AuthorizedView authorized_view = 1 [(google.api.field_behavior) = REQUIRED];
1358+
1359+
// Optional. The list of fields to update.
1360+
// A mask specifying which fields in the AuthorizedView resource should be
1361+
// updated. This mask is relative to the AuthorizedView resource, not to the
1362+
// request message. A field will be overwritten if it is in the mask. If
1363+
// empty, all fields set in the request will be overwritten. A special value
1364+
// `*` means to overwrite all fields (including fields not set in the
1365+
// request).
1366+
google.protobuf.FieldMask update_mask = 2
1367+
[(google.api.field_behavior) = OPTIONAL];
1368+
1369+
// Optional. If true, ignore the safety checks when updating the
1370+
// AuthorizedView.
1371+
bool ignore_warnings = 3 [(google.api.field_behavior) = OPTIONAL];
1372+
}
1373+
1374+
// Metadata for the google.longrunning.Operation returned by
1375+
// [UpdateAuthorizedView][google.bigtable.admin.v2.BigtableTableAdmin.UpdateAuthorizedView].
1376+
message UpdateAuthorizedViewMetadata {
1377+
// The request that prompted the initiation of this UpdateAuthorizedView
1378+
// operation.
1379+
UpdateAuthorizedViewRequest original_request = 1;
1380+
1381+
// The time at which the original request was received.
1382+
google.protobuf.Timestamp request_time = 2;
1383+
1384+
// The time at which the operation failed or was completed successfully.
1385+
google.protobuf.Timestamp finish_time = 3;
1386+
}
1387+
1388+
// Request message for
1389+
// [google.bigtable.admin.v2.BigtableTableAdmin.DeleteAuthorizedView][google.bigtable.admin.v2.BigtableTableAdmin.DeleteAuthorizedView]
1390+
message DeleteAuthorizedViewRequest {
1391+
// Required. The unique name of the AuthorizedView to be deleted.
1392+
// Values are of the form
1393+
// `projects/{project}/instances/{instance}/tables/{table}/authorizedViews/{authorized_view}`.
1394+
string name = 1 [
1395+
(google.api.field_behavior) = REQUIRED,
1396+
(google.api.resource_reference) = {
1397+
type: "bigtableadmin.googleapis.com/AuthorizedView"
1398+
}
1399+
];
1400+
1401+
// Optional. The current etag of the AuthorizedView.
1402+
// If an etag is provided and does not match the current etag of the
1403+
// AuthorizedView, deletion will be blocked and an ABORTED error will be
1404+
// returned.
1405+
string etag = 2 [(google.api.field_behavior) = OPTIONAL];
1406+
}

google/bigtable/admin/v2/bigtableadmin_v2.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ apis:
1010
types:
1111
- name: google.bigtable.admin.v2.Backup
1212
- name: google.bigtable.admin.v2.CopyBackupMetadata
13+
- name: google.bigtable.admin.v2.CreateAuthorizedViewMetadata
1314
- name: google.bigtable.admin.v2.CreateBackupMetadata
1415
- name: google.bigtable.admin.v2.CreateClusterMetadata
1516
- name: google.bigtable.admin.v2.CreateInstanceMetadata
@@ -20,6 +21,7 @@ types:
2021
- name: google.bigtable.admin.v2.SnapshotTableMetadata
2122
- name: google.bigtable.admin.v2.UndeleteTableMetadata
2223
- name: google.bigtable.admin.v2.UpdateAppProfileMetadata
24+
- name: google.bigtable.admin.v2.UpdateAuthorizedViewMetadata
2325
- name: google.bigtable.admin.v2.UpdateClusterMetadata
2426
- name: google.bigtable.admin.v2.UpdateInstanceMetadata
2527
- name: google.bigtable.admin.v2.UpdateTableMetadata

google/bigtable/admin/v2/table.proto

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,79 @@ message Table {
186186
bool deletion_protection = 9;
187187
}
188188

189+
// AuthorizedViews represent subsets of a particular Cloud Bigtable table. Users
190+
// can configure access to each Authorized View independently from the table and
191+
// use the existing Data APIs to access the subset of data.
192+
message AuthorizedView {
193+
option (google.api.resource) = {
194+
type: "bigtableadmin.googleapis.com/AuthorizedView"
195+
pattern: "projects/{project}/instances/{instance}/tables/{table}/authorizedViews/{authorized_view}"
196+
plural: "authorizedViews"
197+
singular: "authorizedView"
198+
};
199+
200+
// Subsets of a column family that are included in this AuthorizedView.
201+
message FamilySubsets {
202+
// Individual exact column qualifiers to be included in the AuthorizedView.
203+
repeated bytes qualifiers = 1;
204+
205+
// Prefixes for qualifiers to be included in the AuthorizedView. Every
206+
// qualifier starting with one of these prefixes is included in the
207+
// AuthorizedView. To provide access to all qualifiers, include the empty
208+
// string as a prefix
209+
// ("").
210+
repeated bytes qualifier_prefixes = 2;
211+
}
212+
213+
// Defines a simple AuthorizedView that is a subset of the underlying Table.
214+
message SubsetView {
215+
// Row prefixes to be included in the AuthorizedView.
216+
// To provide access to all rows, include the empty string as a prefix ("").
217+
repeated bytes row_prefixes = 1;
218+
219+
// Map from column family name to the columns in this family to be included
220+
// in the AuthorizedView.
221+
map<string, FamilySubsets> family_subsets = 2;
222+
}
223+
224+
// Defines a subset of an AuthorizedView's fields.
225+
enum ResponseView {
226+
// Uses the default view for each method as documented in the request.
227+
RESPONSE_VIEW_UNSPECIFIED = 0;
228+
229+
// Only populates `name`.
230+
NAME_ONLY = 1;
231+
232+
// Only populates the AuthorizedView's basic metadata. This includes:
233+
// name, deletion_protection, etag.
234+
BASIC = 2;
235+
236+
// Populates every fields.
237+
FULL = 3;
238+
}
239+
240+
// Identifier. The name of this AuthorizedView.
241+
// Values are of the form
242+
// `projects/{project}/instances/{instance}/tables/{table}/authorizedViews/{authorized_view}`
243+
string name = 1 [(google.api.field_behavior) = IDENTIFIER];
244+
245+
// The type of this AuthorizedView.
246+
oneof authorized_view {
247+
// An AuthorizedView permitting access to an explicit subset of a Table.
248+
SubsetView subset_view = 2;
249+
}
250+
251+
// The etag for this AuthorizedView.
252+
// If this is provided on update, it must match the server's etag. The server
253+
// returns ABORTED error on a mismatched etag.
254+
string etag = 3;
255+
256+
// Set to true to make the AuthorizedView protected against deletion.
257+
// The parent Table and containing Instance cannot be deleted if an
258+
// AuthorizedView has this bit set.
259+
bool deletion_protection = 4;
260+
}
261+
189262
// A set of columns within a table which share a common configuration.
190263
message ColumnFamily {
191264
// Garbage collection rule specified as a protobuf.

0 commit comments

Comments
 (0)