Class: Google::Cloud::Bigtable::Admin::V2::BigtableInstanceAdmin::Client

Inherits:
Object
  • Object
show all
Includes:
Paths
Defined in:
lib/google/cloud/bigtable/admin/v2/bigtable_instance_admin/client.rb

Overview

Client for the BigtableInstanceAdmin service.

Service for creating, configuring, and deleting Cloud Bigtable Instances and Clusters. Provides access to the Instance and Cluster schemas only, not the tables' metadata or data stored in those tables.

Defined Under Namespace

Classes: Configuration

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Paths

#app_profile_path, #cluster_path, #crypto_key_path, #instance_path, #location_path, #project_path

Constructor Details

#initialize {|config| ... } ⇒ Client

Create a new BigtableInstanceAdmin client object.

Examples:


# Create a client using the default configuration
client = ::Google::Cloud::Bigtable::Admin::V2::BigtableInstanceAdmin::Client.new

# Create a client using a custom configuration
client = ::Google::Cloud::Bigtable::Admin::V2::BigtableInstanceAdmin::Client.new do |config|
  config.timeout = 10.0
end

Yields:

  • (config)

    Configure the BigtableInstanceAdmin client.

Yield Parameters:



191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
# File 'lib/google/cloud/bigtable/admin/v2/bigtable_instance_admin/client.rb', line 191

def initialize
  # These require statements are intentionally placed here to initialize
  # the gRPC module only when it's required.
  # See https://github.com/googleapis/toolkit/issues/446
  require "gapic/grpc"
  require "google/bigtable/admin/v2/bigtable_instance_admin_services_pb"

  # Create the configuration object
  @config = Configuration.new Client.configure

  # Yield the configuration if needed
  yield @config if block_given?

  # Create credentials
  credentials = @config.credentials
  # Use self-signed JWT if the endpoint is unchanged from default,
  # but only if the default endpoint does not have a region prefix.
  enable_self_signed_jwt = @config.endpoint == Configuration::DEFAULT_ENDPOINT &&
                           !@config.endpoint.split(".").first.include?("-")
  credentials ||= Credentials.default scope: @config.scope,
                                      enable_self_signed_jwt: enable_self_signed_jwt
  if credentials.is_a?(::String) || credentials.is_a?(::Hash)
    credentials = Credentials.new credentials, scope: @config.scope
  end
  @quota_project_id = @config.quota_project
  @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id

  @operations_client = Operations.new do |config|
    config.credentials = credentials
    config.quota_project = @quota_project_id
    config.endpoint = @config.endpoint
  end

  @bigtable_instance_admin_stub = ::Gapic::ServiceStub.new(
    ::Google::Cloud::Bigtable::Admin::V2::BigtableInstanceAdmin::Stub,
    credentials:  credentials,
    endpoint:     @config.endpoint,
    channel_args: @config.channel_args,
    interceptors: @config.interceptors,
    channel_pool_config: @config.channel_pool
  )
end

Instance Attribute Details

#operations_client::Google::Cloud::Bigtable::Admin::V2::BigtableInstanceAdmin::Operations (readonly)

Get the associated client for long-running operations.



239
240
241
# File 'lib/google/cloud/bigtable/admin/v2/bigtable_instance_admin/client.rb', line 239

def operations_client
  @operations_client
end

Class Method Details

.configure {|config| ... } ⇒ Client::Configuration

Configure the BigtableInstanceAdmin Client class.

See Configuration for a description of the configuration fields.

Examples:


# Modify the configuration for all BigtableInstanceAdmin clients
::Google::Cloud::Bigtable::Admin::V2::BigtableInstanceAdmin::Client.configure do |config|
  config.timeout = 10.0
end

Yields:

  • (config)

    Configure the Client client.

Yield Parameters:

Returns:



59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
# File 'lib/google/cloud/bigtable/admin/v2/bigtable_instance_admin/client.rb', line 59

def self.configure
  @configure ||= begin
    namespace = ["Google", "Cloud", "Bigtable", "Admin", "V2"]
    parent_config = while namespace.any?
                      parent_name = namespace.join "::"
                      parent_const = const_get parent_name
                      break parent_const.configure if parent_const.respond_to? :configure
                      namespace.pop
                    end
    default_config = Client::Configuration.new parent_config

    default_config.rpcs.create_instance.timeout = 300.0

    default_config.rpcs.get_instance.timeout = 60.0
    default_config.rpcs.get_instance.retry_policy = {
      initial_delay: 1.0, max_delay: 60.0, multiplier: 2, retry_codes: [14, 4]
    }

    default_config.rpcs.list_instances.timeout = 60.0
    default_config.rpcs.list_instances.retry_policy = {
      initial_delay: 1.0, max_delay: 60.0, multiplier: 2, retry_codes: [14, 4]
    }

    default_config.rpcs.update_instance.timeout = 60.0
    default_config.rpcs.update_instance.retry_policy = {
      initial_delay: 1.0, max_delay: 60.0, multiplier: 2, retry_codes: [14, 4]
    }

    default_config.rpcs.partial_update_instance.timeout = 60.0
    default_config.rpcs.partial_update_instance.retry_policy = {
      initial_delay: 1.0, max_delay: 60.0, multiplier: 2, retry_codes: [14, 4]
    }

    default_config.rpcs.delete_instance.timeout = 60.0

    default_config.rpcs.create_cluster.timeout = 60.0

    default_config.rpcs.get_cluster.timeout = 60.0
    default_config.rpcs.get_cluster.retry_policy = {
      initial_delay: 1.0, max_delay: 60.0, multiplier: 2, retry_codes: [14, 4]
    }

    default_config.rpcs.list_clusters.timeout = 60.0
    default_config.rpcs.list_clusters.retry_policy = {
      initial_delay: 1.0, max_delay: 60.0, multiplier: 2, retry_codes: [14, 4]
    }

    default_config.rpcs.update_cluster.timeout = 60.0
    default_config.rpcs.update_cluster.retry_policy = {
      initial_delay: 1.0, max_delay: 60.0, multiplier: 2, retry_codes: [14, 4]
    }

    default_config.rpcs.delete_cluster.timeout = 60.0

    default_config.rpcs.create_app_profile.timeout = 60.0

    default_config.rpcs.get_app_profile.timeout = 60.0
    default_config.rpcs.get_app_profile.retry_policy = {
      initial_delay: 1.0, max_delay: 60.0, multiplier: 2, retry_codes: [14, 4]
    }

    default_config.rpcs.list_app_profiles.timeout = 60.0
    default_config.rpcs.list_app_profiles.retry_policy = {
      initial_delay: 1.0, max_delay: 60.0, multiplier: 2, retry_codes: [14, 4]
    }

    default_config.rpcs.update_app_profile.timeout = 60.0
    default_config.rpcs.update_app_profile.retry_policy = {
      initial_delay: 1.0, max_delay: 60.0, multiplier: 2, retry_codes: [14, 4]
    }

    default_config.rpcs.delete_app_profile.timeout = 60.0

    default_config.rpcs.get_iam_policy.timeout = 60.0
    default_config.rpcs.get_iam_policy.retry_policy = {
      initial_delay: 1.0, max_delay: 60.0, multiplier: 2, retry_codes: [14, 4]
    }

    default_config.rpcs.set_iam_policy.timeout = 60.0

    default_config.rpcs.test_iam_permissions.timeout = 60.0
    default_config.rpcs.test_iam_permissions.retry_policy = {
      initial_delay: 1.0, max_delay: 60.0, multiplier: 2, retry_codes: [14, 4]
    }

    default_config.rpcs.list_hot_tablets.timeout = 60.0
    default_config.rpcs.list_hot_tablets.retry_policy = {
      initial_delay: 1.0, max_delay: 60.0, multiplier: 2, retry_codes: [14, 4]
    }

    default_config
  end
  yield @configure if block_given?
  @configure
end

Instance Method Details

#configure {|config| ... } ⇒ Client::Configuration

Configure the BigtableInstanceAdmin Client instance.

The configuration is set to the derived mode, meaning that values can be changed, but structural changes (adding new fields, etc.) are not allowed. Structural changes should be made on configure.

See Configuration for a description of the configuration fields.

Yields:

  • (config)

    Configure the Client client.

Yield Parameters:

Returns:



170
171
172
173
# File 'lib/google/cloud/bigtable/admin/v2/bigtable_instance_admin/client.rb', line 170

def configure
  yield @config if block_given?
  @config
end

#create_app_profile(request, options = nil) ⇒ ::Google::Cloud::Bigtable::Admin::V2::AppProfile #create_app_profile(parent: nil, app_profile_id: nil, app_profile: nil, ignore_warnings: nil) ⇒ ::Google::Cloud::Bigtable::Admin::V2::AppProfile

Creates an app profile within an instance.

Examples:

Basic example

require "google/cloud/bigtable/admin/v2"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Bigtable::Admin::V2::BigtableInstanceAdmin::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Bigtable::Admin::V2::CreateAppProfileRequest.new

# Call the create_app_profile method.
result = client.create_app_profile request

# The returned object is of type Google::Cloud::Bigtable::Admin::V2::AppProfile.
p result

Overloads:

  • #create_app_profile(request, options = nil) ⇒ ::Google::Cloud::Bigtable::Admin::V2::AppProfile

    Pass arguments to create_app_profile via a request object, either of type CreateAppProfileRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::Bigtable::Admin::V2::CreateAppProfileRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #create_app_profile(parent: nil, app_profile_id: nil, app_profile: nil, ignore_warnings: nil) ⇒ ::Google::Cloud::Bigtable::Admin::V2::AppProfile

    Pass arguments to create_app_profile via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • parent (::String) (defaults to: nil)

      Required. The unique name of the instance in which to create the new app profile. Values are of the form projects/{project}/instances/{instance}.

    • app_profile_id (::String) (defaults to: nil)

      Required. The ID to be used when referring to the new app profile within its instance, e.g., just myprofile rather than projects/myproject/instances/myinstance/appProfiles/myprofile.

    • app_profile (::Google::Cloud::Bigtable::Admin::V2::AppProfile, ::Hash) (defaults to: nil)

      Required. The app profile to be created. Fields marked OutputOnly will be ignored.

    • ignore_warnings (::Boolean) (defaults to: nil)

      If true, ignore safety checks when creating the app profile.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
# File 'lib/google/cloud/bigtable/admin/v2/bigtable_instance_admin/client.rb', line 1466

def create_app_profile request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigtable::Admin::V2::CreateAppProfileRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.create_app_profile..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Bigtable::Admin::V2::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.parent
    header_params["parent"] = request.parent
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.create_app_profile.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.create_app_profile.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @bigtable_instance_admin_stub.call_rpc :create_app_profile, request, options: options do |response, operation|
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#create_cluster(request, options = nil) ⇒ ::Gapic::Operation #create_cluster(parent: nil, cluster_id: nil, cluster: nil) ⇒ ::Gapic::Operation

Creates a cluster within an instance.

Note that exactly one of Cluster.serve_nodes and Cluster.cluster_config.cluster_autoscaling_config can be set. If serve_nodes is set to non-zero, then the cluster is manually scaled. If cluster_config.cluster_autoscaling_config is non-empty, then autoscaling is enabled.

Examples:

Basic example

require "google/cloud/bigtable/admin/v2"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Bigtable::Admin::V2::BigtableInstanceAdmin::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Bigtable::Admin::V2::CreateClusterRequest.new

# Call the create_cluster method.
result = client.create_cluster request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

Overloads:

  • #create_cluster(request, options = nil) ⇒ ::Gapic::Operation

    Pass arguments to create_cluster via a request object, either of type CreateClusterRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::Bigtable::Admin::V2::CreateClusterRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #create_cluster(parent: nil, cluster_id: nil, cluster: nil) ⇒ ::Gapic::Operation

    Pass arguments to create_cluster via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • parent (::String) (defaults to: nil)

      Required. The unique name of the instance in which to create the new cluster. Values are of the form projects/{project}/instances/{instance}.

    • cluster_id (::String) (defaults to: nil)

      Required. The ID to be used when referring to the new cluster within its instance, e.g., just mycluster rather than projects/myproject/instances/myinstance/clusters/mycluster.

    • cluster (::Google::Cloud::Bigtable::Admin::V2::Cluster, ::Hash) (defaults to: nil)

      Required. The cluster to be created. Fields marked OutputOnly must be left blank.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)

Returns:

  • (::Gapic::Operation)

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
# File 'lib/google/cloud/bigtable/admin/v2/bigtable_instance_admin/client.rb', line 887

def create_cluster request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigtable::Admin::V2::CreateClusterRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.create_cluster..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Bigtable::Admin::V2::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.parent
    header_params["parent"] = request.parent
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.create_cluster.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.create_cluster.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @bigtable_instance_admin_stub.call_rpc :create_cluster, request, options: options do |response, operation|
    response = ::Gapic::Operation.new response, @operations_client, options: options
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#create_instance(request, options = nil) ⇒ ::Gapic::Operation #create_instance(parent: nil, instance_id: nil, instance: nil, clusters: nil) ⇒ ::Gapic::Operation

Create an instance within a project.

Note that exactly one of Cluster.serve_nodes and Cluster.cluster_config.cluster_autoscaling_config can be set. If serve_nodes is set to non-zero, then the cluster is manually scaled. If cluster_config.cluster_autoscaling_config is non-empty, then autoscaling is enabled.

Examples:

Basic example

require "google/cloud/bigtable/admin/v2"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Bigtable::Admin::V2::BigtableInstanceAdmin::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Bigtable::Admin::V2::CreateInstanceRequest.new

# Call the create_instance method.
result = client.create_instance request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

Overloads:

  • #create_instance(request, options = nil) ⇒ ::Gapic::Operation

    Pass arguments to create_instance via a request object, either of type CreateInstanceRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::Bigtable::Admin::V2::CreateInstanceRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #create_instance(parent: nil, instance_id: nil, instance: nil, clusters: nil) ⇒ ::Gapic::Operation

    Pass arguments to create_instance via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • parent (::String) (defaults to: nil)

      Required. The unique name of the project in which to create the new instance. Values are of the form projects/{project}.

    • instance_id (::String) (defaults to: nil)

      Required. The ID to be used when referring to the new instance within its project, e.g., just myinstance rather than projects/myproject/instances/myinstance.

    • instance (::Google::Cloud::Bigtable::Admin::V2::Instance, ::Hash) (defaults to: nil)

      Required. The instance to create. Fields marked OutputOnly must be left blank.

    • clusters (::Hash{::String => ::Google::Cloud::Bigtable::Admin::V2::Cluster, ::Hash}) (defaults to: nil)

      Required. The clusters to be created within the instance, mapped by desired cluster ID, e.g., just mycluster rather than projects/myproject/instances/myinstance/clusters/mycluster. Fields marked OutputOnly must be left blank. Currently, at most four clusters can be specified.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)

Returns:

  • (::Gapic::Operation)

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
# File 'lib/google/cloud/bigtable/admin/v2/bigtable_instance_admin/client.rb', line 314

def create_instance request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigtable::Admin::V2::CreateInstanceRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.create_instance..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Bigtable::Admin::V2::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.parent
    header_params["parent"] = request.parent
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.create_instance.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.create_instance.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @bigtable_instance_admin_stub.call_rpc :create_instance, request, options: options do |response, operation|
    response = ::Gapic::Operation.new response, @operations_client, options: options
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#delete_app_profile(request, options = nil) ⇒ ::Google::Protobuf::Empty #delete_app_profile(name: nil, ignore_warnings: nil) ⇒ ::Google::Protobuf::Empty

Deletes an app profile from an instance.

Examples:

Basic example

require "google/cloud/bigtable/admin/v2"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Bigtable::Admin::V2::BigtableInstanceAdmin::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Bigtable::Admin::V2::DeleteAppProfileRequest.new

# Call the delete_app_profile method.
result = client.delete_app_profile request

# The returned object is of type Google::Protobuf::Empty.
p result

Overloads:

  • #delete_app_profile(request, options = nil) ⇒ ::Google::Protobuf::Empty

    Pass arguments to delete_app_profile via a request object, either of type DeleteAppProfileRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::Bigtable::Admin::V2::DeleteAppProfileRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #delete_app_profile(name: nil, ignore_warnings: nil) ⇒ ::Google::Protobuf::Empty

    Pass arguments to delete_app_profile via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. The unique name of the app profile to be deleted. Values are of the form projects/{project}/instances/{instance}/appProfiles/{app_profile}.

    • ignore_warnings (::Boolean) (defaults to: nil)

      Required. If true, ignore safety checks when deleting the app profile.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
# File 'lib/google/cloud/bigtable/admin/v2/bigtable_instance_admin/client.rb', line 1845

def delete_app_profile request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigtable::Admin::V2::DeleteAppProfileRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.delete_app_profile..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Bigtable::Admin::V2::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.delete_app_profile.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.delete_app_profile.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @bigtable_instance_admin_stub.call_rpc :delete_app_profile, request, options: options do |response, operation|
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#delete_cluster(request, options = nil) ⇒ ::Google::Protobuf::Empty #delete_cluster(name: nil) ⇒ ::Google::Protobuf::Empty

Deletes a cluster from an instance.

Examples:

Basic example

require "google/cloud/bigtable/admin/v2"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Bigtable::Admin::V2::BigtableInstanceAdmin::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Bigtable::Admin::V2::DeleteClusterRequest.new

# Call the delete_cluster method.
result = client.delete_cluster request

# The returned object is of type Google::Protobuf::Empty.
p result

Overloads:

  • #delete_cluster(request, options = nil) ⇒ ::Google::Protobuf::Empty

    Pass arguments to delete_cluster via a request object, either of type DeleteClusterRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::Bigtable::Admin::V2::DeleteClusterRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #delete_cluster(name: nil) ⇒ ::Google::Protobuf::Empty

    Pass arguments to delete_cluster via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. The unique name of the cluster to be deleted. Values are of the form projects/{project}/instances/{instance}/clusters/{cluster}.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
# File 'lib/google/cloud/bigtable/admin/v2/bigtable_instance_admin/client.rb', line 1371

def delete_cluster request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigtable::Admin::V2::DeleteClusterRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.delete_cluster..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Bigtable::Admin::V2::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.delete_cluster.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.delete_cluster.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @bigtable_instance_admin_stub.call_rpc :delete_cluster, request, options: options do |response, operation|
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#delete_instance(request, options = nil) ⇒ ::Google::Protobuf::Empty #delete_instance(name: nil) ⇒ ::Google::Protobuf::Empty

Delete an instance from a project.

Examples:

Basic example

require "google/cloud/bigtable/admin/v2"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Bigtable::Admin::V2::BigtableInstanceAdmin::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Bigtable::Admin::V2::DeleteInstanceRequest.new

# Call the delete_instance method.
result = client.delete_instance request

# The returned object is of type Google::Protobuf::Empty.
p result

Overloads:

  • #delete_instance(request, options = nil) ⇒ ::Google::Protobuf::Empty

    Pass arguments to delete_instance via a request object, either of type DeleteInstanceRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::Bigtable::Admin::V2::DeleteInstanceRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #delete_instance(name: nil) ⇒ ::Google::Protobuf::Empty

    Pass arguments to delete_instance via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. The unique name of the instance to be deleted. Values are of the form projects/{project}/instances/{instance}.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
# File 'lib/google/cloud/bigtable/admin/v2/bigtable_instance_admin/client.rb', line 781

def delete_instance request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigtable::Admin::V2::DeleteInstanceRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.delete_instance..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Bigtable::Admin::V2::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.delete_instance.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.delete_instance.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @bigtable_instance_admin_stub.call_rpc :delete_instance, request, options: options do |response, operation|
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#get_app_profile(request, options = nil) ⇒ ::Google::Cloud::Bigtable::Admin::V2::AppProfile #get_app_profile(name: nil) ⇒ ::Google::Cloud::Bigtable::Admin::V2::AppProfile

Gets information about an app profile.

Examples:

Basic example

require "google/cloud/bigtable/admin/v2"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Bigtable::Admin::V2::BigtableInstanceAdmin::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Bigtable::Admin::V2::GetAppProfileRequest.new

# Call the get_app_profile method.
result = client.get_app_profile request

# The returned object is of type Google::Cloud::Bigtable::Admin::V2::AppProfile.
p result

Overloads:

  • #get_app_profile(request, options = nil) ⇒ ::Google::Cloud::Bigtable::Admin::V2::AppProfile

    Pass arguments to get_app_profile via a request object, either of type GetAppProfileRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::Bigtable::Admin::V2::GetAppProfileRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #get_app_profile(name: nil) ⇒ ::Google::Cloud::Bigtable::Admin::V2::AppProfile

    Pass arguments to get_app_profile via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. The unique name of the requested app profile. Values are of the form projects/{project}/instances/{instance}/appProfiles/{app_profile}.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
# File 'lib/google/cloud/bigtable/admin/v2/bigtable_instance_admin/client.rb', line 1552

def get_app_profile request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigtable::Admin::V2::GetAppProfileRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.get_app_profile..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Bigtable::Admin::V2::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.get_app_profile.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.get_app_profile.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @bigtable_instance_admin_stub.call_rpc :get_app_profile, request, options: options do |response, operation|
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#get_cluster(request, options = nil) ⇒ ::Google::Cloud::Bigtable::Admin::V2::Cluster #get_cluster(name: nil) ⇒ ::Google::Cloud::Bigtable::Admin::V2::Cluster

Gets information about a cluster.

Examples:

Basic example

require "google/cloud/bigtable/admin/v2"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Bigtable::Admin::V2::BigtableInstanceAdmin::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Bigtable::Admin::V2::GetClusterRequest.new

# Call the get_cluster method.
result = client.get_cluster request

# The returned object is of type Google::Cloud::Bigtable::Admin::V2::Cluster.
p result

Overloads:

  • #get_cluster(request, options = nil) ⇒ ::Google::Cloud::Bigtable::Admin::V2::Cluster

    Pass arguments to get_cluster via a request object, either of type GetClusterRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::Bigtable::Admin::V2::GetClusterRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #get_cluster(name: nil) ⇒ ::Google::Cloud::Bigtable::Admin::V2::Cluster

    Pass arguments to get_cluster via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. The unique name of the requested cluster. Values are of the form projects/{project}/instances/{instance}/clusters/{cluster}.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
# File 'lib/google/cloud/bigtable/admin/v2/bigtable_instance_admin/client.rb', line 974

def get_cluster request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigtable::Admin::V2::GetClusterRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.get_cluster..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Bigtable::Admin::V2::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.get_cluster.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.get_cluster.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @bigtable_instance_admin_stub.call_rpc :get_cluster, request, options: options do |response, operation|
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#get_iam_policy(request, options = nil) ⇒ ::Google::Iam::V1::Policy #get_iam_policy(resource: nil, options: nil) ⇒ ::Google::Iam::V1::Policy

Gets the access control policy for an instance resource. Returns an empty policy if an instance exists but does not have a policy set.

Examples:

Basic example

require "google/cloud/bigtable/admin/v2"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Bigtable::Admin::V2::BigtableInstanceAdmin::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Iam::V1::GetIamPolicyRequest.new

# Call the get_iam_policy method.
result = client.get_iam_policy request

# The returned object is of type Google::Iam::V1::Policy.
p result

Overloads:

  • #get_iam_policy(request, options = nil) ⇒ ::Google::Iam::V1::Policy

    Pass arguments to get_iam_policy via a request object, either of type Iam::V1::GetIamPolicyRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Iam::V1::GetIamPolicyRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #get_iam_policy(resource: nil, options: nil) ⇒ ::Google::Iam::V1::Policy

    Pass arguments to get_iam_policy via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • resource (::String) (defaults to: nil)

      REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field.

    • options (::Google::Iam::V1::GetPolicyOptions, ::Hash) (defaults to: nil)

      OPTIONAL: A GetPolicyOptions object for specifying options to GetIamPolicy.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
# File 'lib/google/cloud/bigtable/admin/v2/bigtable_instance_admin/client.rb', line 1935

def get_iam_policy request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::GetIamPolicyRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.get_iam_policy..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Bigtable::Admin::V2::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.resource
    header_params["resource"] = request.resource
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.get_iam_policy.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.get_iam_policy.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @bigtable_instance_admin_stub.call_rpc :get_iam_policy, request, options: options do |response, operation|
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#get_instance(request, options = nil) ⇒ ::Google::Cloud::Bigtable::Admin::V2::Instance #get_instance(name: nil) ⇒ ::Google::Cloud::Bigtable::Admin::V2::Instance

Gets information about an instance.

Examples:

Basic example

require "google/cloud/bigtable/admin/v2"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Bigtable::Admin::V2::BigtableInstanceAdmin::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Bigtable::Admin::V2::GetInstanceRequest.new

# Call the get_instance method.
result = client.get_instance request

# The returned object is of type Google::Cloud::Bigtable::Admin::V2::Instance.
p result

Overloads:

  • #get_instance(request, options = nil) ⇒ ::Google::Cloud::Bigtable::Admin::V2::Instance

    Pass arguments to get_instance via a request object, either of type GetInstanceRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::Bigtable::Admin::V2::GetInstanceRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #get_instance(name: nil) ⇒ ::Google::Cloud::Bigtable::Admin::V2::Instance

    Pass arguments to get_instance via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. The unique name of the requested instance. Values are of the form projects/{project}/instances/{instance}.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
# File 'lib/google/cloud/bigtable/admin/v2/bigtable_instance_admin/client.rb', line 401

def get_instance request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigtable::Admin::V2::GetInstanceRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.get_instance..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Bigtable::Admin::V2::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.get_instance.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.get_instance.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @bigtable_instance_admin_stub.call_rpc :get_instance, request, options: options do |response, operation|
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#list_app_profiles(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Bigtable::Admin::V2::AppProfile> #list_app_profiles(parent: nil, page_size: nil, page_token: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Bigtable::Admin::V2::AppProfile>

Lists information about app profiles in an instance.

Examples:

Basic example

require "google/cloud/bigtable/admin/v2"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Bigtable::Admin::V2::BigtableInstanceAdmin::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Bigtable::Admin::V2::ListAppProfilesRequest.new

# Call the list_app_profiles method.
result = client.list_app_profiles request

# The returned object is of type Gapic::PagedEnumerable. You can iterate
# over elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::Bigtable::Admin::V2::AppProfile.
  p item
end

Overloads:

  • #list_app_profiles(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Bigtable::Admin::V2::AppProfile>

    Pass arguments to list_app_profiles via a request object, either of type ListAppProfilesRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::Bigtable::Admin::V2::ListAppProfilesRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #list_app_profiles(parent: nil, page_size: nil, page_token: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Bigtable::Admin::V2::AppProfile>

    Pass arguments to list_app_profiles via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • parent (::String) (defaults to: nil)

      Required. The unique name of the instance for which a list of app profiles is requested. Values are of the form projects/{project}/instances/{instance}. Use {instance} = '-' to list AppProfiles for all Instances in a project, e.g., projects/myproject/instances/-.

    • page_size (::Integer) (defaults to: nil)

      Maximum number of results per page.

      A page_size of zero lets the server choose the number of items to return. A page_size which is strictly positive will return at most that many items. A negative page_size will cause an error.

      Following the first request, subsequent paginated calls are not required to pass a page_size. If a page_size is set in subsequent calls, it must match the page_size given in the first request.

    • page_token (::String) (defaults to: nil)

      The value of next_page_token returned by a previous call.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
# File 'lib/google/cloud/bigtable/admin/v2/bigtable_instance_admin/client.rb', line 1657

def list_app_profiles request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigtable::Admin::V2::ListAppProfilesRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.list_app_profiles..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Bigtable::Admin::V2::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.parent
    header_params["parent"] = request.parent
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.list_app_profiles.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.list_app_profiles.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @bigtable_instance_admin_stub.call_rpc :list_app_profiles, request, options: options do |response, operation|
    response = ::Gapic::PagedEnumerable.new @bigtable_instance_admin_stub, :list_app_profiles, request, response, operation, options
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#list_clusters(request, options = nil) ⇒ ::Google::Cloud::Bigtable::Admin::V2::ListClustersResponse #list_clusters(parent: nil, page_token: nil) ⇒ ::Google::Cloud::Bigtable::Admin::V2::ListClustersResponse

Lists information about clusters in an instance.

Examples:

Basic example

require "google/cloud/bigtable/admin/v2"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Bigtable::Admin::V2::BigtableInstanceAdmin::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Bigtable::Admin::V2::ListClustersRequest.new

# Call the list_clusters method.
result = client.list_clusters request

# The returned object is of type Google::Cloud::Bigtable::Admin::V2::ListClustersResponse.
p result

Overloads:

  • #list_clusters(request, options = nil) ⇒ ::Google::Cloud::Bigtable::Admin::V2::ListClustersResponse

    Pass arguments to list_clusters via a request object, either of type ListClustersRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::Bigtable::Admin::V2::ListClustersRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #list_clusters(parent: nil, page_token: nil) ⇒ ::Google::Cloud::Bigtable::Admin::V2::ListClustersResponse

    Pass arguments to list_clusters via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • parent (::String) (defaults to: nil)

      Required. The unique name of the instance for which a list of clusters is requested. Values are of the form projects/{project}/instances/{instance}. Use {instance} = '-' to list Clusters for all Instances in a project, e.g., projects/myproject/instances/-.

    • page_token (::String) (defaults to: nil)

      DEPRECATED: This field is unused and ignored.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
# File 'lib/google/cloud/bigtable/admin/v2/bigtable_instance_admin/client.rb', line 1065

def list_clusters request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigtable::Admin::V2::ListClustersRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.list_clusters..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Bigtable::Admin::V2::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.parent
    header_params["parent"] = request.parent
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.list_clusters.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.list_clusters.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @bigtable_instance_admin_stub.call_rpc :list_clusters, request, options: options do |response, operation|
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#list_hot_tablets(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Bigtable::Admin::V2::HotTablet> #list_hot_tablets(parent: nil, start_time: nil, end_time: nil, page_size: nil, page_token: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Bigtable::Admin::V2::HotTablet>

Lists hot tablets in a cluster, within the time range provided. Hot tablets are ordered based on CPU usage.

Examples:

Basic example

require "google/cloud/bigtable/admin/v2"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Bigtable::Admin::V2::BigtableInstanceAdmin::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Bigtable::Admin::V2::ListHotTabletsRequest.new

# Call the list_hot_tablets method.
result = client.list_hot_tablets request

# The returned object is of type Gapic::PagedEnumerable. You can iterate
# over elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::Bigtable::Admin::V2::HotTablet.
  p item
end

Overloads:

  • #list_hot_tablets(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Bigtable::Admin::V2::HotTablet>

    Pass arguments to list_hot_tablets via a request object, either of type ListHotTabletsRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::Bigtable::Admin::V2::ListHotTabletsRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #list_hot_tablets(parent: nil, start_time: nil, end_time: nil, page_size: nil, page_token: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Bigtable::Admin::V2::HotTablet>

    Pass arguments to list_hot_tablets via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • parent (::String) (defaults to: nil)

      Required. The cluster name to list hot tablets. Value is in the following form: projects/{project}/instances/{instance}/clusters/{cluster}.

    • start_time (::Google::Protobuf::Timestamp, ::Hash) (defaults to: nil)

      The start time to list hot tablets. The hot tablets in the response will have start times between the requested start time and end time. Start time defaults to Now if it is unset, and end time defaults to Now - 24 hours if it is unset. The start time should be less than the end time, and the maximum allowed time range between start time and end time is 48 hours. Start time and end time should have values between Now and Now - 14 days.

    • end_time (::Google::Protobuf::Timestamp, ::Hash) (defaults to: nil)

      The end time to list hot tablets.

    • page_size (::Integer) (defaults to: nil)

      Maximum number of results per page.

      A page_size that is empty or zero lets the server choose the number of items to return. A page_size which is strictly positive will return at most that many items. A negative page_size will cause an error.

      Following the first request, subsequent paginated calls do not need a page_size field. If a page_size is set in subsequent calls, it must match the page_size given in the first request.

    • page_token (::String) (defaults to: nil)

      The value of next_page_token returned by a previous call.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
# File 'lib/google/cloud/bigtable/admin/v2/bigtable_instance_admin/client.rb', line 2237

def list_hot_tablets request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigtable::Admin::V2::ListHotTabletsRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.list_hot_tablets..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Bigtable::Admin::V2::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.parent
    header_params["parent"] = request.parent
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.list_hot_tablets.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.list_hot_tablets.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @bigtable_instance_admin_stub.call_rpc :list_hot_tablets, request, options: options do |response, operation|
    response = ::Gapic::PagedEnumerable.new @bigtable_instance_admin_stub, :list_hot_tablets, request, response, operation, options
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#list_instances(request, options = nil) ⇒ ::Google::Cloud::Bigtable::Admin::V2::ListInstancesResponse #list_instances(parent: nil, page_token: nil) ⇒ ::Google::Cloud::Bigtable::Admin::V2::ListInstancesResponse

Lists information about instances in a project.

Examples:

Basic example

require "google/cloud/bigtable/admin/v2"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Bigtable::Admin::V2::BigtableInstanceAdmin::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Bigtable::Admin::V2::ListInstancesRequest.new

# Call the list_instances method.
result = client.list_instances request

# The returned object is of type Google::Cloud::Bigtable::Admin::V2::ListInstancesResponse.
p result

Overloads:

  • #list_instances(request, options = nil) ⇒ ::Google::Cloud::Bigtable::Admin::V2::ListInstancesResponse

    Pass arguments to list_instances via a request object, either of type ListInstancesRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::Bigtable::Admin::V2::ListInstancesRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #list_instances(parent: nil, page_token: nil) ⇒ ::Google::Cloud::Bigtable::Admin::V2::ListInstancesResponse

    Pass arguments to list_instances via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • parent (::String) (defaults to: nil)

      Required. The unique name of the project for which a list of instances is requested. Values are of the form projects/{project}.

    • page_token (::String) (defaults to: nil)

      DEPRECATED: This field is unused and ignored.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
# File 'lib/google/cloud/bigtable/admin/v2/bigtable_instance_admin/client.rb', line 489

def list_instances request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigtable::Admin::V2::ListInstancesRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.list_instances..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Bigtable::Admin::V2::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.parent
    header_params["parent"] = request.parent
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.list_instances.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.list_instances.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @bigtable_instance_admin_stub.call_rpc :list_instances, request, options: options do |response, operation|
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#partial_update_cluster(request, options = nil) ⇒ ::Gapic::Operation #partial_update_cluster(cluster: nil, update_mask: nil) ⇒ ::Gapic::Operation

Partially updates a cluster within a project. This method is the preferred way to update a Cluster.

To enable and update autoscaling, set cluster_config.cluster_autoscaling_config. When autoscaling is enabled, serve_nodes is treated as an OUTPUT_ONLY field, meaning that updates to it are ignored. Note that an update cannot simultaneously set serve_nodes to non-zero and cluster_config.cluster_autoscaling_config to non-empty, and also specify both in the update_mask.

To disable autoscaling, clear cluster_config.cluster_autoscaling_config, and explicitly set a serve_node count via the update_mask.

Examples:

Basic example

require "google/cloud/bigtable/admin/v2"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Bigtable::Admin::V2::BigtableInstanceAdmin::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Bigtable::Admin::V2::PartialUpdateClusterRequest.new

# Call the partial_update_cluster method.
result = client.partial_update_cluster request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

Overloads:

  • #partial_update_cluster(request, options = nil) ⇒ ::Gapic::Operation

    Pass arguments to partial_update_cluster via a request object, either of type PartialUpdateClusterRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::Bigtable::Admin::V2::PartialUpdateClusterRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #partial_update_cluster(cluster: nil, update_mask: nil) ⇒ ::Gapic::Operation

    Pass arguments to partial_update_cluster via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)

Returns:

  • (::Gapic::Operation)

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
# File 'lib/google/cloud/bigtable/admin/v2/bigtable_instance_admin/client.rb', line 1284

def partial_update_cluster request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigtable::Admin::V2::PartialUpdateClusterRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.partial_update_cluster..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Bigtable::Admin::V2::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.cluster&.name
    header_params["cluster.name"] = request.cluster.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.partial_update_cluster.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.partial_update_cluster.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @bigtable_instance_admin_stub.call_rpc :partial_update_cluster, request, options: options do |response, operation|
    response = ::Gapic::Operation.new response, @operations_client, options: options
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#partial_update_instance(request, options = nil) ⇒ ::Gapic::Operation #partial_update_instance(instance: nil, update_mask: nil) ⇒ ::Gapic::Operation

Partially updates an instance within a project. This method can modify all fields of an Instance and is the preferred way to update an Instance.

Examples:

Basic example

require "google/cloud/bigtable/admin/v2"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Bigtable::Admin::V2::BigtableInstanceAdmin::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Bigtable::Admin::V2::PartialUpdateInstanceRequest.new

# Call the partial_update_instance method.
result = client.partial_update_instance request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

Overloads:

  • #partial_update_instance(request, options = nil) ⇒ ::Gapic::Operation

    Pass arguments to partial_update_instance via a request object, either of type PartialUpdateInstanceRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::Bigtable::Admin::V2::PartialUpdateInstanceRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #partial_update_instance(instance: nil, update_mask: nil) ⇒ ::Gapic::Operation

    Pass arguments to partial_update_instance via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)

Returns:

  • (::Gapic::Operation)

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
# File 'lib/google/cloud/bigtable/admin/v2/bigtable_instance_admin/client.rb', line 694

def partial_update_instance request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigtable::Admin::V2::PartialUpdateInstanceRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.partial_update_instance..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Bigtable::Admin::V2::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.instance&.name
    header_params["instance.name"] = request.instance.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.partial_update_instance.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.partial_update_instance.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @bigtable_instance_admin_stub.call_rpc :partial_update_instance, request, options: options do |response, operation|
    response = ::Gapic::Operation.new response, @operations_client, options: options
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#set_iam_policy(request, options = nil) ⇒ ::Google::Iam::V1::Policy #set_iam_policy(resource: nil, policy: nil, update_mask: nil) ⇒ ::Google::Iam::V1::Policy

Sets the access control policy on an instance resource. Replaces any existing policy.

Examples:

Basic example

require "google/cloud/bigtable/admin/v2"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Bigtable::Admin::V2::BigtableInstanceAdmin::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Iam::V1::SetIamPolicyRequest.new

# Call the set_iam_policy method.
result = client.set_iam_policy request

# The returned object is of type Google::Iam::V1::Policy.
p result

Overloads:

  • #set_iam_policy(request, options = nil) ⇒ ::Google::Iam::V1::Policy

    Pass arguments to set_iam_policy via a request object, either of type Iam::V1::SetIamPolicyRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Iam::V1::SetIamPolicyRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #set_iam_policy(resource: nil, policy: nil, update_mask: nil) ⇒ ::Google::Iam::V1::Policy

    Pass arguments to set_iam_policy via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • resource (::String) (defaults to: nil)

      REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field.

    • policy (::Google::Iam::V1::Policy, ::Hash) (defaults to: nil)

      REQUIRED: The complete policy to be applied to the resource. The size of the policy is limited to a few 10s of KB. An empty policy is a valid policy but certain Cloud Platform services (such as Projects) might reject them.

    • update_mask (::Google::Protobuf::FieldMask, ::Hash) (defaults to: nil)

      OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only the fields in the mask will be modified. If no mask is provided, the following default mask is used:

      paths: "bindings, etag"

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
# File 'lib/google/cloud/bigtable/admin/v2/bigtable_instance_admin/client.rb', line 2033

def set_iam_policy request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::SetIamPolicyRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.set_iam_policy..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Bigtable::Admin::V2::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.resource
    header_params["resource"] = request.resource
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.set_iam_policy.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.set_iam_policy.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @bigtable_instance_admin_stub.call_rpc :set_iam_policy, request, options: options do |response, operation|
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#test_iam_permissions(request, options = nil) ⇒ ::Google::Iam::V1::TestIamPermissionsResponse #test_iam_permissions(resource: nil, permissions: nil) ⇒ ::Google::Iam::V1::TestIamPermissionsResponse

Returns permissions that the caller has on the specified instance resource.

Examples:

Basic example

require "google/cloud/bigtable/admin/v2"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Bigtable::Admin::V2::BigtableInstanceAdmin::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Iam::V1::TestIamPermissionsRequest.new

# Call the test_iam_permissions method.
result = client.test_iam_permissions request

# The returned object is of type Google::Iam::V1::TestIamPermissionsResponse.
p result

Overloads:

  • #test_iam_permissions(request, options = nil) ⇒ ::Google::Iam::V1::TestIamPermissionsResponse

    Pass arguments to test_iam_permissions via a request object, either of type Iam::V1::TestIamPermissionsRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Iam::V1::TestIamPermissionsRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #test_iam_permissions(resource: nil, permissions: nil) ⇒ ::Google::Iam::V1::TestIamPermissionsResponse

    Pass arguments to test_iam_permissions via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • resource (::String) (defaults to: nil)

      REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field.

    • permissions (::Array<::String>) (defaults to: nil)

      The set of permissions to check for the resource. Permissions with wildcards (such as '' or 'storage.') are not allowed. For more information see IAM Overview.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
# File 'lib/google/cloud/bigtable/admin/v2/bigtable_instance_admin/client.rb', line 2124

def test_iam_permissions request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::TestIamPermissionsRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.test_iam_permissions..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Bigtable::Admin::V2::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.resource
    header_params["resource"] = request.resource
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.test_iam_permissions.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.test_iam_permissions.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @bigtable_instance_admin_stub.call_rpc :test_iam_permissions, request, options: options do |response, operation|
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#update_app_profile(request, options = nil) ⇒ ::Gapic::Operation #update_app_profile(app_profile: nil, update_mask: nil, ignore_warnings: nil) ⇒ ::Gapic::Operation

Updates an app profile within an instance.

Examples:

Basic example

require "google/cloud/bigtable/admin/v2"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Bigtable::Admin::V2::BigtableInstanceAdmin::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Bigtable::Admin::V2::UpdateAppProfileRequest.new

# Call the update_app_profile method.
result = client.update_app_profile request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

Overloads:

  • #update_app_profile(request, options = nil) ⇒ ::Gapic::Operation

    Pass arguments to update_app_profile via a request object, either of type UpdateAppProfileRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::Bigtable::Admin::V2::UpdateAppProfileRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #update_app_profile(app_profile: nil, update_mask: nil, ignore_warnings: nil) ⇒ ::Gapic::Operation

    Pass arguments to update_app_profile via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • app_profile (::Google::Cloud::Bigtable::Admin::V2::AppProfile, ::Hash) (defaults to: nil)

      Required. The app profile which will (partially) replace the current value.

    • update_mask (::Google::Protobuf::FieldMask, ::Hash) (defaults to: nil)

      Required. The subset of app profile fields which should be replaced. If unset, all fields will be replaced.

    • ignore_warnings (::Boolean) (defaults to: nil)

      If true, ignore safety checks when updating the app profile.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)

Returns:

  • (::Gapic::Operation)

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
# File 'lib/google/cloud/bigtable/admin/v2/bigtable_instance_admin/client.rb', line 1755

def update_app_profile request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigtable::Admin::V2::UpdateAppProfileRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.update_app_profile..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Bigtable::Admin::V2::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.app_profile&.name
    header_params["app_profile.name"] = request.app_profile.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.update_app_profile.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.update_app_profile.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @bigtable_instance_admin_stub.call_rpc :update_app_profile, request, options: options do |response, operation|
    response = ::Gapic::Operation.new response, @operations_client, options: options
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#update_cluster(request, options = nil) ⇒ ::Gapic::Operation #update_cluster(name: nil, location: nil, serve_nodes: nil, cluster_config: nil, default_storage_type: nil, encryption_config: nil) ⇒ ::Gapic::Operation

Updates a cluster within an instance.

Note that UpdateCluster does not support updating cluster_config.cluster_autoscaling_config. In order to update it, you must use PartialUpdateCluster.

Examples:

Basic example

require "google/cloud/bigtable/admin/v2"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Bigtable::Admin::V2::BigtableInstanceAdmin::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Bigtable::Admin::V2::Cluster.new

# Call the update_cluster method.
result = client.update_cluster request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

Overloads:

  • #update_cluster(request, options = nil) ⇒ ::Gapic::Operation

    Pass arguments to update_cluster via a request object, either of type Cluster or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::Bigtable::Admin::V2::Cluster, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #update_cluster(name: nil, location: nil, serve_nodes: nil, cluster_config: nil, default_storage_type: nil, encryption_config: nil) ⇒ ::Gapic::Operation

    Pass arguments to update_cluster via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • name (::String) (defaults to: nil)

      The unique name of the cluster. Values are of the form projects/{project}/instances/{instance}/clusters/[a-z][-a-z0-9]*.

    • location (::String) (defaults to: nil)

      Immutable. The location where this cluster's nodes and storage reside. For best performance, clients should be located as close as possible to this cluster. Currently only zones are supported, so values should be of the form projects/{project}/locations/{zone}.

    • serve_nodes (::Integer) (defaults to: nil)

      The number of nodes allocated to this cluster. More nodes enable higher throughput and more consistent performance.

    • cluster_config (::Google::Cloud::Bigtable::Admin::V2::Cluster::ClusterConfig, ::Hash) (defaults to: nil)

      Configuration for this cluster.

    • default_storage_type (::Google::Cloud::Bigtable::Admin::V2::StorageType) (defaults to: nil)

      Immutable. The type of storage used by this cluster to serve its parent instance's tables, unless explicitly overridden.

    • encryption_config (::Google::Cloud::Bigtable::Admin::V2::Cluster::EncryptionConfig, ::Hash) (defaults to: nil)

      Immutable. The encryption configuration for CMEK-protected clusters.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)

Returns:

  • (::Gapic::Operation)

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
# File 'lib/google/cloud/bigtable/admin/v2/bigtable_instance_admin/client.rb', line 1177

def update_cluster request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigtable::Admin::V2::Cluster

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.update_cluster..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Bigtable::Admin::V2::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.update_cluster.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.update_cluster.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @bigtable_instance_admin_stub.call_rpc :update_cluster, request, options: options do |response, operation|
    response = ::Gapic::Operation.new response, @operations_client, options: options
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#update_instance(request, options = nil) ⇒ ::Google::Cloud::Bigtable::Admin::V2::Instance #update_instance(name: nil, display_name: nil, state: nil, type: nil, labels: nil) ⇒ ::Google::Cloud::Bigtable::Admin::V2::Instance

Updates an instance within a project. This method updates only the display name and type for an Instance. To update other Instance properties, such as labels, use PartialUpdateInstance.

Examples:

Basic example

require "google/cloud/bigtable/admin/v2"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Bigtable::Admin::V2::BigtableInstanceAdmin::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Bigtable::Admin::V2::Instance.new

# Call the update_instance method.
result = client.update_instance request

# The returned object is of type Google::Cloud::Bigtable::Admin::V2::Instance.
p result

Overloads:

  • #update_instance(request, options = nil) ⇒ ::Google::Cloud::Bigtable::Admin::V2::Instance

    Pass arguments to update_instance via a request object, either of type Instance or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::Bigtable::Admin::V2::Instance, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #update_instance(name: nil, display_name: nil, state: nil, type: nil, labels: nil) ⇒ ::Google::Cloud::Bigtable::Admin::V2::Instance

    Pass arguments to update_instance via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • name (::String) (defaults to: nil)

      The unique name of the instance. Values are of the form projects/{project}/instances/[a-z][a-z0-9\\-]+[a-z0-9].

    • display_name (::String) (defaults to: nil)

      Required. The descriptive name for this instance as it appears in UIs. Can be changed at any time, but should be kept globally unique to avoid confusion.

    • state (::Google::Cloud::Bigtable::Admin::V2::Instance::State) (defaults to: nil)

      (OutputOnly) The current state of the instance.

    • type (::Google::Cloud::Bigtable::Admin::V2::Instance::Type) (defaults to: nil)

      The type of the instance. Defaults to PRODUCTION.

    • labels (::Hash{::String => ::String}) (defaults to: nil)

      Labels are a flexible and lightweight mechanism for organizing cloud resources into groups that reflect a customer's organizational needs and deployment strategies. They can be used to filter resources and aggregate metrics.

      • Label keys must be between 1 and 63 characters long and must conform to the regular expression: [\p{Ll}\p{Lo}][\p{Ll}\p{Lo}\p{N}_-]{0,62}.
      • Label values must be between 0 and 63 characters long and must conform to the regular expression: [\p{Ll}\p{Lo}\p{N}_-]{0,63}.
      • No more than 64 labels can be associated with a given resource.
      • Keys and values must both be under 128 bytes.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
# File 'lib/google/cloud/bigtable/admin/v2/bigtable_instance_admin/client.rb', line 598

def update_instance request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigtable::Admin::V2::Instance

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.update_instance..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Bigtable::Admin::V2::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.update_instance.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.update_instance.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @bigtable_instance_admin_stub.call_rpc :update_instance, request, options: options do |response, operation|
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end