Class: Google::Cloud::Compute::V1::InstanceGroupManagers::Rest::Client
- Inherits:
-
Object
- Object
- Google::Cloud::Compute::V1::InstanceGroupManagers::Rest::Client
- Defined in:
- lib/google/cloud/compute/v1/instance_group_managers/rest/client.rb
Overview
REST client for the InstanceGroupManagers service.
The InstanceGroupManagers 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 InstanceGroupManagers Client class.
Instance Method Summary collapse
-
#abandon_instances(request, options = nil) {|result, operation| ... } ⇒ ::Gapic::GenericLRO::Operation
Flags the specified instances to be removed from the managed instance group.
-
#aggregated_list(request, options = nil) {|result, operation| ... } ⇒ ::Gapic::Rest::PagedEnumerable<::String, ::Google::Cloud::Compute::V1::InstanceGroupManagersScopedList>
Retrieves the list of managed instance groups and groups them by zone.
-
#apply_updates_to_instances(request, options = nil) {|result, operation| ... } ⇒ ::Gapic::GenericLRO::Operation
Applies changes to selected instances on the managed instance group.
-
#configure {|config| ... } ⇒ Client::Configuration
Configure the InstanceGroupManagers Client instance.
-
#create_instances(request, options = nil) {|result, operation| ... } ⇒ ::Gapic::GenericLRO::Operation
Creates instances with per-instance configurations in this managed instance group.
-
#delete(request, options = nil) {|result, operation| ... } ⇒ ::Gapic::GenericLRO::Operation
Deletes the specified managed instance group and all of the instances in that group.
-
#delete_instances(request, options = nil) {|result, operation| ... } ⇒ ::Gapic::GenericLRO::Operation
Flags the specified instances in the managed instance group for immediate deletion.
-
#delete_per_instance_configs(request, options = nil) {|result, operation| ... } ⇒ ::Gapic::GenericLRO::Operation
Deletes selected per-instance configurations for the managed instance group.
-
#get(request, options = nil) {|result, operation| ... } ⇒ ::Google::Cloud::Compute::V1::InstanceGroupManager
Returns all of the details about the specified managed instance group.
-
#initialize {|config| ... } ⇒ Client
constructor
Create a new InstanceGroupManagers REST client object.
-
#insert(request, options = nil) {|result, operation| ... } ⇒ ::Gapic::GenericLRO::Operation
Creates a managed instance group using the information that you specify in the request.
-
#list(request, options = nil) {|result, operation| ... } ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Compute::V1::InstanceGroupManager>
Retrieves a list of managed instance groups that are contained within the specified project and zone.
-
#list_errors(request, options = nil) {|result, operation| ... } ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Compute::V1::InstanceManagedByIgmError>
Lists all errors thrown by actions on instances for a given managed instance group.
-
#list_managed_instances(request, options = nil) {|result, operation| ... } ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Compute::V1::ManagedInstance>
Lists all of the instances in the managed instance group.
-
#list_per_instance_configs(request, options = nil) {|result, operation| ... } ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Compute::V1::PerInstanceConfig>
Lists all of the per-instance configurations defined for the managed instance group.
-
#logger ⇒ Logger
The logger used for request/response debug logging.
-
#patch(request, options = nil) {|result, operation| ... } ⇒ ::Gapic::GenericLRO::Operation
Updates a managed instance group using the information that you specify in the request.
-
#patch_per_instance_configs(request, options = nil) {|result, operation| ... } ⇒ ::Gapic::GenericLRO::Operation
Inserts or patches per-instance configurations for the managed instance group.
-
#recreate_instances(request, options = nil) {|result, operation| ... } ⇒ ::Gapic::GenericLRO::Operation
Flags the specified VM instances in the managed instance group to be immediately recreated.
-
#resize(request, options = nil) {|result, operation| ... } ⇒ ::Gapic::GenericLRO::Operation
Resizes the managed instance group.
-
#resume_instances(request, options = nil) {|result, operation| ... } ⇒ ::Gapic::GenericLRO::Operation
Flags the specified instances in the managed instance group to be resumed.
-
#set_instance_template(request, options = nil) {|result, operation| ... } ⇒ ::Gapic::GenericLRO::Operation
Specifies the instance template to use when creating new instances in this group.
-
#set_target_pools(request, options = nil) {|result, operation| ... } ⇒ ::Gapic::GenericLRO::Operation
Modifies the target pools to which all instances in this managed instance group are assigned.
-
#start_instances(request, options = nil) {|result, operation| ... } ⇒ ::Gapic::GenericLRO::Operation
Flags the specified instances in the managed instance group to be started.
-
#stop_instances(request, options = nil) {|result, operation| ... } ⇒ ::Gapic::GenericLRO::Operation
Flags the specified instances in the managed instance group to be immediately stopped.
-
#suspend_instances(request, options = nil) {|result, operation| ... } ⇒ ::Gapic::GenericLRO::Operation
Flags the specified instances in the managed instance group to be immediately suspended.
-
#universe_domain ⇒ String
The effective universe domain.
-
#update_per_instance_configs(request, options = nil) {|result, operation| ... } ⇒ ::Gapic::GenericLRO::Operation
Inserts or updates per-instance configurations for the managed instance group.
Constructor Details
#initialize {|config| ... } ⇒ Client
Create a new InstanceGroupManagers REST client object.
185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 |
# File 'lib/google/cloud/compute/v1/instance_group_managers/rest/client.rb', line 185 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 @instance_group_managers_stub = ::Google::Cloud::Compute::V1::InstanceGroupManagers::Rest::ServiceStub.new( endpoint: @config.endpoint, endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, universe_domain: @config.universe_domain, credentials: credentials, logger: @config.logger ) @instance_group_managers_stub.logger(stub: true)&.info do |entry| entry.set_system_name entry.set_service entry. = "Created client for #{entry.service}" entry.set_credentials_fields credentials entry.set "customEndpoint", @config.endpoint if @config.endpoint entry.set "defaultTimeout", @config.timeout if @config.timeout entry.set "quotaProject", @quota_project_id if @quota_project_id end end |
Instance Attribute Details
#zone_operations ⇒ ::Google::Cloud::Compute::V1::ZoneOperations::Rest::Client (readonly)
Get the associated client for long-running operations via ZoneOperations.
239 240 241 |
# File 'lib/google/cloud/compute/v1/instance_group_managers/rest/client.rb', line 239 def zone_operations @zone_operations end |
Class Method Details
.configure {|config| ... } ⇒ Client::Configuration
Configure the InstanceGroupManagers 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 |
# File 'lib/google/cloud/compute/v1/instance_group_managers/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.abandon_instances.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.apply_updates_to_instances.timeout = 600.0 default_config.rpcs.create_instances.timeout = 600.0 default_config.rpcs.delete.timeout = 600.0 default_config.rpcs.delete_instances.timeout = 600.0 default_config.rpcs.delete_per_instance_configs.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.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_errors.timeout = 600.0 default_config.rpcs.list_errors.retry_policy = { initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] } default_config.rpcs.list_managed_instances.timeout = 600.0 default_config.rpcs.list_per_instance_configs.timeout = 600.0 default_config.rpcs.patch.timeout = 600.0 default_config.rpcs.patch_per_instance_configs.timeout = 600.0 default_config.rpcs.recreate_instances.timeout = 600.0 default_config.rpcs.resize.timeout = 600.0 default_config.rpcs.resume_instances.timeout = 600.0 default_config.rpcs.set_instance_template.timeout = 600.0 default_config.rpcs.set_target_pools.timeout = 600.0 default_config.rpcs.start_instances.timeout = 600.0 default_config.rpcs.stop_instances.timeout = 600.0 default_config.rpcs.suspend_instances.timeout = 600.0 default_config.rpcs.update_per_instance_configs.timeout = 600.0 default_config end yield @configure if block_given? @configure end |
Instance Method Details
#abandon_instances(request, options = nil) ⇒ ::Gapic::GenericLRO::Operation #abandon_instances(instance_group_manager: nil, instance_group_managers_abandon_instances_request_resource: nil, project: nil, request_id: nil, zone: nil) ⇒ ::Gapic::GenericLRO::Operation
Flags the specified instances to be removed from the managed instance group. Abandoning an instance does not delete the instance, but it does remove the instance from any target pools that are applied by the managed instance group. This method reduces the targetSize of the managed instance group by the number of instances that you abandon. This operation is marked as DONE when the action is scheduled even if the instances have not yet been removed from the group. You must separately verify the status of the abandoning action with the listmanagedinstances method. If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted. You can specify a maximum of 1000 instances with this method per request.
303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 |
# File 'lib/google/cloud/compute/v1/instance_group_managers/rest/client.rb', line 303 def abandon_instances request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::AbandonInstancesInstanceGroupManagerRequest # 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.abandon_instances..to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::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.abandon_instances.timeout, metadata: , retry_policy: @config.rpcs.abandon_instances.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @instance_group_managers_stub.abandon_instances 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? throw :response, 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::InstanceGroupManagersScopedList> #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::InstanceGroupManagersScopedList>
Retrieves the list of managed instance groups and groups them by zone. To prevent failure, Google recommends that you set the returnPartialSuccess
parameter to true
.
405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 |
# File 'lib/google/cloud/compute/v1/instance_group_managers/rest/client.rb', line 405 def aggregated_list request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::AggregatedListInstanceGroupManagersRequest # 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 @instance_group_managers_stub.aggregated_list request, do |result, operation| result = ::Gapic::Rest::PagedEnumerable.new @instance_group_managers_stub, :aggregated_list, "items", request, result, yield result, operation if block_given? throw :response, result end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end |
#apply_updates_to_instances(request, options = nil) ⇒ ::Gapic::GenericLRO::Operation #apply_updates_to_instances(instance_group_manager: nil, instance_group_managers_apply_updates_request_resource: nil, project: nil, zone: nil) ⇒ ::Gapic::GenericLRO::Operation
Applies changes to selected instances on the managed instance group. This method can be used to apply new overrides and/or new versions.
491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 |
# File 'lib/google/cloud/compute/v1/instance_group_managers/rest/client.rb', line 491 def apply_updates_to_instances request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::ApplyUpdatesToInstancesInstanceGroupManagerRequest # 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.apply_updates_to_instances..to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::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.apply_updates_to_instances.timeout, metadata: , retry_policy: @config.rpcs.apply_updates_to_instances.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @instance_group_managers_stub.apply_updates_to_instances 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? throw :response, result end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end |
#configure {|config| ... } ⇒ Client::Configuration
Configure the InstanceGroupManagers 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.
155 156 157 158 |
# File 'lib/google/cloud/compute/v1/instance_group_managers/rest/client.rb', line 155 def configure yield @config if block_given? @config end |
#create_instances(request, options = nil) ⇒ ::Gapic::GenericLRO::Operation #create_instances(instance_group_manager: nil, instance_group_managers_create_instances_request_resource: nil, project: nil, request_id: nil, zone: nil) ⇒ ::Gapic::GenericLRO::Operation
Creates instances with per-instance configurations in this managed instance group. Instances are created using the current instance template. The create instances operation is marked DONE if the createInstances request is successful. The underlying actions take additional time. You must separately verify the status of the creating or actions with the listmanagedinstances method.
587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 |
# File 'lib/google/cloud/compute/v1/instance_group_managers/rest/client.rb', line 587 def create_instances request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::CreateInstancesInstanceGroupManagerRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.create_instances..to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::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.create_instances.timeout, metadata: , retry_policy: @config.rpcs.create_instances.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @instance_group_managers_stub.create_instances 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? throw :response, result end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end |
#delete(request, options = nil) ⇒ ::Gapic::GenericLRO::Operation #delete(instance_group_manager: nil, project: nil, request_id: nil, zone: nil) ⇒ ::Gapic::GenericLRO::Operation
Deletes the specified managed instance group and all of the instances in that group. Note that the instance group must not belong to a backend service. Read Deleting an instance group for more information.
681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 |
# File 'lib/google/cloud/compute/v1/instance_group_managers/rest/client.rb', line 681 def delete request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::DeleteInstanceGroupManagerRequest # 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 @instance_group_managers_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? throw :response, result end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end |
#delete_instances(request, options = nil) ⇒ ::Gapic::GenericLRO::Operation #delete_instances(instance_group_manager: nil, instance_group_managers_delete_instances_request_resource: nil, project: nil, request_id: nil, zone: nil) ⇒ ::Gapic::GenericLRO::Operation
Flags the specified instances in the managed instance group for immediate deletion. The instances are also removed from any target pools of which they were a member. This method reduces the targetSize of the managed instance group by the number of instances that you delete. This operation is marked as DONE when the action is scheduled even if the instances are still being deleted. You must separately verify the status of the deleting action with the listmanagedinstances method. If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted. You can specify a maximum of 1000 instances with this method per request.
777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 |
# File 'lib/google/cloud/compute/v1/instance_group_managers/rest/client.rb', line 777 def delete_instances request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::DeleteInstancesInstanceGroupManagerRequest # 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_instances..to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::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_instances.timeout, metadata: , retry_policy: @config.rpcs.delete_instances.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @instance_group_managers_stub.delete_instances 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? throw :response, result end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end |
#delete_per_instance_configs(request, options = nil) ⇒ ::Gapic::GenericLRO::Operation #delete_per_instance_configs(instance_group_manager: nil, instance_group_managers_delete_per_instance_configs_req_resource: nil, project: nil, zone: nil) ⇒ ::Gapic::GenericLRO::Operation
Deletes selected per-instance configurations for the managed instance group.
871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 |
# File 'lib/google/cloud/compute/v1/instance_group_managers/rest/client.rb', line 871 def delete_per_instance_configs request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::DeletePerInstanceConfigsInstanceGroupManagerRequest # 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_per_instance_configs..to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::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_per_instance_configs.timeout, metadata: , retry_policy: @config.rpcs.delete_per_instance_configs.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @instance_group_managers_stub.delete_per_instance_configs 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? throw :response, result end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end |
#get(request, options = nil) ⇒ ::Google::Cloud::Compute::V1::InstanceGroupManager #get(instance_group_manager: nil, project: nil, zone: nil) ⇒ ::Google::Cloud::Compute::V1::InstanceGroupManager
Returns all of the details about the specified managed instance group.
963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 |
# File 'lib/google/cloud/compute/v1/instance_group_managers/rest/client.rb', line 963 def get request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::GetInstanceGroupManagerRequest # 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 @instance_group_managers_stub.get request, do |result, operation| yield result, operation if block_given? end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end |
#insert(request, options = nil) ⇒ ::Gapic::GenericLRO::Operation #insert(instance_group_manager_resource: nil, project: nil, request_id: nil, zone: nil) ⇒ ::Gapic::GenericLRO::Operation
Creates a managed instance group using the information that you specify in the request. After the group is created, instances in the group are created using the specified instance template. This operation is marked as DONE when the group is created even if the instances in the group have not yet been created. You must separately verify the status of the individual instances with the listmanagedinstances method. A managed instance group can have up to 1000 VM instances per group. Please contact Cloud Support if you need an increase in this limit.
1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 |
# File 'lib/google/cloud/compute/v1/instance_group_managers/rest/client.rb', line 1047 def insert request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::InsertInstanceGroupManagerRequest # 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 @instance_group_managers_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? throw :response, 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::InstanceGroupManager> #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::InstanceGroupManager>
Retrieves a list of managed instance groups that are contained within the specified project and zone.
1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 |
# File 'lib/google/cloud/compute/v1/instance_group_managers/rest/client.rb', line 1147 def list request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::ListInstanceGroupManagersRequest # 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 @instance_group_managers_stub.list request, do |result, operation| result = ::Gapic::Rest::PagedEnumerable.new @instance_group_managers_stub, :list, "items", request, result, yield result, operation if block_given? throw :response, result end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end |
#list_errors(request, options = nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Compute::V1::InstanceManagedByIgmError> #list_errors(filter: nil, instance_group_manager: 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::InstanceManagedByIgmError>
Lists all errors thrown by actions on instances for a given managed instance group. The filter and orderBy query parameters are not supported.
1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 |
# File 'lib/google/cloud/compute/v1/instance_group_managers/rest/client.rb', line 1241 def list_errors request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::ListErrorsInstanceGroupManagersRequest # 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_errors..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_errors.timeout, metadata: , retry_policy: @config.rpcs.list_errors.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @instance_group_managers_stub.list_errors request, do |result, operation| result = ::Gapic::Rest::PagedEnumerable.new @instance_group_managers_stub, :list_errors, "items", request, result, yield result, operation if block_given? throw :response, result end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end |
#list_managed_instances(request, options = nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Compute::V1::ManagedInstance> #list_managed_instances(filter: nil, instance_group_manager: 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::ManagedInstance>
Lists all of the instances in the managed instance group. Each instance in the list has a currentAction, which indicates the action that the managed instance group is performing on the instance. For example, if the group is still creating an instance, the currentAction is CREATING. If a previous action failed, the list displays the errors for that failed action. The orderBy query parameter is not supported. The pageToken
query parameter is supported only if the group's listManagedInstancesResults
field is set to PAGINATED
.
1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 |
# File 'lib/google/cloud/compute/v1/instance_group_managers/rest/client.rb', line 1335 def list_managed_instances request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::ListManagedInstancesInstanceGroupManagersRequest # 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_managed_instances..to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::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_managed_instances.timeout, metadata: , retry_policy: @config.rpcs.list_managed_instances.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @instance_group_managers_stub.list_managed_instances request, do |result, operation| result = ::Gapic::Rest::PagedEnumerable.new @instance_group_managers_stub, :list_managed_instances, "managed_instances", request, result, yield result, operation if block_given? throw :response, result end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end |
#list_per_instance_configs(request, options = nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Compute::V1::PerInstanceConfig> #list_per_instance_configs(filter: nil, instance_group_manager: 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::PerInstanceConfig>
Lists all of the per-instance configurations defined for the managed instance group. The orderBy query parameter is not supported.
1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 |
# File 'lib/google/cloud/compute/v1/instance_group_managers/rest/client.rb', line 1429 def list_per_instance_configs request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::ListPerInstanceConfigsInstanceGroupManagersRequest # 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_per_instance_configs..to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::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_per_instance_configs.timeout, metadata: , retry_policy: @config.rpcs.list_per_instance_configs.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @instance_group_managers_stub.list_per_instance_configs request, do |result, operation| result = ::Gapic::Rest::PagedEnumerable.new @instance_group_managers_stub, :list_per_instance_configs, "items", request, result, yield result, operation if block_given? throw :response, result end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end |
#logger ⇒ Logger
The logger used for request/response debug logging.
246 247 248 |
# File 'lib/google/cloud/compute/v1/instance_group_managers/rest/client.rb', line 246 def logger @instance_group_managers_stub.logger end |
#patch(request, options = nil) ⇒ ::Gapic::GenericLRO::Operation #patch(instance_group_manager: nil, instance_group_manager_resource: nil, project: nil, request_id: nil, zone: nil) ⇒ ::Gapic::GenericLRO::Operation
Updates a managed instance group using the information that you specify in the request. This operation is marked as DONE when the group is patched even if the instances in the group are still in the process of being patched. You must separately verify the status of the individual instances with the listManagedInstances method. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. If you update your group to specify a new template or instance configuration, it's possible that your intended specification for each VM in the group is different from the current state of that VM. To learn how to apply an updated configuration to the VMs in a MIG, see Updating instances in a MIG.
1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 |
# File 'lib/google/cloud/compute/v1/instance_group_managers/rest/client.rb', line 1517 def patch request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::PatchInstanceGroupManagerRequest # 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.patch..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.patch.timeout, metadata: , retry_policy: @config.rpcs.patch.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @instance_group_managers_stub.patch 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? throw :response, result end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end |
#patch_per_instance_configs(request, options = nil) ⇒ ::Gapic::GenericLRO::Operation #patch_per_instance_configs(instance_group_manager: nil, instance_group_managers_patch_per_instance_configs_req_resource: nil, project: nil, request_id: nil, zone: nil) ⇒ ::Gapic::GenericLRO::Operation
Inserts or patches per-instance configurations for the managed instance group. perInstanceConfig.name serves as a key used to distinguish whether to perform insert or patch.
1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 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 |
# File 'lib/google/cloud/compute/v1/instance_group_managers/rest/client.rb', line 1613 def patch_per_instance_configs request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::PatchPerInstanceConfigsInstanceGroupManagerRequest # 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.patch_per_instance_configs..to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::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.patch_per_instance_configs.timeout, metadata: , retry_policy: @config.rpcs.patch_per_instance_configs.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @instance_group_managers_stub.patch_per_instance_configs 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? throw :response, result end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end |
#recreate_instances(request, options = nil) ⇒ ::Gapic::GenericLRO::Operation #recreate_instances(instance_group_manager: nil, instance_group_managers_recreate_instances_request_resource: nil, project: nil, request_id: nil, zone: nil) ⇒ ::Gapic::GenericLRO::Operation
Flags the specified VM instances in the managed instance group to be immediately recreated. Each instance is recreated using the group's current configuration. This operation is marked as DONE when the flag is set even if the instances have not yet been recreated. You must separately verify the status of each instance by checking its currentAction field; for more information, see Checking the status of managed instances. If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted. You can specify a maximum of 1000 instances with this method per request.
1709 1710 1711 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 |
# File 'lib/google/cloud/compute/v1/instance_group_managers/rest/client.rb', line 1709 def recreate_instances request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::RecreateInstancesInstanceGroupManagerRequest # 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.recreate_instances..to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::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.recreate_instances.timeout, metadata: , retry_policy: @config.rpcs.recreate_instances.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @instance_group_managers_stub.recreate_instances 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? throw :response, result end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end |
#resize(request, options = nil) ⇒ ::Gapic::GenericLRO::Operation #resize(instance_group_manager: nil, project: nil, request_id: nil, size: nil, zone: nil) ⇒ ::Gapic::GenericLRO::Operation
Resizes the managed instance group. If you increase the size, the group creates new instances using the current instance template. If you decrease the size, the group deletes instances. The resize operation is marked DONE when the resize actions are scheduled even if the group has not yet added or deleted any instances. You must separately verify the status of the creating or deleting actions with the listmanagedinstances method. When resizing down, the instance group arbitrarily chooses the order in which VMs are deleted. The group takes into account some VM attributes when making the selection including: + The status of the VM instance. + The health of the VM instance. + The instance template version the VM is based on. + For regional managed instance groups, the location of the VM instance. This list is subject to change. If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted.
1805 1806 1807 1808 1809 1810 1811 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 1848 |
# File 'lib/google/cloud/compute/v1/instance_group_managers/rest/client.rb', line 1805 def resize request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::ResizeInstanceGroupManagerRequest # 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.resize..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.resize.timeout, metadata: , retry_policy: @config.rpcs.resize.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @instance_group_managers_stub.resize 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? throw :response, result end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end |
#resume_instances(request, options = nil) ⇒ ::Gapic::GenericLRO::Operation #resume_instances(instance_group_manager: nil, instance_group_managers_resume_instances_request_resource: nil, project: nil, request_id: nil, zone: nil) ⇒ ::Gapic::GenericLRO::Operation
Flags the specified instances in the managed instance group to be resumed. This method increases the targetSize and decreases the targetSuspendedSize of the managed instance group by the number of instances that you resume. The resumeInstances operation is marked DONE if the resumeInstances request is successful. The underlying actions take additional time. You must separately verify the status of the RESUMING action with the listmanagedinstances method. In this request, you can only specify instances that are suspended. For example, if an instance was previously suspended using the suspendInstances method, it can be resumed using the resumeInstances method. If a health check is attached to the managed instance group, the specified instances will be verified as healthy after they are resumed. You can specify a maximum of 1000 instances with this method per request.
1901 1902 1903 1904 1905 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 1942 1943 1944 |
# File 'lib/google/cloud/compute/v1/instance_group_managers/rest/client.rb', line 1901 def resume_instances request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::ResumeInstancesInstanceGroupManagerRequest # 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_instances..to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::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_instances.timeout, metadata: , retry_policy: @config.rpcs.resume_instances.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @instance_group_managers_stub.resume_instances 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? throw :response, result end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end |
#set_instance_template(request, options = nil) ⇒ ::Gapic::GenericLRO::Operation #set_instance_template(instance_group_manager: nil, instance_group_managers_set_instance_template_request_resource: nil, project: nil, request_id: nil, zone: nil) ⇒ ::Gapic::GenericLRO::Operation
Specifies the instance template to use when creating new instances in this group. The templates for existing instances in the group do not change unless you run recreateInstances, run applyUpdatesToInstances, or set the group's updatePolicy.type to PROACTIVE.
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 2036 2037 2038 2039 2040 |
# File 'lib/google/cloud/compute/v1/instance_group_managers/rest/client.rb', line 1997 def set_instance_template request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::SetInstanceTemplateInstanceGroupManagerRequest # 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_instance_template..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_instance_template.timeout, metadata: , retry_policy: @config.rpcs.set_instance_template.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @instance_group_managers_stub.set_instance_template 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? throw :response, result end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end |
#set_target_pools(request, options = nil) ⇒ ::Gapic::GenericLRO::Operation #set_target_pools(instance_group_manager: nil, instance_group_managers_set_target_pools_request_resource: nil, project: nil, request_id: nil, zone: nil) ⇒ ::Gapic::GenericLRO::Operation
Modifies the target pools to which all instances in this managed instance group are assigned. The target pools automatically apply to all of the instances in the managed instance group. This operation is marked DONE when you make the request even if the instances have not yet been added to their target pools. The change might take some time to apply to all of the instances in the group depending on the size of the group.
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 2132 2133 2134 2135 2136 |
# File 'lib/google/cloud/compute/v1/instance_group_managers/rest/client.rb', line 2093 def set_target_pools request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::SetTargetPoolsInstanceGroupManagerRequest # 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_target_pools..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_target_pools.timeout, metadata: , retry_policy: @config.rpcs.set_target_pools.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @instance_group_managers_stub.set_target_pools 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? throw :response, result end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end |
#start_instances(request, options = nil) ⇒ ::Gapic::GenericLRO::Operation #start_instances(instance_group_manager: nil, instance_group_managers_start_instances_request_resource: nil, project: nil, request_id: nil, zone: nil) ⇒ ::Gapic::GenericLRO::Operation
Flags the specified instances in the managed instance group to be started. This method increases the targetSize and decreases the targetStoppedSize of the managed instance group by the number of instances that you start. The startInstances operation is marked DONE if the startInstances request is successful. The underlying actions take additional time. You must separately verify the status of the STARTING action with the listmanagedinstances method. In this request, you can only specify instances that are stopped. For example, if an instance was previously stopped using the stopInstances method, it can be started using the startInstances method. If a health check is attached to the managed instance group, the specified instances will be verified as healthy after they are started. You can specify a maximum of 1000 instances with this method per request.
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 2226 2227 2228 2229 2230 2231 2232 |
# File 'lib/google/cloud/compute/v1/instance_group_managers/rest/client.rb', line 2189 def start_instances request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::StartInstancesInstanceGroupManagerRequest # 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_instances..to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::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_instances.timeout, metadata: , retry_policy: @config.rpcs.start_instances.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @instance_group_managers_stub.start_instances 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? throw :response, result end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end |
#stop_instances(request, options = nil) ⇒ ::Gapic::GenericLRO::Operation #stop_instances(instance_group_manager: nil, instance_group_managers_stop_instances_request_resource: nil, project: nil, request_id: nil, zone: nil) ⇒ ::Gapic::GenericLRO::Operation
Flags the specified instances in the managed instance group to be immediately stopped. You can only specify instances that are running in this request. This method reduces the targetSize and increases the targetStoppedSize of the managed instance group by the number of instances that you stop. The stopInstances operation is marked DONE if the stopInstances request is successful. The underlying actions take additional time. You must separately verify the status of the STOPPING action with the listmanagedinstances method. If the standbyPolicy.initialDelaySec field is set, the group delays stopping the instances until initialDelaySec have passed from instance.creationTimestamp (that is, when the instance was created). This delay gives your application time to set itself up and initialize on the instance. If more than initialDelaySec seconds have passed since instance.creationTimestamp when this method is called, there will be zero delay. If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is stopped. Stopped instances can be started using the startInstances method. You can specify a maximum of 1000 instances with this method per request.
2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 |
# File 'lib/google/cloud/compute/v1/instance_group_managers/rest/client.rb', line 2285 def stop_instances request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::StopInstancesInstanceGroupManagerRequest # 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_instances..to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::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_instances.timeout, metadata: , retry_policy: @config.rpcs.stop_instances.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @instance_group_managers_stub.stop_instances 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? throw :response, result end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end |
#suspend_instances(request, options = nil) ⇒ ::Gapic::GenericLRO::Operation #suspend_instances(instance_group_manager: nil, instance_group_managers_suspend_instances_request_resource: nil, project: nil, request_id: nil, zone: nil) ⇒ ::Gapic::GenericLRO::Operation
Flags the specified instances in the managed instance group to be immediately suspended. You can only specify instances that are running in this request. This method reduces the targetSize and increases the targetSuspendedSize of the managed instance group by the number of instances that you suspend. The suspendInstances operation is marked DONE if the suspendInstances request is successful. The underlying actions take additional time. You must separately verify the status of the SUSPENDING action with the listmanagedinstances method. If the standbyPolicy.initialDelaySec field is set, the group delays suspension of the instances until initialDelaySec have passed from instance.creationTimestamp (that is, when the instance was created). This delay gives your application time to set itself up and initialize on the instance. If more than initialDelaySec seconds have passed since instance.creationTimestamp when this method is called, there will be zero delay. If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is suspended. Suspended instances can be resumed using the resumeInstances method. You can specify a maximum of 1000 instances with this method per request.
2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 |
# File 'lib/google/cloud/compute/v1/instance_group_managers/rest/client.rb', line 2381 def suspend_instances request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::SuspendInstancesInstanceGroupManagerRequest # 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_instances..to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::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_instances.timeout, metadata: , retry_policy: @config.rpcs.suspend_instances.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @instance_group_managers_stub.suspend_instances 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? throw :response, result end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end |
#universe_domain ⇒ String
The effective universe domain
165 166 167 |
# File 'lib/google/cloud/compute/v1/instance_group_managers/rest/client.rb', line 165 def universe_domain @instance_group_managers_stub.universe_domain end |
#update_per_instance_configs(request, options = nil) ⇒ ::Gapic::GenericLRO::Operation #update_per_instance_configs(instance_group_manager: nil, instance_group_managers_update_per_instance_configs_req_resource: nil, project: nil, request_id: nil, zone: nil) ⇒ ::Gapic::GenericLRO::Operation
Inserts or updates per-instance configurations for the managed instance group. perInstanceConfig.name serves as a key used to distinguish whether to perform insert or patch.
2477 2478 2479 2480 2481 2482 2483 2484 2485 2486 2487 2488 2489 2490 2491 2492 2493 2494 2495 2496 2497 2498 2499 2500 2501 2502 2503 2504 2505 2506 2507 2508 2509 2510 2511 2512 2513 2514 2515 2516 2517 2518 2519 2520 |
# File 'lib/google/cloud/compute/v1/instance_group_managers/rest/client.rb', line 2477 def update_per_instance_configs request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::UpdatePerInstanceConfigsInstanceGroupManagerRequest # 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_per_instance_configs..to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::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_per_instance_configs.timeout, metadata: , retry_policy: @config.rpcs.update_per_instance_configs.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @instance_group_managers_stub.update_per_instance_configs 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? throw :response, result end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end |