google-cloud-bigtable 1.2.0 → 1.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/lib/google/bigtable/admin/v2/bigtable_table_admin_pb.rb +64 -0
- data/lib/google/bigtable/admin/v2/bigtable_table_admin_services_pb.rb +28 -2
- data/lib/google/bigtable/admin/v2/common_pb.rb +6 -1
- data/lib/google/bigtable/admin/v2/instance_pb.rb +0 -1
- data/lib/google/bigtable/admin/v2/table_pb.rb +37 -1
- data/lib/google/cloud/bigtable/admin/v2.rb +1 -0
- data/lib/google/cloud/bigtable/admin/v2/bigtable_instance_admin_client.rb +2 -2
- data/lib/google/cloud/bigtable/admin/v2/bigtable_table_admin_client.rb +502 -25
- data/lib/google/cloud/bigtable/admin/v2/bigtable_table_admin_client_config.json +30 -0
- data/lib/google/cloud/bigtable/admin/v2/doc/google/bigtable/admin/v2/bigtable_table_admin.rb +244 -24
- data/lib/google/cloud/bigtable/admin/v2/doc/google/bigtable/admin/v2/instance.rb +2 -2
- data/lib/google/cloud/bigtable/admin/v2/doc/google/bigtable/admin/v2/table.rb +108 -5
- data/lib/google/cloud/bigtable/v2/bigtable_client_config.json +7 -7
- data/lib/google/cloud/bigtable/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0a1017ef14a932be04b10c48b91c119092d63cb819e3c64afd774123046ebd1c
|
4
|
+
data.tar.gz: 1e31e516af43d142ac8d3a06a58c9a79c8bd145d0dc242df571ea56c201b01d4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9505756672b52a498ecaf695c639d1f4f01308878e6adbddbe7cf8c4ea36f0f0fc6d26fd8f2874112ba1eb462d4d3a8c83f8f1f456f13fc24bf91473739794c7
|
7
|
+
data.tar.gz: 467538a39acc69162f601920f0924e2707473adf27f0c5b9ee9d9fd3c2be79ac48ffc760c1e7288b586428df49d9f80a123b68f675d2b38f68838d7c82534853
|
data/CHANGELOG.md
CHANGED
@@ -8,12 +8,14 @@ require 'google/api/annotations_pb'
|
|
8
8
|
require 'google/api/client_pb'
|
9
9
|
require 'google/api/field_behavior_pb'
|
10
10
|
require 'google/api/resource_pb'
|
11
|
+
require 'google/bigtable/admin/v2/common_pb'
|
11
12
|
require 'google/bigtable/admin/v2/table_pb'
|
12
13
|
require 'google/iam/v1/iam_policy_pb'
|
13
14
|
require 'google/iam/v1/policy_pb'
|
14
15
|
require 'google/longrunning/operations_pb'
|
15
16
|
require 'google/protobuf/duration_pb'
|
16
17
|
require 'google/protobuf/empty_pb'
|
18
|
+
require 'google/protobuf/field_mask_pb'
|
17
19
|
require 'google/protobuf/timestamp_pb'
|
18
20
|
Google::Protobuf::DescriptorPool.generated_pool.build do
|
19
21
|
add_message "google.bigtable.admin.v2.CreateTableRequest" do
|
@@ -111,6 +113,58 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
|
|
111
113
|
optional :request_time, :message, 2, "google.protobuf.Timestamp"
|
112
114
|
optional :finish_time, :message, 3, "google.protobuf.Timestamp"
|
113
115
|
end
|
116
|
+
add_message "google.bigtable.admin.v2.CreateBackupRequest" do
|
117
|
+
optional :parent, :string, 1
|
118
|
+
optional :backup_id, :string, 2
|
119
|
+
optional :backup, :message, 3, "google.bigtable.admin.v2.Backup"
|
120
|
+
end
|
121
|
+
add_message "google.bigtable.admin.v2.CreateBackupMetadata" do
|
122
|
+
optional :name, :string, 1
|
123
|
+
optional :source_table, :string, 2
|
124
|
+
optional :start_time, :message, 3, "google.protobuf.Timestamp"
|
125
|
+
optional :end_time, :message, 4, "google.protobuf.Timestamp"
|
126
|
+
end
|
127
|
+
add_message "google.bigtable.admin.v2.GetBackupRequest" do
|
128
|
+
optional :name, :string, 1
|
129
|
+
end
|
130
|
+
add_message "google.bigtable.admin.v2.UpdateBackupRequest" do
|
131
|
+
optional :backup, :message, 1, "google.bigtable.admin.v2.Backup"
|
132
|
+
optional :update_mask, :message, 2, "google.protobuf.FieldMask"
|
133
|
+
end
|
134
|
+
add_message "google.bigtable.admin.v2.DeleteBackupRequest" do
|
135
|
+
optional :name, :string, 1
|
136
|
+
end
|
137
|
+
add_message "google.bigtable.admin.v2.ListBackupsRequest" do
|
138
|
+
optional :parent, :string, 1
|
139
|
+
optional :filter, :string, 2
|
140
|
+
optional :order_by, :string, 3
|
141
|
+
optional :page_size, :int32, 4
|
142
|
+
optional :page_token, :string, 5
|
143
|
+
end
|
144
|
+
add_message "google.bigtable.admin.v2.ListBackupsResponse" do
|
145
|
+
repeated :backups, :message, 1, "google.bigtable.admin.v2.Backup"
|
146
|
+
optional :next_page_token, :string, 2
|
147
|
+
end
|
148
|
+
add_message "google.bigtable.admin.v2.RestoreTableRequest" do
|
149
|
+
optional :parent, :string, 1
|
150
|
+
optional :table_id, :string, 2
|
151
|
+
oneof :source do
|
152
|
+
optional :backup, :string, 3
|
153
|
+
end
|
154
|
+
end
|
155
|
+
add_message "google.bigtable.admin.v2.RestoreTableMetadata" do
|
156
|
+
optional :name, :string, 1
|
157
|
+
optional :source_type, :enum, 2, "google.bigtable.admin.v2.RestoreSourceType"
|
158
|
+
optional :optimize_table_operation_name, :string, 4
|
159
|
+
optional :progress, :message, 5, "google.bigtable.admin.v2.OperationProgress"
|
160
|
+
oneof :source_info do
|
161
|
+
optional :backup_info, :message, 3, "google.bigtable.admin.v2.BackupInfo"
|
162
|
+
end
|
163
|
+
end
|
164
|
+
add_message "google.bigtable.admin.v2.OptimizeRestoredTableMetadata" do
|
165
|
+
optional :name, :string, 1
|
166
|
+
optional :progress, :message, 2, "google.bigtable.admin.v2.OperationProgress"
|
167
|
+
end
|
114
168
|
end
|
115
169
|
|
116
170
|
module Google
|
@@ -138,6 +192,16 @@ module Google
|
|
138
192
|
DeleteSnapshotRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.bigtable.admin.v2.DeleteSnapshotRequest").msgclass
|
139
193
|
SnapshotTableMetadata = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.bigtable.admin.v2.SnapshotTableMetadata").msgclass
|
140
194
|
CreateTableFromSnapshotMetadata = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.bigtable.admin.v2.CreateTableFromSnapshotMetadata").msgclass
|
195
|
+
CreateBackupRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.bigtable.admin.v2.CreateBackupRequest").msgclass
|
196
|
+
CreateBackupMetadata = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.bigtable.admin.v2.CreateBackupMetadata").msgclass
|
197
|
+
GetBackupRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.bigtable.admin.v2.GetBackupRequest").msgclass
|
198
|
+
UpdateBackupRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.bigtable.admin.v2.UpdateBackupRequest").msgclass
|
199
|
+
DeleteBackupRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.bigtable.admin.v2.DeleteBackupRequest").msgclass
|
200
|
+
ListBackupsRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.bigtable.admin.v2.ListBackupsRequest").msgclass
|
201
|
+
ListBackupsResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.bigtable.admin.v2.ListBackupsResponse").msgclass
|
202
|
+
RestoreTableRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.bigtable.admin.v2.RestoreTableRequest").msgclass
|
203
|
+
RestoreTableMetadata = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.bigtable.admin.v2.RestoreTableMetadata").msgclass
|
204
|
+
OptimizeRestoredTableMetadata = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.bigtable.admin.v2.OptimizeRestoredTableMetadata").msgclass
|
141
205
|
end
|
142
206
|
end
|
143
207
|
end
|
@@ -1,7 +1,7 @@
|
|
1
1
|
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
2
2
|
# Source: google/bigtable/admin/v2/bigtable_table_admin.proto for package 'google.bigtable.admin.v2'
|
3
3
|
# Original file comments:
|
4
|
-
# Copyright
|
4
|
+
# Copyright 2020 Google LLC
|
5
5
|
#
|
6
6
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
7
7
|
# you may not use this file except in compliance with the License.
|
@@ -15,7 +15,6 @@
|
|
15
15
|
# See the License for the specific language governing permissions and
|
16
16
|
# limitations under the License.
|
17
17
|
#
|
18
|
-
#
|
19
18
|
|
20
19
|
|
21
20
|
require 'grpc'
|
@@ -109,6 +108,33 @@ module Google
|
|
109
108
|
# recommended for production use. It is not subject to any SLA or deprecation
|
110
109
|
# policy.
|
111
110
|
rpc :DeleteSnapshot, DeleteSnapshotRequest, Google::Protobuf::Empty
|
111
|
+
# Starts creating a new Cloud Bigtable Backup. The returned backup
|
112
|
+
# [long-running operation][google.longrunning.Operation] can be used to
|
113
|
+
# track creation of the backup. The
|
114
|
+
# [metadata][google.longrunning.Operation.metadata] field type is
|
115
|
+
# [CreateBackupMetadata][google.bigtable.admin.v2.CreateBackupMetadata]. The
|
116
|
+
# [response][google.longrunning.Operation.response] field type is
|
117
|
+
# [Backup][google.bigtable.admin.v2.Backup], if successful. Cancelling the
|
118
|
+
# returned operation will stop the creation and delete the backup.
|
119
|
+
rpc :CreateBackup, CreateBackupRequest, Google::Longrunning::Operation
|
120
|
+
# Gets metadata on a pending or completed Cloud Bigtable Backup.
|
121
|
+
rpc :GetBackup, GetBackupRequest, Backup
|
122
|
+
# Updates a pending or completed Cloud Bigtable Backup.
|
123
|
+
rpc :UpdateBackup, UpdateBackupRequest, Backup
|
124
|
+
# Deletes a pending or completed Cloud Bigtable backup.
|
125
|
+
rpc :DeleteBackup, DeleteBackupRequest, Google::Protobuf::Empty
|
126
|
+
# Lists Cloud Bigtable backups. Returns both completed and pending
|
127
|
+
# backups.
|
128
|
+
rpc :ListBackups, ListBackupsRequest, ListBackupsResponse
|
129
|
+
# Create a new table by restoring from a completed backup. The new table
|
130
|
+
# must be in the same instance as the instance containing the backup. The
|
131
|
+
# returned table [long-running operation][google.longrunning.Operation] can
|
132
|
+
# be used to track the progress of the operation, and to cancel it. The
|
133
|
+
# [metadata][google.longrunning.Operation.metadata] field type is
|
134
|
+
# [RestoreTableMetadata][google.bigtable.admin.RestoreTableMetadata]. The
|
135
|
+
# [response][google.longrunning.Operation.response] type is
|
136
|
+
# [Table][google.bigtable.admin.v2.Table], if successful.
|
137
|
+
rpc :RestoreTable, RestoreTableRequest, Google::Longrunning::Operation
|
112
138
|
# Gets the access control policy for a resource.
|
113
139
|
# Returns an empty policy if the resource exists but does not have a policy
|
114
140
|
# set.
|
@@ -4,9 +4,13 @@
|
|
4
4
|
|
5
5
|
require 'google/protobuf'
|
6
6
|
|
7
|
-
require 'google/api/annotations_pb'
|
8
7
|
require 'google/protobuf/timestamp_pb'
|
9
8
|
Google::Protobuf::DescriptorPool.generated_pool.build do
|
9
|
+
add_message "google.bigtable.admin.v2.OperationProgress" do
|
10
|
+
optional :progress_percent, :int32, 1
|
11
|
+
optional :start_time, :message, 2, "google.protobuf.Timestamp"
|
12
|
+
optional :end_time, :message, 3, "google.protobuf.Timestamp"
|
13
|
+
end
|
10
14
|
add_enum "google.bigtable.admin.v2.StorageType" do
|
11
15
|
value :STORAGE_TYPE_UNSPECIFIED, 0
|
12
16
|
value :SSD, 1
|
@@ -18,6 +22,7 @@ module Google
|
|
18
22
|
module Bigtable
|
19
23
|
module Admin
|
20
24
|
module V2
|
25
|
+
OperationProgress = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.bigtable.admin.v2.OperationProgress").msgclass
|
21
26
|
StorageType = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.bigtable.admin.v2.StorageType").enummodule
|
22
27
|
end
|
23
28
|
end
|
@@ -4,17 +4,23 @@
|
|
4
4
|
|
5
5
|
require 'google/protobuf'
|
6
6
|
|
7
|
-
require 'google/api/annotations_pb'
|
8
7
|
require 'google/api/field_behavior_pb'
|
9
8
|
require 'google/api/resource_pb'
|
10
9
|
require 'google/protobuf/duration_pb'
|
11
10
|
require 'google/protobuf/timestamp_pb'
|
12
11
|
Google::Protobuf::DescriptorPool.generated_pool.build do
|
12
|
+
add_message "google.bigtable.admin.v2.RestoreInfo" do
|
13
|
+
optional :source_type, :enum, 1, "google.bigtable.admin.v2.RestoreSourceType"
|
14
|
+
oneof :source_info do
|
15
|
+
optional :backup_info, :message, 2, "google.bigtable.admin.v2.BackupInfo"
|
16
|
+
end
|
17
|
+
end
|
13
18
|
add_message "google.bigtable.admin.v2.Table" do
|
14
19
|
optional :name, :string, 1
|
15
20
|
map :cluster_states, :string, :message, 2, "google.bigtable.admin.v2.Table.ClusterState"
|
16
21
|
map :column_families, :string, :message, 3, "google.bigtable.admin.v2.ColumnFamily"
|
17
22
|
optional :granularity, :enum, 4, "google.bigtable.admin.v2.Table.TimestampGranularity"
|
23
|
+
optional :restore_info, :message, 6, "google.bigtable.admin.v2.RestoreInfo"
|
18
24
|
end
|
19
25
|
add_message "google.bigtable.admin.v2.Table.ClusterState" do
|
20
26
|
optional :replication_state, :enum, 1, "google.bigtable.admin.v2.Table.ClusterState.ReplicationState"
|
@@ -25,6 +31,7 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
|
|
25
31
|
value :PLANNED_MAINTENANCE, 2
|
26
32
|
value :UNPLANNED_MAINTENANCE, 3
|
27
33
|
value :READY, 4
|
34
|
+
value :READY_OPTIMIZING, 5
|
28
35
|
end
|
29
36
|
add_enum "google.bigtable.admin.v2.Table.TimestampGranularity" do
|
30
37
|
value :TIMESTAMP_GRANULARITY_UNSPECIFIED, 0
|
@@ -68,12 +75,37 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
|
|
68
75
|
value :READY, 1
|
69
76
|
value :CREATING, 2
|
70
77
|
end
|
78
|
+
add_message "google.bigtable.admin.v2.Backup" do
|
79
|
+
optional :name, :string, 1
|
80
|
+
optional :source_table, :string, 2
|
81
|
+
optional :expire_time, :message, 3, "google.protobuf.Timestamp"
|
82
|
+
optional :start_time, :message, 4, "google.protobuf.Timestamp"
|
83
|
+
optional :end_time, :message, 5, "google.protobuf.Timestamp"
|
84
|
+
optional :size_bytes, :int64, 6
|
85
|
+
optional :state, :enum, 7, "google.bigtable.admin.v2.Backup.State"
|
86
|
+
end
|
87
|
+
add_enum "google.bigtable.admin.v2.Backup.State" do
|
88
|
+
value :STATE_UNSPECIFIED, 0
|
89
|
+
value :CREATING, 1
|
90
|
+
value :READY, 2
|
91
|
+
end
|
92
|
+
add_message "google.bigtable.admin.v2.BackupInfo" do
|
93
|
+
optional :backup, :string, 1
|
94
|
+
optional :start_time, :message, 2, "google.protobuf.Timestamp"
|
95
|
+
optional :end_time, :message, 3, "google.protobuf.Timestamp"
|
96
|
+
optional :source_table, :string, 4
|
97
|
+
end
|
98
|
+
add_enum "google.bigtable.admin.v2.RestoreSourceType" do
|
99
|
+
value :RESTORE_SOURCE_TYPE_UNSPECIFIED, 0
|
100
|
+
value :BACKUP, 1
|
101
|
+
end
|
71
102
|
end
|
72
103
|
|
73
104
|
module Google
|
74
105
|
module Bigtable
|
75
106
|
module Admin
|
76
107
|
module V2
|
108
|
+
RestoreInfo = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.bigtable.admin.v2.RestoreInfo").msgclass
|
77
109
|
Table = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.bigtable.admin.v2.Table").msgclass
|
78
110
|
Table::ClusterState = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.bigtable.admin.v2.Table.ClusterState").msgclass
|
79
111
|
Table::ClusterState::ReplicationState = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.bigtable.admin.v2.Table.ClusterState.ReplicationState").enummodule
|
@@ -85,6 +117,10 @@ module Google
|
|
85
117
|
GcRule::Union = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.bigtable.admin.v2.GcRule.Union").msgclass
|
86
118
|
Snapshot = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.bigtable.admin.v2.Snapshot").msgclass
|
87
119
|
Snapshot::State = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.bigtable.admin.v2.Snapshot.State").enummodule
|
120
|
+
Backup = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.bigtable.admin.v2.Backup").msgclass
|
121
|
+
Backup::State = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.bigtable.admin.v2.Backup.State").enummodule
|
122
|
+
BackupInfo = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.bigtable.admin.v2.BackupInfo").msgclass
|
123
|
+
RestoreSourceType = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.bigtable.admin.v2.RestoreSourceType").enummodule
|
88
124
|
end
|
89
125
|
end
|
90
126
|
end
|
@@ -16,6 +16,7 @@
|
|
16
16
|
require "google/cloud/bigtable/admin/v2/bigtable_instance_admin_client"
|
17
17
|
require "google/cloud/bigtable/admin/v2/bigtable_table_admin_client"
|
18
18
|
require "google/bigtable/admin/v2/bigtable_instance_admin_pb"
|
19
|
+
require "google/bigtable/admin/v2/table_pb"
|
19
20
|
require "google/bigtable/admin/v2/bigtable_table_admin_pb"
|
20
21
|
|
21
22
|
module Google
|
@@ -944,8 +944,8 @@ module Google
|
|
944
944
|
# The unique name of the cluster. Values are of the form
|
945
945
|
# `projects/{project}/instances/{instance}/clusters/[a-z][-a-z0-9]*`.
|
946
946
|
# @param serve_nodes [Integer]
|
947
|
-
# Required. The number of nodes allocated to this cluster. More nodes enable
|
948
|
-
# throughput and more consistent performance.
|
947
|
+
# Required. The number of nodes allocated to this cluster. More nodes enable
|
948
|
+
# higher throughput and more consistent performance.
|
949
949
|
# @param location [String]
|
950
950
|
# (`CreationOnly`)
|
951
951
|
# The location where this cluster's nodes and storage reside. For best
|
@@ -67,7 +67,11 @@ module Google
|
|
67
67
|
"list_snapshots" => Google::Gax::PageDescriptor.new(
|
68
68
|
"page_token",
|
69
69
|
"next_page_token",
|
70
|
-
"snapshots")
|
70
|
+
"snapshots"),
|
71
|
+
"list_backups" => Google::Gax::PageDescriptor.new(
|
72
|
+
"page_token",
|
73
|
+
"next_page_token",
|
74
|
+
"backups")
|
71
75
|
}.freeze
|
72
76
|
|
73
77
|
private_constant :PAGE_DESCRIPTORS
|
@@ -92,6 +96,12 @@ module Google
|
|
92
96
|
self::GRPC_INTERCEPTORS = BigtableTableAdminClient::GRPC_INTERCEPTORS
|
93
97
|
end
|
94
98
|
|
99
|
+
BACKUP_PATH_TEMPLATE = Google::Gax::PathTemplate.new(
|
100
|
+
"projects/{project}/instances/{instance}/clusters/{cluster}/backups/{backup}"
|
101
|
+
)
|
102
|
+
|
103
|
+
private_constant :BACKUP_PATH_TEMPLATE
|
104
|
+
|
95
105
|
CLUSTER_PATH_TEMPLATE = Google::Gax::PathTemplate.new(
|
96
106
|
"projects/{project}/instances/{instance}/clusters/{cluster}"
|
97
107
|
)
|
@@ -116,6 +126,21 @@ module Google
|
|
116
126
|
|
117
127
|
private_constant :TABLE_PATH_TEMPLATE
|
118
128
|
|
129
|
+
# Returns a fully-qualified backup resource name string.
|
130
|
+
# @param project [String]
|
131
|
+
# @param instance [String]
|
132
|
+
# @param cluster [String]
|
133
|
+
# @param backup [String]
|
134
|
+
# @return [String]
|
135
|
+
def self.backup_path project, instance, cluster, backup
|
136
|
+
BACKUP_PATH_TEMPLATE.render(
|
137
|
+
:"project" => project,
|
138
|
+
:"instance" => instance,
|
139
|
+
:"cluster" => cluster,
|
140
|
+
:"backup" => backup
|
141
|
+
)
|
142
|
+
end
|
143
|
+
|
119
144
|
# Returns a fully-qualified cluster resource name string.
|
120
145
|
# @param project [String]
|
121
146
|
# @param instance [String]
|
@@ -420,6 +445,54 @@ module Google
|
|
420
445
|
{'name' => request.name}
|
421
446
|
end
|
422
447
|
)
|
448
|
+
@create_backup = Google::Gax.create_api_call(
|
449
|
+
@bigtable_table_admin_stub.method(:create_backup),
|
450
|
+
defaults["create_backup"],
|
451
|
+
exception_transformer: exception_transformer,
|
452
|
+
params_extractor: proc do |request|
|
453
|
+
{'parent' => request.parent}
|
454
|
+
end
|
455
|
+
)
|
456
|
+
@get_backup = Google::Gax.create_api_call(
|
457
|
+
@bigtable_table_admin_stub.method(:get_backup),
|
458
|
+
defaults["get_backup"],
|
459
|
+
exception_transformer: exception_transformer,
|
460
|
+
params_extractor: proc do |request|
|
461
|
+
{'name' => request.name}
|
462
|
+
end
|
463
|
+
)
|
464
|
+
@list_backups = Google::Gax.create_api_call(
|
465
|
+
@bigtable_table_admin_stub.method(:list_backups),
|
466
|
+
defaults["list_backups"],
|
467
|
+
exception_transformer: exception_transformer,
|
468
|
+
params_extractor: proc do |request|
|
469
|
+
{'parent' => request.parent}
|
470
|
+
end
|
471
|
+
)
|
472
|
+
@update_backup = Google::Gax.create_api_call(
|
473
|
+
@bigtable_table_admin_stub.method(:update_backup),
|
474
|
+
defaults["update_backup"],
|
475
|
+
exception_transformer: exception_transformer,
|
476
|
+
params_extractor: proc do |request|
|
477
|
+
{'backup.name' => request.backup.name}
|
478
|
+
end
|
479
|
+
)
|
480
|
+
@delete_backup = Google::Gax.create_api_call(
|
481
|
+
@bigtable_table_admin_stub.method(:delete_backup),
|
482
|
+
defaults["delete_backup"],
|
483
|
+
exception_transformer: exception_transformer,
|
484
|
+
params_extractor: proc do |request|
|
485
|
+
{'name' => request.name}
|
486
|
+
end
|
487
|
+
)
|
488
|
+
@restore_table = Google::Gax.create_api_call(
|
489
|
+
@bigtable_table_admin_stub.method(:restore_table),
|
490
|
+
defaults["restore_table"],
|
491
|
+
exception_transformer: exception_transformer,
|
492
|
+
params_extractor: proc do |request|
|
493
|
+
{'parent' => request.parent}
|
494
|
+
end
|
495
|
+
)
|
423
496
|
end
|
424
497
|
|
425
498
|
# Service calls
|
@@ -432,8 +505,8 @@ module Google
|
|
432
505
|
# Required. The unique name of the instance in which to create the table.
|
433
506
|
# Values are of the form `projects/{project}/instances/{instance}`.
|
434
507
|
# @param table_id [String]
|
435
|
-
# Required. The name by which the new table should be referred to within the
|
436
|
-
# instance, e.g., `foobar` rather than `{parent}/tables/foobar`.
|
508
|
+
# Required. The name by which the new table should be referred to within the
|
509
|
+
# parent instance, e.g., `foobar` rather than `{parent}/tables/foobar`.
|
437
510
|
# Maximum 50 characters.
|
438
511
|
# @param table [Google::Bigtable::Admin::V2::Table | Hash]
|
439
512
|
# Required. The Table to create.
|
@@ -509,12 +582,12 @@ module Google
|
|
509
582
|
# Required. The unique name of the instance in which to create the table.
|
510
583
|
# Values are of the form `projects/{project}/instances/{instance}`.
|
511
584
|
# @param table_id [String]
|
512
|
-
# Required. The name by which the new table should be referred to within the
|
513
|
-
# instance, e.g., `foobar` rather than `{parent}/tables/foobar`.
|
585
|
+
# Required. The name by which the new table should be referred to within the
|
586
|
+
# parent instance, e.g., `foobar` rather than `{parent}/tables/foobar`.
|
514
587
|
# @param source_snapshot [String]
|
515
|
-
# Required. The unique name of the snapshot from which to restore the table.
|
516
|
-
# snapshot and the table must be in the same instance.
|
517
|
-
#
|
588
|
+
# Required. The unique name of the snapshot from which to restore the table.
|
589
|
+
# The snapshot and the table must be in the same instance. Values are of the
|
590
|
+
# form
|
518
591
|
# `projects/{project}/instances/{instance}/clusters/{cluster}/snapshots/{snapshot}`.
|
519
592
|
# @param options [Google::Gax::CallOptions]
|
520
593
|
# Overrides the default settings for this call, e.g, timeout,
|
@@ -585,8 +658,8 @@ module Google
|
|
585
658
|
# Lists all tables served from a specified instance.
|
586
659
|
#
|
587
660
|
# @param parent [String]
|
588
|
-
# Required. The unique name of the instance for which tables should be
|
589
|
-
# Values are of the form `projects/{project}/instances/{instance}`.
|
661
|
+
# Required. The unique name of the instance for which tables should be
|
662
|
+
# listed. Values are of the form `projects/{project}/instances/{instance}`.
|
590
663
|
# @param view [Google::Bigtable::Admin::V2::Table::View]
|
591
664
|
# The view to be applied to the returned tables' fields.
|
592
665
|
# Only NAME_ONLY view (default) and REPLICATION_VIEW are supported.
|
@@ -725,10 +798,10 @@ module Google
|
|
725
798
|
# Values are of the form
|
726
799
|
# `projects/{project}/instances/{instance}/tables/{table}`.
|
727
800
|
# @param modifications [Array<Google::Bigtable::Admin::V2::ModifyColumnFamiliesRequest::Modification | Hash>]
|
728
|
-
# Required. Modifications to be atomically applied to the specified table's
|
729
|
-
# Entries are applied in order, meaning that earlier modifications
|
730
|
-
# masked by later ones (in the case of repeated updates to the same
|
731
|
-
# for example).
|
801
|
+
# Required. Modifications to be atomically applied to the specified table's
|
802
|
+
# families. Entries are applied in order, meaning that earlier modifications
|
803
|
+
# can be masked by later ones (in the case of repeated updates to the same
|
804
|
+
# family, for example).
|
732
805
|
# A hash of the same form as `Google::Bigtable::Admin::V2::ModifyColumnFamiliesRequest::Modification`
|
733
806
|
# can also be provided.
|
734
807
|
# @param options [Google::Gax::CallOptions]
|
@@ -811,8 +884,8 @@ module Google
|
|
811
884
|
# for 90 days.
|
812
885
|
#
|
813
886
|
# @param name [String]
|
814
|
-
# Required. The unique name of the Table for which to create a consistency
|
815
|
-
# Values are of the form
|
887
|
+
# Required. The unique name of the Table for which to create a consistency
|
888
|
+
# token. Values are of the form
|
816
889
|
# `projects/{project}/instances/{instance}/tables/{table}`.
|
817
890
|
# @param options [Google::Gax::CallOptions]
|
818
891
|
# Overrides the default settings for this call, e.g, timeout,
|
@@ -845,8 +918,8 @@ module Google
|
|
845
918
|
# and the check request.
|
846
919
|
#
|
847
920
|
# @param name [String]
|
848
|
-
# Required. The unique name of the Table for which to check replication
|
849
|
-
# Values are of the form
|
921
|
+
# Required. The unique name of the Table for which to check replication
|
922
|
+
# consistency. Values are of the form
|
850
923
|
# `projects/{project}/instances/{instance}/tables/{table}`.
|
851
924
|
# @param consistency_token [String]
|
852
925
|
# Required. The token created using GenerateConsistencyToken for the Table.
|
@@ -1016,17 +1089,17 @@ module Google
|
|
1016
1089
|
# policy.
|
1017
1090
|
#
|
1018
1091
|
# @param name [String]
|
1019
|
-
# The unique name of the table to have the snapshot taken.
|
1092
|
+
# Required. The unique name of the table to have the snapshot taken.
|
1020
1093
|
# Values are of the form
|
1021
1094
|
# `projects/{project}/instances/{instance}/tables/{table}`.
|
1022
1095
|
# @param cluster [String]
|
1023
|
-
# The name of the cluster where the snapshot will be created in.
|
1096
|
+
# Required. The name of the cluster where the snapshot will be created in.
|
1024
1097
|
# Values are of the form
|
1025
1098
|
# `projects/{project}/instances/{instance}/clusters/{cluster}`.
|
1026
1099
|
# @param snapshot_id [String]
|
1027
|
-
# The ID by which the new snapshot should be referred to within the
|
1028
|
-
# cluster, e.g., `mysnapshot` of the form:
|
1029
|
-
# rather than
|
1100
|
+
# Required. The ID by which the new snapshot should be referred to within the
|
1101
|
+
# parent cluster, e.g., `mysnapshot` of the form:
|
1102
|
+
# `[_a-zA-Z0-9][-_.a-zA-Z0-9]*` rather than
|
1030
1103
|
# `projects/{project}/instances/{instance}/clusters/{cluster}/snapshots/mysnapshot`.
|
1031
1104
|
# @param description [String]
|
1032
1105
|
# Description of the snapshot.
|
@@ -1157,8 +1230,8 @@ module Google
|
|
1157
1230
|
# policy.
|
1158
1231
|
#
|
1159
1232
|
# @param parent [String]
|
1160
|
-
# Required. The unique name of the cluster for which snapshots should be
|
1161
|
-
# Values are of the form
|
1233
|
+
# Required. The unique name of the cluster for which snapshots should be
|
1234
|
+
# listed. Values are of the form
|
1162
1235
|
# `projects/{project}/instances/{instance}/clusters/{cluster}`.
|
1163
1236
|
# Use `{cluster} = '-'` to list snapshots for all clusters in an instance,
|
1164
1237
|
# e.g., `projects/{project}/instances/{instance}/clusters/-`.
|
@@ -1249,6 +1322,410 @@ module Google
|
|
1249
1322
|
@delete_snapshot.call(req, options, &block)
|
1250
1323
|
nil
|
1251
1324
|
end
|
1325
|
+
|
1326
|
+
# Starts creating a new Cloud Bigtable Backup. The returned backup
|
1327
|
+
# {Google::Longrunning::Operation long-running operation} can be used to
|
1328
|
+
# track creation of the backup. The
|
1329
|
+
# {Google::Longrunning::Operation#metadata metadata} field type is
|
1330
|
+
# {Google::Bigtable::Admin::V2::CreateBackupMetadata CreateBackupMetadata}. The
|
1331
|
+
# {Google::Longrunning::Operation#response response} field type is
|
1332
|
+
# {Google::Bigtable::Admin::V2::Backup Backup}, if successful. Cancelling the
|
1333
|
+
# returned operation will stop the creation and delete the backup.
|
1334
|
+
#
|
1335
|
+
# @param parent [String]
|
1336
|
+
# Required. This must be one of the clusters in the instance in which this
|
1337
|
+
# table is located. The backup will be stored in this cluster. Values are
|
1338
|
+
# of the form `projects/{project}/instances/{instance}/clusters/{cluster}`.
|
1339
|
+
# @param backup_id [String]
|
1340
|
+
# Required. The id of the backup to be created. The `backup_id` along with
|
1341
|
+
# the parent `parent` are combined as \\{parent}/backups/\\{backup_id} to create
|
1342
|
+
# the full backup name, of the form:
|
1343
|
+
# `projects/{project}/instances/{instance}/clusters/{cluster}/backups/{backup_id}`.
|
1344
|
+
# This string must be between 1 and 50 characters in length and match the
|
1345
|
+
# regex [_a-zA-Z0-9][-_.a-zA-Z0-9]*.
|
1346
|
+
# @param backup [Google::Bigtable::Admin::V2::Backup | Hash]
|
1347
|
+
# Required. The backup to create.
|
1348
|
+
# A hash of the same form as `Google::Bigtable::Admin::V2::Backup`
|
1349
|
+
# can also be provided.
|
1350
|
+
# @param options [Google::Gax::CallOptions]
|
1351
|
+
# Overrides the default settings for this call, e.g, timeout,
|
1352
|
+
# retries, etc.
|
1353
|
+
# @return [Google::Gax::Operation]
|
1354
|
+
# @raise [Google::Gax::GaxError] if the RPC is aborted.
|
1355
|
+
# @example
|
1356
|
+
# require "google/cloud/bigtable/admin"
|
1357
|
+
#
|
1358
|
+
# bigtable_table_admin_client = Google::Cloud::Bigtable::Admin::BigtableTableAdmin.new(version: :v2)
|
1359
|
+
# formatted_parent = Google::Cloud::Bigtable::Admin::V2::BigtableTableAdminClient.cluster_path("[PROJECT]", "[INSTANCE]", "[CLUSTER]")
|
1360
|
+
#
|
1361
|
+
# # TODO: Initialize `backup_id`:
|
1362
|
+
# backup_id = ''
|
1363
|
+
#
|
1364
|
+
# # TODO: Initialize `backup`:
|
1365
|
+
# backup = {}
|
1366
|
+
#
|
1367
|
+
# # Register a callback during the method call.
|
1368
|
+
# operation = bigtable_table_admin_client.create_backup(formatted_parent, backup_id, backup) do |op|
|
1369
|
+
# raise op.results.message if op.error?
|
1370
|
+
# op_results = op.results
|
1371
|
+
# # Process the results.
|
1372
|
+
#
|
1373
|
+
# metadata = op.metadata
|
1374
|
+
# # Process the metadata.
|
1375
|
+
# end
|
1376
|
+
#
|
1377
|
+
# # Or use the return value to register a callback.
|
1378
|
+
# operation.on_done do |op|
|
1379
|
+
# raise op.results.message if op.error?
|
1380
|
+
# op_results = op.results
|
1381
|
+
# # Process the results.
|
1382
|
+
#
|
1383
|
+
# metadata = op.metadata
|
1384
|
+
# # Process the metadata.
|
1385
|
+
# end
|
1386
|
+
#
|
1387
|
+
# # Manually reload the operation.
|
1388
|
+
# operation.reload!
|
1389
|
+
#
|
1390
|
+
# # Or block until the operation completes, triggering callbacks on
|
1391
|
+
# # completion.
|
1392
|
+
# operation.wait_until_done!
|
1393
|
+
|
1394
|
+
def create_backup \
|
1395
|
+
parent,
|
1396
|
+
backup_id,
|
1397
|
+
backup,
|
1398
|
+
options: nil
|
1399
|
+
req = {
|
1400
|
+
parent: parent,
|
1401
|
+
backup_id: backup_id,
|
1402
|
+
backup: backup
|
1403
|
+
}.delete_if { |_, v| v.nil? }
|
1404
|
+
req = Google::Gax::to_proto(req, Google::Bigtable::Admin::V2::CreateBackupRequest)
|
1405
|
+
operation = Google::Gax::Operation.new(
|
1406
|
+
@create_backup.call(req, options),
|
1407
|
+
@operations_client,
|
1408
|
+
Google::Bigtable::Admin::V2::Backup,
|
1409
|
+
Google::Bigtable::Admin::V2::CreateBackupMetadata,
|
1410
|
+
call_options: options
|
1411
|
+
)
|
1412
|
+
operation.on_done { |operation| yield(operation) } if block_given?
|
1413
|
+
operation
|
1414
|
+
end
|
1415
|
+
|
1416
|
+
# Gets metadata on a pending or completed Cloud Bigtable Backup.
|
1417
|
+
#
|
1418
|
+
# @param name [String]
|
1419
|
+
# Required. Name of the backup.
|
1420
|
+
# Values are of the form
|
1421
|
+
# `projects/{project}/instances/{instance}/clusters/{cluster}/backups/{backup}`.
|
1422
|
+
# @param options [Google::Gax::CallOptions]
|
1423
|
+
# Overrides the default settings for this call, e.g, timeout,
|
1424
|
+
# retries, etc.
|
1425
|
+
# @yield [result, operation] Access the result along with the RPC operation
|
1426
|
+
# @yieldparam result [Google::Bigtable::Admin::V2::Backup]
|
1427
|
+
# @yieldparam operation [GRPC::ActiveCall::Operation]
|
1428
|
+
# @return [Google::Bigtable::Admin::V2::Backup]
|
1429
|
+
# @raise [Google::Gax::GaxError] if the RPC is aborted.
|
1430
|
+
# @example
|
1431
|
+
# require "google/cloud/bigtable/admin"
|
1432
|
+
#
|
1433
|
+
# bigtable_table_admin_client = Google::Cloud::Bigtable::Admin::BigtableTableAdmin.new(version: :v2)
|
1434
|
+
# formatted_name = Google::Cloud::Bigtable::Admin::V2::BigtableTableAdminClient.backup_path("[PROJECT]", "[INSTANCE]", "[CLUSTER]", "[BACKUP]")
|
1435
|
+
# response = bigtable_table_admin_client.get_backup(formatted_name)
|
1436
|
+
|
1437
|
+
def get_backup \
|
1438
|
+
name,
|
1439
|
+
options: nil,
|
1440
|
+
&block
|
1441
|
+
req = {
|
1442
|
+
name: name
|
1443
|
+
}.delete_if { |_, v| v.nil? }
|
1444
|
+
req = Google::Gax::to_proto(req, Google::Bigtable::Admin::V2::GetBackupRequest)
|
1445
|
+
@get_backup.call(req, options, &block)
|
1446
|
+
end
|
1447
|
+
|
1448
|
+
# Lists Cloud Bigtable backups. Returns both completed and pending
|
1449
|
+
# backups.
|
1450
|
+
#
|
1451
|
+
# @param parent [String]
|
1452
|
+
# Required. The cluster to list backups from. Values are of the
|
1453
|
+
# form `projects/{project}/instances/{instance}/clusters/{cluster}`.
|
1454
|
+
# Use `{cluster} = '-'` to list backups for all clusters in an instance,
|
1455
|
+
# e.g., `projects/{project}/instances/{instance}/clusters/-`.
|
1456
|
+
# @param filter [String]
|
1457
|
+
# A filter expression that filters backups listed in the response.
|
1458
|
+
# The expression must specify the field name, a comparison operator,
|
1459
|
+
# and the value that you want to use for filtering. The value must be a
|
1460
|
+
# string, a number, or a boolean. The comparison operator must be
|
1461
|
+
# <, >, <=, >=, !=, =, or :. Colon ‘:’ represents a HAS operator which is
|
1462
|
+
# roughly synonymous with equality. Filter rules are case insensitive.
|
1463
|
+
#
|
1464
|
+
# The fields eligible for filtering are:
|
1465
|
+
# * `name`
|
1466
|
+
# * `source_table`
|
1467
|
+
# * `state`
|
1468
|
+
# * `start_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ)
|
1469
|
+
# * `end_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ)
|
1470
|
+
# * `expire_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ)
|
1471
|
+
# * `size_bytes`
|
1472
|
+
#
|
1473
|
+
# To filter on multiple expressions, provide each separate expression within
|
1474
|
+
# parentheses. By default, each expression is an AND expression. However,
|
1475
|
+
# you can include AND, OR, and NOT expressions explicitly.
|
1476
|
+
#
|
1477
|
+
# Some examples of using filters are:
|
1478
|
+
#
|
1479
|
+
# * `name:"exact"` --> The backup's name is the string "exact".
|
1480
|
+
# * `name:howl` --> The backup's name contains the string "howl".
|
1481
|
+
# * `source_table:prod`
|
1482
|
+
# --> The source_table's name contains the string "prod".
|
1483
|
+
# * `state:CREATING` --> The backup is pending creation.
|
1484
|
+
# * `state:READY` --> The backup is fully created and ready for use.
|
1485
|
+
# * `(name:howl) AND (start_time < \"2018-03-28T14:50:00Z\")`
|
1486
|
+
# --> The backup name contains the string "howl" and start_time
|
1487
|
+
# of the backup is before 2018-03-28T14:50:00Z.
|
1488
|
+
# * `size_bytes > 10000000000` --> The backup's size is greater than 10GB
|
1489
|
+
# @param order_by [String]
|
1490
|
+
# An expression for specifying the sort order of the results of the request.
|
1491
|
+
# The string value should specify one or more fields in
|
1492
|
+
# {Google::Bigtable::Admin::V2::Backup Backup}. The full syntax is described at
|
1493
|
+
# https://aip.dev/132#ordering.
|
1494
|
+
#
|
1495
|
+
# Fields supported are:
|
1496
|
+
# * name
|
1497
|
+
# * source_table
|
1498
|
+
# * expire_time
|
1499
|
+
# * start_time
|
1500
|
+
# * end_time
|
1501
|
+
# * size_bytes
|
1502
|
+
# * state
|
1503
|
+
#
|
1504
|
+
# For example, "start_time". The default sorting order is ascending.
|
1505
|
+
# To specify descending order for the field, a suffix " desc" should
|
1506
|
+
# be appended to the field name. For example, "start_time desc".
|
1507
|
+
# Redundant space characters in the syntax are insigificant.
|
1508
|
+
#
|
1509
|
+
# If order_by is empty, results will be sorted by `start_time` in descending
|
1510
|
+
# order starting from the most recently created backup.
|
1511
|
+
# @param page_size [Integer]
|
1512
|
+
# The maximum number of resources contained in the underlying API
|
1513
|
+
# response. If page streaming is performed per-resource, this
|
1514
|
+
# parameter does not affect the return value. If page streaming is
|
1515
|
+
# performed per-page, this determines the maximum number of
|
1516
|
+
# resources in a page.
|
1517
|
+
# @param options [Google::Gax::CallOptions]
|
1518
|
+
# Overrides the default settings for this call, e.g, timeout,
|
1519
|
+
# retries, etc.
|
1520
|
+
# @yield [result, operation] Access the result along with the RPC operation
|
1521
|
+
# @yieldparam result [Google::Gax::PagedEnumerable<Google::Bigtable::Admin::V2::Backup>]
|
1522
|
+
# @yieldparam operation [GRPC::ActiveCall::Operation]
|
1523
|
+
# @return [Google::Gax::PagedEnumerable<Google::Bigtable::Admin::V2::Backup>]
|
1524
|
+
# An enumerable of Google::Bigtable::Admin::V2::Backup instances.
|
1525
|
+
# See Google::Gax::PagedEnumerable documentation for other
|
1526
|
+
# operations such as per-page iteration or access to the response
|
1527
|
+
# object.
|
1528
|
+
# @raise [Google::Gax::GaxError] if the RPC is aborted.
|
1529
|
+
# @example
|
1530
|
+
# require "google/cloud/bigtable/admin"
|
1531
|
+
#
|
1532
|
+
# bigtable_table_admin_client = Google::Cloud::Bigtable::Admin::BigtableTableAdmin.new(version: :v2)
|
1533
|
+
# formatted_parent = Google::Cloud::Bigtable::Admin::V2::BigtableTableAdminClient.cluster_path("[PROJECT]", "[INSTANCE]", "[CLUSTER]")
|
1534
|
+
#
|
1535
|
+
# # Iterate over all results.
|
1536
|
+
# bigtable_table_admin_client.list_backups(formatted_parent).each do |element|
|
1537
|
+
# # Process element.
|
1538
|
+
# end
|
1539
|
+
#
|
1540
|
+
# # Or iterate over results one page at a time.
|
1541
|
+
# bigtable_table_admin_client.list_backups(formatted_parent).each_page do |page|
|
1542
|
+
# # Process each page at a time.
|
1543
|
+
# page.each do |element|
|
1544
|
+
# # Process element.
|
1545
|
+
# end
|
1546
|
+
# end
|
1547
|
+
|
1548
|
+
def list_backups \
|
1549
|
+
parent,
|
1550
|
+
filter: nil,
|
1551
|
+
order_by: nil,
|
1552
|
+
page_size: nil,
|
1553
|
+
options: nil,
|
1554
|
+
&block
|
1555
|
+
req = {
|
1556
|
+
parent: parent,
|
1557
|
+
filter: filter,
|
1558
|
+
order_by: order_by,
|
1559
|
+
page_size: page_size
|
1560
|
+
}.delete_if { |_, v| v.nil? }
|
1561
|
+
req = Google::Gax::to_proto(req, Google::Bigtable::Admin::V2::ListBackupsRequest)
|
1562
|
+
@list_backups.call(req, options, &block)
|
1563
|
+
end
|
1564
|
+
|
1565
|
+
# Updates a pending or completed Cloud Bigtable Backup.
|
1566
|
+
#
|
1567
|
+
# @param backup [Google::Bigtable::Admin::V2::Backup | Hash]
|
1568
|
+
# Required. The backup to update. `backup.name`, and the fields to be updated
|
1569
|
+
# as specified by `update_mask` are required. Other fields are ignored.
|
1570
|
+
# Update is only supported for the following fields:
|
1571
|
+
# * `backup.expire_time`.
|
1572
|
+
# A hash of the same form as `Google::Bigtable::Admin::V2::Backup`
|
1573
|
+
# can also be provided.
|
1574
|
+
# @param update_mask [Google::Protobuf::FieldMask | Hash]
|
1575
|
+
# Required. A mask specifying which fields (e.g. `expire_time`) in the
|
1576
|
+
# Backup resource should be updated. This mask is relative to the Backup
|
1577
|
+
# resource, not to the request message. The field mask must always be
|
1578
|
+
# specified; this prevents any future fields from being erased accidentally
|
1579
|
+
# by clients that do not know about them.
|
1580
|
+
# A hash of the same form as `Google::Protobuf::FieldMask`
|
1581
|
+
# can also be provided.
|
1582
|
+
# @param options [Google::Gax::CallOptions]
|
1583
|
+
# Overrides the default settings for this call, e.g, timeout,
|
1584
|
+
# retries, etc.
|
1585
|
+
# @yield [result, operation] Access the result along with the RPC operation
|
1586
|
+
# @yieldparam result [Google::Bigtable::Admin::V2::Backup]
|
1587
|
+
# @yieldparam operation [GRPC::ActiveCall::Operation]
|
1588
|
+
# @return [Google::Bigtable::Admin::V2::Backup]
|
1589
|
+
# @raise [Google::Gax::GaxError] if the RPC is aborted.
|
1590
|
+
# @example
|
1591
|
+
# require "google/cloud/bigtable/admin"
|
1592
|
+
#
|
1593
|
+
# bigtable_table_admin_client = Google::Cloud::Bigtable::Admin::BigtableTableAdmin.new(version: :v2)
|
1594
|
+
#
|
1595
|
+
# # TODO: Initialize `backup`:
|
1596
|
+
# backup = {}
|
1597
|
+
#
|
1598
|
+
# # TODO: Initialize `update_mask`:
|
1599
|
+
# update_mask = {}
|
1600
|
+
# response = bigtable_table_admin_client.update_backup(backup, update_mask)
|
1601
|
+
|
1602
|
+
def update_backup \
|
1603
|
+
backup,
|
1604
|
+
update_mask,
|
1605
|
+
options: nil,
|
1606
|
+
&block
|
1607
|
+
req = {
|
1608
|
+
backup: backup,
|
1609
|
+
update_mask: update_mask
|
1610
|
+
}.delete_if { |_, v| v.nil? }
|
1611
|
+
req = Google::Gax::to_proto(req, Google::Bigtable::Admin::V2::UpdateBackupRequest)
|
1612
|
+
@update_backup.call(req, options, &block)
|
1613
|
+
end
|
1614
|
+
|
1615
|
+
# Deletes a pending or completed Cloud Bigtable backup.
|
1616
|
+
#
|
1617
|
+
# @param name [String]
|
1618
|
+
# Required. Name of the backup to delete.
|
1619
|
+
# Values are of the form
|
1620
|
+
# `projects/{project}/instances/{instance}/clusters/{cluster}/backups/{backup}`.
|
1621
|
+
# @param options [Google::Gax::CallOptions]
|
1622
|
+
# Overrides the default settings for this call, e.g, timeout,
|
1623
|
+
# retries, etc.
|
1624
|
+
# @yield [result, operation] Access the result along with the RPC operation
|
1625
|
+
# @yieldparam result []
|
1626
|
+
# @yieldparam operation [GRPC::ActiveCall::Operation]
|
1627
|
+
# @raise [Google::Gax::GaxError] if the RPC is aborted.
|
1628
|
+
# @example
|
1629
|
+
# require "google/cloud/bigtable/admin"
|
1630
|
+
#
|
1631
|
+
# bigtable_table_admin_client = Google::Cloud::Bigtable::Admin::BigtableTableAdmin.new(version: :v2)
|
1632
|
+
# formatted_name = Google::Cloud::Bigtable::Admin::V2::BigtableTableAdminClient.backup_path("[PROJECT]", "[INSTANCE]", "[CLUSTER]", "[BACKUP]")
|
1633
|
+
# bigtable_table_admin_client.delete_backup(formatted_name)
|
1634
|
+
|
1635
|
+
def delete_backup \
|
1636
|
+
name,
|
1637
|
+
options: nil,
|
1638
|
+
&block
|
1639
|
+
req = {
|
1640
|
+
name: name
|
1641
|
+
}.delete_if { |_, v| v.nil? }
|
1642
|
+
req = Google::Gax::to_proto(req, Google::Bigtable::Admin::V2::DeleteBackupRequest)
|
1643
|
+
@delete_backup.call(req, options, &block)
|
1644
|
+
nil
|
1645
|
+
end
|
1646
|
+
|
1647
|
+
# Create a new table by restoring from a completed backup. The new table
|
1648
|
+
# must be in the same instance as the instance containing the backup. The
|
1649
|
+
# returned table {Google::Longrunning::Operation long-running operation} can
|
1650
|
+
# be used to track the progress of the operation, and to cancel it. The
|
1651
|
+
# {Google::Longrunning::Operation#metadata metadata} field type is
|
1652
|
+
# {Google::Bigtable::Admin::RestoreTableMetadata RestoreTableMetadata}. The
|
1653
|
+
# {Google::Longrunning::Operation#response response} type is
|
1654
|
+
# {Google::Bigtable::Admin::V2::Table Table}, if successful.
|
1655
|
+
#
|
1656
|
+
# @param parent [String]
|
1657
|
+
# Required. The name of the instance in which to create the restored
|
1658
|
+
# table. This instance must be the parent of the source backup. Values are
|
1659
|
+
# of the form `projects/<project>/instances/<instance>`.
|
1660
|
+
# @param table_id [String]
|
1661
|
+
# Required. The id of the table to create and restore to. This
|
1662
|
+
# table must not already exist. The `table_id` appended to
|
1663
|
+
# `parent` forms the full table name of the form
|
1664
|
+
# `projects/<project>/instances/<instance>/tables/<table_id>`.
|
1665
|
+
# @param backup [String]
|
1666
|
+
# Name of the backup from which to restore. Values are of the form
|
1667
|
+
# `projects/<project>/instances/<instance>/clusters/<cluster>/backups/<backup>`.
|
1668
|
+
# @param options [Google::Gax::CallOptions]
|
1669
|
+
# Overrides the default settings for this call, e.g, timeout,
|
1670
|
+
# retries, etc.
|
1671
|
+
# @return [Google::Gax::Operation]
|
1672
|
+
# @raise [Google::Gax::GaxError] if the RPC is aborted.
|
1673
|
+
# @example
|
1674
|
+
# require "google/cloud/bigtable/admin"
|
1675
|
+
#
|
1676
|
+
# bigtable_table_admin_client = Google::Cloud::Bigtable::Admin::BigtableTableAdmin.new(version: :v2)
|
1677
|
+
#
|
1678
|
+
# # TODO: Initialize `parent`:
|
1679
|
+
# parent = ''
|
1680
|
+
#
|
1681
|
+
# # Register a callback during the method call.
|
1682
|
+
# operation = bigtable_table_admin_client.restore_table(parent) do |op|
|
1683
|
+
# raise op.results.message if op.error?
|
1684
|
+
# op_results = op.results
|
1685
|
+
# # Process the results.
|
1686
|
+
#
|
1687
|
+
# metadata = op.metadata
|
1688
|
+
# # Process the metadata.
|
1689
|
+
# end
|
1690
|
+
#
|
1691
|
+
# # Or use the return value to register a callback.
|
1692
|
+
# operation.on_done do |op|
|
1693
|
+
# raise op.results.message if op.error?
|
1694
|
+
# op_results = op.results
|
1695
|
+
# # Process the results.
|
1696
|
+
#
|
1697
|
+
# metadata = op.metadata
|
1698
|
+
# # Process the metadata.
|
1699
|
+
# end
|
1700
|
+
#
|
1701
|
+
# # Manually reload the operation.
|
1702
|
+
# operation.reload!
|
1703
|
+
#
|
1704
|
+
# # Or block until the operation completes, triggering callbacks on
|
1705
|
+
# # completion.
|
1706
|
+
# operation.wait_until_done!
|
1707
|
+
|
1708
|
+
def restore_table \
|
1709
|
+
parent,
|
1710
|
+
table_id: nil,
|
1711
|
+
backup: nil,
|
1712
|
+
options: nil
|
1713
|
+
req = {
|
1714
|
+
parent: parent,
|
1715
|
+
table_id: table_id,
|
1716
|
+
backup: backup
|
1717
|
+
}.delete_if { |_, v| v.nil? }
|
1718
|
+
req = Google::Gax::to_proto(req, Google::Bigtable::Admin::V2::RestoreTableRequest)
|
1719
|
+
operation = Google::Gax::Operation.new(
|
1720
|
+
@restore_table.call(req, options),
|
1721
|
+
@operations_client,
|
1722
|
+
Google::Bigtable::Admin::V2::Table,
|
1723
|
+
Google::Bigtable::Admin::V2::RestoreTableMetadata,
|
1724
|
+
call_options: options
|
1725
|
+
)
|
1726
|
+
operation.on_done { |operation| yield(operation) } if block_given?
|
1727
|
+
operation
|
1728
|
+
end
|
1252
1729
|
end
|
1253
1730
|
end
|
1254
1731
|
end
|