Class: Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client
- Inherits:
-
Object
- Object
- Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client
- Includes:
- Paths
- Defined in:
- lib/google/cloud/spanner/admin/instance/v1/instance_admin/client.rb
Overview
Client for the InstanceAdmin service.
Cloud Spanner Instance Admin API
The Cloud Spanner Instance Admin API can be used to create, delete, modify and list instances. Instances are dedicated Cloud Spanner serving and storage resources to be used by Cloud Spanner databases.
Each instance has a "configuration", which dictates where the serving resources for the Cloud Spanner instance are located (e.g., US-central, Europe). Configurations are created by Google based on resource availability.
Cloud Spanner billing is based on the instances that exist and their sizes. After an instance exists, there are no additional per-database or per-operation charges for use of the instance (though there may be additional network bandwidth charges). Instances offer isolation: problems with databases in one instance will not affect other instances. However, within an instance databases can affect each other. For example, if one database in an instance receives a lot of requests and consumes most of the instance resources, fewer resources are available for other databases in that instance, and their performance may suffer.
Defined Under Namespace
Classes: Configuration
Instance Attribute Summary collapse
-
#operations_client ⇒ ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Operations
readonly
Get the associated client for long-running operations.
Class Method Summary collapse
-
.configure {|config| ... } ⇒ Client::Configuration
Configure the InstanceAdmin Client class.
Instance Method Summary collapse
-
#configure {|config| ... } ⇒ Client::Configuration
Configure the InstanceAdmin Client instance.
-
#create_instance(request, options = nil) {|response, operation| ... } ⇒ ::Gapic::Operation
Creates an instance and begins preparing it to begin serving.
-
#create_instance_config(request, options = nil) {|response, operation| ... } ⇒ ::Gapic::Operation
Creates an instance configuration and begins preparing it to be used.
-
#create_instance_partition(request, options = nil) {|response, operation| ... } ⇒ ::Gapic::Operation
Creates an instance partition and begins preparing it to be used.
-
#delete_instance(request, options = nil) {|response, operation| ... } ⇒ ::Google::Protobuf::Empty
Deletes an instance.
-
#delete_instance_config(request, options = nil) {|response, operation| ... } ⇒ ::Google::Protobuf::Empty
Deletes the instance configuration.
-
#delete_instance_partition(request, options = nil) {|response, operation| ... } ⇒ ::Google::Protobuf::Empty
Deletes an existing instance partition.
-
#get_iam_policy(request, options = nil) {|response, operation| ... } ⇒ ::Google::Iam::V1::Policy
Gets the access control policy for an instance resource.
-
#get_instance(request, options = nil) {|response, operation| ... } ⇒ ::Google::Cloud::Spanner::Admin::Instance::V1::Instance
Gets information about a particular instance.
-
#get_instance_config(request, options = nil) {|response, operation| ... } ⇒ ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig
Gets information about a particular instance configuration.
-
#get_instance_partition(request, options = nil) {|response, operation| ... } ⇒ ::Google::Cloud::Spanner::Admin::Instance::V1::InstancePartition
Gets information about a particular instance partition.
-
#initialize {|config| ... } ⇒ Client
constructor
Create a new InstanceAdmin client object.
-
#list_instance_config_operations(request, options = nil) {|response, operation| ... } ⇒ ::Gapic::PagedEnumerable<::Gapic::Operation>
Lists the user-managed instance configuration [long-running operations][google.longrunning.Operation] in the given project.
-
#list_instance_configs(request, options = nil) {|response, operation| ... } ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig>
Lists the supported instance configurations for a given project.
-
#list_instance_partition_operations(request, options = nil) {|response, operation| ... } ⇒ ::Gapic::PagedEnumerable<::Gapic::Operation>
Lists instance partition [long-running operations][google.longrunning.Operation] in the given instance.
-
#list_instance_partitions(request, options = nil) {|response, operation| ... } ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Spanner::Admin::Instance::V1::InstancePartition>
Lists all instance partitions for the given instance.
-
#list_instances(request, options = nil) {|response, operation| ... } ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Spanner::Admin::Instance::V1::Instance>
Lists all instances in the given project.
-
#logger ⇒ Logger
The logger used for request/response debug logging.
-
#move_instance(request, options = nil) {|response, operation| ... } ⇒ ::Gapic::Operation
Moves an instance to the target instance configuration.
-
#set_iam_policy(request, options = nil) {|response, operation| ... } ⇒ ::Google::Iam::V1::Policy
Sets the access control policy on an instance resource.
-
#test_iam_permissions(request, options = nil) {|response, operation| ... } ⇒ ::Google::Iam::V1::TestIamPermissionsResponse
Returns permissions that the caller has on the specified instance resource.
-
#universe_domain ⇒ String
The effective universe domain.
-
#update_instance(request, options = nil) {|response, operation| ... } ⇒ ::Gapic::Operation
Updates an instance, and begins allocating or releasing resources as requested.
-
#update_instance_config(request, options = nil) {|response, operation| ... } ⇒ ::Gapic::Operation
Updates an instance configuration.
-
#update_instance_partition(request, options = nil) {|response, operation| ... } ⇒ ::Gapic::Operation
Updates an instance partition, and begins allocating or releasing resources as requested.
Methods included from Paths
#instance_config_path, #instance_partition_path, #instance_path, #project_path
Constructor Details
#initialize {|config| ... } ⇒ Client
Create a new InstanceAdmin client object.
184 185 186 187 188 189 190 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 233 234 235 236 237 238 239 240 |
# File 'lib/google/cloud/spanner/admin/instance/v1/instance_admin/client.rb', line 184 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/spanner/admin/instance/v1/spanner_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.nil? || (@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 config.universe_domain = @config.universe_domain end @instance_admin_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Stub, credentials: credentials, endpoint: @config.endpoint, endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, universe_domain: @config.universe_domain, channel_args: @config.channel_args, interceptors: @config.interceptors, channel_pool_config: @config.channel_pool, logger: @config.logger ) @instance_admin_stub.stub_logger&.info do |entry| entry.set_system_name entry.set_service entry. = "Created client for #{entry.service}" entry.set_credentials_fields credentials entry.set "customEndpoint", @config.endpoint if @config.endpoint entry.set "defaultTimeout", @config.timeout if @config.timeout entry.set "quotaProject", @quota_project_id if @quota_project_id end end |
Instance Attribute Details
#operations_client ⇒ ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Operations (readonly)
Get the associated client for long-running operations.
247 248 249 |
# File 'lib/google/cloud/spanner/admin/instance/v1/instance_admin/client.rb', line 247 def operations_client @operations_client end |
Class Method Details
.configure {|config| ... } ⇒ Client::Configuration
Configure the InstanceAdmin Client class.
See Configuration for a description of the configuration fields.
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 |
# File 'lib/google/cloud/spanner/admin/instance/v1/instance_admin/client.rb', line 84 def self.configure @configure ||= begin namespace = ["Google", "Cloud", "Spanner", "Admin", "Instance", "V1"] 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.list_instance_configs.timeout = 3600.0 default_config.rpcs.list_instance_configs.retry_policy = { initial_delay: 1.0, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 4] } default_config.rpcs.get_instance_config.timeout = 3600.0 default_config.rpcs.get_instance_config.retry_policy = { initial_delay: 1.0, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 4] } default_config.rpcs.list_instances.timeout = 3600.0 default_config.rpcs.list_instances.retry_policy = { initial_delay: 1.0, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 4] } default_config.rpcs.get_instance.timeout = 3600.0 default_config.rpcs.get_instance.retry_policy = { initial_delay: 1.0, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 4] } default_config.rpcs.create_instance.timeout = 3600.0 default_config.rpcs.update_instance.timeout = 3600.0 default_config.rpcs.delete_instance.timeout = 3600.0 default_config.rpcs.delete_instance.retry_policy = { initial_delay: 1.0, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 4] } default_config.rpcs.set_iam_policy.timeout = 30.0 default_config.rpcs.get_iam_policy.timeout = 30.0 default_config.rpcs.get_iam_policy.retry_policy = { initial_delay: 1.0, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 4] } default_config.rpcs..timeout = 30.0 default_config end yield @configure if block_given? @configure end |
Instance Method Details
#configure {|config| ... } ⇒ Client::Configuration
Configure the InstanceAdmin 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.
154 155 156 157 |
# File 'lib/google/cloud/spanner/admin/instance/v1/instance_admin/client.rb', line 154 def configure yield @config if block_given? @config end |
#create_instance(request, options = nil) ⇒ ::Gapic::Operation #create_instance(parent: nil, instance_id: nil, instance: nil) ⇒ ::Gapic::Operation
Creates an instance and begins preparing it to begin serving. The
returned long-running operation
can be used to track the progress of preparing the new
instance. The instance name is assigned by the caller. If the
named instance already exists, CreateInstance
returns
ALREADY_EXISTS
.
Immediately upon completion of this request:
- The instance is readable via the API, with all requested attributes
but no allocated resources. Its state is
CREATING
.
Until completion of the returned operation:
- Cancelling the operation renders the instance immediately unreadable via the API.
- The instance can be deleted.
- All other attempts to modify the instance are rejected.
Upon completion of the returned operation:
- Billing for all successfully-allocated resources begins (some types may have lower than the requested levels).
- Databases can be created in the instance.
- The instance's allocated resource levels are readable via the API.
- The instance's state becomes
READY
.
The returned long-running operation will
have a name of the format <instance_name>/operations/<operation_id>
and
can be used to track creation of the instance. The
metadata field type is
CreateInstanceMetadata.
The response field type is
Instance, if successful.
1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 |
# File 'lib/google/cloud/spanner/admin/instance/v1/instance_admin/client.rb', line 1427 def create_instance request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.create_instance..to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version 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::Spanner::Admin::Instance::V1::VERSION [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"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 .apply_defaults timeout: @config.rpcs.create_instance.timeout, metadata: , retry_policy: @config.rpcs.create_instance.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @instance_admin_stub.call_rpc :create_instance, request, options: do |response, operation| response = ::Gapic::Operation.new response, @operations_client, options: yield response, operation if block_given? throw :response, response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#create_instance_config(request, options = nil) ⇒ ::Gapic::Operation #create_instance_config(parent: nil, instance_config_id: nil, instance_config: nil, validate_only: nil) ⇒ ::Gapic::Operation
Creates an instance configuration and begins preparing it to be used. The
returned long-running operation
can be used to track the progress of preparing the new
instance configuration. The instance configuration name is assigned by the
caller. If the named instance configuration already exists,
CreateInstanceConfig
returns ALREADY_EXISTS
.
Immediately after the request returns:
- The instance configuration is readable via the API, with all requested
attributes. The instance configuration's
reconciling
field is set to true. Its state is
CREATING
.
While the operation is pending:
- Cancelling the operation renders the instance configuration immediately unreadable via the API.
- Except for deleting the creating resource, all other attempts to modify the instance configuration are rejected.
Upon completion of the returned operation:
- Instances can be created using the instance configuration.
- The instance configuration's
reconciling
field becomes false. Its state becomes
READY
.
The returned long-running operation will
have a name of the format
<instance_config_name>/operations/<operation_id>
and can be used to track
creation of the instance configuration. The
metadata field type is
CreateInstanceConfigMetadata.
The response field type is
InstanceConfig, if
successful.
Authorization requires spanner.instanceConfigs.create
permission on
the resource
parent.
553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 |
# File 'lib/google/cloud/spanner/admin/instance/v1/instance_admin/client.rb', line 553 def create_instance_config request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceConfigRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.create_instance_config..to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version 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::Spanner::Admin::Instance::V1::VERSION [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"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 .apply_defaults timeout: @config.rpcs.create_instance_config.timeout, metadata: , retry_policy: @config.rpcs.create_instance_config.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @instance_admin_stub.call_rpc :create_instance_config, request, options: do |response, operation| response = ::Gapic::Operation.new response, @operations_client, options: yield response, operation if block_given? throw :response, response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#create_instance_partition(request, options = nil) ⇒ ::Gapic::Operation #create_instance_partition(parent: nil, instance_partition_id: nil, instance_partition: nil) ⇒ ::Gapic::Operation
Creates an instance partition and begins preparing it to be used. The
returned long-running operation
can be used to track the progress of preparing the new instance partition.
The instance partition name is assigned by the caller. If the named
instance partition already exists, CreateInstancePartition
returns
ALREADY_EXISTS
.
Immediately upon completion of this request:
- The instance partition is readable via the API, with all requested
attributes but no allocated resources. Its state is
CREATING
.
Until completion of the returned operation:
- Cancelling the operation renders the instance partition immediately unreadable via the API.
- The instance partition can be deleted.
- All other attempts to modify the instance partition are rejected.
Upon completion of the returned operation:
- Billing for all successfully-allocated resources begins (some types may have lower than the requested levels).
- Databases can start using this instance partition.
- The instance partition's allocated resource levels are readable via the API.
- The instance partition's state becomes
READY
.
The returned long-running operation will
have a name of the format
<instance_partition_name>/operations/<operation_id>
and can be used to
track creation of the instance partition. The
metadata field type is
CreateInstancePartitionMetadata.
The response field type is
InstancePartition, if
successful.
2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 |
# File 'lib/google/cloud/spanner/admin/instance/v1/instance_admin/client.rb', line 2182 def create_instance_partition request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstancePartitionRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.create_instance_partition..to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version 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::Spanner::Admin::Instance::V1::VERSION [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"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 .apply_defaults timeout: @config.rpcs.create_instance_partition.timeout, metadata: , retry_policy: @config.rpcs.create_instance_partition.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @instance_admin_stub.call_rpc :create_instance_partition, request, options: do |response, operation| response = ::Gapic::Operation.new response, @operations_client, options: yield response, operation if block_given? throw :response, 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
Deletes an instance.
Immediately upon completion of the request:
- Billing ceases for all of the instance's reserved resources.
Soon afterward:
- The instance and all of its databases immediately and irrevocably disappear from the API. All data in the databases is permanently deleted.
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 1698 1699 1700 1701 1702 1703 1704 1705 1706 |
# File 'lib/google/cloud/spanner/admin/instance/v1/instance_admin/client.rb', line 1667 def delete_instance request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstanceRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.delete_instance..to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version 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::Spanner::Admin::Instance::V1::VERSION [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"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 .apply_defaults timeout: @config.rpcs.delete_instance.timeout, metadata: , retry_policy: @config.rpcs.delete_instance.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @instance_admin_stub.call_rpc :delete_instance, request, options: do |response, operation| yield response, operation if block_given? end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#delete_instance_config(request, options = nil) ⇒ ::Google::Protobuf::Empty #delete_instance_config(name: nil, etag: nil, validate_only: nil) ⇒ ::Google::Protobuf::Empty
Deletes the instance configuration. Deletion is only allowed when no
instances are using the configuration. If any instances are using
the configuration, returns FAILED_PRECONDITION
.
Only user-managed configurations can be deleted.
Authorization requires spanner.instanceConfigs.delete
permission on
the resource name.
813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 |
# File 'lib/google/cloud/spanner/admin/instance/v1/instance_admin/client.rb', line 813 def delete_instance_config request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstanceConfigRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.delete_instance_config..to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version 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::Spanner::Admin::Instance::V1::VERSION [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"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 .apply_defaults timeout: @config.rpcs.delete_instance_config.timeout, metadata: , retry_policy: @config.rpcs.delete_instance_config.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @instance_admin_stub.call_rpc :delete_instance_config, request, options: do |response, operation| yield response, operation if block_given? end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#delete_instance_partition(request, options = nil) ⇒ ::Google::Protobuf::Empty #delete_instance_partition(name: nil, etag: nil) ⇒ ::Google::Protobuf::Empty
Deletes an existing instance partition. Requires that the instance partition is not used by any database or backup and is not the default instance partition of an instance.
Authorization requires spanner.instancePartitions.delete
permission on
the resource
name.
2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 |
# File 'lib/google/cloud/spanner/admin/instance/v1/instance_admin/client.rb', line 2282 def delete_instance_partition request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstancePartitionRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.delete_instance_partition..to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version 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::Spanner::Admin::Instance::V1::VERSION [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"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 .apply_defaults timeout: @config.rpcs.delete_instance_partition.timeout, metadata: , retry_policy: @config.rpcs.delete_instance_partition.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @instance_admin_stub.call_rpc :delete_instance_partition, request, options: do |response, operation| yield response, operation if block_given? 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.
Authorization requires spanner.instances.getIamPolicy
on
resource.
1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 |
# File 'lib/google/cloud/spanner/admin/instance/v1/instance_admin/client.rb', line 1861 def get_iam_policy request, = 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 = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.get_iam_policy..to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version 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::Spanner::Admin::Instance::V1::VERSION [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"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 .apply_defaults timeout: @config.rpcs.get_iam_policy.timeout, metadata: , retry_policy: @config.rpcs.get_iam_policy.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @instance_admin_stub.call_rpc :get_iam_policy, request, options: do |response, operation| yield response, operation if block_given? end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#get_instance(request, options = nil) ⇒ ::Google::Cloud::Spanner::Admin::Instance::V1::Instance #get_instance(name: nil, field_mask: nil) ⇒ ::Google::Cloud::Spanner::Admin::Instance::V1::Instance
Gets information about a particular instance.
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 1325 1326 1327 1328 1329 1330 1331 1332 1333 |
# File 'lib/google/cloud/spanner/admin/instance/v1/instance_admin/client.rb', line 1294 def get_instance request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Instance::V1::GetInstanceRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.get_instance..to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version 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::Spanner::Admin::Instance::V1::VERSION [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"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 .apply_defaults timeout: @config.rpcs.get_instance.timeout, metadata: , retry_policy: @config.rpcs.get_instance.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @instance_admin_stub.call_rpc :get_instance, request, options: do |response, operation| yield response, operation if block_given? end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#get_instance_config(request, options = nil) ⇒ ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig #get_instance_config(name: nil) ⇒ ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig
Gets information about a particular instance configuration.
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 441 442 443 444 445 |
# File 'lib/google/cloud/spanner/admin/instance/v1/instance_admin/client.rb', line 406 def get_instance_config request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Instance::V1::GetInstanceConfigRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.get_instance_config..to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version 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::Spanner::Admin::Instance::V1::VERSION [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"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 .apply_defaults timeout: @config.rpcs.get_instance_config.timeout, metadata: , retry_policy: @config.rpcs.get_instance_config.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @instance_admin_stub.call_rpc :get_instance_config, request, options: do |response, operation| yield response, operation if block_given? end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#get_instance_partition(request, options = nil) ⇒ ::Google::Cloud::Spanner::Admin::Instance::V1::InstancePartition #get_instance_partition(name: nil) ⇒ ::Google::Cloud::Spanner::Admin::Instance::V1::InstancePartition
Gets information about a particular instance partition.
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 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 |
# File 'lib/google/cloud/spanner/admin/instance/v1/instance_admin/client.rb', line 2044 def get_instance_partition request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Instance::V1::GetInstancePartitionRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.get_instance_partition..to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version 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::Spanner::Admin::Instance::V1::VERSION [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"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 .apply_defaults timeout: @config.rpcs.get_instance_partition.timeout, metadata: , retry_policy: @config.rpcs.get_instance_partition.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @instance_admin_stub.call_rpc :get_instance_partition, request, options: do |response, operation| yield response, operation if block_given? end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#list_instance_config_operations(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Gapic::Operation> #list_instance_config_operations(parent: nil, filter: nil, page_size: nil, page_token: nil) ⇒ ::Gapic::PagedEnumerable<::Gapic::Operation>
Lists the user-managed instance configuration [long-running
operations][google.longrunning.Operation] in the given project. An instance
configuration operation has a name of the form
projects/<project>/instanceConfigs/<instance_config>/operations/<operation>
.
The long-running operation
metadata field type
metadata.type_url
describes the type of the metadata. Operations returned
include those that have completed/failed/canceled within the last 7 days,
and pending operations. Operations returned are ordered by
operation.metadata.value.start_time
in descending order starting
from the most recently started operation.
966 967 968 969 970 971 972 973 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 |
# File 'lib/google/cloud/spanner/admin/instance/v1/instance_admin/client.rb', line 966 def list_instance_config_operations request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigOperationsRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.list_instance_config_operations..to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version 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::Spanner::Admin::Instance::V1::VERSION [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"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 .apply_defaults timeout: @config.rpcs.list_instance_config_operations.timeout, metadata: , retry_policy: @config.rpcs.list_instance_config_operations.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @instance_admin_stub.call_rpc :list_instance_config_operations, request, options: do |response, operation| wrap_lro_operation = ->(op_response) { ::Gapic::Operation.new op_response, @operations_client } response = ::Gapic::PagedEnumerable.new @instance_admin_stub, :list_instance_config_operations, request, response, operation, , format_resource: wrap_lro_operation yield response, operation if block_given? throw :response, response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#list_instance_configs(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig> #list_instance_configs(parent: nil, page_size: nil, page_token: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig>
Lists the supported instance configurations for a given project.
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 355 356 357 358 359 |
# File 'lib/google/cloud/spanner/admin/instance/v1/instance_admin/client.rb', line 318 def list_instance_configs request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigsRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.list_instance_configs..to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version 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::Spanner::Admin::Instance::V1::VERSION [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"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 .apply_defaults timeout: @config.rpcs.list_instance_configs.timeout, metadata: , retry_policy: @config.rpcs.list_instance_configs.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @instance_admin_stub.call_rpc :list_instance_configs, request, options: do |response, operation| response = ::Gapic::PagedEnumerable.new @instance_admin_stub, :list_instance_configs, request, response, operation, yield response, operation if block_given? throw :response, response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#list_instance_partition_operations(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Gapic::Operation> #list_instance_partition_operations(parent: nil, filter: nil, page_size: nil, page_token: nil, instance_partition_deadline: nil) ⇒ ::Gapic::PagedEnumerable<::Gapic::Operation>
Lists instance partition [long-running
operations][google.longrunning.Operation] in the given instance.
An instance partition operation has a name of the form
projects/<project>/instances/<instance>/instancePartitions/<instance_partition>/operations/<operation>
.
The long-running operation
metadata field type
metadata.type_url
describes the type of the metadata. Operations returned
include those that have completed/failed/canceled within the last 7 days,
and pending operations. Operations returned are ordered by
operation.metadata.value.start_time
in descending order starting from the
most recently started operation.
Authorization requires spanner.instancePartitionOperations.list
permission on the resource
parent.
2592 2593 2594 2595 2596 2597 2598 2599 2600 2601 2602 2603 2604 2605 2606 2607 2608 2609 2610 2611 2612 2613 2614 2615 2616 2617 2618 2619 2620 2621 2622 2623 2624 2625 2626 2627 2628 2629 2630 2631 2632 2633 2634 |
# File 'lib/google/cloud/spanner/admin/instance/v1/instance_admin/client.rb', line 2592 def list_instance_partition_operations request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionOperationsRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.list_instance_partition_operations..to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version 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::Spanner::Admin::Instance::V1::VERSION [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"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 .apply_defaults timeout: @config.rpcs.list_instance_partition_operations.timeout, metadata: , retry_policy: @config.rpcs.list_instance_partition_operations.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @instance_admin_stub.call_rpc :list_instance_partition_operations, request, options: do |response, operation| wrap_lro_operation = ->(op_response) { ::Gapic::Operation.new op_response, @operations_client } response = ::Gapic::PagedEnumerable.new @instance_admin_stub, :list_instance_partition_operations, request, response, operation, , format_resource: wrap_lro_operation yield response, operation if block_given? throw :response, response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#list_instance_partitions(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Spanner::Admin::Instance::V1::InstancePartition> #list_instance_partitions(parent: nil, page_size: nil, page_token: nil, instance_partition_deadline: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Spanner::Admin::Instance::V1::InstancePartition>
Lists all instance partitions for the given instance.
1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 |
# File 'lib/google/cloud/spanner/admin/instance/v1/instance_admin/client.rb', line 1201 def list_instance_partitions request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancePartitionsRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.list_instance_partitions..to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version 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::Spanner::Admin::Instance::V1::VERSION [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"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 .apply_defaults timeout: @config.rpcs.list_instance_partitions.timeout, metadata: , retry_policy: @config.rpcs.list_instance_partitions.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @instance_admin_stub.call_rpc :list_instance_partitions, request, options: do |response, operation| response = ::Gapic::PagedEnumerable.new @instance_admin_stub, :list_instance_partitions, request, response, operation, yield response, operation if block_given? throw :response, response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#list_instances(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Spanner::Admin::Instance::V1::Instance> #list_instances(parent: nil, page_size: nil, page_token: nil, filter: nil, instance_deadline: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Spanner::Admin::Instance::V1::Instance>
Lists all instances in the given project.
1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 |
# File 'lib/google/cloud/spanner/admin/instance/v1/instance_admin/client.rb', line 1094 def list_instances request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancesRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.list_instances..to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version 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::Spanner::Admin::Instance::V1::VERSION [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"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 .apply_defaults timeout: @config.rpcs.list_instances.timeout, metadata: , retry_policy: @config.rpcs.list_instances.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @instance_admin_stub.call_rpc :list_instances, request, options: do |response, operation| response = ::Gapic::PagedEnumerable.new @instance_admin_stub, :list_instances, request, response, operation, yield response, operation if block_given? throw :response, response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#logger ⇒ Logger
The logger used for request/response debug logging.
254 255 256 |
# File 'lib/google/cloud/spanner/admin/instance/v1/instance_admin/client.rb', line 254 def logger @instance_admin_stub.logger end |
#move_instance(request, options = nil) ⇒ ::Gapic::Operation #move_instance(name: nil, target_config: nil) ⇒ ::Gapic::Operation
Moves an instance to the target instance configuration. You can use the returned long-running operation to track the progress of moving the instance.
MoveInstance
returns FAILED_PRECONDITION
if the instance meets any of
the following criteria:
- Is undergoing a move to a different instance configuration
- Has backups
- Has an ongoing update
- Contains any CMEK-enabled databases
- Is a free trial instance
While the operation is pending:
- All other attempts to modify the instance, including changes to its compute capacity, are rejected.
The following database and backup admin operations are rejected:
DatabaseAdmin.CreateDatabase
DatabaseAdmin.UpdateDatabaseDdl
(disabled if default_leader is specified in the request.)DatabaseAdmin.RestoreDatabase
DatabaseAdmin.CreateBackup
DatabaseAdmin.CopyBackup
Both the source and target instance configurations are subject to hourly compute and storage charges.
The instance might experience higher read-write latencies and a higher transaction abort rate. However, moving an instance doesn't cause any downtime.
The returned long-running operation has
a name of the format
<instance_name>/operations/<operation_id>
and can be used to track
the move instance operation. The
metadata field type is
MoveInstanceMetadata.
The response field type is
Instance,
if successful.
Cancelling the operation sets its metadata's
cancel_time.
Cancellation is not immediate because it involves moving any data
previously moved to the target instance configuration back to the original
instance configuration. You can use this operation to track the progress of
the cancellation. Upon successful completion of the cancellation, the
operation terminates with CANCELLED
status.
If not cancelled, upon completion of the returned operation:
- The instance successfully moves to the target instance configuration.
- You are billed for compute and storage in target instance configuration.
Authorization requires the spanner.instances.update
permission on
the resource instance.
For more details, see Move an instance.
2751 2752 2753 2754 2755 2756 2757 2758 2759 2760 2761 2762 2763 2764 2765 2766 2767 2768 2769 2770 2771 2772 2773 2774 2775 2776 2777 2778 2779 2780 2781 2782 2783 2784 2785 2786 2787 2788 2789 2790 2791 2792 |
# File 'lib/google/cloud/spanner/admin/instance/v1/instance_admin/client.rb', line 2751 def move_instance request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Instance::V1::MoveInstanceRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.move_instance..to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version 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::Spanner::Admin::Instance::V1::VERSION [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"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 .apply_defaults timeout: @config.rpcs.move_instance.timeout, metadata: , retry_policy: @config.rpcs.move_instance.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @instance_admin_stub.call_rpc :move_instance, request, options: do |response, operation| response = ::Gapic::Operation.new response, @operations_client, options: yield response, operation if block_given? throw :response, 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.
Authorization requires spanner.instances.setIamPolicy
on
resource.
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 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 |
# File 'lib/google/cloud/spanner/admin/instance/v1/instance_admin/client.rb', line 1768 def set_iam_policy request, = 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 = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.set_iam_policy..to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version 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::Spanner::Admin::Instance::V1::VERSION [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"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 .apply_defaults timeout: @config.rpcs.set_iam_policy.timeout, metadata: , retry_policy: @config.rpcs.set_iam_policy.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @instance_admin_stub.call_rpc :set_iam_policy, request, options: do |response, operation| yield response, operation if block_given? 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.
Attempting this RPC on a non-existent Cloud Spanner instance resource will
result in a NOT_FOUND error if the user has spanner.instances.list
permission on the containing Google Cloud Project. Otherwise returns an
empty set of permissions.
1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 |
# File 'lib/google/cloud/spanner/admin/instance/v1/instance_admin/client.rb', line 1957 def request, = 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 = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs...to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version 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::Spanner::Admin::Instance::V1::VERSION [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"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 .apply_defaults timeout: @config.rpcs..timeout, metadata: , retry_policy: @config.rpcs..retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @instance_admin_stub.call_rpc :test_iam_permissions, request, options: do |response, operation| yield response, operation if block_given? end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#universe_domain ⇒ String
The effective universe domain
164 165 166 |
# File 'lib/google/cloud/spanner/admin/instance/v1/instance_admin/client.rb', line 164 def universe_domain @instance_admin_stub.universe_domain end |
#update_instance(request, options = nil) ⇒ ::Gapic::Operation #update_instance(instance: nil, field_mask: nil) ⇒ ::Gapic::Operation
Updates an instance, and begins allocating or releasing resources
as requested. The returned [long-running
operation][google.longrunning.Operation] can be used to track the
progress of updating the instance. If the named instance does not
exist, returns NOT_FOUND
.
Immediately upon completion of this request:
- For resource types for which a decrease in the instance's allocation has been requested, billing is based on the newly-requested level.
Until completion of the returned operation:
- Cancelling the operation sets its metadata's
cancel_time,
and begins restoring resources to their pre-request values. The
operation is guaranteed to succeed at undoing all resource changes,
after which point it terminates with a
CANCELLED
status. - All other attempts to modify the instance are rejected.
- Reading the instance via the API continues to give the pre-request resource levels.
Upon completion of the returned operation:
- Billing begins for all successfully-allocated resources (some types may have lower than the requested levels).
- All newly-reserved resources are available for serving the instance's tables.
- The instance's new resource levels are readable via the API.
The returned long-running operation will
have a name of the format <instance_name>/operations/<operation_id>
and
can be used to track the instance modification. The
metadata field type is
UpdateInstanceMetadata.
The response field type is
Instance, if successful.
Authorization requires spanner.instances.update
permission on
the resource name.
1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 |
# File 'lib/google/cloud/spanner/admin/instance/v1/instance_admin/client.rb', line 1569 def update_instance request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.update_instance..to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version 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::Spanner::Admin::Instance::V1::VERSION [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"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 .apply_defaults timeout: @config.rpcs.update_instance.timeout, metadata: , retry_policy: @config.rpcs.update_instance.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @instance_admin_stub.call_rpc :update_instance, request, options: do |response, operation| response = ::Gapic::Operation.new response, @operations_client, options: yield response, operation if block_given? throw :response, response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#update_instance_config(request, options = nil) ⇒ ::Gapic::Operation #update_instance_config(instance_config: nil, update_mask: nil, validate_only: nil) ⇒ ::Gapic::Operation
Updates an instance configuration. The returned
long-running operation can be used to track
the progress of updating the instance. If the named instance configuration
does not exist, returns NOT_FOUND
.
Only user-managed configurations can be updated.
Immediately after the request returns:
- The instance configuration's reconciling field is set to true.
While the operation is pending:
- Cancelling the operation sets its metadata's
cancel_time.
The operation is guaranteed to succeed at undoing all changes, after
which point it terminates with a
CANCELLED
status. - All other attempts to modify the instance configuration are rejected.
- Reading the instance configuration via the API continues to give the pre-request values.
Upon completion of the returned operation:
- Creating instances using the instance configuration uses the new values.
- The new values of the instance configuration are readable via the API.
- The instance configuration's reconciling field becomes false.
The returned long-running operation will
have a name of the format
<instance_config_name>/operations/<operation_id>
and can be used to track
the instance configuration modification. The
metadata field type is
UpdateInstanceConfigMetadata.
The response field type is
InstanceConfig, if
successful.
Authorization requires spanner.instanceConfigs.update
permission on
the resource name.
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 735 736 737 738 739 740 741 742 743 744 745 746 747 |
# File 'lib/google/cloud/spanner/admin/instance/v1/instance_admin/client.rb', line 706 def update_instance_config request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceConfigRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.update_instance_config..to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version 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::Spanner::Admin::Instance::V1::VERSION [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.instance_config&.name header_params["instance_config.name"] = request.instance_config.name end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.update_instance_config.timeout, metadata: , retry_policy: @config.rpcs.update_instance_config.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @instance_admin_stub.call_rpc :update_instance_config, request, options: do |response, operation| response = ::Gapic::Operation.new response, @operations_client, options: yield response, operation if block_given? throw :response, response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#update_instance_partition(request, options = nil) ⇒ ::Gapic::Operation #update_instance_partition(instance_partition: nil, field_mask: nil) ⇒ ::Gapic::Operation
Updates an instance partition, and begins allocating or releasing resources
as requested. The returned [long-running
operation][google.longrunning.Operation] can be used to track the
progress of updating the instance partition. If the named instance
partition does not exist, returns NOT_FOUND
.
Immediately upon completion of this request:
- For resource types for which a decrease in the instance partition's allocation has been requested, billing is based on the newly-requested level.
Until completion of the returned operation:
- Cancelling the operation sets its metadata's
cancel_time,
and begins restoring resources to their pre-request values. The
operation is guaranteed to succeed at undoing all resource changes,
after which point it terminates with a
CANCELLED
status. - All other attempts to modify the instance partition are rejected.
- Reading the instance partition via the API continues to give the pre-request resource levels.
Upon completion of the returned operation:
- Billing begins for all successfully-allocated resources (some types may have lower than the requested levels).
- All newly-reserved resources are available for serving the instance partition's tables.
- The instance partition's new resource levels are readable via the API.
The returned long-running operation will
have a name of the format
<instance_partition_name>/operations/<operation_id>
and can be used to
track the instance partition modification. The
metadata field type is
UpdateInstancePartitionMetadata.
The response field type is
InstancePartition, if
successful.
Authorization requires spanner.instancePartitions.update
permission on
the resource
name.
2427 2428 2429 2430 2431 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 |
# File 'lib/google/cloud/spanner/admin/instance/v1/instance_admin/client.rb', line 2427 def update_instance_partition request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstancePartitionRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.update_instance_partition..to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version 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::Spanner::Admin::Instance::V1::VERSION [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.instance_partition&.name header_params["instance_partition.name"] = request.instance_partition.name end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.update_instance_partition.timeout, metadata: , retry_policy: @config.rpcs.update_instance_partition.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @instance_admin_stub.call_rpc :update_instance_partition, request, options: do |response, operation| response = ::Gapic::Operation.new response, @operations_client, options: yield response, operation if block_given? throw :response, response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |