#[derive(Clone, PartialEq, ::prost::Message)]
pub struct OperationProgress {
#[prost(int32, tag = "1")]
pub progress_percent: i32,
#[prost(message, optional, tag = "2")]
pub start_time: ::core::option::Option<::prost_types::Timestamp>,
#[prost(message, optional, tag = "3")]
pub end_time: ::core::option::Option<::prost_types::Timestamp>,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum StorageType {
Unspecified = 0,
Ssd = 1,
Hdd = 2,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RestoreInfo {
#[prost(enumeration = "RestoreSourceType", tag = "1")]
pub source_type: i32,
#[prost(oneof = "restore_info::SourceInfo", tags = "2")]
pub source_info: ::core::option::Option<restore_info::SourceInfo>,
}
pub mod restore_info {
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum SourceInfo {
#[prost(message, tag = "2")]
BackupInfo(super::BackupInfo),
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Table {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
#[prost(map = "string, message", tag = "2")]
pub cluster_states:
::std::collections::HashMap<::prost::alloc::string::String, table::ClusterState>,
#[prost(map = "string, message", tag = "3")]
pub column_families: ::std::collections::HashMap<::prost::alloc::string::String, ColumnFamily>,
#[prost(enumeration = "table::TimestampGranularity", tag = "4")]
pub granularity: i32,
#[prost(message, optional, tag = "6")]
pub restore_info: ::core::option::Option<RestoreInfo>,
#[prost(bool, tag = "9")]
pub deletion_protection: bool,
}
pub mod table {
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ClusterState {
#[prost(enumeration = "cluster_state::ReplicationState", tag = "1")]
pub replication_state: i32,
#[prost(message, repeated, tag = "2")]
pub encryption_info: ::prost::alloc::vec::Vec<super::EncryptionInfo>,
}
pub mod cluster_state {
#[derive(
Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration,
)]
#[repr(i32)]
pub enum ReplicationState {
StateNotKnown = 0,
Initializing = 1,
PlannedMaintenance = 2,
UnplannedMaintenance = 3,
Ready = 4,
ReadyOptimizing = 5,
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum TimestampGranularity {
Unspecified = 0,
Millis = 1,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum View {
Unspecified = 0,
NameOnly = 1,
SchemaView = 2,
ReplicationView = 3,
EncryptionView = 5,
Full = 4,
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ColumnFamily {
#[prost(message, optional, tag = "1")]
pub gc_rule: ::core::option::Option<GcRule>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GcRule {
#[prost(oneof = "gc_rule::Rule", tags = "1, 2, 3, 4")]
pub rule: ::core::option::Option<gc_rule::Rule>,
}
pub mod gc_rule {
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Intersection {
#[prost(message, repeated, tag = "1")]
pub rules: ::prost::alloc::vec::Vec<super::GcRule>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Union {
#[prost(message, repeated, tag = "1")]
pub rules: ::prost::alloc::vec::Vec<super::GcRule>,
}
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Rule {
#[prost(int32, tag = "1")]
MaxNumVersions(i32),
#[prost(message, tag = "2")]
MaxAge(::prost_types::Duration),
#[prost(message, tag = "3")]
Intersection(Intersection),
#[prost(message, tag = "4")]
Union(Union),
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct EncryptionInfo {
#[prost(enumeration = "encryption_info::EncryptionType", tag = "3")]
pub encryption_type: i32,
#[prost(message, optional, tag = "4")]
pub encryption_status: ::core::option::Option<super::super::super::rpc::Status>,
#[prost(string, tag = "2")]
pub kms_key_version: ::prost::alloc::string::String,
}
pub mod encryption_info {
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum EncryptionType {
Unspecified = 0,
GoogleDefaultEncryption = 1,
CustomerManagedEncryption = 2,
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Snapshot {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
#[prost(message, optional, tag = "2")]
pub source_table: ::core::option::Option<Table>,
#[prost(int64, tag = "3")]
pub data_size_bytes: i64,
#[prost(message, optional, tag = "4")]
pub create_time: ::core::option::Option<::prost_types::Timestamp>,
#[prost(message, optional, tag = "5")]
pub delete_time: ::core::option::Option<::prost_types::Timestamp>,
#[prost(enumeration = "snapshot::State", tag = "6")]
pub state: i32,
#[prost(string, tag = "7")]
pub description: ::prost::alloc::string::String,
}
pub mod snapshot {
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum State {
NotKnown = 0,
Ready = 1,
Creating = 2,
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Backup {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub source_table: ::prost::alloc::string::String,
#[prost(message, optional, tag = "3")]
pub expire_time: ::core::option::Option<::prost_types::Timestamp>,
#[prost(message, optional, tag = "4")]
pub start_time: ::core::option::Option<::prost_types::Timestamp>,
#[prost(message, optional, tag = "5")]
pub end_time: ::core::option::Option<::prost_types::Timestamp>,
#[prost(int64, tag = "6")]
pub size_bytes: i64,
#[prost(enumeration = "backup::State", tag = "7")]
pub state: i32,
#[prost(message, optional, tag = "9")]
pub encryption_info: ::core::option::Option<EncryptionInfo>,
}
pub mod backup {
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum State {
Unspecified = 0,
Creating = 1,
Ready = 2,
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BackupInfo {
#[prost(string, tag = "1")]
pub backup: ::prost::alloc::string::String,
#[prost(message, optional, tag = "2")]
pub start_time: ::core::option::Option<::prost_types::Timestamp>,
#[prost(message, optional, tag = "3")]
pub end_time: ::core::option::Option<::prost_types::Timestamp>,
#[prost(string, tag = "4")]
pub source_table: ::prost::alloc::string::String,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum RestoreSourceType {
Unspecified = 0,
Backup = 1,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RestoreTableRequest {
#[prost(string, tag = "1")]
pub parent: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub table_id: ::prost::alloc::string::String,
#[prost(oneof = "restore_table_request::Source", tags = "3")]
pub source: ::core::option::Option<restore_table_request::Source>,
}
pub mod restore_table_request {
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Source {
#[prost(string, tag = "3")]
Backup(::prost::alloc::string::String),
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RestoreTableMetadata {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
#[prost(enumeration = "RestoreSourceType", tag = "2")]
pub source_type: i32,
#[prost(string, tag = "4")]
pub optimize_table_operation_name: ::prost::alloc::string::String,
#[prost(message, optional, tag = "5")]
pub progress: ::core::option::Option<OperationProgress>,
#[prost(oneof = "restore_table_metadata::SourceInfo", tags = "3")]
pub source_info: ::core::option::Option<restore_table_metadata::SourceInfo>,
}
pub mod restore_table_metadata {
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum SourceInfo {
#[prost(message, tag = "3")]
BackupInfo(super::BackupInfo),
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct OptimizeRestoredTableMetadata {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
#[prost(message, optional, tag = "2")]
pub progress: ::core::option::Option<OperationProgress>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateTableRequest {
#[prost(string, tag = "1")]
pub parent: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub table_id: ::prost::alloc::string::String,
#[prost(message, optional, tag = "3")]
pub table: ::core::option::Option<Table>,
#[prost(message, repeated, tag = "4")]
pub initial_splits: ::prost::alloc::vec::Vec<create_table_request::Split>,
}
pub mod create_table_request {
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Split {
#[prost(bytes = "bytes", tag = "1")]
pub key: ::prost::bytes::Bytes,
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateTableFromSnapshotRequest {
#[prost(string, tag = "1")]
pub parent: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub table_id: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub source_snapshot: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DropRowRangeRequest {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
#[prost(oneof = "drop_row_range_request::Target", tags = "2, 3")]
pub target: ::core::option::Option<drop_row_range_request::Target>,
}
pub mod drop_row_range_request {
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Target {
#[prost(bytes, tag = "2")]
RowKeyPrefix(::prost::bytes::Bytes),
#[prost(bool, tag = "3")]
DeleteAllDataFromTable(bool),
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListTablesRequest {
#[prost(string, tag = "1")]
pub parent: ::prost::alloc::string::String,
#[prost(enumeration = "table::View", tag = "2")]
pub view: i32,
#[prost(int32, tag = "4")]
pub page_size: i32,
#[prost(string, tag = "3")]
pub page_token: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListTablesResponse {
#[prost(message, repeated, tag = "1")]
pub tables: ::prost::alloc::vec::Vec<Table>,
#[prost(string, tag = "2")]
pub next_page_token: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetTableRequest {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
#[prost(enumeration = "table::View", tag = "2")]
pub view: i32,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UpdateTableRequest {
#[prost(message, optional, tag = "1")]
pub table: ::core::option::Option<Table>,
#[prost(message, optional, tag = "2")]
pub update_mask: ::core::option::Option<::prost_types::FieldMask>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UpdateTableMetadata {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
#[prost(message, optional, tag = "2")]
pub start_time: ::core::option::Option<::prost_types::Timestamp>,
#[prost(message, optional, tag = "3")]
pub end_time: ::core::option::Option<::prost_types::Timestamp>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DeleteTableRequest {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UndeleteTableRequest {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UndeleteTableMetadata {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
#[prost(message, optional, tag = "2")]
pub start_time: ::core::option::Option<::prost_types::Timestamp>,
#[prost(message, optional, tag = "3")]
pub end_time: ::core::option::Option<::prost_types::Timestamp>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ModifyColumnFamiliesRequest {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
#[prost(message, repeated, tag = "2")]
pub modifications: ::prost::alloc::vec::Vec<modify_column_families_request::Modification>,
}
pub mod modify_column_families_request {
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Modification {
#[prost(string, tag = "1")]
pub id: ::prost::alloc::string::String,
#[prost(oneof = "modification::Mod", tags = "2, 3, 4")]
pub r#mod: ::core::option::Option<modification::Mod>,
}
pub mod modification {
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Mod {
#[prost(message, tag = "2")]
Create(super::super::ColumnFamily),
#[prost(message, tag = "3")]
Update(super::super::ColumnFamily),
#[prost(bool, tag = "4")]
Drop(bool),
}
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GenerateConsistencyTokenRequest {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GenerateConsistencyTokenResponse {
#[prost(string, tag = "1")]
pub consistency_token: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CheckConsistencyRequest {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub consistency_token: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CheckConsistencyResponse {
#[prost(bool, tag = "1")]
pub consistent: bool,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SnapshotTableRequest {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub cluster: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub snapshot_id: ::prost::alloc::string::String,
#[prost(message, optional, tag = "4")]
pub ttl: ::core::option::Option<::prost_types::Duration>,
#[prost(string, tag = "5")]
pub description: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetSnapshotRequest {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListSnapshotsRequest {
#[prost(string, tag = "1")]
pub parent: ::prost::alloc::string::String,
#[prost(int32, tag = "2")]
pub page_size: i32,
#[prost(string, tag = "3")]
pub page_token: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListSnapshotsResponse {
#[prost(message, repeated, tag = "1")]
pub snapshots: ::prost::alloc::vec::Vec<Snapshot>,
#[prost(string, tag = "2")]
pub next_page_token: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DeleteSnapshotRequest {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SnapshotTableMetadata {
#[prost(message, optional, tag = "1")]
pub original_request: ::core::option::Option<SnapshotTableRequest>,
#[prost(message, optional, tag = "2")]
pub request_time: ::core::option::Option<::prost_types::Timestamp>,
#[prost(message, optional, tag = "3")]
pub finish_time: ::core::option::Option<::prost_types::Timestamp>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateTableFromSnapshotMetadata {
#[prost(message, optional, tag = "1")]
pub original_request: ::core::option::Option<CreateTableFromSnapshotRequest>,
#[prost(message, optional, tag = "2")]
pub request_time: ::core::option::Option<::prost_types::Timestamp>,
#[prost(message, optional, tag = "3")]
pub finish_time: ::core::option::Option<::prost_types::Timestamp>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateBackupRequest {
#[prost(string, tag = "1")]
pub parent: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub backup_id: ::prost::alloc::string::String,
#[prost(message, optional, tag = "3")]
pub backup: ::core::option::Option<Backup>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateBackupMetadata {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub source_table: ::prost::alloc::string::String,
#[prost(message, optional, tag = "3")]
pub start_time: ::core::option::Option<::prost_types::Timestamp>,
#[prost(message, optional, tag = "4")]
pub end_time: ::core::option::Option<::prost_types::Timestamp>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UpdateBackupRequest {
#[prost(message, optional, tag = "1")]
pub backup: ::core::option::Option<Backup>,
#[prost(message, optional, tag = "2")]
pub update_mask: ::core::option::Option<::prost_types::FieldMask>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetBackupRequest {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DeleteBackupRequest {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListBackupsRequest {
#[prost(string, tag = "1")]
pub parent: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub filter: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub order_by: ::prost::alloc::string::String,
#[prost(int32, tag = "4")]
pub page_size: i32,
#[prost(string, tag = "5")]
pub page_token: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListBackupsResponse {
#[prost(message, repeated, tag = "1")]
pub backups: ::prost::alloc::vec::Vec<Backup>,
#[prost(string, tag = "2")]
pub next_page_token: ::prost::alloc::string::String,
}
#[doc = r" Generated client implementations."]
pub mod bigtable_table_admin_client {
#![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
use tonic::codegen::*;
#[doc = " Service for creating, configuring, and deleting Cloud Bigtable tables."]
#[doc = ""]
#[doc = ""]
#[doc = " Provides access to the table schemas only, not the data stored within"]
#[doc = " the tables."]
#[derive(Debug, Clone)]
pub struct BigtableTableAdminClient<T> {
inner: tonic::client::Grpc<T>,
}
impl BigtableTableAdminClient<tonic::transport::Channel> {
#[doc = r" Attempt to create a new client by connecting to a given endpoint."]
pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
where
D: std::convert::TryInto<tonic::transport::Endpoint>,
D::Error: Into<StdError>,
{
let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
Ok(Self::new(conn))
}
}
impl<T> BigtableTableAdminClient<T>
where
T: tonic::client::GrpcService<tonic::body::BoxBody>,
T::ResponseBody: Body + Send + 'static,
T::Error: Into<StdError>,
<T::ResponseBody as Body>::Error: Into<StdError> + Send,
{
pub fn new(inner: T) -> Self {
let inner = tonic::client::Grpc::new(inner);
Self { inner }
}
pub fn with_interceptor<F>(
inner: T,
interceptor: F,
) -> BigtableTableAdminClient<InterceptedService<T, F>>
where
F: tonic::service::Interceptor,
T: tonic::codegen::Service<
http::Request<tonic::body::BoxBody>,
Response = http::Response<
<T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
>,
>,
<T as tonic::codegen::Service<http::Request<tonic::body::BoxBody>>>::Error:
Into<StdError> + Send + Sync,
{
BigtableTableAdminClient::new(InterceptedService::new(inner, interceptor))
}
#[doc = r" Compress requests with `gzip`."]
#[doc = r""]
#[doc = r" This requires the server to support it otherwise it might respond with an"]
#[doc = r" error."]
pub fn send_gzip(mut self) -> Self {
self.inner = self.inner.send_gzip();
self
}
#[doc = r" Enable decompressing responses with `gzip`."]
pub fn accept_gzip(mut self) -> Self {
self.inner = self.inner.accept_gzip();
self
}
#[doc = " Creates a new table in the specified instance."]
#[doc = " The table can be created with a full set of initial column families,"]
#[doc = " specified in the request."]
pub async fn create_table(
&mut self,
request: impl tonic::IntoRequest<super::CreateTableRequest>,
) -> Result<tonic::Response<super::Table>, tonic::Status> {
self.inner.ready().await.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.bigtable.admin.v2.BigtableTableAdmin/CreateTable",
);
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Creates a new table from the specified snapshot. The target table must"]
#[doc = " not exist. The snapshot and the table must be in the same instance."]
#[doc = ""]
#[doc = " Note: This is a private alpha release of Cloud Bigtable snapshots. This"]
#[doc = " feature is not currently available to most Cloud Bigtable customers. This"]
#[doc = " feature might be changed in backward-incompatible ways and is not"]
#[doc = " recommended for production use. It is not subject to any SLA or deprecation"]
#[doc = " policy."]
pub async fn create_table_from_snapshot(
&mut self,
request: impl tonic::IntoRequest<super::CreateTableFromSnapshotRequest>,
) -> Result<
tonic::Response<super::super::super::super::longrunning::Operation>,
tonic::Status,
> {
self.inner.ready().await.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.bigtable.admin.v2.BigtableTableAdmin/CreateTableFromSnapshot",
);
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Lists all tables served from a specified instance."]
pub async fn list_tables(
&mut self,
request: impl tonic::IntoRequest<super::ListTablesRequest>,
) -> Result<tonic::Response<super::ListTablesResponse>, tonic::Status> {
self.inner.ready().await.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.bigtable.admin.v2.BigtableTableAdmin/ListTables",
);
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Gets metadata information about the specified table."]
pub async fn get_table(
&mut self,
request: impl tonic::IntoRequest<super::GetTableRequest>,
) -> Result<tonic::Response<super::Table>, tonic::Status> {
self.inner.ready().await.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.bigtable.admin.v2.BigtableTableAdmin/GetTable",
);
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Updates a specified table."]
pub async fn update_table(
&mut self,
request: impl tonic::IntoRequest<super::UpdateTableRequest>,
) -> Result<
tonic::Response<super::super::super::super::longrunning::Operation>,
tonic::Status,
> {
self.inner.ready().await.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.bigtable.admin.v2.BigtableTableAdmin/UpdateTable",
);
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Permanently deletes a specified table and all of its data."]
pub async fn delete_table(
&mut self,
request: impl tonic::IntoRequest<super::DeleteTableRequest>,
) -> Result<tonic::Response<()>, tonic::Status> {
self.inner.ready().await.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.bigtable.admin.v2.BigtableTableAdmin/DeleteTable",
);
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Restores a specified table which was accidentally deleted."]
pub async fn undelete_table(
&mut self,
request: impl tonic::IntoRequest<super::UndeleteTableRequest>,
) -> Result<
tonic::Response<super::super::super::super::longrunning::Operation>,
tonic::Status,
> {
self.inner.ready().await.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.bigtable.admin.v2.BigtableTableAdmin/UndeleteTable",
);
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Performs a series of column family modifications on the specified table."]
#[doc = " Either all or none of the modifications will occur before this method"]
#[doc = " returns, but data requests received prior to that point may see a table"]
#[doc = " where only some modifications have taken effect."]
pub async fn modify_column_families(
&mut self,
request: impl tonic::IntoRequest<super::ModifyColumnFamiliesRequest>,
) -> Result<tonic::Response<super::Table>, tonic::Status> {
self.inner.ready().await.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.bigtable.admin.v2.BigtableTableAdmin/ModifyColumnFamilies",
);
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Permanently drop/delete a row range from a specified table. The request can"]
#[doc = " specify whether to delete all rows in a table, or only those that match a"]
#[doc = " particular prefix."]
pub async fn drop_row_range(
&mut self,
request: impl tonic::IntoRequest<super::DropRowRangeRequest>,
) -> Result<tonic::Response<()>, tonic::Status> {
self.inner.ready().await.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.bigtable.admin.v2.BigtableTableAdmin/DropRowRange",
);
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Generates a consistency token for a Table, which can be used in"]
#[doc = " CheckConsistency to check whether mutations to the table that finished"]
#[doc = " before this call started have been replicated. The tokens will be available"]
#[doc = " for 90 days."]
pub async fn generate_consistency_token(
&mut self,
request: impl tonic::IntoRequest<super::GenerateConsistencyTokenRequest>,
) -> Result<tonic::Response<super::GenerateConsistencyTokenResponse>, tonic::Status>
{
self.inner.ready().await.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.bigtable.admin.v2.BigtableTableAdmin/GenerateConsistencyToken",
);
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Checks replication consistency based on a consistency token, that is, if"]
#[doc = " replication has caught up based on the conditions specified in the token"]
#[doc = " and the check request."]
pub async fn check_consistency(
&mut self,
request: impl tonic::IntoRequest<super::CheckConsistencyRequest>,
) -> Result<tonic::Response<super::CheckConsistencyResponse>, tonic::Status> {
self.inner.ready().await.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.bigtable.admin.v2.BigtableTableAdmin/CheckConsistency",
);
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Creates a new snapshot in the specified cluster from the specified"]
#[doc = " source table. The cluster and the table must be in the same instance."]
#[doc = ""]
#[doc = " Note: This is a private alpha release of Cloud Bigtable snapshots. This"]
#[doc = " feature is not currently available to most Cloud Bigtable customers. This"]
#[doc = " feature might be changed in backward-incompatible ways and is not"]
#[doc = " recommended for production use. It is not subject to any SLA or deprecation"]
#[doc = " policy."]
pub async fn snapshot_table(
&mut self,
request: impl tonic::IntoRequest<super::SnapshotTableRequest>,
) -> Result<
tonic::Response<super::super::super::super::longrunning::Operation>,
tonic::Status,
> {
self.inner.ready().await.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.bigtable.admin.v2.BigtableTableAdmin/SnapshotTable",
);
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Gets metadata information about the specified snapshot."]
#[doc = ""]
#[doc = " Note: This is a private alpha release of Cloud Bigtable snapshots. This"]
#[doc = " feature is not currently available to most Cloud Bigtable customers. This"]
#[doc = " feature might be changed in backward-incompatible ways and is not"]
#[doc = " recommended for production use. It is not subject to any SLA or deprecation"]
#[doc = " policy."]
pub async fn get_snapshot(
&mut self,
request: impl tonic::IntoRequest<super::GetSnapshotRequest>,
) -> Result<tonic::Response<super::Snapshot>, tonic::Status> {
self.inner.ready().await.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.bigtable.admin.v2.BigtableTableAdmin/GetSnapshot",
);
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Lists all snapshots associated with the specified cluster."]
#[doc = ""]
#[doc = " Note: This is a private alpha release of Cloud Bigtable snapshots. This"]
#[doc = " feature is not currently available to most Cloud Bigtable customers. This"]
#[doc = " feature might be changed in backward-incompatible ways and is not"]
#[doc = " recommended for production use. It is not subject to any SLA or deprecation"]
#[doc = " policy."]
pub async fn list_snapshots(
&mut self,
request: impl tonic::IntoRequest<super::ListSnapshotsRequest>,
) -> Result<tonic::Response<super::ListSnapshotsResponse>, tonic::Status> {
self.inner.ready().await.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.bigtable.admin.v2.BigtableTableAdmin/ListSnapshots",
);
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Permanently deletes the specified snapshot."]
#[doc = ""]
#[doc = " Note: This is a private alpha release of Cloud Bigtable snapshots. This"]
#[doc = " feature is not currently available to most Cloud Bigtable customers. This"]
#[doc = " feature might be changed in backward-incompatible ways and is not"]
#[doc = " recommended for production use. It is not subject to any SLA or deprecation"]
#[doc = " policy."]
pub async fn delete_snapshot(
&mut self,
request: impl tonic::IntoRequest<super::DeleteSnapshotRequest>,
) -> Result<tonic::Response<()>, tonic::Status> {
self.inner.ready().await.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.bigtable.admin.v2.BigtableTableAdmin/DeleteSnapshot",
);
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Starts creating a new Cloud Bigtable Backup. The returned backup"]
#[doc = " [long-running operation][google.longrunning.Operation] can be used to"]
#[doc = " track creation of the backup. The"]
#[doc = " [metadata][google.longrunning.Operation.metadata] field type is"]
#[doc = " [CreateBackupMetadata][google.bigtable.admin.v2.CreateBackupMetadata]. The"]
#[doc = " [response][google.longrunning.Operation.response] field type is"]
#[doc = " [Backup][google.bigtable.admin.v2.Backup], if successful. Cancelling the returned operation will stop the"]
#[doc = " creation and delete the backup."]
pub async fn create_backup(
&mut self,
request: impl tonic::IntoRequest<super::CreateBackupRequest>,
) -> Result<
tonic::Response<super::super::super::super::longrunning::Operation>,
tonic::Status,
> {
self.inner.ready().await.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.bigtable.admin.v2.BigtableTableAdmin/CreateBackup",
);
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Gets metadata on a pending or completed Cloud Bigtable Backup."]
pub async fn get_backup(
&mut self,
request: impl tonic::IntoRequest<super::GetBackupRequest>,
) -> Result<tonic::Response<super::Backup>, tonic::Status> {
self.inner.ready().await.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.bigtable.admin.v2.BigtableTableAdmin/GetBackup",
);
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Updates a pending or completed Cloud Bigtable Backup."]
pub async fn update_backup(
&mut self,
request: impl tonic::IntoRequest<super::UpdateBackupRequest>,
) -> Result<tonic::Response<super::Backup>, tonic::Status> {
self.inner.ready().await.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.bigtable.admin.v2.BigtableTableAdmin/UpdateBackup",
);
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Deletes a pending or completed Cloud Bigtable backup."]
pub async fn delete_backup(
&mut self,
request: impl tonic::IntoRequest<super::DeleteBackupRequest>,
) -> Result<tonic::Response<()>, tonic::Status> {
self.inner.ready().await.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.bigtable.admin.v2.BigtableTableAdmin/DeleteBackup",
);
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Lists Cloud Bigtable backups. Returns both completed and pending"]
#[doc = " backups."]
pub async fn list_backups(
&mut self,
request: impl tonic::IntoRequest<super::ListBackupsRequest>,
) -> Result<tonic::Response<super::ListBackupsResponse>, tonic::Status> {
self.inner.ready().await.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.bigtable.admin.v2.BigtableTableAdmin/ListBackups",
);
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Create a new table by restoring from a completed backup. The new table"]
#[doc = " must be in the same project as the instance containing the backup. The"]
#[doc = " returned table [long-running operation][google.longrunning.Operation] can"]
#[doc = " be used to track the progress of the operation, and to cancel it. The"]
#[doc = " [metadata][google.longrunning.Operation.metadata] field type is"]
#[doc = " [RestoreTableMetadata][google.bigtable.admin.RestoreTableMetadata]. The"]
#[doc = " [response][google.longrunning.Operation.response] type is"]
#[doc = " [Table][google.bigtable.admin.v2.Table], if successful."]
pub async fn restore_table(
&mut self,
request: impl tonic::IntoRequest<super::RestoreTableRequest>,
) -> Result<
tonic::Response<super::super::super::super::longrunning::Operation>,
tonic::Status,
> {
self.inner.ready().await.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.bigtable.admin.v2.BigtableTableAdmin/RestoreTable",
);
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Gets the access control policy for a Table or Backup resource."]
#[doc = " Returns an empty policy if the resource exists but does not have a policy"]
#[doc = " set."]
pub async fn get_iam_policy(
&mut self,
request: impl tonic::IntoRequest<super::super::super::super::iam::v1::GetIamPolicyRequest>,
) -> Result<tonic::Response<super::super::super::super::iam::v1::Policy>, tonic::Status>
{
self.inner.ready().await.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.bigtable.admin.v2.BigtableTableAdmin/GetIamPolicy",
);
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Sets the access control policy on a Table or Backup resource."]
#[doc = " Replaces any existing policy."]
pub async fn set_iam_policy(
&mut self,
request: impl tonic::IntoRequest<super::super::super::super::iam::v1::SetIamPolicyRequest>,
) -> Result<tonic::Response<super::super::super::super::iam::v1::Policy>, tonic::Status>
{
self.inner.ready().await.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.bigtable.admin.v2.BigtableTableAdmin/SetIamPolicy",
);
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Returns permissions that the caller has on the specified Table or Backup resource."]
pub async fn test_iam_permissions(
&mut self,
request: impl tonic::IntoRequest<
super::super::super::super::iam::v1::TestIamPermissionsRequest,
>,
) -> Result<
tonic::Response<super::super::super::super::iam::v1::TestIamPermissionsResponse>,
tonic::Status,
> {
self.inner.ready().await.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.bigtable.admin.v2.BigtableTableAdmin/TestIamPermissions",
);
self.inner.unary(request.into_request(), path, codec).await
}
}
}