google-cloud-bigtable 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.yardopts +10 -0
- data/LICENSE +201 -0
- data/README.md +65 -0
- data/lib/google/bigtable/admin/v2/bigtable_instance_admin_pb.rb +139 -0
- data/lib/google/bigtable/admin/v2/bigtable_instance_admin_services_pb.rb +85 -0
- data/lib/google/bigtable/admin/v2/bigtable_table_admin_pb.rb +137 -0
- data/lib/google/bigtable/admin/v2/bigtable_table_admin_services_pb.rb +117 -0
- data/lib/google/bigtable/admin/v2/common_pb.rb +24 -0
- data/lib/google/bigtable/admin/v2/instance_pb.rb +72 -0
- data/lib/google/bigtable/admin/v2/table_pb.rb +88 -0
- data/lib/google/bigtable/v2/bigtable_pb.rb +109 -0
- data/lib/google/bigtable/v2/bigtable_services_pb.rb +67 -0
- data/lib/google/bigtable/v2/data_pb.rb +155 -0
- data/lib/google/cloud/bigtable/admin/credentials.rb +26 -0
- data/lib/google/cloud/bigtable/admin/v2/bigtable_instance_admin_client.rb +1417 -0
- data/lib/google/cloud/bigtable/admin/v2/bigtable_instance_admin_client_config.json +123 -0
- data/lib/google/cloud/bigtable/admin/v2/bigtable_table_admin_client.rb +1079 -0
- data/lib/google/cloud/bigtable/admin/v2/bigtable_table_admin_client_config.json +109 -0
- data/lib/google/cloud/bigtable/admin/v2/credentials.rb +50 -0
- data/lib/google/cloud/bigtable/admin/v2/doc/google/bigtable/admin/v2/bigtable_instance_admin.rb +279 -0
- data/lib/google/cloud/bigtable/admin/v2/doc/google/bigtable/admin/v2/bigtable_table_admin.rb +353 -0
- data/lib/google/cloud/bigtable/admin/v2/doc/google/bigtable/admin/v2/instance.rb +194 -0
- data/lib/google/cloud/bigtable/admin/v2/doc/google/bigtable/admin/v2/table.rb +209 -0
- data/lib/google/cloud/bigtable/admin/v2/doc/google/iam/v1/iam_policy.rb +62 -0
- data/lib/google/cloud/bigtable/admin/v2/doc/google/iam/v1/policy.rb +127 -0
- data/lib/google/cloud/bigtable/admin/v2/doc/google/longrunning/operations.rb +92 -0
- data/lib/google/cloud/bigtable/admin/v2/doc/google/protobuf/any.rb +124 -0
- data/lib/google/cloud/bigtable/admin/v2/doc/google/protobuf/duration.rb +90 -0
- data/lib/google/cloud/bigtable/admin/v2/doc/google/protobuf/empty.rb +28 -0
- data/lib/google/cloud/bigtable/admin/v2/doc/google/protobuf/field_mask.rb +223 -0
- data/lib/google/cloud/bigtable/admin/v2/doc/google/protobuf/timestamp.rb +106 -0
- data/lib/google/cloud/bigtable/admin/v2/doc/google/rpc/status.rb +83 -0
- data/lib/google/cloud/bigtable/admin/v2.rb +200 -0
- data/lib/google/cloud/bigtable/admin.rb +196 -0
- data/lib/google/cloud/bigtable/app_profile/job.rb +102 -0
- data/lib/google/cloud/bigtable/app_profile/list.rb +159 -0
- data/lib/google/cloud/bigtable/app_profile.rb +373 -0
- data/lib/google/cloud/bigtable/chunk_processor.rb +253 -0
- data/lib/google/cloud/bigtable/cluster/job.rb +92 -0
- data/lib/google/cloud/bigtable/cluster/list.rb +169 -0
- data/lib/google/cloud/bigtable/cluster.rb +264 -0
- data/lib/google/cloud/bigtable/column_family.rb +280 -0
- data/lib/google/cloud/bigtable/column_range.rb +186 -0
- data/lib/google/cloud/bigtable/convert.rb +75 -0
- data/lib/google/cloud/bigtable/credentials.rb +24 -0
- data/lib/google/cloud/bigtable/errors.rb +35 -0
- data/lib/google/cloud/bigtable/gc_rule.rb +215 -0
- data/lib/google/cloud/bigtable/instance/cluster_map.rb +70 -0
- data/lib/google/cloud/bigtable/instance/job.rb +97 -0
- data/lib/google/cloud/bigtable/instance/list.rb +159 -0
- data/lib/google/cloud/bigtable/instance.rb +921 -0
- data/lib/google/cloud/bigtable/longrunning_job.rb +105 -0
- data/lib/google/cloud/bigtable/mutation_entry.rb +244 -0
- data/lib/google/cloud/bigtable/mutation_operations.rb +338 -0
- data/lib/google/cloud/bigtable/policy.rb +163 -0
- data/lib/google/cloud/bigtable/project.rb +580 -0
- data/lib/google/cloud/bigtable/read_modify_write_rule.rb +129 -0
- data/lib/google/cloud/bigtable/read_operations.rb +345 -0
- data/lib/google/cloud/bigtable/row.rb +125 -0
- data/lib/google/cloud/bigtable/row_filter/chain_filter.rb +539 -0
- data/lib/google/cloud/bigtable/row_filter/condition_filter.rb +108 -0
- data/lib/google/cloud/bigtable/row_filter/interleave_filter.rb +570 -0
- data/lib/google/cloud/bigtable/row_filter/simple_filter.rb +273 -0
- data/lib/google/cloud/bigtable/row_filter.rb +593 -0
- data/lib/google/cloud/bigtable/row_range.rb +174 -0
- data/lib/google/cloud/bigtable/rows_mutator.rb +120 -0
- data/lib/google/cloud/bigtable/rows_reader.rb +196 -0
- data/lib/google/cloud/bigtable/sample_row_key.rb +82 -0
- data/lib/google/cloud/bigtable/service.rb +817 -0
- data/lib/google/cloud/bigtable/table/cluster_state.rb +93 -0
- data/lib/google/cloud/bigtable/table/column_family_map.rb +68 -0
- data/lib/google/cloud/bigtable/table/list.rb +147 -0
- data/lib/google/cloud/bigtable/table.rb +676 -0
- data/lib/google/cloud/bigtable/v2/bigtable_client.rb +579 -0
- data/lib/google/cloud/bigtable/v2/bigtable_client_config.json +65 -0
- data/lib/google/cloud/bigtable/v2/credentials.rb +45 -0
- data/lib/google/cloud/bigtable/v2/doc/google/bigtable/v2/bigtable.rb +286 -0
- data/lib/google/cloud/bigtable/v2/doc/google/bigtable/v2/data.rb +492 -0
- data/lib/google/cloud/bigtable/v2/doc/google/protobuf/any.rb +124 -0
- data/lib/google/cloud/bigtable/v2/doc/google/protobuf/wrappers.rb +89 -0
- data/lib/google/cloud/bigtable/v2/doc/google/rpc/status.rb +83 -0
- data/lib/google/cloud/bigtable/v2.rb +132 -0
- data/lib/google/cloud/bigtable/value_range.rb +175 -0
- data/lib/google/cloud/bigtable/version.rb +22 -0
- data/lib/google/cloud/bigtable.rb +223 -0
- data/lib/google-cloud-bigtable.rb +167 -0
- metadata +283 -0
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
{
|
|
2
|
+
"interfaces": {
|
|
3
|
+
"google.bigtable.admin.v2.BigtableInstanceAdmin": {
|
|
4
|
+
"retry_codes": {
|
|
5
|
+
"idempotent": [
|
|
6
|
+
"DEADLINE_EXCEEDED",
|
|
7
|
+
"UNAVAILABLE"
|
|
8
|
+
],
|
|
9
|
+
"non_idempotent": [
|
|
10
|
+
"UNAVAILABLE"
|
|
11
|
+
]
|
|
12
|
+
},
|
|
13
|
+
"retry_params": {
|
|
14
|
+
"default": {
|
|
15
|
+
"initial_retry_delay_millis": 5,
|
|
16
|
+
"retry_delay_multiplier": 2.0,
|
|
17
|
+
"max_retry_delay_millis": 60000,
|
|
18
|
+
"initial_rpc_timeout_millis": 60000,
|
|
19
|
+
"rpc_timeout_multiplier": 1.0,
|
|
20
|
+
"max_rpc_timeout_millis": 60000,
|
|
21
|
+
"total_timeout_millis": 600000
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
"methods": {
|
|
25
|
+
"CreateInstance": {
|
|
26
|
+
"timeout_millis": 60000,
|
|
27
|
+
"retry_codes_name": "non_idempotent",
|
|
28
|
+
"retry_params_name": "default"
|
|
29
|
+
},
|
|
30
|
+
"GetInstance": {
|
|
31
|
+
"timeout_millis": 60000,
|
|
32
|
+
"retry_codes_name": "idempotent",
|
|
33
|
+
"retry_params_name": "default"
|
|
34
|
+
},
|
|
35
|
+
"ListInstances": {
|
|
36
|
+
"timeout_millis": 60000,
|
|
37
|
+
"retry_codes_name": "idempotent",
|
|
38
|
+
"retry_params_name": "default"
|
|
39
|
+
},
|
|
40
|
+
"UpdateInstance": {
|
|
41
|
+
"timeout_millis": 60000,
|
|
42
|
+
"retry_codes_name": "idempotent",
|
|
43
|
+
"retry_params_name": "default"
|
|
44
|
+
},
|
|
45
|
+
"PartialUpdateInstance": {
|
|
46
|
+
"timeout_millis": 60000,
|
|
47
|
+
"retry_codes_name": "idempotent",
|
|
48
|
+
"retry_params_name": "default"
|
|
49
|
+
},
|
|
50
|
+
"DeleteInstance": {
|
|
51
|
+
"timeout_millis": 60000,
|
|
52
|
+
"retry_codes_name": "idempotent",
|
|
53
|
+
"retry_params_name": "default"
|
|
54
|
+
},
|
|
55
|
+
"CreateCluster": {
|
|
56
|
+
"timeout_millis": 60000,
|
|
57
|
+
"retry_codes_name": "non_idempotent",
|
|
58
|
+
"retry_params_name": "default"
|
|
59
|
+
},
|
|
60
|
+
"GetCluster": {
|
|
61
|
+
"timeout_millis": 60000,
|
|
62
|
+
"retry_codes_name": "idempotent",
|
|
63
|
+
"retry_params_name": "default"
|
|
64
|
+
},
|
|
65
|
+
"ListClusters": {
|
|
66
|
+
"timeout_millis": 60000,
|
|
67
|
+
"retry_codes_name": "idempotent",
|
|
68
|
+
"retry_params_name": "default"
|
|
69
|
+
},
|
|
70
|
+
"UpdateCluster": {
|
|
71
|
+
"timeout_millis": 60000,
|
|
72
|
+
"retry_codes_name": "idempotent",
|
|
73
|
+
"retry_params_name": "default"
|
|
74
|
+
},
|
|
75
|
+
"DeleteCluster": {
|
|
76
|
+
"timeout_millis": 60000,
|
|
77
|
+
"retry_codes_name": "idempotent",
|
|
78
|
+
"retry_params_name": "default"
|
|
79
|
+
},
|
|
80
|
+
"CreateAppProfile": {
|
|
81
|
+
"timeout_millis": 60000,
|
|
82
|
+
"retry_codes_name": "non_idempotent",
|
|
83
|
+
"retry_params_name": "default"
|
|
84
|
+
},
|
|
85
|
+
"GetAppProfile": {
|
|
86
|
+
"timeout_millis": 60000,
|
|
87
|
+
"retry_codes_name": "idempotent",
|
|
88
|
+
"retry_params_name": "default"
|
|
89
|
+
},
|
|
90
|
+
"ListAppProfiles": {
|
|
91
|
+
"timeout_millis": 60000,
|
|
92
|
+
"retry_codes_name": "idempotent",
|
|
93
|
+
"retry_params_name": "default"
|
|
94
|
+
},
|
|
95
|
+
"UpdateAppProfile": {
|
|
96
|
+
"timeout_millis": 60000,
|
|
97
|
+
"retry_codes_name": "idempotent",
|
|
98
|
+
"retry_params_name": "default"
|
|
99
|
+
},
|
|
100
|
+
"DeleteAppProfile": {
|
|
101
|
+
"timeout_millis": 60000,
|
|
102
|
+
"retry_codes_name": "non_idempotent",
|
|
103
|
+
"retry_params_name": "default"
|
|
104
|
+
},
|
|
105
|
+
"GetIamPolicy": {
|
|
106
|
+
"timeout_millis": 60000,
|
|
107
|
+
"retry_codes_name": "idempotent",
|
|
108
|
+
"retry_params_name": "default"
|
|
109
|
+
},
|
|
110
|
+
"SetIamPolicy": {
|
|
111
|
+
"timeout_millis": 60000,
|
|
112
|
+
"retry_codes_name": "non_idempotent",
|
|
113
|
+
"retry_params_name": "default"
|
|
114
|
+
},
|
|
115
|
+
"TestIamPermissions": {
|
|
116
|
+
"timeout_millis": 60000,
|
|
117
|
+
"retry_codes_name": "idempotent",
|
|
118
|
+
"retry_params_name": "default"
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
}
|
|
@@ -0,0 +1,1079 @@
|
|
|
1
|
+
# Copyright 2018 Google LLC
|
|
2
|
+
#
|
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
# you may not use this file except in compliance with the License.
|
|
5
|
+
# You may obtain a copy of the License at
|
|
6
|
+
#
|
|
7
|
+
# https://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
#
|
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
# See the License for the specific language governing permissions and
|
|
13
|
+
# limitations under the License.
|
|
14
|
+
#
|
|
15
|
+
# EDITING INSTRUCTIONS
|
|
16
|
+
# This file was generated from the file
|
|
17
|
+
# https://github.com/googleapis/googleapis/blob/master/google/bigtable/admin/v2/bigtable_table_admin.proto,
|
|
18
|
+
# and updates to that file get reflected here through a refresh process.
|
|
19
|
+
# For the short term, the refresh process will only be runnable by Google
|
|
20
|
+
# engineers.
|
|
21
|
+
|
|
22
|
+
require "json"
|
|
23
|
+
require "pathname"
|
|
24
|
+
|
|
25
|
+
require "google/gax"
|
|
26
|
+
require "google/gax/operation"
|
|
27
|
+
require "google/longrunning/operations_client"
|
|
28
|
+
|
|
29
|
+
require "google/bigtable/admin/v2/bigtable_table_admin_pb"
|
|
30
|
+
require "google/cloud/bigtable/admin/v2/credentials"
|
|
31
|
+
|
|
32
|
+
module Google
|
|
33
|
+
module Cloud
|
|
34
|
+
module Bigtable
|
|
35
|
+
module Admin
|
|
36
|
+
module V2
|
|
37
|
+
# Service for creating, configuring, and deleting Cloud Bigtable tables.
|
|
38
|
+
#
|
|
39
|
+
#
|
|
40
|
+
# Provides access to the table schemas only, not the data stored within
|
|
41
|
+
# the tables.
|
|
42
|
+
#
|
|
43
|
+
# @!attribute [r] bigtable_table_admin_stub
|
|
44
|
+
# @return [Google::Bigtable::Admin::V2::BigtableTableAdmin::Stub]
|
|
45
|
+
class BigtableTableAdminClient
|
|
46
|
+
attr_reader :bigtable_table_admin_stub
|
|
47
|
+
|
|
48
|
+
# The default address of the service.
|
|
49
|
+
SERVICE_ADDRESS = "bigtableadmin.googleapis.com".freeze
|
|
50
|
+
|
|
51
|
+
# The default port of the service.
|
|
52
|
+
DEFAULT_SERVICE_PORT = 443
|
|
53
|
+
|
|
54
|
+
# The default set of gRPC interceptors.
|
|
55
|
+
GRPC_INTERCEPTORS = []
|
|
56
|
+
|
|
57
|
+
DEFAULT_TIMEOUT = 30
|
|
58
|
+
|
|
59
|
+
PAGE_DESCRIPTORS = {
|
|
60
|
+
"list_tables" => Google::Gax::PageDescriptor.new(
|
|
61
|
+
"page_token",
|
|
62
|
+
"next_page_token",
|
|
63
|
+
"tables"),
|
|
64
|
+
"list_snapshots" => Google::Gax::PageDescriptor.new(
|
|
65
|
+
"page_token",
|
|
66
|
+
"next_page_token",
|
|
67
|
+
"snapshots")
|
|
68
|
+
}.freeze
|
|
69
|
+
|
|
70
|
+
private_constant :PAGE_DESCRIPTORS
|
|
71
|
+
|
|
72
|
+
# The scopes needed to make gRPC calls to all of the methods defined in
|
|
73
|
+
# this service.
|
|
74
|
+
ALL_SCOPES = [
|
|
75
|
+
"https://www.googleapis.com/auth/bigtable.admin",
|
|
76
|
+
"https://www.googleapis.com/auth/bigtable.admin.cluster",
|
|
77
|
+
"https://www.googleapis.com/auth/bigtable.admin.instance",
|
|
78
|
+
"https://www.googleapis.com/auth/bigtable.admin.table",
|
|
79
|
+
"https://www.googleapis.com/auth/cloud-bigtable.admin",
|
|
80
|
+
"https://www.googleapis.com/auth/cloud-bigtable.admin.cluster",
|
|
81
|
+
"https://www.googleapis.com/auth/cloud-bigtable.admin.table",
|
|
82
|
+
"https://www.googleapis.com/auth/cloud-platform",
|
|
83
|
+
"https://www.googleapis.com/auth/cloud-platform.read-only"
|
|
84
|
+
].freeze
|
|
85
|
+
|
|
86
|
+
class OperationsClient < Google::Longrunning::OperationsClient
|
|
87
|
+
self::SERVICE_ADDRESS = BigtableTableAdminClient::SERVICE_ADDRESS
|
|
88
|
+
self::GRPC_INTERCEPTORS = BigtableTableAdminClient::GRPC_INTERCEPTORS
|
|
89
|
+
end
|
|
90
|
+
|
|
91
|
+
INSTANCE_PATH_TEMPLATE = Google::Gax::PathTemplate.new(
|
|
92
|
+
"projects/{project}/instances/{instance}"
|
|
93
|
+
)
|
|
94
|
+
|
|
95
|
+
private_constant :INSTANCE_PATH_TEMPLATE
|
|
96
|
+
|
|
97
|
+
CLUSTER_PATH_TEMPLATE = Google::Gax::PathTemplate.new(
|
|
98
|
+
"projects/{project}/instances/{instance}/clusters/{cluster}"
|
|
99
|
+
)
|
|
100
|
+
|
|
101
|
+
private_constant :CLUSTER_PATH_TEMPLATE
|
|
102
|
+
|
|
103
|
+
SNAPSHOT_PATH_TEMPLATE = Google::Gax::PathTemplate.new(
|
|
104
|
+
"projects/{project}/instances/{instance}/clusters/{cluster}/snapshots/{snapshot}"
|
|
105
|
+
)
|
|
106
|
+
|
|
107
|
+
private_constant :SNAPSHOT_PATH_TEMPLATE
|
|
108
|
+
|
|
109
|
+
TABLE_PATH_TEMPLATE = Google::Gax::PathTemplate.new(
|
|
110
|
+
"projects/{project}/instances/{instance}/tables/{table}"
|
|
111
|
+
)
|
|
112
|
+
|
|
113
|
+
private_constant :TABLE_PATH_TEMPLATE
|
|
114
|
+
|
|
115
|
+
# Returns a fully-qualified instance resource name string.
|
|
116
|
+
# @param project [String]
|
|
117
|
+
# @param instance [String]
|
|
118
|
+
# @return [String]
|
|
119
|
+
def self.instance_path project, instance
|
|
120
|
+
INSTANCE_PATH_TEMPLATE.render(
|
|
121
|
+
:"project" => project,
|
|
122
|
+
:"instance" => instance
|
|
123
|
+
)
|
|
124
|
+
end
|
|
125
|
+
|
|
126
|
+
# Returns a fully-qualified cluster resource name string.
|
|
127
|
+
# @param project [String]
|
|
128
|
+
# @param instance [String]
|
|
129
|
+
# @param cluster [String]
|
|
130
|
+
# @return [String]
|
|
131
|
+
def self.cluster_path project, instance, cluster
|
|
132
|
+
CLUSTER_PATH_TEMPLATE.render(
|
|
133
|
+
:"project" => project,
|
|
134
|
+
:"instance" => instance,
|
|
135
|
+
:"cluster" => cluster
|
|
136
|
+
)
|
|
137
|
+
end
|
|
138
|
+
|
|
139
|
+
# Returns a fully-qualified snapshot resource name string.
|
|
140
|
+
# @param project [String]
|
|
141
|
+
# @param instance [String]
|
|
142
|
+
# @param cluster [String]
|
|
143
|
+
# @param snapshot [String]
|
|
144
|
+
# @return [String]
|
|
145
|
+
def self.snapshot_path project, instance, cluster, snapshot
|
|
146
|
+
SNAPSHOT_PATH_TEMPLATE.render(
|
|
147
|
+
:"project" => project,
|
|
148
|
+
:"instance" => instance,
|
|
149
|
+
:"cluster" => cluster,
|
|
150
|
+
:"snapshot" => snapshot
|
|
151
|
+
)
|
|
152
|
+
end
|
|
153
|
+
|
|
154
|
+
# Returns a fully-qualified table resource name string.
|
|
155
|
+
# @param project [String]
|
|
156
|
+
# @param instance [String]
|
|
157
|
+
# @param table [String]
|
|
158
|
+
# @return [String]
|
|
159
|
+
def self.table_path project, instance, table
|
|
160
|
+
TABLE_PATH_TEMPLATE.render(
|
|
161
|
+
:"project" => project,
|
|
162
|
+
:"instance" => instance,
|
|
163
|
+
:"table" => table
|
|
164
|
+
)
|
|
165
|
+
end
|
|
166
|
+
|
|
167
|
+
# @param credentials [Google::Auth::Credentials, String, Hash, GRPC::Core::Channel, GRPC::Core::ChannelCredentials, Proc]
|
|
168
|
+
# Provides the means for authenticating requests made by the client. This parameter can
|
|
169
|
+
# be many types.
|
|
170
|
+
# A `Google::Auth::Credentials` uses a the properties of its represented keyfile for
|
|
171
|
+
# authenticating requests made by this client.
|
|
172
|
+
# A `String` will be treated as the path to the keyfile to be used for the construction of
|
|
173
|
+
# credentials for this client.
|
|
174
|
+
# A `Hash` will be treated as the contents of a keyfile to be used for the construction of
|
|
175
|
+
# credentials for this client.
|
|
176
|
+
# A `GRPC::Core::Channel` will be used to make calls through.
|
|
177
|
+
# A `GRPC::Core::ChannelCredentials` for the setting up the RPC client. The channel credentials
|
|
178
|
+
# should already be composed with a `GRPC::Core::CallCredentials` object.
|
|
179
|
+
# A `Proc` will be used as an updater_proc for the Grpc channel. The proc transforms the
|
|
180
|
+
# metadata for requests, generally, to give OAuth credentials.
|
|
181
|
+
# @param scopes [Array<String>]
|
|
182
|
+
# The OAuth scopes for this service. This parameter is ignored if
|
|
183
|
+
# an updater_proc is supplied.
|
|
184
|
+
# @param client_config [Hash]
|
|
185
|
+
# A Hash for call options for each method. See
|
|
186
|
+
# Google::Gax#construct_settings for the structure of
|
|
187
|
+
# this data. Falls back to the default config if not specified
|
|
188
|
+
# or the specified config is missing data points.
|
|
189
|
+
# @param timeout [Numeric]
|
|
190
|
+
# The default timeout, in seconds, for calls made through this client.
|
|
191
|
+
# @param metadata [Hash]
|
|
192
|
+
# Default metadata to be sent with each request. This can be overridden on a per call basis.
|
|
193
|
+
# @param exception_transformer [Proc]
|
|
194
|
+
# An optional proc that intercepts any exceptions raised during an API call to inject
|
|
195
|
+
# custom error handling.
|
|
196
|
+
def initialize \
|
|
197
|
+
credentials: nil,
|
|
198
|
+
scopes: ALL_SCOPES,
|
|
199
|
+
client_config: {},
|
|
200
|
+
timeout: DEFAULT_TIMEOUT,
|
|
201
|
+
metadata: nil,
|
|
202
|
+
exception_transformer: nil,
|
|
203
|
+
lib_name: nil,
|
|
204
|
+
lib_version: ""
|
|
205
|
+
# These require statements are intentionally placed here to initialize
|
|
206
|
+
# the gRPC module only when it's required.
|
|
207
|
+
# See https://github.com/googleapis/toolkit/issues/446
|
|
208
|
+
require "google/gax/grpc"
|
|
209
|
+
require "google/bigtable/admin/v2/bigtable_table_admin_services_pb"
|
|
210
|
+
|
|
211
|
+
credentials ||= Google::Cloud::Bigtable::Admin::V2::Credentials.default
|
|
212
|
+
|
|
213
|
+
@operations_client = OperationsClient.new(
|
|
214
|
+
credentials: credentials,
|
|
215
|
+
scopes: scopes,
|
|
216
|
+
client_config: client_config,
|
|
217
|
+
timeout: timeout,
|
|
218
|
+
lib_name: lib_name,
|
|
219
|
+
lib_version: lib_version,
|
|
220
|
+
)
|
|
221
|
+
|
|
222
|
+
if credentials.is_a?(String) || credentials.is_a?(Hash)
|
|
223
|
+
updater_proc = Google::Cloud::Bigtable::Admin::V2::Credentials.new(credentials).updater_proc
|
|
224
|
+
end
|
|
225
|
+
if credentials.is_a?(GRPC::Core::Channel)
|
|
226
|
+
channel = credentials
|
|
227
|
+
end
|
|
228
|
+
if credentials.is_a?(GRPC::Core::ChannelCredentials)
|
|
229
|
+
chan_creds = credentials
|
|
230
|
+
end
|
|
231
|
+
if credentials.is_a?(Proc)
|
|
232
|
+
updater_proc = credentials
|
|
233
|
+
end
|
|
234
|
+
if credentials.is_a?(Google::Auth::Credentials)
|
|
235
|
+
updater_proc = credentials.updater_proc
|
|
236
|
+
end
|
|
237
|
+
|
|
238
|
+
package_version = Gem.loaded_specs['google-cloud-bigtable'].version.version
|
|
239
|
+
|
|
240
|
+
google_api_client = "gl-ruby/#{RUBY_VERSION}"
|
|
241
|
+
google_api_client << " #{lib_name}/#{lib_version}" if lib_name
|
|
242
|
+
google_api_client << " gapic/#{package_version} gax/#{Google::Gax::VERSION}"
|
|
243
|
+
google_api_client << " grpc/#{GRPC::VERSION}"
|
|
244
|
+
google_api_client.freeze
|
|
245
|
+
|
|
246
|
+
headers = { :"x-goog-api-client" => google_api_client }
|
|
247
|
+
headers.merge!(metadata) unless metadata.nil?
|
|
248
|
+
client_config_file = Pathname.new(__dir__).join(
|
|
249
|
+
"bigtable_table_admin_client_config.json"
|
|
250
|
+
)
|
|
251
|
+
defaults = client_config_file.open do |f|
|
|
252
|
+
Google::Gax.construct_settings(
|
|
253
|
+
"google.bigtable.admin.v2.BigtableTableAdmin",
|
|
254
|
+
JSON.parse(f.read),
|
|
255
|
+
client_config,
|
|
256
|
+
Google::Gax::Grpc::STATUS_CODE_NAMES,
|
|
257
|
+
timeout,
|
|
258
|
+
page_descriptors: PAGE_DESCRIPTORS,
|
|
259
|
+
errors: Google::Gax::Grpc::API_ERRORS,
|
|
260
|
+
metadata: headers
|
|
261
|
+
)
|
|
262
|
+
end
|
|
263
|
+
|
|
264
|
+
# Allow overriding the service path/port in subclasses.
|
|
265
|
+
service_path = self.class::SERVICE_ADDRESS
|
|
266
|
+
port = self.class::DEFAULT_SERVICE_PORT
|
|
267
|
+
interceptors = self.class::GRPC_INTERCEPTORS
|
|
268
|
+
@bigtable_table_admin_stub = Google::Gax::Grpc.create_stub(
|
|
269
|
+
service_path,
|
|
270
|
+
port,
|
|
271
|
+
chan_creds: chan_creds,
|
|
272
|
+
channel: channel,
|
|
273
|
+
updater_proc: updater_proc,
|
|
274
|
+
scopes: scopes,
|
|
275
|
+
interceptors: interceptors,
|
|
276
|
+
&Google::Bigtable::Admin::V2::BigtableTableAdmin::Stub.method(:new)
|
|
277
|
+
)
|
|
278
|
+
|
|
279
|
+
@create_table = Google::Gax.create_api_call(
|
|
280
|
+
@bigtable_table_admin_stub.method(:create_table),
|
|
281
|
+
defaults["create_table"],
|
|
282
|
+
exception_transformer: exception_transformer,
|
|
283
|
+
params_extractor: proc do |request|
|
|
284
|
+
{'parent' => request.parent}
|
|
285
|
+
end
|
|
286
|
+
)
|
|
287
|
+
@create_table_from_snapshot = Google::Gax.create_api_call(
|
|
288
|
+
@bigtable_table_admin_stub.method(:create_table_from_snapshot),
|
|
289
|
+
defaults["create_table_from_snapshot"],
|
|
290
|
+
exception_transformer: exception_transformer,
|
|
291
|
+
params_extractor: proc do |request|
|
|
292
|
+
{'parent' => request.parent}
|
|
293
|
+
end
|
|
294
|
+
)
|
|
295
|
+
@list_tables = Google::Gax.create_api_call(
|
|
296
|
+
@bigtable_table_admin_stub.method(:list_tables),
|
|
297
|
+
defaults["list_tables"],
|
|
298
|
+
exception_transformer: exception_transformer,
|
|
299
|
+
params_extractor: proc do |request|
|
|
300
|
+
{'parent' => request.parent}
|
|
301
|
+
end
|
|
302
|
+
)
|
|
303
|
+
@get_table = Google::Gax.create_api_call(
|
|
304
|
+
@bigtable_table_admin_stub.method(:get_table),
|
|
305
|
+
defaults["get_table"],
|
|
306
|
+
exception_transformer: exception_transformer,
|
|
307
|
+
params_extractor: proc do |request|
|
|
308
|
+
{'name' => request.name}
|
|
309
|
+
end
|
|
310
|
+
)
|
|
311
|
+
@delete_table = Google::Gax.create_api_call(
|
|
312
|
+
@bigtable_table_admin_stub.method(:delete_table),
|
|
313
|
+
defaults["delete_table"],
|
|
314
|
+
exception_transformer: exception_transformer,
|
|
315
|
+
params_extractor: proc do |request|
|
|
316
|
+
{'name' => request.name}
|
|
317
|
+
end
|
|
318
|
+
)
|
|
319
|
+
@modify_column_families = Google::Gax.create_api_call(
|
|
320
|
+
@bigtable_table_admin_stub.method(:modify_column_families),
|
|
321
|
+
defaults["modify_column_families"],
|
|
322
|
+
exception_transformer: exception_transformer,
|
|
323
|
+
params_extractor: proc do |request|
|
|
324
|
+
{'name' => request.name}
|
|
325
|
+
end
|
|
326
|
+
)
|
|
327
|
+
@drop_row_range = Google::Gax.create_api_call(
|
|
328
|
+
@bigtable_table_admin_stub.method(:drop_row_range),
|
|
329
|
+
defaults["drop_row_range"],
|
|
330
|
+
exception_transformer: exception_transformer,
|
|
331
|
+
params_extractor: proc do |request|
|
|
332
|
+
{'name' => request.name}
|
|
333
|
+
end
|
|
334
|
+
)
|
|
335
|
+
@generate_consistency_token = Google::Gax.create_api_call(
|
|
336
|
+
@bigtable_table_admin_stub.method(:generate_consistency_token),
|
|
337
|
+
defaults["generate_consistency_token"],
|
|
338
|
+
exception_transformer: exception_transformer,
|
|
339
|
+
params_extractor: proc do |request|
|
|
340
|
+
{'name' => request.name}
|
|
341
|
+
end
|
|
342
|
+
)
|
|
343
|
+
@check_consistency = Google::Gax.create_api_call(
|
|
344
|
+
@bigtable_table_admin_stub.method(:check_consistency),
|
|
345
|
+
defaults["check_consistency"],
|
|
346
|
+
exception_transformer: exception_transformer,
|
|
347
|
+
params_extractor: proc do |request|
|
|
348
|
+
{'name' => request.name}
|
|
349
|
+
end
|
|
350
|
+
)
|
|
351
|
+
@snapshot_table = Google::Gax.create_api_call(
|
|
352
|
+
@bigtable_table_admin_stub.method(:snapshot_table),
|
|
353
|
+
defaults["snapshot_table"],
|
|
354
|
+
exception_transformer: exception_transformer,
|
|
355
|
+
params_extractor: proc do |request|
|
|
356
|
+
{'name' => request.name}
|
|
357
|
+
end
|
|
358
|
+
)
|
|
359
|
+
@get_snapshot = Google::Gax.create_api_call(
|
|
360
|
+
@bigtable_table_admin_stub.method(:get_snapshot),
|
|
361
|
+
defaults["get_snapshot"],
|
|
362
|
+
exception_transformer: exception_transformer,
|
|
363
|
+
params_extractor: proc do |request|
|
|
364
|
+
{'name' => request.name}
|
|
365
|
+
end
|
|
366
|
+
)
|
|
367
|
+
@list_snapshots = Google::Gax.create_api_call(
|
|
368
|
+
@bigtable_table_admin_stub.method(:list_snapshots),
|
|
369
|
+
defaults["list_snapshots"],
|
|
370
|
+
exception_transformer: exception_transformer,
|
|
371
|
+
params_extractor: proc do |request|
|
|
372
|
+
{'parent' => request.parent}
|
|
373
|
+
end
|
|
374
|
+
)
|
|
375
|
+
@delete_snapshot = Google::Gax.create_api_call(
|
|
376
|
+
@bigtable_table_admin_stub.method(:delete_snapshot),
|
|
377
|
+
defaults["delete_snapshot"],
|
|
378
|
+
exception_transformer: exception_transformer,
|
|
379
|
+
params_extractor: proc do |request|
|
|
380
|
+
{'name' => request.name}
|
|
381
|
+
end
|
|
382
|
+
)
|
|
383
|
+
end
|
|
384
|
+
|
|
385
|
+
# Service calls
|
|
386
|
+
|
|
387
|
+
# Creates a new table in the specified instance.
|
|
388
|
+
# The table can be created with a full set of initial column families,
|
|
389
|
+
# specified in the request.
|
|
390
|
+
#
|
|
391
|
+
# @param parent [String]
|
|
392
|
+
# The unique name of the instance in which to create the table.
|
|
393
|
+
# Values are of the form +projects/<project>/instances/<instance>+.
|
|
394
|
+
# @param table_id [String]
|
|
395
|
+
# The name by which the new table should be referred to within the parent
|
|
396
|
+
# instance, e.g., +foobar+ rather than +<parent>/tables/foobar+.
|
|
397
|
+
# @param table [Google::Bigtable::Admin::V2::Table | Hash]
|
|
398
|
+
# The Table to create.
|
|
399
|
+
# A hash of the same form as `Google::Bigtable::Admin::V2::Table`
|
|
400
|
+
# can also be provided.
|
|
401
|
+
# @param initial_splits [Array<Google::Bigtable::Admin::V2::CreateTableRequest::Split | Hash>]
|
|
402
|
+
# The optional list of row keys that will be used to initially split the
|
|
403
|
+
# table into several tablets (tablets are similar to HBase regions).
|
|
404
|
+
# Given two split keys, +s1+ and +s2+, three tablets will be created,
|
|
405
|
+
# spanning the key ranges: +[, s1), [s1, s2), [s2, )+.
|
|
406
|
+
#
|
|
407
|
+
# Example:
|
|
408
|
+
#
|
|
409
|
+
# * Row keys := +["a", "apple", "custom", "customer_1", "customer_2",+
|
|
410
|
+
# +"other", "zz"]+
|
|
411
|
+
# * initial_split_keys := +["apple", "customer_1", "customer_2", "other"]+
|
|
412
|
+
# * Key assignment:
|
|
413
|
+
# * Tablet 1 +[, apple) => {"a"}.+
|
|
414
|
+
# * Tablet 2 +[apple, customer_1) => {"apple", "custom"}.+
|
|
415
|
+
# * Tablet 3 +[customer_1, customer_2) => {"customer_1"}.+
|
|
416
|
+
# * Tablet 4 +[customer_2, other) => {"customer_2"}.+
|
|
417
|
+
# * Tablet 5 +[other, ) => {"other", "zz"}.+
|
|
418
|
+
# A hash of the same form as `Google::Bigtable::Admin::V2::CreateTableRequest::Split`
|
|
419
|
+
# can also be provided.
|
|
420
|
+
# @param options [Google::Gax::CallOptions]
|
|
421
|
+
# Overrides the default settings for this call, e.g, timeout,
|
|
422
|
+
# retries, etc.
|
|
423
|
+
# @yield [result, operation] Access the result along with the RPC operation
|
|
424
|
+
# @yieldparam result [Google::Bigtable::Admin::V2::Table]
|
|
425
|
+
# @yieldparam operation [GRPC::ActiveCall::Operation]
|
|
426
|
+
# @return [Google::Bigtable::Admin::V2::Table]
|
|
427
|
+
# @raise [Google::Gax::GaxError] if the RPC is aborted.
|
|
428
|
+
# @example
|
|
429
|
+
# require "google/cloud/bigtable/admin"
|
|
430
|
+
#
|
|
431
|
+
# bigtable_table_admin_client = Google::Cloud::Bigtable::Admin::BigtableTableAdmin.new(version: :v2)
|
|
432
|
+
# formatted_parent = Google::Cloud::Bigtable::Admin::V2::BigtableTableAdminClient.instance_path("[PROJECT]", "[INSTANCE]")
|
|
433
|
+
#
|
|
434
|
+
# # TODO: Initialize +table_id+:
|
|
435
|
+
# table_id = ''
|
|
436
|
+
#
|
|
437
|
+
# # TODO: Initialize +table+:
|
|
438
|
+
# table = {}
|
|
439
|
+
# response = bigtable_table_admin_client.create_table(formatted_parent, table_id, table)
|
|
440
|
+
|
|
441
|
+
def create_table \
|
|
442
|
+
parent,
|
|
443
|
+
table_id,
|
|
444
|
+
table,
|
|
445
|
+
initial_splits: nil,
|
|
446
|
+
options: nil,
|
|
447
|
+
&block
|
|
448
|
+
req = {
|
|
449
|
+
parent: parent,
|
|
450
|
+
table_id: table_id,
|
|
451
|
+
table: table,
|
|
452
|
+
initial_splits: initial_splits
|
|
453
|
+
}.delete_if { |_, v| v.nil? }
|
|
454
|
+
req = Google::Gax::to_proto(req, Google::Bigtable::Admin::V2::CreateTableRequest)
|
|
455
|
+
@create_table.call(req, options, &block)
|
|
456
|
+
end
|
|
457
|
+
|
|
458
|
+
# Creates a new table from the specified snapshot. The target table must
|
|
459
|
+
# not exist. The snapshot and the table must be in the same instance.
|
|
460
|
+
#
|
|
461
|
+
# Note: This is a private alpha release of Cloud Bigtable snapshots. This
|
|
462
|
+
# feature is not currently available to most Cloud Bigtable customers. This
|
|
463
|
+
# feature might be changed in backward-incompatible ways and is not
|
|
464
|
+
# recommended for production use. It is not subject to any SLA or deprecation
|
|
465
|
+
# policy.
|
|
466
|
+
#
|
|
467
|
+
# @param parent [String]
|
|
468
|
+
# The unique name of the instance in which to create the table.
|
|
469
|
+
# Values are of the form +projects/<project>/instances/<instance>+.
|
|
470
|
+
# @param table_id [String]
|
|
471
|
+
# The name by which the new table should be referred to within the parent
|
|
472
|
+
# instance, e.g., +foobar+ rather than +<parent>/tables/foobar+.
|
|
473
|
+
# @param source_snapshot [String]
|
|
474
|
+
# The unique name of the snapshot from which to restore the table. The
|
|
475
|
+
# snapshot and the table must be in the same instance.
|
|
476
|
+
# Values are of the form
|
|
477
|
+
# +projects/<project>/instances/<instance>/clusters/<cluster>/snapshots/<snapshot>+.
|
|
478
|
+
# @param options [Google::Gax::CallOptions]
|
|
479
|
+
# Overrides the default settings for this call, e.g, timeout,
|
|
480
|
+
# retries, etc.
|
|
481
|
+
# @return [Google::Gax::Operation]
|
|
482
|
+
# @raise [Google::Gax::GaxError] if the RPC is aborted.
|
|
483
|
+
# @example
|
|
484
|
+
# require "google/cloud/bigtable/admin"
|
|
485
|
+
#
|
|
486
|
+
# bigtable_table_admin_client = Google::Cloud::Bigtable::Admin::BigtableTableAdmin.new(version: :v2)
|
|
487
|
+
# formatted_parent = Google::Cloud::Bigtable::Admin::V2::BigtableTableAdminClient.instance_path("[PROJECT]", "[INSTANCE]")
|
|
488
|
+
#
|
|
489
|
+
# # TODO: Initialize +table_id+:
|
|
490
|
+
# table_id = ''
|
|
491
|
+
#
|
|
492
|
+
# # TODO: Initialize +source_snapshot+:
|
|
493
|
+
# source_snapshot = ''
|
|
494
|
+
#
|
|
495
|
+
# # Register a callback during the method call.
|
|
496
|
+
# operation = bigtable_table_admin_client.create_table_from_snapshot(formatted_parent, table_id, source_snapshot) do |op|
|
|
497
|
+
# raise op.results.message if op.error?
|
|
498
|
+
# op_results = op.results
|
|
499
|
+
# # Process the results.
|
|
500
|
+
#
|
|
501
|
+
# metadata = op.metadata
|
|
502
|
+
# # Process the metadata.
|
|
503
|
+
# end
|
|
504
|
+
#
|
|
505
|
+
# # Or use the return value to register a callback.
|
|
506
|
+
# operation.on_done do |op|
|
|
507
|
+
# raise op.results.message if op.error?
|
|
508
|
+
# op_results = op.results
|
|
509
|
+
# # Process the results.
|
|
510
|
+
#
|
|
511
|
+
# metadata = op.metadata
|
|
512
|
+
# # Process the metadata.
|
|
513
|
+
# end
|
|
514
|
+
#
|
|
515
|
+
# # Manually reload the operation.
|
|
516
|
+
# operation.reload!
|
|
517
|
+
#
|
|
518
|
+
# # Or block until the operation completes, triggering callbacks on
|
|
519
|
+
# # completion.
|
|
520
|
+
# operation.wait_until_done!
|
|
521
|
+
|
|
522
|
+
def create_table_from_snapshot \
|
|
523
|
+
parent,
|
|
524
|
+
table_id,
|
|
525
|
+
source_snapshot,
|
|
526
|
+
options: nil
|
|
527
|
+
req = {
|
|
528
|
+
parent: parent,
|
|
529
|
+
table_id: table_id,
|
|
530
|
+
source_snapshot: source_snapshot
|
|
531
|
+
}.delete_if { |_, v| v.nil? }
|
|
532
|
+
req = Google::Gax::to_proto(req, Google::Bigtable::Admin::V2::CreateTableFromSnapshotRequest)
|
|
533
|
+
operation = Google::Gax::Operation.new(
|
|
534
|
+
@create_table_from_snapshot.call(req, options),
|
|
535
|
+
@operations_client,
|
|
536
|
+
Google::Bigtable::Admin::V2::Table,
|
|
537
|
+
Google::Bigtable::Admin::V2::CreateTableFromSnapshotMetadata,
|
|
538
|
+
call_options: options
|
|
539
|
+
)
|
|
540
|
+
operation.on_done { |operation| yield(operation) } if block_given?
|
|
541
|
+
operation
|
|
542
|
+
end
|
|
543
|
+
|
|
544
|
+
# Lists all tables served from a specified instance.
|
|
545
|
+
#
|
|
546
|
+
# @param parent [String]
|
|
547
|
+
# The unique name of the instance for which tables should be listed.
|
|
548
|
+
# Values are of the form +projects/<project>/instances/<instance>+.
|
|
549
|
+
# @param view [Google::Bigtable::Admin::V2::Table::View]
|
|
550
|
+
# The view to be applied to the returned tables' fields.
|
|
551
|
+
# Defaults to +NAME_ONLY+ if unspecified; no others are currently supported.
|
|
552
|
+
# @param options [Google::Gax::CallOptions]
|
|
553
|
+
# Overrides the default settings for this call, e.g, timeout,
|
|
554
|
+
# retries, etc.
|
|
555
|
+
# @yield [result, operation] Access the result along with the RPC operation
|
|
556
|
+
# @yieldparam result [Google::Gax::PagedEnumerable<Google::Bigtable::Admin::V2::Table>]
|
|
557
|
+
# @yieldparam operation [GRPC::ActiveCall::Operation]
|
|
558
|
+
# @return [Google::Gax::PagedEnumerable<Google::Bigtable::Admin::V2::Table>]
|
|
559
|
+
# An enumerable of Google::Bigtable::Admin::V2::Table instances.
|
|
560
|
+
# See Google::Gax::PagedEnumerable documentation for other
|
|
561
|
+
# operations such as per-page iteration or access to the response
|
|
562
|
+
# object.
|
|
563
|
+
# @raise [Google::Gax::GaxError] if the RPC is aborted.
|
|
564
|
+
# @example
|
|
565
|
+
# require "google/cloud/bigtable/admin"
|
|
566
|
+
#
|
|
567
|
+
# bigtable_table_admin_client = Google::Cloud::Bigtable::Admin::BigtableTableAdmin.new(version: :v2)
|
|
568
|
+
# formatted_parent = Google::Cloud::Bigtable::Admin::V2::BigtableTableAdminClient.instance_path("[PROJECT]", "[INSTANCE]")
|
|
569
|
+
#
|
|
570
|
+
# # Iterate over all results.
|
|
571
|
+
# bigtable_table_admin_client.list_tables(formatted_parent).each do |element|
|
|
572
|
+
# # Process element.
|
|
573
|
+
# end
|
|
574
|
+
#
|
|
575
|
+
# # Or iterate over results one page at a time.
|
|
576
|
+
# bigtable_table_admin_client.list_tables(formatted_parent).each_page do |page|
|
|
577
|
+
# # Process each page at a time.
|
|
578
|
+
# page.each do |element|
|
|
579
|
+
# # Process element.
|
|
580
|
+
# end
|
|
581
|
+
# end
|
|
582
|
+
|
|
583
|
+
def list_tables \
|
|
584
|
+
parent,
|
|
585
|
+
view: nil,
|
|
586
|
+
options: nil,
|
|
587
|
+
&block
|
|
588
|
+
req = {
|
|
589
|
+
parent: parent,
|
|
590
|
+
view: view
|
|
591
|
+
}.delete_if { |_, v| v.nil? }
|
|
592
|
+
req = Google::Gax::to_proto(req, Google::Bigtable::Admin::V2::ListTablesRequest)
|
|
593
|
+
@list_tables.call(req, options, &block)
|
|
594
|
+
end
|
|
595
|
+
|
|
596
|
+
# Gets metadata information about the specified table.
|
|
597
|
+
#
|
|
598
|
+
# @param name [String]
|
|
599
|
+
# The unique name of the requested table.
|
|
600
|
+
# Values are of the form
|
|
601
|
+
# +projects/<project>/instances/<instance>/tables/<table>+.
|
|
602
|
+
# @param view [Google::Bigtable::Admin::V2::Table::View]
|
|
603
|
+
# The view to be applied to the returned table's fields.
|
|
604
|
+
# Defaults to +SCHEMA_VIEW+ if unspecified.
|
|
605
|
+
# @param options [Google::Gax::CallOptions]
|
|
606
|
+
# Overrides the default settings for this call, e.g, timeout,
|
|
607
|
+
# retries, etc.
|
|
608
|
+
# @yield [result, operation] Access the result along with the RPC operation
|
|
609
|
+
# @yieldparam result [Google::Bigtable::Admin::V2::Table]
|
|
610
|
+
# @yieldparam operation [GRPC::ActiveCall::Operation]
|
|
611
|
+
# @return [Google::Bigtable::Admin::V2::Table]
|
|
612
|
+
# @raise [Google::Gax::GaxError] if the RPC is aborted.
|
|
613
|
+
# @example
|
|
614
|
+
# require "google/cloud/bigtable/admin"
|
|
615
|
+
#
|
|
616
|
+
# bigtable_table_admin_client = Google::Cloud::Bigtable::Admin::BigtableTableAdmin.new(version: :v2)
|
|
617
|
+
# formatted_name = Google::Cloud::Bigtable::Admin::V2::BigtableTableAdminClient.table_path("[PROJECT]", "[INSTANCE]", "[TABLE]")
|
|
618
|
+
# response = bigtable_table_admin_client.get_table(formatted_name)
|
|
619
|
+
|
|
620
|
+
def get_table \
|
|
621
|
+
name,
|
|
622
|
+
view: nil,
|
|
623
|
+
options: nil,
|
|
624
|
+
&block
|
|
625
|
+
req = {
|
|
626
|
+
name: name,
|
|
627
|
+
view: view
|
|
628
|
+
}.delete_if { |_, v| v.nil? }
|
|
629
|
+
req = Google::Gax::to_proto(req, Google::Bigtable::Admin::V2::GetTableRequest)
|
|
630
|
+
@get_table.call(req, options, &block)
|
|
631
|
+
end
|
|
632
|
+
|
|
633
|
+
# Permanently deletes a specified table and all of its data.
|
|
634
|
+
#
|
|
635
|
+
# @param name [String]
|
|
636
|
+
# The unique name of the table to be deleted.
|
|
637
|
+
# Values are of the form
|
|
638
|
+
# +projects/<project>/instances/<instance>/tables/<table>+.
|
|
639
|
+
# @param options [Google::Gax::CallOptions]
|
|
640
|
+
# Overrides the default settings for this call, e.g, timeout,
|
|
641
|
+
# retries, etc.
|
|
642
|
+
# @yield [result, operation] Access the result along with the RPC operation
|
|
643
|
+
# @yieldparam result []
|
|
644
|
+
# @yieldparam operation [GRPC::ActiveCall::Operation]
|
|
645
|
+
# @raise [Google::Gax::GaxError] if the RPC is aborted.
|
|
646
|
+
# @example
|
|
647
|
+
# require "google/cloud/bigtable/admin"
|
|
648
|
+
#
|
|
649
|
+
# bigtable_table_admin_client = Google::Cloud::Bigtable::Admin::BigtableTableAdmin.new(version: :v2)
|
|
650
|
+
# formatted_name = Google::Cloud::Bigtable::Admin::V2::BigtableTableAdminClient.table_path("[PROJECT]", "[INSTANCE]", "[TABLE]")
|
|
651
|
+
# bigtable_table_admin_client.delete_table(formatted_name)
|
|
652
|
+
|
|
653
|
+
def delete_table \
|
|
654
|
+
name,
|
|
655
|
+
options: nil,
|
|
656
|
+
&block
|
|
657
|
+
req = {
|
|
658
|
+
name: name
|
|
659
|
+
}.delete_if { |_, v| v.nil? }
|
|
660
|
+
req = Google::Gax::to_proto(req, Google::Bigtable::Admin::V2::DeleteTableRequest)
|
|
661
|
+
@delete_table.call(req, options, &block)
|
|
662
|
+
nil
|
|
663
|
+
end
|
|
664
|
+
|
|
665
|
+
# Performs a series of column family modifications on the specified table.
|
|
666
|
+
# Either all or none of the modifications will occur before this method
|
|
667
|
+
# returns, but data requests received prior to that point may see a table
|
|
668
|
+
# where only some modifications have taken effect.
|
|
669
|
+
#
|
|
670
|
+
# @param name [String]
|
|
671
|
+
# The unique name of the table whose families should be modified.
|
|
672
|
+
# Values are of the form
|
|
673
|
+
# +projects/<project>/instances/<instance>/tables/<table>+.
|
|
674
|
+
# @param modifications [Array<Google::Bigtable::Admin::V2::ModifyColumnFamiliesRequest::Modification | Hash>]
|
|
675
|
+
# Modifications to be atomically applied to the specified table's families.
|
|
676
|
+
# Entries are applied in order, meaning that earlier modifications can be
|
|
677
|
+
# masked by later ones (in the case of repeated updates to the same family,
|
|
678
|
+
# for example).
|
|
679
|
+
# A hash of the same form as `Google::Bigtable::Admin::V2::ModifyColumnFamiliesRequest::Modification`
|
|
680
|
+
# can also be provided.
|
|
681
|
+
# @param options [Google::Gax::CallOptions]
|
|
682
|
+
# Overrides the default settings for this call, e.g, timeout,
|
|
683
|
+
# retries, etc.
|
|
684
|
+
# @yield [result, operation] Access the result along with the RPC operation
|
|
685
|
+
# @yieldparam result [Google::Bigtable::Admin::V2::Table]
|
|
686
|
+
# @yieldparam operation [GRPC::ActiveCall::Operation]
|
|
687
|
+
# @return [Google::Bigtable::Admin::V2::Table]
|
|
688
|
+
# @raise [Google::Gax::GaxError] if the RPC is aborted.
|
|
689
|
+
# @example
|
|
690
|
+
# require "google/cloud/bigtable/admin"
|
|
691
|
+
#
|
|
692
|
+
# bigtable_table_admin_client = Google::Cloud::Bigtable::Admin::BigtableTableAdmin.new(version: :v2)
|
|
693
|
+
# formatted_name = Google::Cloud::Bigtable::Admin::V2::BigtableTableAdminClient.table_path("[PROJECT]", "[INSTANCE]", "[TABLE]")
|
|
694
|
+
#
|
|
695
|
+
# # TODO: Initialize +modifications+:
|
|
696
|
+
# modifications = []
|
|
697
|
+
# response = bigtable_table_admin_client.modify_column_families(formatted_name, modifications)
|
|
698
|
+
|
|
699
|
+
def modify_column_families \
|
|
700
|
+
name,
|
|
701
|
+
modifications,
|
|
702
|
+
options: nil,
|
|
703
|
+
&block
|
|
704
|
+
req = {
|
|
705
|
+
name: name,
|
|
706
|
+
modifications: modifications
|
|
707
|
+
}.delete_if { |_, v| v.nil? }
|
|
708
|
+
req = Google::Gax::to_proto(req, Google::Bigtable::Admin::V2::ModifyColumnFamiliesRequest)
|
|
709
|
+
@modify_column_families.call(req, options, &block)
|
|
710
|
+
end
|
|
711
|
+
|
|
712
|
+
# Permanently drop/delete a row range from a specified table. The request can
|
|
713
|
+
# specify whether to delete all rows in a table, or only those that match a
|
|
714
|
+
# particular prefix.
|
|
715
|
+
#
|
|
716
|
+
# @param name [String]
|
|
717
|
+
# The unique name of the table on which to drop a range of rows.
|
|
718
|
+
# Values are of the form
|
|
719
|
+
# +projects/<project>/instances/<instance>/tables/<table>+.
|
|
720
|
+
# @param row_key_prefix [String]
|
|
721
|
+
# Delete all rows that start with this row key prefix. Prefix cannot be
|
|
722
|
+
# zero length.
|
|
723
|
+
# @param delete_all_data_from_table [true, false]
|
|
724
|
+
# Delete all rows in the table. Setting this to false is a no-op.
|
|
725
|
+
# @param options [Google::Gax::CallOptions]
|
|
726
|
+
# Overrides the default settings for this call, e.g, timeout,
|
|
727
|
+
# retries, etc.
|
|
728
|
+
# @yield [result, operation] Access the result along with the RPC operation
|
|
729
|
+
# @yieldparam result []
|
|
730
|
+
# @yieldparam operation [GRPC::ActiveCall::Operation]
|
|
731
|
+
# @raise [Google::Gax::GaxError] if the RPC is aborted.
|
|
732
|
+
# @example
|
|
733
|
+
# require "google/cloud/bigtable/admin"
|
|
734
|
+
#
|
|
735
|
+
# bigtable_table_admin_client = Google::Cloud::Bigtable::Admin::BigtableTableAdmin.new(version: :v2)
|
|
736
|
+
# formatted_name = Google::Cloud::Bigtable::Admin::V2::BigtableTableAdminClient.table_path("[PROJECT]", "[INSTANCE]", "[TABLE]")
|
|
737
|
+
# bigtable_table_admin_client.drop_row_range(formatted_name)
|
|
738
|
+
|
|
739
|
+
def drop_row_range \
|
|
740
|
+
name,
|
|
741
|
+
row_key_prefix: nil,
|
|
742
|
+
delete_all_data_from_table: nil,
|
|
743
|
+
options: nil,
|
|
744
|
+
&block
|
|
745
|
+
req = {
|
|
746
|
+
name: name,
|
|
747
|
+
row_key_prefix: row_key_prefix,
|
|
748
|
+
delete_all_data_from_table: delete_all_data_from_table
|
|
749
|
+
}.delete_if { |_, v| v.nil? }
|
|
750
|
+
req = Google::Gax::to_proto(req, Google::Bigtable::Admin::V2::DropRowRangeRequest)
|
|
751
|
+
@drop_row_range.call(req, options, &block)
|
|
752
|
+
nil
|
|
753
|
+
end
|
|
754
|
+
|
|
755
|
+
# Generates a consistency token for a Table, which can be used in
|
|
756
|
+
# CheckConsistency to check whether mutations to the table that finished
|
|
757
|
+
# before this call started have been replicated. The tokens will be available
|
|
758
|
+
# for 90 days.
|
|
759
|
+
#
|
|
760
|
+
# @param name [String]
|
|
761
|
+
# The unique name of the Table for which to create a consistency token.
|
|
762
|
+
# Values are of the form
|
|
763
|
+
# +projects/<project>/instances/<instance>/tables/<table>+.
|
|
764
|
+
# @param options [Google::Gax::CallOptions]
|
|
765
|
+
# Overrides the default settings for this call, e.g, timeout,
|
|
766
|
+
# retries, etc.
|
|
767
|
+
# @yield [result, operation] Access the result along with the RPC operation
|
|
768
|
+
# @yieldparam result [Google::Bigtable::Admin::V2::GenerateConsistencyTokenResponse]
|
|
769
|
+
# @yieldparam operation [GRPC::ActiveCall::Operation]
|
|
770
|
+
# @return [Google::Bigtable::Admin::V2::GenerateConsistencyTokenResponse]
|
|
771
|
+
# @raise [Google::Gax::GaxError] if the RPC is aborted.
|
|
772
|
+
# @example
|
|
773
|
+
# require "google/cloud/bigtable/admin"
|
|
774
|
+
#
|
|
775
|
+
# bigtable_table_admin_client = Google::Cloud::Bigtable::Admin::BigtableTableAdmin.new(version: :v2)
|
|
776
|
+
# formatted_name = Google::Cloud::Bigtable::Admin::V2::BigtableTableAdminClient.table_path("[PROJECT]", "[INSTANCE]", "[TABLE]")
|
|
777
|
+
# response = bigtable_table_admin_client.generate_consistency_token(formatted_name)
|
|
778
|
+
|
|
779
|
+
def generate_consistency_token \
|
|
780
|
+
name,
|
|
781
|
+
options: nil,
|
|
782
|
+
&block
|
|
783
|
+
req = {
|
|
784
|
+
name: name
|
|
785
|
+
}.delete_if { |_, v| v.nil? }
|
|
786
|
+
req = Google::Gax::to_proto(req, Google::Bigtable::Admin::V2::GenerateConsistencyTokenRequest)
|
|
787
|
+
@generate_consistency_token.call(req, options, &block)
|
|
788
|
+
end
|
|
789
|
+
|
|
790
|
+
# Checks replication consistency based on a consistency token, that is, if
|
|
791
|
+
# replication has caught up based on the conditions specified in the token
|
|
792
|
+
# and the check request.
|
|
793
|
+
#
|
|
794
|
+
# @param name [String]
|
|
795
|
+
# The unique name of the Table for which to check replication consistency.
|
|
796
|
+
# Values are of the form
|
|
797
|
+
# +projects/<project>/instances/<instance>/tables/<table>+.
|
|
798
|
+
# @param consistency_token [String]
|
|
799
|
+
# The token created using GenerateConsistencyToken for the Table.
|
|
800
|
+
# @param options [Google::Gax::CallOptions]
|
|
801
|
+
# Overrides the default settings for this call, e.g, timeout,
|
|
802
|
+
# retries, etc.
|
|
803
|
+
# @yield [result, operation] Access the result along with the RPC operation
|
|
804
|
+
# @yieldparam result [Google::Bigtable::Admin::V2::CheckConsistencyResponse]
|
|
805
|
+
# @yieldparam operation [GRPC::ActiveCall::Operation]
|
|
806
|
+
# @return [Google::Bigtable::Admin::V2::CheckConsistencyResponse]
|
|
807
|
+
# @raise [Google::Gax::GaxError] if the RPC is aborted.
|
|
808
|
+
# @example
|
|
809
|
+
# require "google/cloud/bigtable/admin"
|
|
810
|
+
#
|
|
811
|
+
# bigtable_table_admin_client = Google::Cloud::Bigtable::Admin::BigtableTableAdmin.new(version: :v2)
|
|
812
|
+
# formatted_name = Google::Cloud::Bigtable::Admin::V2::BigtableTableAdminClient.table_path("[PROJECT]", "[INSTANCE]", "[TABLE]")
|
|
813
|
+
#
|
|
814
|
+
# # TODO: Initialize +consistency_token+:
|
|
815
|
+
# consistency_token = ''
|
|
816
|
+
# response = bigtable_table_admin_client.check_consistency(formatted_name, consistency_token)
|
|
817
|
+
|
|
818
|
+
def check_consistency \
|
|
819
|
+
name,
|
|
820
|
+
consistency_token,
|
|
821
|
+
options: nil,
|
|
822
|
+
&block
|
|
823
|
+
req = {
|
|
824
|
+
name: name,
|
|
825
|
+
consistency_token: consistency_token
|
|
826
|
+
}.delete_if { |_, v| v.nil? }
|
|
827
|
+
req = Google::Gax::to_proto(req, Google::Bigtable::Admin::V2::CheckConsistencyRequest)
|
|
828
|
+
@check_consistency.call(req, options, &block)
|
|
829
|
+
end
|
|
830
|
+
|
|
831
|
+
# Creates a new snapshot in the specified cluster from the specified
|
|
832
|
+
# source table. The cluster and the table must be in the same instance.
|
|
833
|
+
#
|
|
834
|
+
# Note: This is a private alpha release of Cloud Bigtable snapshots. This
|
|
835
|
+
# feature is not currently available to most Cloud Bigtable customers. This
|
|
836
|
+
# feature might be changed in backward-incompatible ways and is not
|
|
837
|
+
# recommended for production use. It is not subject to any SLA or deprecation
|
|
838
|
+
# policy.
|
|
839
|
+
#
|
|
840
|
+
# @param name [String]
|
|
841
|
+
# The unique name of the table to have the snapshot taken.
|
|
842
|
+
# Values are of the form
|
|
843
|
+
# +projects/<project>/instances/<instance>/tables/<table>+.
|
|
844
|
+
# @param cluster [String]
|
|
845
|
+
# The name of the cluster where the snapshot will be created in.
|
|
846
|
+
# Values are of the form
|
|
847
|
+
# +projects/<project>/instances/<instance>/clusters/<cluster>+.
|
|
848
|
+
# @param snapshot_id [String]
|
|
849
|
+
# The ID by which the new snapshot should be referred to within the parent
|
|
850
|
+
# cluster, e.g., +mysnapshot+ of the form: +[_a-zA-Z0-9][-_.a-zA-Z0-9]*+
|
|
851
|
+
# rather than
|
|
852
|
+
# +projects/<project>/instances/<instance>/clusters/<cluster>/snapshots/mysnapshot+.
|
|
853
|
+
# @param description [String]
|
|
854
|
+
# Description of the snapshot.
|
|
855
|
+
# @param ttl [Google::Protobuf::Duration | Hash]
|
|
856
|
+
# The amount of time that the new snapshot can stay active after it is
|
|
857
|
+
# created. Once 'ttl' expires, the snapshot will get deleted. The maximum
|
|
858
|
+
# amount of time a snapshot can stay active is 7 days. If 'ttl' is not
|
|
859
|
+
# specified, the default value of 24 hours will be used.
|
|
860
|
+
# A hash of the same form as `Google::Protobuf::Duration`
|
|
861
|
+
# can also be provided.
|
|
862
|
+
# @param options [Google::Gax::CallOptions]
|
|
863
|
+
# Overrides the default settings for this call, e.g, timeout,
|
|
864
|
+
# retries, etc.
|
|
865
|
+
# @return [Google::Gax::Operation]
|
|
866
|
+
# @raise [Google::Gax::GaxError] if the RPC is aborted.
|
|
867
|
+
# @example
|
|
868
|
+
# require "google/cloud/bigtable/admin"
|
|
869
|
+
#
|
|
870
|
+
# bigtable_table_admin_client = Google::Cloud::Bigtable::Admin::BigtableTableAdmin.new(version: :v2)
|
|
871
|
+
# formatted_name = Google::Cloud::Bigtable::Admin::V2::BigtableTableAdminClient.table_path("[PROJECT]", "[INSTANCE]", "[TABLE]")
|
|
872
|
+
#
|
|
873
|
+
# # TODO: Initialize +cluster+:
|
|
874
|
+
# cluster = ''
|
|
875
|
+
#
|
|
876
|
+
# # TODO: Initialize +snapshot_id+:
|
|
877
|
+
# snapshot_id = ''
|
|
878
|
+
#
|
|
879
|
+
# # TODO: Initialize +description+:
|
|
880
|
+
# description = ''
|
|
881
|
+
#
|
|
882
|
+
# # Register a callback during the method call.
|
|
883
|
+
# operation = bigtable_table_admin_client.snapshot_table(formatted_name, cluster, snapshot_id, description) do |op|
|
|
884
|
+
# raise op.results.message if op.error?
|
|
885
|
+
# op_results = op.results
|
|
886
|
+
# # Process the results.
|
|
887
|
+
#
|
|
888
|
+
# metadata = op.metadata
|
|
889
|
+
# # Process the metadata.
|
|
890
|
+
# end
|
|
891
|
+
#
|
|
892
|
+
# # Or use the return value to register a callback.
|
|
893
|
+
# operation.on_done do |op|
|
|
894
|
+
# raise op.results.message if op.error?
|
|
895
|
+
# op_results = op.results
|
|
896
|
+
# # Process the results.
|
|
897
|
+
#
|
|
898
|
+
# metadata = op.metadata
|
|
899
|
+
# # Process the metadata.
|
|
900
|
+
# end
|
|
901
|
+
#
|
|
902
|
+
# # Manually reload the operation.
|
|
903
|
+
# operation.reload!
|
|
904
|
+
#
|
|
905
|
+
# # Or block until the operation completes, triggering callbacks on
|
|
906
|
+
# # completion.
|
|
907
|
+
# operation.wait_until_done!
|
|
908
|
+
|
|
909
|
+
def snapshot_table \
|
|
910
|
+
name,
|
|
911
|
+
cluster,
|
|
912
|
+
snapshot_id,
|
|
913
|
+
description,
|
|
914
|
+
ttl: nil,
|
|
915
|
+
options: nil
|
|
916
|
+
req = {
|
|
917
|
+
name: name,
|
|
918
|
+
cluster: cluster,
|
|
919
|
+
snapshot_id: snapshot_id,
|
|
920
|
+
description: description,
|
|
921
|
+
ttl: ttl
|
|
922
|
+
}.delete_if { |_, v| v.nil? }
|
|
923
|
+
req = Google::Gax::to_proto(req, Google::Bigtable::Admin::V2::SnapshotTableRequest)
|
|
924
|
+
operation = Google::Gax::Operation.new(
|
|
925
|
+
@snapshot_table.call(req, options),
|
|
926
|
+
@operations_client,
|
|
927
|
+
Google::Bigtable::Admin::V2::Snapshot,
|
|
928
|
+
Google::Bigtable::Admin::V2::SnapshotTableMetadata,
|
|
929
|
+
call_options: options
|
|
930
|
+
)
|
|
931
|
+
operation.on_done { |operation| yield(operation) } if block_given?
|
|
932
|
+
operation
|
|
933
|
+
end
|
|
934
|
+
|
|
935
|
+
# Gets metadata information about the specified snapshot.
|
|
936
|
+
#
|
|
937
|
+
# Note: This is a private alpha release of Cloud Bigtable snapshots. This
|
|
938
|
+
# feature is not currently available to most Cloud Bigtable customers. This
|
|
939
|
+
# feature might be changed in backward-incompatible ways and is not
|
|
940
|
+
# recommended for production use. It is not subject to any SLA or deprecation
|
|
941
|
+
# policy.
|
|
942
|
+
#
|
|
943
|
+
# @param name [String]
|
|
944
|
+
# The unique name of the requested snapshot.
|
|
945
|
+
# Values are of the form
|
|
946
|
+
# +projects/<project>/instances/<instance>/clusters/<cluster>/snapshots/<snapshot>+.
|
|
947
|
+
# @param options [Google::Gax::CallOptions]
|
|
948
|
+
# Overrides the default settings for this call, e.g, timeout,
|
|
949
|
+
# retries, etc.
|
|
950
|
+
# @yield [result, operation] Access the result along with the RPC operation
|
|
951
|
+
# @yieldparam result [Google::Bigtable::Admin::V2::Snapshot]
|
|
952
|
+
# @yieldparam operation [GRPC::ActiveCall::Operation]
|
|
953
|
+
# @return [Google::Bigtable::Admin::V2::Snapshot]
|
|
954
|
+
# @raise [Google::Gax::GaxError] if the RPC is aborted.
|
|
955
|
+
# @example
|
|
956
|
+
# require "google/cloud/bigtable/admin"
|
|
957
|
+
#
|
|
958
|
+
# bigtable_table_admin_client = Google::Cloud::Bigtable::Admin::BigtableTableAdmin.new(version: :v2)
|
|
959
|
+
# formatted_name = Google::Cloud::Bigtable::Admin::V2::BigtableTableAdminClient.snapshot_path("[PROJECT]", "[INSTANCE]", "[CLUSTER]", "[SNAPSHOT]")
|
|
960
|
+
# response = bigtable_table_admin_client.get_snapshot(formatted_name)
|
|
961
|
+
|
|
962
|
+
def get_snapshot \
|
|
963
|
+
name,
|
|
964
|
+
options: nil,
|
|
965
|
+
&block
|
|
966
|
+
req = {
|
|
967
|
+
name: name
|
|
968
|
+
}.delete_if { |_, v| v.nil? }
|
|
969
|
+
req = Google::Gax::to_proto(req, Google::Bigtable::Admin::V2::GetSnapshotRequest)
|
|
970
|
+
@get_snapshot.call(req, options, &block)
|
|
971
|
+
end
|
|
972
|
+
|
|
973
|
+
# Lists all snapshots associated with the specified cluster.
|
|
974
|
+
#
|
|
975
|
+
# Note: This is a private alpha release of Cloud Bigtable snapshots. This
|
|
976
|
+
# feature is not currently available to most Cloud Bigtable customers. This
|
|
977
|
+
# feature might be changed in backward-incompatible ways and is not
|
|
978
|
+
# recommended for production use. It is not subject to any SLA or deprecation
|
|
979
|
+
# policy.
|
|
980
|
+
#
|
|
981
|
+
# @param parent [String]
|
|
982
|
+
# The unique name of the cluster for which snapshots should be listed.
|
|
983
|
+
# Values are of the form
|
|
984
|
+
# +projects/<project>/instances/<instance>/clusters/<cluster>+.
|
|
985
|
+
# Use +<cluster> = '-'+ to list snapshots for all clusters in an instance,
|
|
986
|
+
# e.g., +projects/<project>/instances/<instance>/clusters/-+.
|
|
987
|
+
# @param page_size [Integer]
|
|
988
|
+
# The maximum number of resources contained in the underlying API
|
|
989
|
+
# response. If page streaming is performed per-resource, this
|
|
990
|
+
# parameter does not affect the return value. If page streaming is
|
|
991
|
+
# performed per-page, this determines the maximum number of
|
|
992
|
+
# resources in a page.
|
|
993
|
+
# @param options [Google::Gax::CallOptions]
|
|
994
|
+
# Overrides the default settings for this call, e.g, timeout,
|
|
995
|
+
# retries, etc.
|
|
996
|
+
# @yield [result, operation] Access the result along with the RPC operation
|
|
997
|
+
# @yieldparam result [Google::Gax::PagedEnumerable<Google::Bigtable::Admin::V2::Snapshot>]
|
|
998
|
+
# @yieldparam operation [GRPC::ActiveCall::Operation]
|
|
999
|
+
# @return [Google::Gax::PagedEnumerable<Google::Bigtable::Admin::V2::Snapshot>]
|
|
1000
|
+
# An enumerable of Google::Bigtable::Admin::V2::Snapshot instances.
|
|
1001
|
+
# See Google::Gax::PagedEnumerable documentation for other
|
|
1002
|
+
# operations such as per-page iteration or access to the response
|
|
1003
|
+
# object.
|
|
1004
|
+
# @raise [Google::Gax::GaxError] if the RPC is aborted.
|
|
1005
|
+
# @example
|
|
1006
|
+
# require "google/cloud/bigtable/admin"
|
|
1007
|
+
#
|
|
1008
|
+
# bigtable_table_admin_client = Google::Cloud::Bigtable::Admin::BigtableTableAdmin.new(version: :v2)
|
|
1009
|
+
# formatted_parent = Google::Cloud::Bigtable::Admin::V2::BigtableTableAdminClient.cluster_path("[PROJECT]", "[INSTANCE]", "[CLUSTER]")
|
|
1010
|
+
#
|
|
1011
|
+
# # Iterate over all results.
|
|
1012
|
+
# bigtable_table_admin_client.list_snapshots(formatted_parent).each do |element|
|
|
1013
|
+
# # Process element.
|
|
1014
|
+
# end
|
|
1015
|
+
#
|
|
1016
|
+
# # Or iterate over results one page at a time.
|
|
1017
|
+
# bigtable_table_admin_client.list_snapshots(formatted_parent).each_page do |page|
|
|
1018
|
+
# # Process each page at a time.
|
|
1019
|
+
# page.each do |element|
|
|
1020
|
+
# # Process element.
|
|
1021
|
+
# end
|
|
1022
|
+
# end
|
|
1023
|
+
|
|
1024
|
+
def list_snapshots \
|
|
1025
|
+
parent,
|
|
1026
|
+
page_size: nil,
|
|
1027
|
+
options: nil,
|
|
1028
|
+
&block
|
|
1029
|
+
req = {
|
|
1030
|
+
parent: parent,
|
|
1031
|
+
page_size: page_size
|
|
1032
|
+
}.delete_if { |_, v| v.nil? }
|
|
1033
|
+
req = Google::Gax::to_proto(req, Google::Bigtable::Admin::V2::ListSnapshotsRequest)
|
|
1034
|
+
@list_snapshots.call(req, options, &block)
|
|
1035
|
+
end
|
|
1036
|
+
|
|
1037
|
+
# Permanently deletes the specified snapshot.
|
|
1038
|
+
#
|
|
1039
|
+
# Note: This is a private alpha release of Cloud Bigtable snapshots. This
|
|
1040
|
+
# feature is not currently available to most Cloud Bigtable customers. This
|
|
1041
|
+
# feature might be changed in backward-incompatible ways and is not
|
|
1042
|
+
# recommended for production use. It is not subject to any SLA or deprecation
|
|
1043
|
+
# policy.
|
|
1044
|
+
#
|
|
1045
|
+
# @param name [String]
|
|
1046
|
+
# The unique name of the snapshot to be deleted.
|
|
1047
|
+
# Values are of the form
|
|
1048
|
+
# +projects/<project>/instances/<instance>/clusters/<cluster>/snapshots/<snapshot>+.
|
|
1049
|
+
# @param options [Google::Gax::CallOptions]
|
|
1050
|
+
# Overrides the default settings for this call, e.g, timeout,
|
|
1051
|
+
# retries, etc.
|
|
1052
|
+
# @yield [result, operation] Access the result along with the RPC operation
|
|
1053
|
+
# @yieldparam result []
|
|
1054
|
+
# @yieldparam operation [GRPC::ActiveCall::Operation]
|
|
1055
|
+
# @raise [Google::Gax::GaxError] if the RPC is aborted.
|
|
1056
|
+
# @example
|
|
1057
|
+
# require "google/cloud/bigtable/admin"
|
|
1058
|
+
#
|
|
1059
|
+
# bigtable_table_admin_client = Google::Cloud::Bigtable::Admin::BigtableTableAdmin.new(version: :v2)
|
|
1060
|
+
# formatted_name = Google::Cloud::Bigtable::Admin::V2::BigtableTableAdminClient.snapshot_path("[PROJECT]", "[INSTANCE]", "[CLUSTER]", "[SNAPSHOT]")
|
|
1061
|
+
# bigtable_table_admin_client.delete_snapshot(formatted_name)
|
|
1062
|
+
|
|
1063
|
+
def delete_snapshot \
|
|
1064
|
+
name,
|
|
1065
|
+
options: nil,
|
|
1066
|
+
&block
|
|
1067
|
+
req = {
|
|
1068
|
+
name: name
|
|
1069
|
+
}.delete_if { |_, v| v.nil? }
|
|
1070
|
+
req = Google::Gax::to_proto(req, Google::Bigtable::Admin::V2::DeleteSnapshotRequest)
|
|
1071
|
+
@delete_snapshot.call(req, options, &block)
|
|
1072
|
+
nil
|
|
1073
|
+
end
|
|
1074
|
+
end
|
|
1075
|
+
end
|
|
1076
|
+
end
|
|
1077
|
+
end
|
|
1078
|
+
end
|
|
1079
|
+
end
|