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

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.

Attributes

bigtable_instance_admin_stub[R]

@private

operations_client[R]

Get the associated client for long-running operations.

@return [::Google::Cloud::Bigtable::Admin::V2::BigtableInstanceAdmin::Operations]

Public Class Methods

configure() { |configure| ... } click to toggle source

Configure the BigtableInstanceAdmin Client class.

See {::Google::Cloud::Bigtable::Admin::V2::BigtableInstanceAdmin::Client::Configuration} for a description of the configuration fields.

@example

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

@yield [config] Configure the Client client. @yieldparam config [Client::Configuration]

@return [Client::Configuration]

# 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
  end
  yield @configure if block_given?
  @configure
end
new() { |config| ... } click to toggle source

Create a new BigtableInstanceAdmin client object.

@example

# 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

@yield [config] Configure the BigtableInstanceAdmin client. @yieldparam config [Client::Configuration]

# File lib/google/cloud/bigtable/admin/v2/bigtable_instance_admin/client.rb, line 186
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 == Client.configure.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.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
  )
end

Public Instance Methods

configure() { |config| ... } click to toggle source

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 {Client.configure}.

See {::Google::Cloud::Bigtable::Admin::V2::BigtableInstanceAdmin::Client::Configuration} for a description of the configuration fields.

@yield [config] Configure the Client client. @yieldparam config [Client::Configuration]

@return [Client::Configuration]

# File lib/google/cloud/bigtable/admin/v2/bigtable_instance_admin/client.rb, line 165
def configure
  yield @config if block_given?
  @config
end
create_app_profile(request, options = nil) { |response, operation| ... } click to toggle source

Creates an app profile within an instance.

@overload create_app_profile(request, options = nil)

Pass arguments to `create_app_profile` via a request object, either of type
{::Google::Cloud::Bigtable::Admin::V2::CreateAppProfileRequest} or an equivalent Hash.

@param 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.
@param options [::Gapic::CallOptions, ::Hash]
  Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

@overload create_app_profile(parent: nil, app_profile_id: nil, app_profile: nil, ignore_warnings: nil)

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).

@param parent [::String]
  Required. The unique name of the instance in which to create the new app profile.
  Values are of the form
  `projects/{project}/instances/{instance}`.
@param app_profile_id [::String]
  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`.
@param app_profile [::Google::Cloud::Bigtable::Admin::V2::AppProfile, ::Hash]
  Required. The app profile to be created.
  Fields marked `OutputOnly` will be ignored.
@param ignore_warnings [::Boolean]
  If true, ignore safety checks when creating the app profile.

@yield [response, operation] Access the result along with the RPC operation @yieldparam response [::Google::Cloud::Bigtable::Admin::V2::AppProfile] @yieldparam operation [::GRPC::ActiveCall::Operation]

@return [::Google::Cloud::Bigtable::Admin::V2::AppProfile]

@raise [::Google::Cloud::Error] if the RPC is aborted.

# File lib/google/cloud/bigtable/admin/v2/bigtable_instance_admin/client.rb, line 1101
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
  metadata = @config.rpcs.create_app_profile.metadata.to_h

  # Set x-goog-api-client and x-goog-user-project headers
  metadata[:"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
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

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

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

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.metadata,
                         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) { |response, operation| ... } click to toggle source

Creates a cluster within an instance.

@overload create_cluster(request, options = nil)

Pass arguments to `create_cluster` via a request object, either of type
{::Google::Cloud::Bigtable::Admin::V2::CreateClusterRequest} or an equivalent Hash.

@param 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.
@param options [::Gapic::CallOptions, ::Hash]
  Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

@overload create_cluster(parent: nil, cluster_id: nil, cluster: nil)

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).

@param parent [::String]
  Required. The unique name of the instance in which to create the new cluster.
  Values are of the form
  `projects/{project}/instances/{instance}`.
@param cluster_id [::String]
  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`.
@param cluster [::Google::Cloud::Bigtable::Admin::V2::Cluster, ::Hash]
  Required. The cluster to be created.
  Fields marked `OutputOnly` must be left blank.

@yield [response, operation] Access the result along with the RPC operation @yieldparam response [::Gapic::Operation] @yieldparam operation [::GRPC::ActiveCall::Operation]

@return [::Gapic::Operation]

@raise [::Google::Cloud::Error] if the RPC is aborted.

# File lib/google/cloud/bigtable/admin/v2/bigtable_instance_admin/client.rb, line 728
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
  metadata = @config.rpcs.create_cluster.metadata.to_h

  # Set x-goog-api-client and x-goog-user-project headers
  metadata[:"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
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

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

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

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.metadata,
                         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) { |response, operation| ... } click to toggle source

Create an instance within a project.

@overload create_instance(request, options = nil)

Pass arguments to `create_instance` via a request object, either of type
{::Google::Cloud::Bigtable::Admin::V2::CreateInstanceRequest} or an equivalent Hash.

@param 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.
@param options [::Gapic::CallOptions, ::Hash]
  Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

@overload create_instance(parent: nil, instance_id: nil, instance: nil, clusters: nil)

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).

@param parent [::String]
  Required. The unique name of the project in which to create the new instance.
  Values are of the form `projects/{project}`.
@param instance_id [::String]
  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`.
@param instance [::Google::Cloud::Bigtable::Admin::V2::Instance, ::Hash]
  Required. The instance to create.
  Fields marked `OutputOnly` must be left blank.
@param clusters [::Hash{::String => ::Google::Cloud::Bigtable::Admin::V2::Cluster, ::Hash}]
  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.

@yield [response, operation] Access the result along with the RPC operation @yieldparam response [::Gapic::Operation] @yieldparam operation [::GRPC::ActiveCall::Operation]

@return [::Gapic::Operation]

@raise [::Google::Cloud::Error] if the RPC is aborted.

# File lib/google/cloud/bigtable/admin/v2/bigtable_instance_admin/client.rb, line 279
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
  metadata = @config.rpcs.create_instance.metadata.to_h

  # Set x-goog-api-client and x-goog-user-project headers
  metadata[:"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
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

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

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

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.metadata,
                         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) { |response, operation| ... } click to toggle source

Deletes an app profile from an instance.

@overload delete_app_profile(request, options = nil)

Pass arguments to `delete_app_profile` via a request object, either of type
{::Google::Cloud::Bigtable::Admin::V2::DeleteAppProfileRequest} or an equivalent Hash.

@param 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.
@param options [::Gapic::CallOptions, ::Hash]
  Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

@overload delete_app_profile(name: nil, ignore_warnings: nil)

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).

@param name [::String]
  Required. The unique name of the app profile to be deleted. Values are of the form
  `projects/{project}/instances/{instance}/appProfiles/{app_profile}`.
@param ignore_warnings [::Boolean]
  Required. If true, ignore safety checks when deleting the app profile.

@yield [response, operation] Access the result along with the RPC operation @yieldparam response [::Google::Protobuf::Empty] @yieldparam operation [::GRPC::ActiveCall::Operation]

@return [::Google::Protobuf::Empty]

@raise [::Google::Cloud::Error] if the RPC is aborted.

# File lib/google/cloud/bigtable/admin/v2/bigtable_instance_admin/client.rb, line 1400
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
  metadata = @config.rpcs.delete_app_profile.metadata.to_h

  # Set x-goog-api-client and x-goog-user-project headers
  metadata[:"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
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

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

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

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.metadata,
                         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) { |response, operation| ... } click to toggle source

Deletes a cluster from an instance.

@overload delete_cluster(request, options = nil)

Pass arguments to `delete_cluster` via a request object, either of type
{::Google::Cloud::Bigtable::Admin::V2::DeleteClusterRequest} or an equivalent Hash.

@param 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.
@param options [::Gapic::CallOptions, ::Hash]
  Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

@overload delete_cluster(name: nil)

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).

@param name [::String]
  Required. The unique name of the cluster to be deleted. Values are of the form
  `projects/{project}/instances/{instance}/clusters/{cluster}`.

@yield [response, operation] Access the result along with the RPC operation @yieldparam response [::Google::Protobuf::Empty] @yieldparam operation [::GRPC::ActiveCall::Operation]

@return [::Google::Protobuf::Empty]

@raise [::Google::Cloud::Error] if the RPC is aborted.

# File lib/google/cloud/bigtable/admin/v2/bigtable_instance_admin/client.rb, line 1022
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
  metadata = @config.rpcs.delete_cluster.metadata.to_h

  # Set x-goog-api-client and x-goog-user-project headers
  metadata[:"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
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

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

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

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.metadata,
                         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) { |response, operation| ... } click to toggle source

Delete an instance from a project.

@overload delete_instance(request, options = nil)

Pass arguments to `delete_instance` via a request object, either of type
{::Google::Cloud::Bigtable::Admin::V2::DeleteInstanceRequest} or an equivalent Hash.

@param 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.
@param options [::Gapic::CallOptions, ::Hash]
  Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

@overload delete_instance(name: nil)

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).

@param name [::String]
  Required. The unique name of the instance to be deleted.
  Values are of the form `projects/{project}/instances/{instance}`.

@yield [response, operation] Access the result along with the RPC operation @yieldparam response [::Google::Protobuf::Empty] @yieldparam operation [::GRPC::ActiveCall::Operation]

@return [::Google::Protobuf::Empty]

@raise [::Google::Cloud::Error] if the RPC is aborted.

# File lib/google/cloud/bigtable/admin/v2/bigtable_instance_admin/client.rb, line 651
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
  metadata = @config.rpcs.delete_instance.metadata.to_h

  # Set x-goog-api-client and x-goog-user-project headers
  metadata[:"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
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

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

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

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.metadata,
                         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) { |response, operation| ... } click to toggle source

Gets information about an app profile.

@overload get_app_profile(request, options = nil)

Pass arguments to `get_app_profile` via a request object, either of type
{::Google::Cloud::Bigtable::Admin::V2::GetAppProfileRequest} or an equivalent Hash.

@param 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.
@param options [::Gapic::CallOptions, ::Hash]
  Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

@overload get_app_profile(name: nil)

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).

@param name [::String]
  Required. The unique name of the requested app profile. Values are of the form
  `projects/{project}/instances/{instance}/appProfiles/{app_profile}`.

@yield [response, operation] Access the result along with the RPC operation @yieldparam response [::Google::Cloud::Bigtable::Admin::V2::AppProfile] @yieldparam operation [::GRPC::ActiveCall::Operation]

@return [::Google::Cloud::Bigtable::Admin::V2::AppProfile]

@raise [::Google::Cloud::Error] if the RPC is aborted.

# File lib/google/cloud/bigtable/admin/v2/bigtable_instance_admin/client.rb, line 1170
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
  metadata = @config.rpcs.get_app_profile.metadata.to_h

  # Set x-goog-api-client and x-goog-user-project headers
  metadata[:"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
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

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

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

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.metadata,
                         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) { |response, operation| ... } click to toggle source

Gets information about a cluster.

@overload get_cluster(request, options = nil)

Pass arguments to `get_cluster` via a request object, either of type
{::Google::Cloud::Bigtable::Admin::V2::GetClusterRequest} or an equivalent Hash.

@param 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.
@param options [::Gapic::CallOptions, ::Hash]
  Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

@overload get_cluster(name: nil)

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).

@param name [::String]
  Required. The unique name of the requested cluster. Values are of the form
  `projects/{project}/instances/{instance}/clusters/{cluster}`.

@yield [response, operation] Access the result along with the RPC operation @yieldparam response [::Google::Cloud::Bigtable::Admin::V2::Cluster] @yieldparam operation [::GRPC::ActiveCall::Operation]

@return [::Google::Cloud::Bigtable::Admin::V2::Cluster]

@raise [::Google::Cloud::Error] if the RPC is aborted.

# File lib/google/cloud/bigtable/admin/v2/bigtable_instance_admin/client.rb, line 798
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
  metadata = @config.rpcs.get_cluster.metadata.to_h

  # Set x-goog-api-client and x-goog-user-project headers
  metadata[:"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
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

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

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

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.metadata,
                         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) { |response, operation| ... } click to toggle source

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

@overload get_iam_policy(request, options = nil)

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

@param 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.
@param options [::Gapic::CallOptions, ::Hash]
  Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

@overload get_iam_policy(resource: nil, options: nil)

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).

@param resource [::String]
  REQUIRED: The resource for which the policy is being requested.
  See the operation documentation for the appropriate value for this field.
@param options [::Google::Iam::V1::GetPolicyOptions, ::Hash]
  OPTIONAL: A `GetPolicyOptions` object for specifying options to
  `GetIamPolicy`. This field is only used by Cloud IAM.

@yield [response, operation] Access the result along with the RPC operation @yieldparam response [::Google::Iam::V1::Policy] @yieldparam operation [::GRPC::ActiveCall::Operation]

@return [::Google::Iam::V1::Policy]

@raise [::Google::Cloud::Error] if the RPC is aborted.

# File lib/google/cloud/bigtable/admin/v2/bigtable_instance_admin/client.rb, line 1473
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
  metadata = @config.rpcs.get_iam_policy.metadata.to_h

  # Set x-goog-api-client and x-goog-user-project headers
  metadata[:"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
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

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

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

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.metadata,
                         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) { |response, operation| ... } click to toggle source

Gets information about an instance.

@overload get_instance(request, options = nil)

Pass arguments to `get_instance` via a request object, either of type
{::Google::Cloud::Bigtable::Admin::V2::GetInstanceRequest} or an equivalent Hash.

@param 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.
@param options [::Gapic::CallOptions, ::Hash]
  Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

@overload get_instance(name: nil)

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).

@param name [::String]
  Required. The unique name of the requested instance. Values are of the form
  `projects/{project}/instances/{instance}`.

@yield [response, operation] Access the result along with the RPC operation @yieldparam response [::Google::Cloud::Bigtable::Admin::V2::Instance] @yieldparam operation [::GRPC::ActiveCall::Operation]

@return [::Google::Cloud::Bigtable::Admin::V2::Instance]

@raise [::Google::Cloud::Error] if the RPC is aborted.

# File lib/google/cloud/bigtable/admin/v2/bigtable_instance_admin/client.rb, line 349
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
  metadata = @config.rpcs.get_instance.metadata.to_h

  # Set x-goog-api-client and x-goog-user-project headers
  metadata[:"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
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

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

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

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.metadata,
                         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) { |response, operation| ... } click to toggle source

Lists information about app profiles in an instance.

@overload list_app_profiles(request, options = nil)

Pass arguments to `list_app_profiles` via a request object, either of type
{::Google::Cloud::Bigtable::Admin::V2::ListAppProfilesRequest} or an equivalent Hash.

@param 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.
@param options [::Gapic::CallOptions, ::Hash]
  Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

@overload list_app_profiles(parent: nil, page_size: nil, page_token: nil)

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).

@param parent [::String]
  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/-`.
@param page_size [::Integer]
  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.
@param page_token [::String]
  The value of `next_page_token` returned by a previous call.

@yield [response, operation] Access the result along with the RPC operation @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Bigtable::Admin::V2::AppProfile>] @yieldparam operation [::GRPC::ActiveCall::Operation]

@return [::Gapic::PagedEnumerable<::Google::Cloud::Bigtable::Admin::V2::AppProfile>]

@raise [::Google::Cloud::Error] if the RPC is aborted.

# File lib/google/cloud/bigtable/admin/v2/bigtable_instance_admin/client.rb, line 1254
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
  metadata = @config.rpcs.list_app_profiles.metadata.to_h

  # Set x-goog-api-client and x-goog-user-project headers
  metadata[:"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
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

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

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

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.metadata,
                         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) { |response, operation| ... } click to toggle source

Lists information about clusters in an instance.

@overload list_clusters(request, options = nil)

Pass arguments to `list_clusters` via a request object, either of type
{::Google::Cloud::Bigtable::Admin::V2::ListClustersRequest} or an equivalent Hash.

@param 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.
@param options [::Gapic::CallOptions, ::Hash]
  Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

@overload list_clusters(parent: nil, page_token: nil)

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).

@param parent [::String]
  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/-`.
@param page_token [::String]
  DEPRECATED: This field is unused and ignored.

@yield [response, operation] Access the result along with the RPC operation @yieldparam response [::Google::Cloud::Bigtable::Admin::V2::ListClustersResponse] @yieldparam operation [::GRPC::ActiveCall::Operation]

@return [::Google::Cloud::Bigtable::Admin::V2::ListClustersResponse]

@raise [::Google::Cloud::Error] if the RPC is aborted.

# File lib/google/cloud/bigtable/admin/v2/bigtable_instance_admin/client.rb, line 871
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
  metadata = @config.rpcs.list_clusters.metadata.to_h

  # Set x-goog-api-client and x-goog-user-project headers
  metadata[:"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
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

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

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

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.metadata,
                         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_instances(request, options = nil) { |response, operation| ... } click to toggle source

Lists information about instances in a project.

@overload list_instances(request, options = nil)

Pass arguments to `list_instances` via a request object, either of type
{::Google::Cloud::Bigtable::Admin::V2::ListInstancesRequest} or an equivalent Hash.

@param 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.
@param options [::Gapic::CallOptions, ::Hash]
  Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

@overload list_instances(parent: nil, page_token: nil)

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).

@param parent [::String]
  Required. The unique name of the project for which a list of instances is requested.
  Values are of the form `projects/{project}`.
@param page_token [::String]
  DEPRECATED: This field is unused and ignored.

@yield [response, operation] Access the result along with the RPC operation @yieldparam response [::Google::Cloud::Bigtable::Admin::V2::ListInstancesResponse] @yieldparam operation [::GRPC::ActiveCall::Operation]

@return [::Google::Cloud::Bigtable::Admin::V2::ListInstancesResponse]

@raise [::Google::Cloud::Error] if the RPC is aborted.

# File lib/google/cloud/bigtable/admin/v2/bigtable_instance_admin/client.rb, line 420
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
  metadata = @config.rpcs.list_instances.metadata.to_h

  # Set x-goog-api-client and x-goog-user-project headers
  metadata[:"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
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

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

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

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.metadata,
                         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_instance(request, options = nil) { |response, operation| ... } click to toggle source

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.

@overload partial_update_instance(request, options = nil)

Pass arguments to `partial_update_instance` via a request object, either of type
{::Google::Cloud::Bigtable::Admin::V2::PartialUpdateInstanceRequest} or an equivalent Hash.

@param 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.
@param options [::Gapic::CallOptions, ::Hash]
  Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

@overload partial_update_instance(instance: nil, update_mask: nil)

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).

@param instance [::Google::Cloud::Bigtable::Admin::V2::Instance, ::Hash]
  Required. The Instance which will (partially) replace the current value.
@param update_mask [::Google::Protobuf::FieldMask, ::Hash]
  Required. The subset of Instance fields which should be replaced.
  Must be explicitly set.

@yield [response, operation] Access the result along with the RPC operation @yieldparam response [::Gapic::Operation] @yieldparam operation [::GRPC::ActiveCall::Operation]

@return [::Gapic::Operation]

@raise [::Google::Cloud::Error] if the RPC is aborted.

# File lib/google/cloud/bigtable/admin/v2/bigtable_instance_admin/client.rb, line 581
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
  metadata = @config.rpcs.partial_update_instance.metadata.to_h

  # Set x-goog-api-client and x-goog-user-project headers
  metadata[:"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
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

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

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

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.metadata,
                         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) { |response, operation| ... } click to toggle source

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

@overload set_iam_policy(request, options = nil)

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

@param 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.
@param options [::Gapic::CallOptions, ::Hash]
  Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

@overload set_iam_policy(resource: nil, policy: nil)

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).

@param resource [::String]
  REQUIRED: The resource for which the policy is being specified.
  See the operation documentation for the appropriate value for this field.
@param policy [::Google::Iam::V1::Policy, ::Hash]
  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.

@yield [response, operation] Access the result along with the RPC operation @yieldparam response [::Google::Iam::V1::Policy] @yieldparam operation [::GRPC::ActiveCall::Operation]

@return [::Google::Iam::V1::Policy]

@raise [::Google::Cloud::Error] if the RPC is aborted.

# File lib/google/cloud/bigtable/admin/v2/bigtable_instance_admin/client.rb, line 1548
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
  metadata = @config.rpcs.set_iam_policy.metadata.to_h

  # Set x-goog-api-client and x-goog-user-project headers
  metadata[:"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
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

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

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

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.metadata,
                         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) { |response, operation| ... } click to toggle source

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

@overload test_iam_permissions(request, options = nil)

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

@param 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.
@param options [::Gapic::CallOptions, ::Hash]
  Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

@overload test_iam_permissions(resource: nil, permissions: nil)

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).

@param resource [::String]
  REQUIRED: The resource for which the policy detail is being requested.
  See the operation documentation for the appropriate value for this field.
@param permissions [::Array<::String>]
  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](https://cloud.google.com/iam/docs/overview#permissions).

@yield [response, operation] Access the result along with the RPC operation @yieldparam response [::Google::Iam::V1::TestIamPermissionsResponse] @yieldparam operation [::GRPC::ActiveCall::Operation]

@return [::Google::Iam::V1::TestIamPermissionsResponse]

@raise [::Google::Cloud::Error] if the RPC is aborted.

# File lib/google/cloud/bigtable/admin/v2/bigtable_instance_admin/client.rb, line 1622
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
  metadata = @config.rpcs.test_iam_permissions.metadata.to_h

  # Set x-goog-api-client and x-goog-user-project headers
  metadata[:"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
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

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

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

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.metadata,
                         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) { |response, operation| ... } click to toggle source

Updates an app profile within an instance.

@overload update_app_profile(request, options = nil)

Pass arguments to `update_app_profile` via a request object, either of type
{::Google::Cloud::Bigtable::Admin::V2::UpdateAppProfileRequest} or an equivalent Hash.

@param 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.
@param options [::Gapic::CallOptions, ::Hash]
  Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

@overload update_app_profile(app_profile: nil, update_mask: nil, ignore_warnings: nil)

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).

@param app_profile [::Google::Cloud::Bigtable::Admin::V2::AppProfile, ::Hash]
  Required. The app profile which will (partially) replace the current value.
@param update_mask [::Google::Protobuf::FieldMask, ::Hash]
  Required. The subset of app profile fields which should be replaced.
  If unset, all fields will be replaced.
@param ignore_warnings [::Boolean]
  If true, ignore safety checks when updating the app profile.

@yield [response, operation] Access the result along with the RPC operation @yieldparam response [::Gapic::Operation] @yieldparam operation [::GRPC::ActiveCall::Operation]

@return [::Gapic::Operation]

@raise [::Google::Cloud::Error] if the RPC is aborted.

# File lib/google/cloud/bigtable/admin/v2/bigtable_instance_admin/client.rb, line 1328
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
  metadata = @config.rpcs.update_app_profile.metadata.to_h

  # Set x-goog-api-client and x-goog-user-project headers
  metadata[:"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
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

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

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

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.metadata,
                         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) { |response, operation| ... } click to toggle source

Updates a cluster within an instance.

@overload update_cluster(request, options = nil)

Pass arguments to `update_cluster` via a request object, either of type
{::Google::Cloud::Bigtable::Admin::V2::Cluster} or an equivalent Hash.

@param 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.
@param options [::Gapic::CallOptions, ::Hash]
  Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

@overload update_cluster(location: nil, serve_nodes: nil, default_storage_type: nil, encryption_config: nil)

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).

@param location [::String]
  (`CreationOnly`)
  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}`.
@param serve_nodes [::Integer]
  Required. The number of nodes allocated to this cluster. More nodes enable
  higher throughput and more consistent performance.
@param default_storage_type [::Google::Cloud::Bigtable::Admin::V2::StorageType]
  (`CreationOnly`)
  The type of storage used by this cluster to serve its
  parent instance's tables, unless explicitly overridden.
@param encryption_config [::Google::Cloud::Bigtable::Admin::V2::Cluster::EncryptionConfig, ::Hash]
  Immutable. The encryption configuration for CMEK-protected clusters.

@yield [response, operation] Access the result along with the RPC operation @yieldparam response [::Gapic::Operation] @yieldparam operation [::GRPC::ActiveCall::Operation]

@return [::Gapic::Operation]

@raise [::Google::Cloud::Error] if the RPC is aborted.

# File lib/google/cloud/bigtable/admin/v2/bigtable_instance_admin/client.rb, line 952
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
  metadata = @config.rpcs.update_cluster.metadata.to_h

  # Set x-goog-api-client and x-goog-user-project headers
  metadata[:"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
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

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

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

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.metadata,
                         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) { |response, operation| ... } click to toggle source

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.

@overload update_instance(request, options = nil)

Pass arguments to `update_instance` via a request object, either of type
{::Google::Cloud::Bigtable::Admin::V2::Instance} or an equivalent Hash.

@param 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.
@param options [::Gapic::CallOptions, ::Hash]
  Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

@overload update_instance(display_name: nil, state: nil, type: nil, labels: nil)

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).

@param display_name [::String]
  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.
@param state [::Google::Cloud::Bigtable::Admin::V2::Instance::State]
  (`OutputOnly`)
  The current state of the instance.
@param type [::Google::Cloud::Bigtable::Admin::V2::Instance::Type]
  The type of the instance. Defaults to `PRODUCTION`.
@param labels [::Hash{::String => ::String}]
  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.

@yield [response, operation] Access the result along with the RPC operation @yieldparam response [::Google::Cloud::Bigtable::Admin::V2::Instance] @yieldparam operation [::GRPC::ActiveCall::Operation]

@return [::Google::Cloud::Bigtable::Admin::V2::Instance]

@raise [::Google::Cloud::Error] if the RPC is aborted.

# File lib/google/cloud/bigtable/admin/v2/bigtable_instance_admin/client.rb, line 509
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
  metadata = @config.rpcs.update_instance.metadata.to_h

  # Set x-goog-api-client and x-goog-user-project headers
  metadata[:"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
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

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

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

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.metadata,
                         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