feat: add MaterializedViews and LogicalViews APIs

PiperOrigin-RevId: 733101782
master
Google APIs 1 week ago committed by Copybara-Service
parent cd8473077f
commit 05f571eb75
  1. 118
      google/bigtable/admin/v2/bigtable_instance_admin.proto
  2. 3
      google/bigtable/admin/v2/bigtableadmin_v2.yaml
  3. 97
      google/bigtable/admin/v2/instance.proto

@ -252,6 +252,7 @@ service BigtableInstanceAdmin {
delete: "/v2/{name=projects/*/instances/*/appProfiles/*}"
};
option (google.api.method_signature) = "name";
option (google.api.method_signature) = "name,ignore_warnings";
}
// Gets the access control policy for an instance resource. Returns an empty
@ -261,6 +262,14 @@ service BigtableInstanceAdmin {
option (google.api.http) = {
post: "/v2/{resource=projects/*/instances/*}:getIamPolicy"
body: "*"
additional_bindings {
post: "/v2/{resource=projects/*/instances/*/materializedViews/*}:getIamPolicy"
body: "*"
}
additional_bindings {
post: "/v2/{resource=projects/*/instances/*/logicalViews/*}:getIamPolicy"
body: "*"
}
};
option (google.api.method_signature) = "resource";
}
@ -272,6 +281,14 @@ service BigtableInstanceAdmin {
option (google.api.http) = {
post: "/v2/{resource=projects/*/instances/*}:setIamPolicy"
body: "*"
additional_bindings {
post: "/v2/{resource=projects/*/instances/*/materializedViews/*}:setIamPolicy"
body: "*"
}
additional_bindings {
post: "/v2/{resource=projects/*/instances/*/logicalViews/*}:setIamPolicy"
body: "*"
}
};
option (google.api.method_signature) = "resource,policy";
}
@ -282,6 +299,14 @@ service BigtableInstanceAdmin {
option (google.api.http) = {
post: "/v2/{resource=projects/*/instances/*}:testIamPermissions"
body: "*"
additional_bindings {
post: "/v2/{resource=projects/*/instances/*/materializedViews/*}:testIamPermissions"
body: "*"
}
additional_bindings {
post: "/v2/{resource=projects/*/instances/*/logicalViews/*}:testIamPermissions"
body: "*"
}
};
option (google.api.method_signature) = "resource,permissions";
}
@ -320,7 +345,6 @@ message CreateInstanceRequest {
// cluster ID, e.g., just `mycluster` rather than
// `projects/myproject/instances/myinstance/clusters/mycluster`.
// Fields marked `OutputOnly` must be left blank.
// Currently, at most four clusters can be specified.
map<string, Cluster> clusters = 4 [(google.api.field_behavior) = REQUIRED];
}
@ -749,3 +773,95 @@ message ListHotTabletsResponse {
// page of results.
string next_page_token = 2;
}
// Request message for BigtableInstanceAdmin.CreateLogicalView.
message CreateLogicalViewRequest {
// Required. The parent instance where this logical view will be created.
// Format: `projects/{project}/instances/{instance}`.
string parent = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "bigtableadmin.googleapis.com/Instance"
}
];
// Required. The ID to use for the logical view, which will become the final
// component of the logical view's resource name.
string logical_view_id = 2 [(google.api.field_behavior) = REQUIRED];
// Required. The logical view to create.
LogicalView logical_view = 3 [(google.api.field_behavior) = REQUIRED];
}
// The metadata for the Operation returned by CreateLogicalView.
message CreateLogicalViewMetadata {
// The request that prompted the initiation of this CreateLogicalView
// operation.
CreateLogicalViewRequest original_request = 1;
// The time at which this operation started.
google.protobuf.Timestamp start_time = 2;
// If set, the time at which this operation finished or was canceled.
google.protobuf.Timestamp end_time = 3;
}
// Request message for BigtableInstanceAdmin.UpdateLogicalView.
message UpdateLogicalViewRequest {
// Required. The logical view to update.
//
// The logical view's `name` field is used to identify the view to update.
// Format:
// `projects/{project}/instances/{instance}/logicalViews/{logical_view}`.
LogicalView logical_view = 1 [(google.api.field_behavior) = REQUIRED];
// Optional. The list of fields to update.
google.protobuf.FieldMask update_mask = 2
[(google.api.field_behavior) = OPTIONAL];
}
// The metadata for the Operation returned by UpdateLogicalView.
message UpdateLogicalViewMetadata {
// The request that prompted the initiation of this UpdateLogicalView
// operation.
UpdateLogicalViewRequest original_request = 1;
// The time at which this operation was started.
google.protobuf.Timestamp start_time = 2;
// If set, the time at which this operation finished or was canceled.
google.protobuf.Timestamp end_time = 3;
}
// Request message for BigtableInstanceAdmin.CreateMaterializedView.
message CreateMaterializedViewRequest {
// Required. The parent instance where this materialized view will be created.
// Format: `projects/{project}/instances/{instance}`.
string parent = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "bigtableadmin.googleapis.com/Instance"
}
];
// Required. The ID to use for the materialized view, which will become the
// final component of the materialized view's resource name.
string materialized_view_id = 2 [(google.api.field_behavior) = REQUIRED];
// Required. The materialized view to create.
MaterializedView materialized_view = 3
[(google.api.field_behavior) = REQUIRED];
}
// The metadata for the Operation returned by CreateMaterializedView.
message CreateMaterializedViewMetadata {
// The request that prompted the initiation of this CreateMaterializedView
// operation.
CreateMaterializedViewRequest original_request = 1;
// The time at which this operation started.
google.protobuf.Timestamp start_time = 2;
// If set, the time at which this operation finished or was canceled.
google.protobuf.Timestamp end_time = 3;
}

@ -14,6 +14,8 @@ types:
- name: google.bigtable.admin.v2.CreateBackupMetadata
- name: google.bigtable.admin.v2.CreateClusterMetadata
- name: google.bigtable.admin.v2.CreateInstanceMetadata
- name: google.bigtable.admin.v2.CreateLogicalViewMetadata
- name: google.bigtable.admin.v2.CreateMaterializedViewMetadata
- name: google.bigtable.admin.v2.CreateTableFromSnapshotMetadata
- name: google.bigtable.admin.v2.OptimizeRestoredTableMetadata
- name: google.bigtable.admin.v2.PartialUpdateClusterMetadata
@ -24,6 +26,7 @@ types:
- name: google.bigtable.admin.v2.UpdateAuthorizedViewMetadata
- name: google.bigtable.admin.v2.UpdateClusterMetadata
- name: google.bigtable.admin.v2.UpdateInstanceMetadata
- name: google.bigtable.admin.v2.UpdateLogicalViewMetadata
- name: google.bigtable.admin.v2.UpdateTableMetadata
documentation:

@ -41,6 +41,8 @@ message Instance {
option (google.api.resource) = {
type: "bigtableadmin.googleapis.com/Instance"
pattern: "projects/{project}/instances/{instance}"
plural: "instances"
singular: "instance"
};
// Possible states of an instance.
@ -82,9 +84,8 @@ message Instance {
// to avoid confusion.
string display_name = 2 [(google.api.field_behavior) = REQUIRED];
// (`OutputOnly`)
// The current state of the instance.
State state = 3;
// Output only. The current state of the instance.
State state = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
// The type of the instance. Defaults to `PRODUCTION`.
Type type = 4;
@ -102,14 +103,17 @@ message Instance {
// * Keys and values must both be under 128 bytes.
map<string, string> labels = 5;
// Output only. A server-assigned timestamp representing when this Instance
// was created. For instances created before this field was added (August
// 2021), this value is `seconds: 0, nanos: 1`.
// Output only. A commit timestamp representing when this Instance was
// created. For instances created before this field was added (August 2021),
// this value is `seconds: 0, nanos: 1`.
google.protobuf.Timestamp create_time = 7
[(google.api.field_behavior) = OUTPUT_ONLY];
// Output only. Reserved for future use.
optional bool satisfies_pzs = 8 [(google.api.field_behavior) = OUTPUT_ONLY];
// Output only. Reserved for future use.
optional bool satisfies_pzi = 11 [(google.api.field_behavior) = OUTPUT_ONLY];
}
// The Autoscaling targets for a Cluster. These determine the recommended nodes.
@ -145,6 +149,8 @@ message Cluster {
option (google.api.resource) = {
type: "bigtableadmin.googleapis.com/Cluster"
pattern: "projects/{project}/instances/{instance}/clusters/{cluster}"
plural: "clusters"
singular: "cluster"
};
// Possible states of a cluster.
@ -214,7 +220,6 @@ message Cluster {
// `cloudkms.cryptoKeyEncrypterDecrypter` role on the CMEK key.
// 2) Only regional keys can be used and the region of the CMEK key must
// match the region of the cluster.
// 3) All clusters within an instance must use the same CMEK key.
// Values are of the form
// `projects/{project}/locations/{location}/keyRings/{keyring}/cryptoKeys/{key}`
string kms_key_name = 1 [(google.api.resource_reference) = {
@ -240,8 +245,9 @@ message Cluster {
// Output only. The current state of the cluster.
State state = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
// The number of nodes allocated to this cluster. More nodes enable higher
// throughput and more consistent performance.
// The number of nodes in the cluster. If no value is set,
// Cloud Bigtable automatically allocates nodes based on your data footprint
// and optimized for 50% storage utilization.
int32 serve_nodes = 4;
// Immutable. The node scaling factor of this cluster.
@ -269,6 +275,8 @@ message AppProfile {
option (google.api.resource) = {
type: "bigtableadmin.googleapis.com/AppProfile"
pattern: "projects/{project}/instances/{instance}/appProfiles/{app_profile}"
plural: "appProfiles"
singular: "appProfile"
};
// Read/write requests are routed to the nearest cluster in the instance, and
@ -342,17 +350,10 @@ message AppProfile {
}
// Data Boost is a serverless compute capability that lets you run
// high-throughput read jobs on your Bigtable data, without impacting the
// performance of the clusters that handle your application traffic.
// Currently, Data Boost exclusively supports read-only use-cases with
// single-cluster routing.
//
// Data Boost reads are only guaranteed to see the results of writes that
// were written at least 30 minutes ago. This means newly written values may
// not become visible for up to 30m, and also means that old values may
// remain visible for up to 30m after being deleted or overwritten. To
// mitigate the staleness of the data, users may either wait 30m, or use
// CheckConsistency.
// high-throughput read jobs and queries on your Bigtable data, without
// impacting the performance of the clusters that handle your application
// traffic. Data Boost supports read-only use cases with single-cluster
// routing.
message DataBoostIsolationReadOnly {
// Compute Billing Owner specifies how usage should be accounted when using
// Data Boost. Compute Billing Owner also configures which Cloud Project is
@ -424,6 +425,8 @@ message HotTablet {
option (google.api.resource) = {
type: "bigtableadmin.googleapis.com/HotTablet"
pattern: "projects/{project}/instances/{instance}/clusters/{cluster}/hotTablets/{hot_tablet}"
plural: "hotTablets"
singular: "hotTablet"
};
// The unique name of the hot tablet. Values are of the form
@ -456,3 +459,57 @@ message HotTablet {
// to 100% (the node spent all cycles serving the hot tablet).
float node_cpu_usage_percent = 7 [(google.api.field_behavior) = OUTPUT_ONLY];
}
// A SQL logical view object that can be referenced in SQL queries.
message LogicalView {
option (google.api.resource) = {
type: "bigtableadmin.googleapis.com/LogicalView"
pattern: "projects/{project}/instances/{instance}/logicalViews/{logical_view}"
plural: "logicalViews"
singular: "logicalView"
};
// Identifier. The unique name of the logical view.
// Format:
// `projects/{project}/instances/{instance}/logicalViews/{logical_view}
string name = 1 [(google.api.field_behavior) = IDENTIFIER];
// Required. The logical view's select query.
string query = 2 [(google.api.field_behavior) = REQUIRED];
// Optional. The etag for this logical view.
// This may be sent on update requests to ensure that the client has an
// up-to-date value before proceeding. The server returns an ABORTED error on
// a mismatched etag.
string etag = 3 [(google.api.field_behavior) = OPTIONAL];
}
// A materialized view object that can be referenced in SQL queries.
message MaterializedView {
option (google.api.resource) = {
type: "bigtableadmin.googleapis.com/MaterializedView"
pattern: "projects/{project}/instances/{instance}/materializedViews/{materialized_view}"
plural: "materializedViews"
singular: "materializedView"
};
// Identifier. The unique name of the materialized view.
// Format:
// `projects/{project}/instances/{instance}/materializedViews/{materialized_view}
string name = 1 [(google.api.field_behavior) = IDENTIFIER];
// Required. Immutable. The materialized view's select query.
string query = 2 [
(google.api.field_behavior) = REQUIRED,
(google.api.field_behavior) = IMMUTABLE
];
// Optional. The etag for this materialized view.
// This may be sent on update requests to ensure that the client has an
// up-to-date value before proceeding. The server returns an ABORTED error on
// a mismatched etag.
string etag = 3 [(google.api.field_behavior) = OPTIONAL];
// Set to true to make the MaterializedView protected against deletion.
bool deletion_protection = 6;
}

Loading…
Cancel
Save