Class: Google::Cloud::Compute::V1::Instances::Rest::Client
- Inherits:
-
Object
- Object
- Google::Cloud::Compute::V1::Instances::Rest::Client
- Defined in:
- lib/google/cloud/compute/v1/instances/rest/client.rb
Overview
REST client for the Instances service.
The Instances API.
Defined Under Namespace
Classes: Configuration
Instance Attribute Summary collapse
-
#zone_operations ⇒ ::Google::Cloud::Compute::V1::ZoneOperations::Rest::Client
readonly
Get the associated client for long-running operations via ZoneOperations.
Class Method Summary collapse
-
.configure {|config| ... } ⇒ Client::Configuration
Configure the Instances Client class.
Instance Method Summary collapse
-
#add_access_config(request, options = nil) {|result, operation| ... } ⇒ ::Gapic::GenericLRO::Operation
Adds an access config to an instance's network interface.
-
#add_resource_policies(request, options = nil) {|result, operation| ... } ⇒ ::Gapic::GenericLRO::Operation
Adds existing resource policies to an instance.
-
#aggregated_list(request, options = nil) {|result, operation| ... } ⇒ ::Gapic::Rest::PagedEnumerable<::String, ::Google::Cloud::Compute::V1::InstancesScopedList>
Retrieves an aggregated list of all of the instances in your project across all regions and zones.
-
#attach_disk(request, options = nil) {|result, operation| ... } ⇒ ::Gapic::GenericLRO::Operation
Attaches an existing Disk resource to an instance.
-
#bulk_insert(request, options = nil) {|result, operation| ... } ⇒ ::Gapic::GenericLRO::Operation
Creates multiple instances.
-
#configure {|config| ... } ⇒ Client::Configuration
Configure the Instances Client instance.
-
#delete(request, options = nil) {|result, operation| ... } ⇒ ::Gapic::GenericLRO::Operation
Deletes the specified Instance resource.
-
#delete_access_config(request, options = nil) {|result, operation| ... } ⇒ ::Gapic::GenericLRO::Operation
Deletes an access config from an instance's network interface.
-
#detach_disk(request, options = nil) {|result, operation| ... } ⇒ ::Gapic::GenericLRO::Operation
Detaches a disk from an instance.
-
#get(request, options = nil) {|result, operation| ... } ⇒ ::Google::Cloud::Compute::V1::Instance
Returns the specified Instance resource.
-
#get_effective_firewalls(request, options = nil) {|result, operation| ... } ⇒ ::Google::Cloud::Compute::V1::InstancesGetEffectiveFirewallsResponse
Returns effective firewalls applied to an interface of the instance.
-
#get_guest_attributes(request, options = nil) {|result, operation| ... } ⇒ ::Google::Cloud::Compute::V1::GuestAttributes
Returns the specified guest attributes entry.
-
#get_iam_policy(request, options = nil) {|result, operation| ... } ⇒ ::Google::Cloud::Compute::V1::Policy
Gets the access control policy for a resource.
-
#get_screenshot(request, options = nil) {|result, operation| ... } ⇒ ::Google::Cloud::Compute::V1::Screenshot
Returns the screenshot from the specified instance.
-
#get_serial_port_output(request, options = nil) {|result, operation| ... } ⇒ ::Google::Cloud::Compute::V1::SerialPortOutput
Returns the last 1 MB of serial port output from the specified instance.
-
#get_shielded_instance_identity(request, options = nil) {|result, operation| ... } ⇒ ::Google::Cloud::Compute::V1::ShieldedInstanceIdentity
Returns the Shielded Instance Identity of an instance.
-
#initialize {|config| ... } ⇒ Client
constructor
Create a new Instances REST client object.
-
#insert(request, options = nil) {|result, operation| ... } ⇒ ::Gapic::GenericLRO::Operation
Creates an instance resource in the specified project using the data included in the request.
-
#list(request, options = nil) {|result, operation| ... } ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Compute::V1::Instance>
Retrieves the list of instances contained within the specified zone.
-
#list_referrers(request, options = nil) {|result, operation| ... } ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Compute::V1::Reference>
Retrieves a list of resources that refer to the VM instance specified in the request.
-
#perform_maintenance(request, options = nil) {|result, operation| ... } ⇒ ::Gapic::GenericLRO::Operation
Perform a manual maintenance on the instance.
-
#remove_resource_policies(request, options = nil) {|result, operation| ... } ⇒ ::Gapic::GenericLRO::Operation
Removes resource policies from an instance.
-
#reset(request, options = nil) {|result, operation| ... } ⇒ ::Gapic::GenericLRO::Operation
Performs a reset on the instance.
-
#resume(request, options = nil) {|result, operation| ... } ⇒ ::Gapic::GenericLRO::Operation
Resumes an instance that was suspended using the instances().suspend method.
-
#send_diagnostic_interrupt(request, options = nil) {|result, operation| ... } ⇒ ::Google::Cloud::Compute::V1::SendDiagnosticInterruptInstanceResponse
Sends diagnostic interrupt to the instance.
-
#set_deletion_protection(request, options = nil) {|result, operation| ... } ⇒ ::Gapic::GenericLRO::Operation
Sets deletion protection on the instance.
-
#set_disk_auto_delete(request, options = nil) {|result, operation| ... } ⇒ ::Gapic::GenericLRO::Operation
Sets the auto-delete flag for a disk attached to an instance.
-
#set_iam_policy(request, options = nil) {|result, operation| ... } ⇒ ::Google::Cloud::Compute::V1::Policy
Sets the access control policy on the specified resource.
-
#set_labels(request, options = nil) {|result, operation| ... } ⇒ ::Gapic::GenericLRO::Operation
Sets labels on an instance.
-
#set_machine_resources(request, options = nil) {|result, operation| ... } ⇒ ::Gapic::GenericLRO::Operation
Changes the number and/or type of accelerator for a stopped instance to the values specified in the request.
-
#set_machine_type(request, options = nil) {|result, operation| ... } ⇒ ::Gapic::GenericLRO::Operation
Changes the machine type for a stopped instance to the machine type specified in the request.
-
#set_metadata(request, options = nil) {|result, operation| ... } ⇒ ::Gapic::GenericLRO::Operation
Sets metadata for the specified instance to the data included in the request.
-
#set_min_cpu_platform(request, options = nil) {|result, operation| ... } ⇒ ::Gapic::GenericLRO::Operation
Changes the minimum CPU platform that this instance should use.
-
#set_name(request, options = nil) {|result, operation| ... } ⇒ ::Gapic::GenericLRO::Operation
Sets name of an instance.
-
#set_scheduling(request, options = nil) {|result, operation| ... } ⇒ ::Gapic::GenericLRO::Operation
Sets an instance's scheduling options.
-
#set_security_policy(request, options = nil) {|result, operation| ... } ⇒ ::Gapic::GenericLRO::Operation
Sets the Google Cloud Armor security policy for the specified instance.
-
#set_service_account(request, options = nil) {|result, operation| ... } ⇒ ::Gapic::GenericLRO::Operation
Sets the service account on the instance.
-
#set_shielded_instance_integrity_policy(request, options = nil) {|result, operation| ... } ⇒ ::Gapic::GenericLRO::Operation
Sets the Shielded Instance integrity policy for an instance.
-
#set_tags(request, options = nil) {|result, operation| ... } ⇒ ::Gapic::GenericLRO::Operation
Sets network tags for the specified instance to the data included in the request.
-
#simulate_maintenance_event(request, options = nil) {|result, operation| ... } ⇒ ::Gapic::GenericLRO::Operation
Simulates a host maintenance event on a VM.
-
#start(request, options = nil) {|result, operation| ... } ⇒ ::Gapic::GenericLRO::Operation
Starts an instance that was stopped using the instances().stop method.
-
#start_with_encryption_key(request, options = nil) {|result, operation| ... } ⇒ ::Gapic::GenericLRO::Operation
Starts an instance that was stopped using the instances().stop method.
-
#stop(request, options = nil) {|result, operation| ... } ⇒ ::Gapic::GenericLRO::Operation
Stops a running instance, shutting it down cleanly, and allows you to restart the instance at a later time.
-
#suspend(request, options = nil) {|result, operation| ... } ⇒ ::Gapic::GenericLRO::Operation
This method suspends a running instance, saving its state to persistent storage, and allows you to resume the instance at a later time.
-
#test_iam_permissions(request, options = nil) {|result, operation| ... } ⇒ ::Google::Cloud::Compute::V1::TestPermissionsResponse
Returns permissions that a caller has on the specified resource.
-
#universe_domain ⇒ String
The effective universe domain.
-
#update(request, options = nil) {|result, operation| ... } ⇒ ::Gapic::GenericLRO::Operation
Updates an instance only if the necessary resources are available.
-
#update_access_config(request, options = nil) {|result, operation| ... } ⇒ ::Gapic::GenericLRO::Operation
Updates the specified access config from an instance's network interface with the data included in the request.
-
#update_display_device(request, options = nil) {|result, operation| ... } ⇒ ::Gapic::GenericLRO::Operation
Updates the Display config for a VM instance.
-
#update_network_interface(request, options = nil) {|result, operation| ... } ⇒ ::Gapic::GenericLRO::Operation
Updates an instance's network interface.
-
#update_shielded_instance_config(request, options = nil) {|result, operation| ... } ⇒ ::Gapic::GenericLRO::Operation
Updates the Shielded Instance config for an instance.
Constructor Details
#initialize {|config| ... } ⇒ Client
Create a new Instances REST client object.
251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 |
# File 'lib/google/cloud/compute/v1/instances/rest/client.rb', line 251 def initialize # 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 @zone_operations = ::Google::Cloud::Compute::V1::ZoneOperations::Rest::Client.new do |config| config.credentials = credentials config.quota_project = @quota_project_id config.endpoint = @config.endpoint config.universe_domain = @config.universe_domain end @instances_stub = ::Google::Cloud::Compute::V1::Instances::Rest::ServiceStub.new( endpoint: @config.endpoint, endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, universe_domain: @config.universe_domain, credentials: credentials ) end |
Instance Attribute Details
#zone_operations ⇒ ::Google::Cloud::Compute::V1::ZoneOperations::Rest::Client (readonly)
Get the associated client for long-running operations via ZoneOperations.
294 295 296 |
# File 'lib/google/cloud/compute/v1/instances/rest/client.rb', line 294 def zone_operations @zone_operations end |
Class Method Details
.configure {|config| ... } ⇒ Client::Configuration
Configure the Instances Client class.
See Configuration for a description of the configuration fields.
63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 |
# File 'lib/google/cloud/compute/v1/instances/rest/client.rb', line 63 def self.configure @configure ||= begin namespace = ["Google", "Cloud", "Compute", "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.add_access_config.timeout = 600.0 default_config.rpcs.add_resource_policies.timeout = 600.0 default_config.rpcs.aggregated_list.timeout = 600.0 default_config.rpcs.aggregated_list.retry_policy = { initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] } default_config.rpcs.attach_disk.timeout = 600.0 default_config.rpcs.bulk_insert.timeout = 600.0 default_config.rpcs.delete.timeout = 600.0 default_config.rpcs.delete_access_config.timeout = 600.0 default_config.rpcs.detach_disk.timeout = 600.0 default_config.rpcs.get.timeout = 600.0 default_config.rpcs.get.retry_policy = { initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] } default_config.rpcs.get_effective_firewalls.timeout = 600.0 default_config.rpcs.get_effective_firewalls.retry_policy = { initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] } default_config.rpcs.get_guest_attributes.timeout = 600.0 default_config.rpcs.get_guest_attributes.retry_policy = { initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] } default_config.rpcs.get_iam_policy.timeout = 600.0 default_config.rpcs.get_iam_policy.retry_policy = { initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] } default_config.rpcs.get_screenshot.timeout = 600.0 default_config.rpcs.get_screenshot.retry_policy = { initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] } default_config.rpcs.get_serial_port_output.timeout = 600.0 default_config.rpcs.get_serial_port_output.retry_policy = { initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] } default_config.rpcs.get_shielded_instance_identity.timeout = 600.0 default_config.rpcs.get_shielded_instance_identity.retry_policy = { initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] } default_config.rpcs.insert.timeout = 600.0 default_config.rpcs.list.timeout = 600.0 default_config.rpcs.list.retry_policy = { initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] } default_config.rpcs.list_referrers.timeout = 600.0 default_config.rpcs.list_referrers.retry_policy = { initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] } default_config.rpcs.perform_maintenance.timeout = 600.0 default_config.rpcs.remove_resource_policies.timeout = 600.0 default_config.rpcs.reset.timeout = 600.0 default_config.rpcs.resume.timeout = 600.0 default_config.rpcs.send_diagnostic_interrupt.timeout = 600.0 default_config.rpcs.set_deletion_protection.timeout = 600.0 default_config.rpcs.set_disk_auto_delete.timeout = 600.0 default_config.rpcs.set_iam_policy.timeout = 600.0 default_config.rpcs.set_labels.timeout = 600.0 default_config.rpcs.set_machine_resources.timeout = 600.0 default_config.rpcs.set_machine_type.timeout = 600.0 default_config.rpcs..timeout = 600.0 default_config.rpcs.set_min_cpu_platform.timeout = 600.0 default_config.rpcs.set_name.timeout = 600.0 default_config.rpcs.set_scheduling.timeout = 600.0 default_config.rpcs.set_security_policy.timeout = 600.0 default_config.rpcs.set_service_account.timeout = 600.0 default_config.rpcs.set_shielded_instance_integrity_policy.timeout = 600.0 default_config.rpcs..timeout = 600.0 default_config.rpcs.simulate_maintenance_event.timeout = 600.0 default_config.rpcs.start.timeout = 600.0 default_config.rpcs.start_with_encryption_key.timeout = 600.0 default_config.rpcs.stop.timeout = 600.0 default_config.rpcs.suspend.timeout = 600.0 default_config.rpcs..timeout = 600.0 default_config.rpcs.update.timeout = 600.0 default_config.rpcs.update_access_config.timeout = 600.0 default_config.rpcs.update_display_device.timeout = 600.0 default_config.rpcs.update_network_interface.timeout = 600.0 default_config.rpcs.update_shielded_instance_config.timeout = 600.0 default_config end yield @configure if block_given? @configure end |
Instance Method Details
#add_access_config(request, options = nil) ⇒ ::Gapic::GenericLRO::Operation #add_access_config(access_config_resource: nil, instance: nil, network_interface: nil, project: nil, request_id: nil, zone: nil) ⇒ ::Gapic::GenericLRO::Operation
Adds an access config to an instance's network interface.
351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 |
# File 'lib/google/cloud/compute/v1/instances/rest/client.rb', line 351 def add_access_config request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::AddAccessConfigInstanceRequest # 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.add_access_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::Compute::V1::VERSION, transports_version_send: [:rest] [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id .apply_defaults timeout: @config.rpcs.add_access_config.timeout, metadata: , retry_policy: @config.rpcs.add_access_config.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @instances_stub.add_access_config request, do |result, response| result = ::Google::Cloud::Compute::V1::ZoneOperations::Rest::NonstandardLro.create_operation( operation: result, client: zone_operations, request_values: { "project" => request.project, "zone" => request.zone }, options: ) yield result, response if block_given? return result end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end |
#add_resource_policies(request, options = nil) ⇒ ::Gapic::GenericLRO::Operation #add_resource_policies(instance: nil, instances_add_resource_policies_request_resource: nil, project: nil, request_id: nil, zone: nil) ⇒ ::Gapic::GenericLRO::Operation
Adds existing resource policies to an instance. You can only add one policy right now which will be applied to this instance for scheduling live migrations.
447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 |
# File 'lib/google/cloud/compute/v1/instances/rest/client.rb', line 447 def add_resource_policies request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::AddResourcePoliciesInstanceRequest # 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.add_resource_policies..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::Compute::V1::VERSION, transports_version_send: [:rest] [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id .apply_defaults timeout: @config.rpcs.add_resource_policies.timeout, metadata: , retry_policy: @config.rpcs.add_resource_policies.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @instances_stub.add_resource_policies request, do |result, response| result = ::Google::Cloud::Compute::V1::ZoneOperations::Rest::NonstandardLro.create_operation( operation: result, client: zone_operations, request_values: { "project" => request.project, "zone" => request.zone }, options: ) yield result, response if block_given? return result end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end |
#aggregated_list(request, options = nil) ⇒ ::Gapic::Rest::PagedEnumerable<::String, ::Google::Cloud::Compute::V1::InstancesScopedList> #aggregated_list(filter: nil, include_all_scopes: nil, max_results: nil, order_by: nil, page_token: nil, project: nil, return_partial_success: nil, service_project_number: nil) ⇒ ::Gapic::Rest::PagedEnumerable<::String, ::Google::Cloud::Compute::V1::InstancesScopedList>
Retrieves an aggregated list of all of the instances in your project across all regions and zones. The performance of this method degrades when a filter is specified on a project that has a very large number of instances. To prevent failure, Google recommends that you set the returnPartialSuccess
parameter to true
.
549 550 551 552 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 |
# File 'lib/google/cloud/compute/v1/instances/rest/client.rb', line 549 def aggregated_list request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::AggregatedListInstancesRequest # 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.aggregated_list..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::Compute::V1::VERSION, transports_version_send: [:rest] [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id .apply_defaults timeout: @config.rpcs.aggregated_list.timeout, metadata: , retry_policy: @config.rpcs.aggregated_list.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @instances_stub.aggregated_list request, do |result, operation| result = ::Gapic::Rest::PagedEnumerable.new @instances_stub, :aggregated_list, "items", request, result, yield result, operation if block_given? return result end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end |
#attach_disk(request, options = nil) ⇒ ::Gapic::GenericLRO::Operation #attach_disk(attached_disk_resource: nil, force_attach: nil, instance: nil, project: nil, request_id: nil, zone: nil) ⇒ ::Gapic::GenericLRO::Operation
Attaches an existing Disk resource to an instance. You must first create the disk before you can attach it. It is not possible to create and attach a disk at the same time. For more information, read Adding a persistent disk to your instance.
639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 |
# File 'lib/google/cloud/compute/v1/instances/rest/client.rb', line 639 def attach_disk request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::AttachDiskInstanceRequest # 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.attach_disk..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::Compute::V1::VERSION, transports_version_send: [:rest] [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id .apply_defaults timeout: @config.rpcs.attach_disk.timeout, metadata: , retry_policy: @config.rpcs.attach_disk.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @instances_stub.attach_disk request, do |result, response| result = ::Google::Cloud::Compute::V1::ZoneOperations::Rest::NonstandardLro.create_operation( operation: result, client: zone_operations, request_values: { "project" => request.project, "zone" => request.zone }, options: ) yield result, response if block_given? return result end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end |
#bulk_insert(request, options = nil) ⇒ ::Gapic::GenericLRO::Operation #bulk_insert(bulk_insert_instance_resource_resource: nil, project: nil, request_id: nil, zone: nil) ⇒ ::Gapic::GenericLRO::Operation
Creates multiple instances. Count specifies the number of instances to create. For more information, see About bulk creation of VMs.
733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 |
# File 'lib/google/cloud/compute/v1/instances/rest/client.rb', line 733 def bulk_insert request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::BulkInsertInstanceRequest # 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.bulk_insert..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::Compute::V1::VERSION, transports_version_send: [:rest] [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id .apply_defaults timeout: @config.rpcs.bulk_insert.timeout, metadata: , retry_policy: @config.rpcs.bulk_insert.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @instances_stub.bulk_insert request, do |result, response| result = ::Google::Cloud::Compute::V1::ZoneOperations::Rest::NonstandardLro.create_operation( operation: result, client: zone_operations, request_values: { "project" => request.project, "zone" => request.zone }, options: ) yield result, response if block_given? return result end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end |
#configure {|config| ... } ⇒ Client::Configuration
Configure the Instances 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.
221 222 223 224 |
# File 'lib/google/cloud/compute/v1/instances/rest/client.rb', line 221 def configure yield @config if block_given? @config end |
#delete(request, options = nil) ⇒ ::Gapic::GenericLRO::Operation #delete(instance: nil, project: nil, request_id: nil, zone: nil) ⇒ ::Gapic::GenericLRO::Operation
Deletes the specified Instance resource. For more information, see Deleting an instance.
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 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 |
# File 'lib/google/cloud/compute/v1/instances/rest/client.rb', line 827 def delete request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::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..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::Compute::V1::VERSION, transports_version_send: [:rest] [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id .apply_defaults timeout: @config.rpcs.delete.timeout, metadata: , retry_policy: @config.rpcs.delete.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @instances_stub.delete request, do |result, response| result = ::Google::Cloud::Compute::V1::ZoneOperations::Rest::NonstandardLro.create_operation( operation: result, client: zone_operations, request_values: { "project" => request.project, "zone" => request.zone }, options: ) yield result, response if block_given? return result end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end |
#delete_access_config(request, options = nil) ⇒ ::Gapic::GenericLRO::Operation #delete_access_config(access_config: nil, instance: nil, network_interface: nil, project: nil, request_id: nil, zone: nil) ⇒ ::Gapic::GenericLRO::Operation
Deletes an access config from an instance's network interface.
925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 |
# File 'lib/google/cloud/compute/v1/instances/rest/client.rb', line 925 def delete_access_config request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::DeleteAccessConfigInstanceRequest # 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_access_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::Compute::V1::VERSION, transports_version_send: [:rest] [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id .apply_defaults timeout: @config.rpcs.delete_access_config.timeout, metadata: , retry_policy: @config.rpcs.delete_access_config.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @instances_stub.delete_access_config request, do |result, response| result = ::Google::Cloud::Compute::V1::ZoneOperations::Rest::NonstandardLro.create_operation( operation: result, client: zone_operations, request_values: { "project" => request.project, "zone" => request.zone }, options: ) yield result, response if block_given? return result end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end |
#detach_disk(request, options = nil) ⇒ ::Gapic::GenericLRO::Operation #detach_disk(device_name: nil, instance: nil, project: nil, request_id: nil, zone: nil) ⇒ ::Gapic::GenericLRO::Operation
Detaches a disk from an instance.
1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 |
# File 'lib/google/cloud/compute/v1/instances/rest/client.rb', line 1021 def detach_disk request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::DetachDiskInstanceRequest # 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.detach_disk..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::Compute::V1::VERSION, transports_version_send: [:rest] [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id .apply_defaults timeout: @config.rpcs.detach_disk.timeout, metadata: , retry_policy: @config.rpcs.detach_disk.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @instances_stub.detach_disk request, do |result, response| result = ::Google::Cloud::Compute::V1::ZoneOperations::Rest::NonstandardLro.create_operation( operation: result, client: zone_operations, request_values: { "project" => request.project, "zone" => request.zone }, options: ) yield result, response if block_given? return result end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end |
#get(request, options = nil) ⇒ ::Google::Cloud::Compute::V1::Instance #get(instance: nil, project: nil, zone: nil) ⇒ ::Google::Cloud::Compute::V1::Instance
Returns the specified Instance resource.
1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 |
# File 'lib/google/cloud/compute/v1/instances/rest/client.rb', line 1113 def get request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::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..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::Compute::V1::VERSION, transports_version_send: [:rest] [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id .apply_defaults timeout: @config.rpcs.get.timeout, metadata: , retry_policy: @config.rpcs.get.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @instances_stub.get request, do |result, operation| yield result, operation if block_given? return result end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end |
#get_effective_firewalls(request, options = nil) ⇒ ::Google::Cloud::Compute::V1::InstancesGetEffectiveFirewallsResponse #get_effective_firewalls(instance: nil, network_interface: nil, project: nil, zone: nil) ⇒ ::Google::Cloud::Compute::V1::InstancesGetEffectiveFirewallsResponse
Returns effective firewalls applied to an interface of the instance.
1198 1199 1200 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 |
# File 'lib/google/cloud/compute/v1/instances/rest/client.rb', line 1198 def get_effective_firewalls request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::GetEffectiveFirewallsInstanceRequest # 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_effective_firewalls..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::Compute::V1::VERSION, transports_version_send: [:rest] [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id .apply_defaults timeout: @config.rpcs.get_effective_firewalls.timeout, metadata: , retry_policy: @config.rpcs.get_effective_firewalls.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @instances_stub.get_effective_firewalls request, do |result, operation| yield result, operation if block_given? return result end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end |
#get_guest_attributes(request, options = nil) ⇒ ::Google::Cloud::Compute::V1::GuestAttributes #get_guest_attributes(instance: nil, project: nil, query_path: nil, variable_key: nil, zone: nil) ⇒ ::Google::Cloud::Compute::V1::GuestAttributes
Returns the specified guest attributes entry.
1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 |
# File 'lib/google/cloud/compute/v1/instances/rest/client.rb', line 1285 def get_guest_attributes request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::GetGuestAttributesInstanceRequest # 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_guest_attributes..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::Compute::V1::VERSION, transports_version_send: [:rest] [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id .apply_defaults timeout: @config.rpcs.get_guest_attributes.timeout, metadata: , retry_policy: @config.rpcs.get_guest_attributes.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @instances_stub.get_guest_attributes request, do |result, operation| yield result, operation if block_given? return result end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end |
#get_iam_policy(request, options = nil) ⇒ ::Google::Cloud::Compute::V1::Policy #get_iam_policy(options_requested_policy_version: nil, project: nil, resource: nil, zone: nil) ⇒ ::Google::Cloud::Compute::V1::Policy
Gets the access control policy for a resource. May be empty if no such policy or resource exists.
1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 |
# File 'lib/google/cloud/compute/v1/instances/rest/client.rb', line 1370 def get_iam_policy request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::GetIamPolicyInstanceRequest # 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::Compute::V1::VERSION, transports_version_send: [:rest] [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id .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 @instances_stub.get_iam_policy request, do |result, operation| yield result, operation if block_given? return result end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end |
#get_screenshot(request, options = nil) ⇒ ::Google::Cloud::Compute::V1::Screenshot #get_screenshot(instance: nil, project: nil, zone: nil) ⇒ ::Google::Cloud::Compute::V1::Screenshot
Returns the screenshot from the specified instance.
1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 |
# File 'lib/google/cloud/compute/v1/instances/rest/client.rb', line 1453 def get_screenshot request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::GetScreenshotInstanceRequest # 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_screenshot..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::Compute::V1::VERSION, transports_version_send: [:rest] [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id .apply_defaults timeout: @config.rpcs.get_screenshot.timeout, metadata: , retry_policy: @config.rpcs.get_screenshot.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @instances_stub.get_screenshot request, do |result, operation| yield result, operation if block_given? return result end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end |
#get_serial_port_output(request, options = nil) ⇒ ::Google::Cloud::Compute::V1::SerialPortOutput #get_serial_port_output(instance: nil, port: nil, project: nil, start: nil, zone: nil) ⇒ ::Google::Cloud::Compute::V1::SerialPortOutput
Returns the last 1 MB of serial port output from the specified instance.
1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 |
# File 'lib/google/cloud/compute/v1/instances/rest/client.rb', line 1540 def get_serial_port_output request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::GetSerialPortOutputInstanceRequest # 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_serial_port_output..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::Compute::V1::VERSION, transports_version_send: [:rest] [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id .apply_defaults timeout: @config.rpcs.get_serial_port_output.timeout, metadata: , retry_policy: @config.rpcs.get_serial_port_output.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @instances_stub.get_serial_port_output request, do |result, operation| yield result, operation if block_given? return result end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end |
#get_shielded_instance_identity(request, options = nil) ⇒ ::Google::Cloud::Compute::V1::ShieldedInstanceIdentity #get_shielded_instance_identity(instance: nil, project: nil, zone: nil) ⇒ ::Google::Cloud::Compute::V1::ShieldedInstanceIdentity
Returns the Shielded Instance Identity of an instance
1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 |
# File 'lib/google/cloud/compute/v1/instances/rest/client.rb', line 1623 def get_shielded_instance_identity request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::GetShieldedInstanceIdentityInstanceRequest # 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_shielded_instance_identity..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::Compute::V1::VERSION, transports_version_send: [:rest] [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id .apply_defaults timeout: @config.rpcs.get_shielded_instance_identity.timeout, metadata: , retry_policy: @config.rpcs.get_shielded_instance_identity.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @instances_stub.get_shielded_instance_identity request, do |result, operation| yield result, operation if block_given? return result end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end |
#insert(request, options = nil) ⇒ ::Gapic::GenericLRO::Operation #insert(instance_resource: nil, project: nil, request_id: nil, source_instance_template: nil, source_machine_image: nil, zone: nil) ⇒ ::Gapic::GenericLRO::Operation
Creates an instance resource in the specified project using the data included in the request.
1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 |
# File 'lib/google/cloud/compute/v1/instances/rest/client.rb', line 1712 def insert request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::InsertInstanceRequest # 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.insert..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::Compute::V1::VERSION, transports_version_send: [:rest] [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id .apply_defaults timeout: @config.rpcs.insert.timeout, metadata: , retry_policy: @config.rpcs.insert.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @instances_stub.insert request, do |result, response| result = ::Google::Cloud::Compute::V1::ZoneOperations::Rest::NonstandardLro.create_operation( operation: result, client: zone_operations, request_values: { "project" => request.project, "zone" => request.zone }, options: ) yield result, response if block_given? return result end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end |
#list(request, options = nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Compute::V1::Instance> #list(filter: nil, max_results: nil, order_by: nil, page_token: nil, project: nil, return_partial_success: nil, zone: nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Compute::V1::Instance>
Retrieves the list of instances contained within the specified zone.
1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 |
# File 'lib/google/cloud/compute/v1/instances/rest/client.rb', line 1812 def list request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::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..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::Compute::V1::VERSION, transports_version_send: [:rest] [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id .apply_defaults timeout: @config.rpcs.list.timeout, metadata: , retry_policy: @config.rpcs.list.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @instances_stub.list request, do |result, operation| result = ::Gapic::Rest::PagedEnumerable.new @instances_stub, :list, "items", request, result, yield result, operation if block_given? return result end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end |
#list_referrers(request, options = nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Compute::V1::Reference> #list_referrers(filter: nil, instance: nil, max_results: nil, order_by: nil, page_token: nil, project: nil, return_partial_success: nil, zone: nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Compute::V1::Reference>
Retrieves a list of resources that refer to the VM instance specified in the request. For example, if the VM instance is part of a managed or unmanaged instance group, the referrers list includes the instance group. For more information, read Viewing referrers to VM instances.
1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 |
# File 'lib/google/cloud/compute/v1/instances/rest/client.rb', line 1906 def list_referrers request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::ListReferrersInstancesRequest # 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_referrers..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::Compute::V1::VERSION, transports_version_send: [:rest] [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id .apply_defaults timeout: @config.rpcs.list_referrers.timeout, metadata: , retry_policy: @config.rpcs.list_referrers.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @instances_stub.list_referrers request, do |result, operation| result = ::Gapic::Rest::PagedEnumerable.new @instances_stub, :list_referrers, "items", request, result, yield result, operation if block_given? return result end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end |
#perform_maintenance(request, options = nil) ⇒ ::Gapic::GenericLRO::Operation #perform_maintenance(instance: nil, project: nil, request_id: nil, zone: nil) ⇒ ::Gapic::GenericLRO::Operation
Perform a manual maintenance on the instance.
1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 |
# File 'lib/google/cloud/compute/v1/instances/rest/client.rb', line 1992 def perform_maintenance request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::PerformMaintenanceInstanceRequest # 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.perform_maintenance..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::Compute::V1::VERSION, transports_version_send: [:rest] [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id .apply_defaults timeout: @config.rpcs.perform_maintenance.timeout, metadata: , retry_policy: @config.rpcs.perform_maintenance.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @instances_stub.perform_maintenance request, do |result, response| result = ::Google::Cloud::Compute::V1::ZoneOperations::Rest::NonstandardLro.create_operation( operation: result, client: zone_operations, request_values: { "project" => request.project, "zone" => request.zone }, options: ) yield result, response if block_given? return result end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end |
#remove_resource_policies(request, options = nil) ⇒ ::Gapic::GenericLRO::Operation #remove_resource_policies(instance: nil, instances_remove_resource_policies_request_resource: nil, project: nil, request_id: nil, zone: nil) ⇒ ::Gapic::GenericLRO::Operation
Removes resource policies from an instance.
2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 |
# File 'lib/google/cloud/compute/v1/instances/rest/client.rb', line 2088 def remove_resource_policies request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::RemoveResourcePoliciesInstanceRequest # 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.remove_resource_policies..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::Compute::V1::VERSION, transports_version_send: [:rest] [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id .apply_defaults timeout: @config.rpcs.remove_resource_policies.timeout, metadata: , retry_policy: @config.rpcs.remove_resource_policies.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @instances_stub.remove_resource_policies request, do |result, response| result = ::Google::Cloud::Compute::V1::ZoneOperations::Rest::NonstandardLro.create_operation( operation: result, client: zone_operations, request_values: { "project" => request.project, "zone" => request.zone }, options: ) yield result, response if block_given? return result end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end |
#reset(request, options = nil) ⇒ ::Gapic::GenericLRO::Operation #reset(instance: nil, project: nil, request_id: nil, zone: nil) ⇒ ::Gapic::GenericLRO::Operation
Performs a reset on the instance. This is a hard reset. The VM does not do a graceful shutdown. For more information, see Resetting an instance.
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 2224 2225 |
# File 'lib/google/cloud/compute/v1/instances/rest/client.rb', line 2182 def reset request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::ResetInstanceRequest # 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.reset..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::Compute::V1::VERSION, transports_version_send: [:rest] [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id .apply_defaults timeout: @config.rpcs.reset.timeout, metadata: , retry_policy: @config.rpcs.reset.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @instances_stub.reset request, do |result, response| result = ::Google::Cloud::Compute::V1::ZoneOperations::Rest::NonstandardLro.create_operation( operation: result, client: zone_operations, request_values: { "project" => request.project, "zone" => request.zone }, options: ) yield result, response if block_given? return result end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end |
#resume(request, options = nil) ⇒ ::Gapic::GenericLRO::Operation #resume(instance: nil, project: nil, request_id: nil, zone: nil) ⇒ ::Gapic::GenericLRO::Operation
Resumes an instance that was suspended using the instances().suspend method.
2276 2277 2278 2279 2280 2281 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 |
# File 'lib/google/cloud/compute/v1/instances/rest/client.rb', line 2276 def resume request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::ResumeInstanceRequest # 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.resume..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::Compute::V1::VERSION, transports_version_send: [:rest] [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id .apply_defaults timeout: @config.rpcs.resume.timeout, metadata: , retry_policy: @config.rpcs.resume.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @instances_stub.resume request, do |result, response| result = ::Google::Cloud::Compute::V1::ZoneOperations::Rest::NonstandardLro.create_operation( operation: result, client: zone_operations, request_values: { "project" => request.project, "zone" => request.zone }, options: ) yield result, response if block_given? return result end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end |
#send_diagnostic_interrupt(request, options = nil) ⇒ ::Google::Cloud::Compute::V1::SendDiagnosticInterruptInstanceResponse #send_diagnostic_interrupt(instance: nil, project: nil, zone: nil) ⇒ ::Google::Cloud::Compute::V1::SendDiagnosticInterruptInstanceResponse
Sends diagnostic interrupt to the instance.
2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 |
# File 'lib/google/cloud/compute/v1/instances/rest/client.rb', line 2368 def send_diagnostic_interrupt request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::SendDiagnosticInterruptInstanceRequest # 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.send_diagnostic_interrupt..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::Compute::V1::VERSION, transports_version_send: [:rest] [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id .apply_defaults timeout: @config.rpcs.send_diagnostic_interrupt.timeout, metadata: , retry_policy: @config.rpcs.send_diagnostic_interrupt.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @instances_stub.send_diagnostic_interrupt request, do |result, operation| yield result, operation if block_given? return result end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end |
#set_deletion_protection(request, options = nil) ⇒ ::Gapic::GenericLRO::Operation #set_deletion_protection(deletion_protection: nil, project: nil, request_id: nil, resource: nil, zone: nil) ⇒ ::Gapic::GenericLRO::Operation
Sets deletion protection on the instance.
2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 2472 2473 2474 2475 2476 2477 2478 2479 2480 2481 2482 2483 2484 2485 2486 2487 2488 2489 2490 2491 2492 2493 2494 2495 2496 2497 2498 |
# File 'lib/google/cloud/compute/v1/instances/rest/client.rb', line 2455 def set_deletion_protection request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::SetDeletionProtectionInstanceRequest # 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_deletion_protection..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::Compute::V1::VERSION, transports_version_send: [:rest] [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id .apply_defaults timeout: @config.rpcs.set_deletion_protection.timeout, metadata: , retry_policy: @config.rpcs.set_deletion_protection.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @instances_stub.set_deletion_protection request, do |result, response| result = ::Google::Cloud::Compute::V1::ZoneOperations::Rest::NonstandardLro.create_operation( operation: result, client: zone_operations, request_values: { "project" => request.project, "zone" => request.zone }, options: ) yield result, response if block_given? return result end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end |
#set_disk_auto_delete(request, options = nil) ⇒ ::Gapic::GenericLRO::Operation #set_disk_auto_delete(auto_delete: nil, device_name: nil, instance: nil, project: nil, request_id: nil, zone: nil) ⇒ ::Gapic::GenericLRO::Operation
Sets the auto-delete flag for a disk attached to an instance.
2553 2554 2555 2556 2557 2558 2559 2560 2561 2562 2563 2564 2565 2566 2567 2568 2569 2570 2571 2572 2573 2574 2575 2576 2577 2578 2579 2580 2581 2582 2583 2584 2585 2586 2587 2588 2589 2590 2591 2592 2593 2594 2595 2596 |
# File 'lib/google/cloud/compute/v1/instances/rest/client.rb', line 2553 def set_disk_auto_delete request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::SetDiskAutoDeleteInstanceRequest # 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_disk_auto_delete..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::Compute::V1::VERSION, transports_version_send: [:rest] [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id .apply_defaults timeout: @config.rpcs.set_disk_auto_delete.timeout, metadata: , retry_policy: @config.rpcs.set_disk_auto_delete.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @instances_stub.set_disk_auto_delete request, do |result, response| result = ::Google::Cloud::Compute::V1::ZoneOperations::Rest::NonstandardLro.create_operation( operation: result, client: zone_operations, request_values: { "project" => request.project, "zone" => request.zone }, options: ) yield result, response if block_given? return result end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end |
#set_iam_policy(request, options = nil) ⇒ ::Google::Cloud::Compute::V1::Policy #set_iam_policy(project: nil, resource: nil, zone: nil, zone_set_policy_request_resource: nil) ⇒ ::Google::Cloud::Compute::V1::Policy
Sets the access control policy on the specified resource. Replaces any existing policy.
2647 2648 2649 2650 2651 2652 2653 2654 2655 2656 2657 2658 2659 2660 2661 2662 2663 2664 2665 2666 2667 2668 2669 2670 2671 2672 2673 2674 2675 2676 2677 2678 2679 2680 2681 |
# File 'lib/google/cloud/compute/v1/instances/rest/client.rb', line 2647 def set_iam_policy request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::SetIamPolicyInstanceRequest # 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::Compute::V1::VERSION, transports_version_send: [:rest] [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id .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 @instances_stub.set_iam_policy request, do |result, operation| yield result, operation if block_given? return result end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end |
#set_labels(request, options = nil) ⇒ ::Gapic::GenericLRO::Operation #set_labels(instance: nil, instances_set_labels_request_resource: nil, project: nil, request_id: nil, zone: nil) ⇒ ::Gapic::GenericLRO::Operation
Sets labels on an instance. To learn more about labels, read the Labeling Resources documentation.
2734 2735 2736 2737 2738 2739 2740 2741 2742 2743 2744 2745 2746 2747 2748 2749 2750 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 |
# File 'lib/google/cloud/compute/v1/instances/rest/client.rb', line 2734 def set_labels request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::SetLabelsInstanceRequest # 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_labels..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::Compute::V1::VERSION, transports_version_send: [:rest] [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id .apply_defaults timeout: @config.rpcs.set_labels.timeout, metadata: , retry_policy: @config.rpcs.set_labels.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @instances_stub.set_labels request, do |result, response| result = ::Google::Cloud::Compute::V1::ZoneOperations::Rest::NonstandardLro.create_operation( operation: result, client: zone_operations, request_values: { "project" => request.project, "zone" => request.zone }, options: ) yield result, response if block_given? return result end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end |
#set_machine_resources(request, options = nil) ⇒ ::Gapic::GenericLRO::Operation #set_machine_resources(instance: nil, instances_set_machine_resources_request_resource: nil, project: nil, request_id: nil, zone: nil) ⇒ ::Gapic::GenericLRO::Operation
Changes the number and/or type of accelerator for a stopped instance to the values specified in the request.
2830 2831 2832 2833 2834 2835 2836 2837 2838 2839 2840 2841 2842 2843 2844 2845 2846 2847 2848 2849 2850 2851 2852 2853 2854 2855 2856 2857 2858 2859 2860 2861 2862 2863 2864 2865 2866 2867 2868 2869 2870 2871 2872 2873 |
# File 'lib/google/cloud/compute/v1/instances/rest/client.rb', line 2830 def set_machine_resources request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::SetMachineResourcesInstanceRequest # 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_machine_resources..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::Compute::V1::VERSION, transports_version_send: [:rest] [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id .apply_defaults timeout: @config.rpcs.set_machine_resources.timeout, metadata: , retry_policy: @config.rpcs.set_machine_resources.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @instances_stub.set_machine_resources request, do |result, response| result = ::Google::Cloud::Compute::V1::ZoneOperations::Rest::NonstandardLro.create_operation( operation: result, client: zone_operations, request_values: { "project" => request.project, "zone" => request.zone }, options: ) yield result, response if block_given? return result end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end |
#set_machine_type(request, options = nil) ⇒ ::Gapic::GenericLRO::Operation #set_machine_type(instance: nil, instances_set_machine_type_request_resource: nil, project: nil, request_id: nil, zone: nil) ⇒ ::Gapic::GenericLRO::Operation
Changes the machine type for a stopped instance to the machine type specified in the request.
2926 2927 2928 2929 2930 2931 2932 2933 2934 2935 2936 2937 2938 2939 2940 2941 2942 2943 2944 2945 2946 2947 2948 2949 2950 2951 2952 2953 2954 2955 2956 2957 2958 2959 2960 2961 2962 2963 2964 2965 2966 2967 2968 2969 |
# File 'lib/google/cloud/compute/v1/instances/rest/client.rb', line 2926 def set_machine_type request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::SetMachineTypeInstanceRequest # 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_machine_type..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::Compute::V1::VERSION, transports_version_send: [:rest] [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id .apply_defaults timeout: @config.rpcs.set_machine_type.timeout, metadata: , retry_policy: @config.rpcs.set_machine_type.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @instances_stub.set_machine_type request, do |result, response| result = ::Google::Cloud::Compute::V1::ZoneOperations::Rest::NonstandardLro.create_operation( operation: result, client: zone_operations, request_values: { "project" => request.project, "zone" => request.zone }, options: ) yield result, response if block_given? return result end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end |
#set_metadata(request, options = nil) ⇒ ::Gapic::GenericLRO::Operation #set_metadata(instance: nil, metadata_resource: nil, project: nil, request_id: nil, zone: nil) ⇒ ::Gapic::GenericLRO::Operation
Sets metadata for the specified instance to the data included in the request.
3022 3023 3024 3025 3026 3027 3028 3029 3030 3031 3032 3033 3034 3035 3036 3037 3038 3039 3040 3041 3042 3043 3044 3045 3046 3047 3048 3049 3050 3051 3052 3053 3054 3055 3056 3057 3058 3059 3060 3061 3062 3063 3064 3065 |
# File 'lib/google/cloud/compute/v1/instances/rest/client.rb', line 3022 def request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::SetMetadataInstanceRequest # 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::Compute::V1::VERSION, transports_version_send: [:rest] [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id .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 @instances_stub. request, do |result, response| result = ::Google::Cloud::Compute::V1::ZoneOperations::Rest::NonstandardLro.create_operation( operation: result, client: zone_operations, request_values: { "project" => request.project, "zone" => request.zone }, options: ) yield result, response if block_given? return result end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end |
#set_min_cpu_platform(request, options = nil) ⇒ ::Gapic::GenericLRO::Operation #set_min_cpu_platform(instance: nil, instances_set_min_cpu_platform_request_resource: nil, project: nil, request_id: nil, zone: nil) ⇒ ::Gapic::GenericLRO::Operation
Changes the minimum CPU platform that this instance should use. This method can only be called on a stopped instance. For more information, read Specifying a Minimum CPU Platform.
3118 3119 3120 3121 3122 3123 3124 3125 3126 3127 3128 3129 3130 3131 3132 3133 3134 3135 3136 3137 3138 3139 3140 3141 3142 3143 3144 3145 3146 3147 3148 3149 3150 3151 3152 3153 3154 3155 3156 3157 3158 3159 3160 3161 |
# File 'lib/google/cloud/compute/v1/instances/rest/client.rb', line 3118 def set_min_cpu_platform request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::SetMinCpuPlatformInstanceRequest # 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_min_cpu_platform..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::Compute::V1::VERSION, transports_version_send: [:rest] [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id .apply_defaults timeout: @config.rpcs.set_min_cpu_platform.timeout, metadata: , retry_policy: @config.rpcs.set_min_cpu_platform.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @instances_stub.set_min_cpu_platform request, do |result, response| result = ::Google::Cloud::Compute::V1::ZoneOperations::Rest::NonstandardLro.create_operation( operation: result, client: zone_operations, request_values: { "project" => request.project, "zone" => request.zone }, options: ) yield result, response if block_given? return result end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end |
#set_name(request, options = nil) ⇒ ::Gapic::GenericLRO::Operation #set_name(instance: nil, instances_set_name_request_resource: nil, project: nil, request_id: nil, zone: nil) ⇒ ::Gapic::GenericLRO::Operation
Sets name of an instance.
3214 3215 3216 3217 3218 3219 3220 3221 3222 3223 3224 3225 3226 3227 3228 3229 3230 3231 3232 3233 3234 3235 3236 3237 3238 3239 3240 3241 3242 3243 3244 3245 3246 3247 3248 3249 3250 3251 3252 3253 3254 3255 3256 3257 |
# File 'lib/google/cloud/compute/v1/instances/rest/client.rb', line 3214 def set_name request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::SetNameInstanceRequest # 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_name..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::Compute::V1::VERSION, transports_version_send: [:rest] [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id .apply_defaults timeout: @config.rpcs.set_name.timeout, metadata: , retry_policy: @config.rpcs.set_name.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @instances_stub.set_name request, do |result, response| result = ::Google::Cloud::Compute::V1::ZoneOperations::Rest::NonstandardLro.create_operation( operation: result, client: zone_operations, request_values: { "project" => request.project, "zone" => request.zone }, options: ) yield result, response if block_given? return result end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end |
#set_scheduling(request, options = nil) ⇒ ::Gapic::GenericLRO::Operation #set_scheduling(instance: nil, project: nil, request_id: nil, scheduling_resource: nil, zone: nil) ⇒ ::Gapic::GenericLRO::Operation
Sets an instance's scheduling options. You can only call this method on a stopped instance, that is, a VM instance that is in a TERMINATED
state. See Instance Life Cycle for more information on the possible instance states. For more information about setting scheduling options for a VM, see Set VM host maintenance policy.
3310 3311 3312 3313 3314 3315 3316 3317 3318 3319 3320 3321 3322 3323 3324 3325 3326 3327 3328 3329 3330 3331 3332 3333 3334 3335 3336 3337 3338 3339 3340 3341 3342 3343 3344 3345 3346 3347 3348 3349 3350 3351 3352 3353 |
# File 'lib/google/cloud/compute/v1/instances/rest/client.rb', line 3310 def set_scheduling request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::SetSchedulingInstanceRequest # 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_scheduling..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::Compute::V1::VERSION, transports_version_send: [:rest] [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id .apply_defaults timeout: @config.rpcs.set_scheduling.timeout, metadata: , retry_policy: @config.rpcs.set_scheduling.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @instances_stub.set_scheduling request, do |result, response| result = ::Google::Cloud::Compute::V1::ZoneOperations::Rest::NonstandardLro.create_operation( operation: result, client: zone_operations, request_values: { "project" => request.project, "zone" => request.zone }, options: ) yield result, response if block_given? return result end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end |
#set_security_policy(request, options = nil) ⇒ ::Gapic::GenericLRO::Operation #set_security_policy(instance: nil, instances_set_security_policy_request_resource: nil, project: nil, request_id: nil, zone: nil) ⇒ ::Gapic::GenericLRO::Operation
Sets the Google Cloud Armor security policy for the specified instance. For more information, see Google Cloud Armor Overview
3406 3407 3408 3409 3410 3411 3412 3413 3414 3415 3416 3417 3418 3419 3420 3421 3422 3423 3424 3425 3426 3427 3428 3429 3430 3431 3432 3433 3434 3435 3436 3437 3438 3439 3440 3441 3442 3443 3444 3445 3446 3447 3448 3449 |
# File 'lib/google/cloud/compute/v1/instances/rest/client.rb', line 3406 def set_security_policy request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::SetSecurityPolicyInstanceRequest # 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_security_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::Compute::V1::VERSION, transports_version_send: [:rest] [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id .apply_defaults timeout: @config.rpcs.set_security_policy.timeout, metadata: , retry_policy: @config.rpcs.set_security_policy.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @instances_stub.set_security_policy request, do |result, response| result = ::Google::Cloud::Compute::V1::ZoneOperations::Rest::NonstandardLro.create_operation( operation: result, client: zone_operations, request_values: { "project" => request.project, "zone" => request.zone }, options: ) yield result, response if block_given? return result end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end |
#set_service_account(request, options = nil) ⇒ ::Gapic::GenericLRO::Operation #set_service_account(instance: nil, instances_set_service_account_request_resource: nil, project: nil, request_id: nil, zone: nil) ⇒ ::Gapic::GenericLRO::Operation
Sets the service account on the instance. For more information, read Changing the service account and access scopes for an instance.
3502 3503 3504 3505 3506 3507 3508 3509 3510 3511 3512 3513 3514 3515 3516 3517 3518 3519 3520 3521 3522 3523 3524 3525 3526 3527 3528 3529 3530 3531 3532 3533 3534 3535 3536 3537 3538 3539 3540 3541 3542 3543 3544 3545 |
# File 'lib/google/cloud/compute/v1/instances/rest/client.rb', line 3502 def set_service_account request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::SetServiceAccountInstanceRequest # 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_service_account..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::Compute::V1::VERSION, transports_version_send: [:rest] [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id .apply_defaults timeout: @config.rpcs.set_service_account.timeout, metadata: , retry_policy: @config.rpcs.set_service_account.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @instances_stub.set_service_account request, do |result, response| result = ::Google::Cloud::Compute::V1::ZoneOperations::Rest::NonstandardLro.create_operation( operation: result, client: zone_operations, request_values: { "project" => request.project, "zone" => request.zone }, options: ) yield result, response if block_given? return result end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end |
#set_shielded_instance_integrity_policy(request, options = nil) ⇒ ::Gapic::GenericLRO::Operation #set_shielded_instance_integrity_policy(instance: nil, project: nil, request_id: nil, shielded_instance_integrity_policy_resource: nil, zone: nil) ⇒ ::Gapic::GenericLRO::Operation
Sets the Shielded Instance integrity policy for an instance. You can only use this method on a running instance. This method supports PATCH semantics and uses the JSON merge patch format and processing rules.
3598 3599 3600 3601 3602 3603 3604 3605 3606 3607 3608 3609 3610 3611 3612 3613 3614 3615 3616 3617 3618 3619 3620 3621 3622 3623 3624 3625 3626 3627 3628 3629 3630 3631 3632 3633 3634 3635 3636 3637 3638 3639 3640 3641 |
# File 'lib/google/cloud/compute/v1/instances/rest/client.rb', line 3598 def set_shielded_instance_integrity_policy request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::SetShieldedInstanceIntegrityPolicyInstanceRequest # 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_shielded_instance_integrity_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::Compute::V1::VERSION, transports_version_send: [:rest] [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id .apply_defaults timeout: @config.rpcs.set_shielded_instance_integrity_policy.timeout, metadata: , retry_policy: @config.rpcs.set_shielded_instance_integrity_policy.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @instances_stub.set_shielded_instance_integrity_policy request, do |result, response| result = ::Google::Cloud::Compute::V1::ZoneOperations::Rest::NonstandardLro.create_operation( operation: result, client: zone_operations, request_values: { "project" => request.project, "zone" => request.zone }, options: ) yield result, response if block_given? return result end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end |
#set_tags(request, options = nil) ⇒ ::Gapic::GenericLRO::Operation #set_tags(instance: nil, project: nil, request_id: nil, tags_resource: nil, zone: nil) ⇒ ::Gapic::GenericLRO::Operation
Sets network tags for the specified instance to the data included in the request.
3694 3695 3696 3697 3698 3699 3700 3701 3702 3703 3704 3705 3706 3707 3708 3709 3710 3711 3712 3713 3714 3715 3716 3717 3718 3719 3720 3721 3722 3723 3724 3725 3726 3727 3728 3729 3730 3731 3732 3733 3734 3735 3736 3737 |
# File 'lib/google/cloud/compute/v1/instances/rest/client.rb', line 3694 def request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::SetTagsInstanceRequest # 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::Compute::V1::VERSION, transports_version_send: [:rest] [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id .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 @instances_stub. request, do |result, response| result = ::Google::Cloud::Compute::V1::ZoneOperations::Rest::NonstandardLro.create_operation( operation: result, client: zone_operations, request_values: { "project" => request.project, "zone" => request.zone }, options: ) yield result, response if block_given? return result end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end |
#simulate_maintenance_event(request, options = nil) ⇒ ::Gapic::GenericLRO::Operation #simulate_maintenance_event(instance: nil, project: nil, request_id: nil, with_extended_notifications: nil, zone: nil) ⇒ ::Gapic::GenericLRO::Operation
Simulates a host maintenance event on a VM. For more information, see Simulate a host maintenance event.
3790 3791 3792 3793 3794 3795 3796 3797 3798 3799 3800 3801 3802 3803 3804 3805 3806 3807 3808 3809 3810 3811 3812 3813 3814 3815 3816 3817 3818 3819 3820 3821 3822 3823 3824 3825 3826 3827 3828 3829 3830 3831 3832 3833 |
# File 'lib/google/cloud/compute/v1/instances/rest/client.rb', line 3790 def simulate_maintenance_event request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::SimulateMaintenanceEventInstanceRequest # 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.simulate_maintenance_event..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::Compute::V1::VERSION, transports_version_send: [:rest] [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id .apply_defaults timeout: @config.rpcs.simulate_maintenance_event.timeout, metadata: , retry_policy: @config.rpcs.simulate_maintenance_event.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @instances_stub.simulate_maintenance_event request, do |result, response| result = ::Google::Cloud::Compute::V1::ZoneOperations::Rest::NonstandardLro.create_operation( operation: result, client: zone_operations, request_values: { "project" => request.project, "zone" => request.zone }, options: ) yield result, response if block_given? return result end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end |
#start(request, options = nil) ⇒ ::Gapic::GenericLRO::Operation #start(instance: nil, project: nil, request_id: nil, zone: nil) ⇒ ::Gapic::GenericLRO::Operation
Starts an instance that was stopped using the instances().stop method. For more information, see Restart an instance.
3884 3885 3886 3887 3888 3889 3890 3891 3892 3893 3894 3895 3896 3897 3898 3899 3900 3901 3902 3903 3904 3905 3906 3907 3908 3909 3910 3911 3912 3913 3914 3915 3916 3917 3918 3919 3920 3921 3922 3923 3924 3925 3926 3927 |
# File 'lib/google/cloud/compute/v1/instances/rest/client.rb', line 3884 def start request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::StartInstanceRequest # 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.start..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::Compute::V1::VERSION, transports_version_send: [:rest] [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id .apply_defaults timeout: @config.rpcs.start.timeout, metadata: , retry_policy: @config.rpcs.start.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @instances_stub.start request, do |result, response| result = ::Google::Cloud::Compute::V1::ZoneOperations::Rest::NonstandardLro.create_operation( operation: result, client: zone_operations, request_values: { "project" => request.project, "zone" => request.zone }, options: ) yield result, response if block_given? return result end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end |
#start_with_encryption_key(request, options = nil) ⇒ ::Gapic::GenericLRO::Operation #start_with_encryption_key(instance: nil, instances_start_with_encryption_key_request_resource: nil, project: nil, request_id: nil, zone: nil) ⇒ ::Gapic::GenericLRO::Operation
Starts an instance that was stopped using the instances().stop method. For more information, see Restart an instance.
3980 3981 3982 3983 3984 3985 3986 3987 3988 3989 3990 3991 3992 3993 3994 3995 3996 3997 3998 3999 4000 4001 4002 4003 4004 4005 4006 4007 4008 4009 4010 4011 4012 4013 4014 4015 4016 4017 4018 4019 4020 4021 4022 4023 |
# File 'lib/google/cloud/compute/v1/instances/rest/client.rb', line 3980 def start_with_encryption_key request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::StartWithEncryptionKeyInstanceRequest # 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.start_with_encryption_key..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::Compute::V1::VERSION, transports_version_send: [:rest] [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id .apply_defaults timeout: @config.rpcs.start_with_encryption_key.timeout, metadata: , retry_policy: @config.rpcs.start_with_encryption_key.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @instances_stub.start_with_encryption_key request, do |result, response| result = ::Google::Cloud::Compute::V1::ZoneOperations::Rest::NonstandardLro.create_operation( operation: result, client: zone_operations, request_values: { "project" => request.project, "zone" => request.zone }, options: ) yield result, response if block_given? return result end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end |
#stop(request, options = nil) ⇒ ::Gapic::GenericLRO::Operation #stop(discard_local_ssd: nil, instance: nil, project: nil, request_id: nil, zone: nil) ⇒ ::Gapic::GenericLRO::Operation
Stops a running instance, shutting it down cleanly, and allows you to restart the instance at a later time. Stopped instances do not incur VM usage charges while they are stopped. However, resources that the VM is using, such as persistent disks and static IP addresses, will continue to be charged until they are deleted. For more information, see Stopping an instance.
4076 4077 4078 4079 4080 4081 4082 4083 4084 4085 4086 4087 4088 4089 4090 4091 4092 4093 4094 4095 4096 4097 4098 4099 4100 4101 4102 4103 4104 4105 4106 4107 4108 4109 4110 4111 4112 4113 4114 4115 4116 4117 4118 4119 |
# File 'lib/google/cloud/compute/v1/instances/rest/client.rb', line 4076 def stop request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::StopInstanceRequest # 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.stop..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::Compute::V1::VERSION, transports_version_send: [:rest] [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id .apply_defaults timeout: @config.rpcs.stop.timeout, metadata: , retry_policy: @config.rpcs.stop.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @instances_stub.stop request, do |result, response| result = ::Google::Cloud::Compute::V1::ZoneOperations::Rest::NonstandardLro.create_operation( operation: result, client: zone_operations, request_values: { "project" => request.project, "zone" => request.zone }, options: ) yield result, response if block_given? return result end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end |
#suspend(request, options = nil) ⇒ ::Gapic::GenericLRO::Operation #suspend(discard_local_ssd: nil, instance: nil, project: nil, request_id: nil, zone: nil) ⇒ ::Gapic::GenericLRO::Operation
This method suspends a running instance, saving its state to persistent storage, and allows you to resume the instance at a later time. Suspended instances have no compute costs (cores or RAM), and incur only storage charges for the saved VM memory and localSSD data. Any charged resources the virtual machine was using, such as persistent disks and static IP addresses, will continue to be charged while the instance is suspended. For more information, see Suspending and resuming an instance.
4172 4173 4174 4175 4176 4177 4178 4179 4180 4181 4182 4183 4184 4185 4186 4187 4188 4189 4190 4191 4192 4193 4194 4195 4196 4197 4198 4199 4200 4201 4202 4203 4204 4205 4206 4207 4208 4209 4210 4211 4212 4213 4214 4215 |
# File 'lib/google/cloud/compute/v1/instances/rest/client.rb', line 4172 def suspend request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::SuspendInstanceRequest # 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.suspend..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::Compute::V1::VERSION, transports_version_send: [:rest] [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id .apply_defaults timeout: @config.rpcs.suspend.timeout, metadata: , retry_policy: @config.rpcs.suspend.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @instances_stub.suspend request, do |result, response| result = ::Google::Cloud::Compute::V1::ZoneOperations::Rest::NonstandardLro.create_operation( operation: result, client: zone_operations, request_values: { "project" => request.project, "zone" => request.zone }, options: ) yield result, response if block_given? return result end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end |
#test_iam_permissions(request, options = nil) ⇒ ::Google::Cloud::Compute::V1::TestPermissionsResponse #test_iam_permissions(project: nil, resource: nil, test_permissions_request_resource: nil, zone: nil) ⇒ ::Google::Cloud::Compute::V1::TestPermissionsResponse
Returns permissions that a caller has on the specified resource.
4266 4267 4268 4269 4270 4271 4272 4273 4274 4275 4276 4277 4278 4279 4280 4281 4282 4283 4284 4285 4286 4287 4288 4289 4290 4291 4292 4293 4294 4295 4296 4297 4298 4299 4300 |
# File 'lib/google/cloud/compute/v1/instances/rest/client.rb', line 4266 def request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::TestIamPermissionsInstanceRequest # 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::Compute::V1::VERSION, transports_version_send: [:rest] [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id .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 @instances_stub. request, do |result, operation| yield result, operation if block_given? return result end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end |
#universe_domain ⇒ String
The effective universe domain
231 232 233 |
# File 'lib/google/cloud/compute/v1/instances/rest/client.rb', line 231 def universe_domain @instances_stub.universe_domain end |
#update(request, options = nil) ⇒ ::Gapic::GenericLRO::Operation #update(instance: nil, instance_resource: nil, minimal_action: nil, most_disruptive_allowed_action: nil, project: nil, request_id: nil, zone: nil) ⇒ ::Gapic::GenericLRO::Operation
Updates an instance only if the necessary resources are available. This method can update only a specific set of instance properties. See Updating a running instance for a list of updatable instance properties.
4359 4360 4361 4362 4363 4364 4365 4366 4367 4368 4369 4370 4371 4372 4373 4374 4375 4376 4377 4378 4379 4380 4381 4382 4383 4384 4385 4386 4387 4388 4389 4390 4391 4392 4393 4394 4395 4396 4397 4398 4399 4400 4401 4402 |
# File 'lib/google/cloud/compute/v1/instances/rest/client.rb', line 4359 def update request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::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..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::Compute::V1::VERSION, transports_version_send: [:rest] [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id .apply_defaults timeout: @config.rpcs.update.timeout, metadata: , retry_policy: @config.rpcs.update.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @instances_stub.update request, do |result, response| result = ::Google::Cloud::Compute::V1::ZoneOperations::Rest::NonstandardLro.create_operation( operation: result, client: zone_operations, request_values: { "project" => request.project, "zone" => request.zone }, options: ) yield result, response if block_given? return result end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end |
#update_access_config(request, options = nil) ⇒ ::Gapic::GenericLRO::Operation #update_access_config(access_config_resource: nil, instance: nil, network_interface: nil, project: nil, request_id: nil, zone: nil) ⇒ ::Gapic::GenericLRO::Operation
Updates the specified access config from an instance's network interface with the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules.
4457 4458 4459 4460 4461 4462 4463 4464 4465 4466 4467 4468 4469 4470 4471 4472 4473 4474 4475 4476 4477 4478 4479 4480 4481 4482 4483 4484 4485 4486 4487 4488 4489 4490 4491 4492 4493 4494 4495 4496 4497 4498 4499 4500 |
# File 'lib/google/cloud/compute/v1/instances/rest/client.rb', line 4457 def update_access_config request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::UpdateAccessConfigInstanceRequest # 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_access_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::Compute::V1::VERSION, transports_version_send: [:rest] [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id .apply_defaults timeout: @config.rpcs.update_access_config.timeout, metadata: , retry_policy: @config.rpcs.update_access_config.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @instances_stub.update_access_config request, do |result, response| result = ::Google::Cloud::Compute::V1::ZoneOperations::Rest::NonstandardLro.create_operation( operation: result, client: zone_operations, request_values: { "project" => request.project, "zone" => request.zone }, options: ) yield result, response if block_given? return result end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end |
#update_display_device(request, options = nil) ⇒ ::Gapic::GenericLRO::Operation #update_display_device(display_device_resource: nil, instance: nil, project: nil, request_id: nil, zone: nil) ⇒ ::Gapic::GenericLRO::Operation
Updates the Display config for a VM instance. You can only use this method on a stopped VM instance. This method supports PATCH semantics and uses the JSON merge patch format and processing rules.
4553 4554 4555 4556 4557 4558 4559 4560 4561 4562 4563 4564 4565 4566 4567 4568 4569 4570 4571 4572 4573 4574 4575 4576 4577 4578 4579 4580 4581 4582 4583 4584 4585 4586 4587 4588 4589 4590 4591 4592 4593 4594 4595 4596 |
# File 'lib/google/cloud/compute/v1/instances/rest/client.rb', line 4553 def update_display_device request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::UpdateDisplayDeviceInstanceRequest # 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_display_device..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::Compute::V1::VERSION, transports_version_send: [:rest] [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id .apply_defaults timeout: @config.rpcs.update_display_device.timeout, metadata: , retry_policy: @config.rpcs.update_display_device.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @instances_stub.update_display_device request, do |result, response| result = ::Google::Cloud::Compute::V1::ZoneOperations::Rest::NonstandardLro.create_operation( operation: result, client: zone_operations, request_values: { "project" => request.project, "zone" => request.zone }, options: ) yield result, response if block_given? return result end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end |
#update_network_interface(request, options = nil) ⇒ ::Gapic::GenericLRO::Operation #update_network_interface(instance: nil, network_interface: nil, network_interface_resource: nil, project: nil, request_id: nil, zone: nil) ⇒ ::Gapic::GenericLRO::Operation
Updates an instance's network interface. This method can only update an interface's alias IP range and attached network. See Modifying alias IP ranges for an existing instance for instructions on changing alias IP ranges. See Migrating a VM between networks for instructions on migrating an interface. This method follows PATCH semantics.
4651 4652 4653 4654 4655 4656 4657 4658 4659 4660 4661 4662 4663 4664 4665 4666 4667 4668 4669 4670 4671 4672 4673 4674 4675 4676 4677 4678 4679 4680 4681 4682 4683 4684 4685 4686 4687 4688 4689 4690 4691 4692 4693 4694 |
# File 'lib/google/cloud/compute/v1/instances/rest/client.rb', line 4651 def update_network_interface request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::UpdateNetworkInterfaceInstanceRequest # 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_network_interface..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::Compute::V1::VERSION, transports_version_send: [:rest] [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id .apply_defaults timeout: @config.rpcs.update_network_interface.timeout, metadata: , retry_policy: @config.rpcs.update_network_interface.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @instances_stub.update_network_interface request, do |result, response| result = ::Google::Cloud::Compute::V1::ZoneOperations::Rest::NonstandardLro.create_operation( operation: result, client: zone_operations, request_values: { "project" => request.project, "zone" => request.zone }, options: ) yield result, response if block_given? return result end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end |
#update_shielded_instance_config(request, options = nil) ⇒ ::Gapic::GenericLRO::Operation #update_shielded_instance_config(instance: nil, project: nil, request_id: nil, shielded_instance_config_resource: nil, zone: nil) ⇒ ::Gapic::GenericLRO::Operation
Updates the Shielded Instance config for an instance. You can only use this method on a stopped instance. This method supports PATCH semantics and uses the JSON merge patch format and processing rules.
4747 4748 4749 4750 4751 4752 4753 4754 4755 4756 4757 4758 4759 4760 4761 4762 4763 4764 4765 4766 4767 4768 4769 4770 4771 4772 4773 4774 4775 4776 4777 4778 4779 4780 4781 4782 4783 4784 4785 4786 4787 4788 4789 4790 |
# File 'lib/google/cloud/compute/v1/instances/rest/client.rb', line 4747 def update_shielded_instance_config request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::UpdateShieldedInstanceConfigInstanceRequest # 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_shielded_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::Compute::V1::VERSION, transports_version_send: [:rest] [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id .apply_defaults timeout: @config.rpcs.update_shielded_instance_config.timeout, metadata: , retry_policy: @config.rpcs.update_shielded_instance_config.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @instances_stub.update_shielded_instance_config request, do |result, response| result = ::Google::Cloud::Compute::V1::ZoneOperations::Rest::NonstandardLro.create_operation( operation: result, client: zone_operations, request_values: { "project" => request.project, "zone" => request.zone }, options: ) yield result, response if block_given? return result end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end |