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.
-
#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.
-
#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.
-
#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.
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 205 206 207 208 209 210 211 212 213 |
# File 'lib/google/cloud/compute/v1/instance_group_managers/rest/client.rb', line 177 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 ) end |
Instance Attribute Details
#zone_operations ⇒ ::Google::Cloud::Compute::V1::ZoneOperations::Rest::Client (readonly)
Get the associated client for long-running operations via ZoneOperations.
220 221 222 |
# File 'lib/google/cloud/compute/v1/instance_group_managers/rest/client.rb', line 220 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 |
# 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.set_instance_template.timeout = 600.0 default_config.rpcs.set_target_pools.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.
275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 |
# File 'lib/google/cloud/compute/v1/instance_group_managers/rest/client.rb', line 275 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? 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::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
.
377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 |
# File 'lib/google/cloud/compute/v1/instance_group_managers/rest/client.rb', line 377 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? return 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.
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 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 |
# File 'lib/google/cloud/compute/v1/instance_group_managers/rest/client.rb', line 463 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? return 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.
147 148 149 150 |
# File 'lib/google/cloud/compute/v1/instance_group_managers/rest/client.rb', line 147 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.
559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 |
# File 'lib/google/cloud/compute/v1/instance_group_managers/rest/client.rb', line 559 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? return 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.
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 683 684 685 686 687 688 689 690 691 692 693 694 695 696 |
# File 'lib/google/cloud/compute/v1/instance_group_managers/rest/client.rb', line 653 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? return 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.
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 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 |
# File 'lib/google/cloud/compute/v1/instance_group_managers/rest/client.rb', line 749 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? return 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.
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 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 |
# File 'lib/google/cloud/compute/v1/instance_group_managers/rest/client.rb', line 843 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? return 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.
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 969 |
# File 'lib/google/cloud/compute/v1/instance_group_managers/rest/client.rb', line 935 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? 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_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.
1020 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 |
# File 'lib/google/cloud/compute/v1/instance_group_managers/rest/client.rb', line 1020 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? 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::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.
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 1148 1149 1150 1151 1152 1153 1154 1155 |
# File 'lib/google/cloud/compute/v1/instance_group_managers/rest/client.rb', line 1120 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? return 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.
1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 |
# File 'lib/google/cloud/compute/v1/instance_group_managers/rest/client.rb', line 1214 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? return 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
.
1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 |
# File 'lib/google/cloud/compute/v1/instance_group_managers/rest/client.rb', line 1308 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? return 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.
1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 |
# File 'lib/google/cloud/compute/v1/instance_group_managers/rest/client.rb', line 1402 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? return result end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) 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.
1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 |
# File 'lib/google/cloud/compute/v1/instance_group_managers/rest/client.rb', line 1490 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? return 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.
1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 |
# File 'lib/google/cloud/compute/v1/instance_group_managers/rest/client.rb', line 1586 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? return 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.
1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 |
# File 'lib/google/cloud/compute/v1/instance_group_managers/rest/client.rb', line 1682 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? return 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.
1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 |
# File 'lib/google/cloud/compute/v1/instance_group_managers/rest/client.rb', line 1778 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? return 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.
1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 |
# File 'lib/google/cloud/compute/v1/instance_group_managers/rest/client.rb', line 1874 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? return 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.
1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 |
# File 'lib/google/cloud/compute/v1/instance_group_managers/rest/client.rb', line 1970 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? return result end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end |
#universe_domain ⇒ String
The effective universe domain
157 158 159 |
# File 'lib/google/cloud/compute/v1/instance_group_managers/rest/client.rb', line 157 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.
2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 |
# File 'lib/google/cloud/compute/v1/instance_group_managers/rest/client.rb', line 2066 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? return result end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end |