Class: OCI::Core::ComputeManagementClient
- Inherits:
-
Object
- Object
- OCI::Core::ComputeManagementClient
- Defined in:
- lib/oci/core/compute_management_client.rb
Overview
APIs for Networking Service, Compute Service, and Block Volume Service.
Instance Attribute Summary collapse
-
#api_client ⇒ OCI::ApiClient
readonly
Client used to make HTTP requests.
-
#endpoint ⇒ String
readonly
Fully qualified endpoint URL.
-
#region ⇒ String
The region, which will usually correspond to a value in Regions::REGION_ENUM.
-
#retry_config ⇒ OCI::Retry::RetryConfig
readonly
The default retry configuration to apply to all operations in this service client.
Instance Method Summary collapse
-
#create_instance_configuration(create_instance_configuration, opts = {}) ⇒ Response
Creates an instance configuration.
-
#create_instance_pool(create_instance_pool_details, opts = {}) ⇒ Response
Create an instance pool.
-
#delete_instance_configuration(instance_configuration_id, opts = {}) ⇒ Response
Deletes an instance configuration.
-
#get_instance_configuration(instance_configuration_id, opts = {}) ⇒ Response
Gets the specified instance configuration.
-
#get_instance_pool(instance_pool_id, opts = {}) ⇒ Response
Gets the specified instance pool.
-
#initialize(config: nil, region: nil, signer: nil, proxy_settings: nil, retry_config: nil) ⇒ ComputeManagementClient
constructor
Creates a new ComputeManagementClient.
-
#launch_instance_configuration(instance_configuration_id, instance_configuration, opts = {}) ⇒ Response
Launch an instance from an instance configuration.
-
#list_instance_configurations(compartment_id, opts = {}) ⇒ Response
Lists the available instanceConfigurations in the specific compartment.
-
#list_instance_pool_instances(compartment_id, instance_pool_id, opts = {}) ⇒ Response
List the instances in the specified instance pool.
-
#list_instance_pools(compartment_id, opts = {}) ⇒ Response
Lists the instance pools in the specified compartment.
-
#logger ⇒ Logger
The logger for this client.
-
#reset_instance_pool(instance_pool_id, opts = {}) ⇒ Response
Performs the reset (power off and power on) action on the specified instance pool, which performs the action on all the instances in the pool.
-
#softreset_instance_pool(instance_pool_id, opts = {}) ⇒ Response
Performs the softreset (ACPI shutdown and power on) action on the specified instance pool, which performs the action on all the instances in the pool.
-
#start_instance_pool(instance_pool_id, opts = {}) ⇒ Response
Performs the start (power on) action on the specified instance pool, which performs the action on all the instances in the pool.
-
#stop_instance_pool(instance_pool_id, opts = {}) ⇒ Response
Performs the stop (power off) action on the specified instance pool, which performs the action on all the instances in the pool.
-
#terminate_instance_pool(instance_pool_id, opts = {}) ⇒ Response
Terminate the specified instance pool.
-
#update_instance_configuration(instance_configuration_id, update_instance_configuration_details, opts = {}) ⇒ Response
Updates the freeFormTags, definedTags, and display name of an instance configuration.
-
#update_instance_pool(instance_pool_id, update_instance_pool_details, opts = {}) ⇒ Response
Update the specified instance pool.
Constructor Details
#initialize(config: nil, region: nil, signer: nil, proxy_settings: nil, retry_config: nil) ⇒ ComputeManagementClient
Creates a new ComputeManagementClient. Notes:
If a config is not specified, then the global OCI.config will be used.
This client is not thread-safe
A region must be specified in either the config or the region parameter. If specified in both,
then the region parameter will be used.
50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 |
# File 'lib/oci/core/compute_management_client.rb', line 50 def initialize(config: nil, region: nil, signer: nil, proxy_settings: nil, retry_config: nil) # If the signer is an InstancePrincipalsSecurityTokenSigner and no config was supplied (which is valid for instance principals) # then create a dummy config to pass to the ApiClient constructor. If customers wish to create a client which uses instance principals # and has config (either populated programmatically or loaded from a file), they must construct that config themselves and then # pass it to this constructor. # # If there is no signer (or the signer is not an instance principals signer) and no config was supplied, this is not valid # so try and load the config from the default file. config ||= OCI.config unless signer.is_a?(OCI::Auth::Signers::InstancePrincipalsSecurityTokenSigner) config ||= OCI::Config.new if signer.is_a?(OCI::Auth::Signers::InstancePrincipalsSecurityTokenSigner) config.validate unless signer.is_a?(OCI::Auth::Signers::InstancePrincipalsSecurityTokenSigner) if signer.nil? signer = OCI::Signer.new( config.user, config.fingerprint, config.tenancy, config.key_file, pass_phrase: config.pass_phrase, private_key_content: config.key_content ) end @api_client = OCI::ApiClient.new(config, signer, proxy_settings: proxy_settings) @retry_config = retry_config region ||= config.region region ||= signer.region if signer.respond_to?(:region) self.region = region end |
Instance Attribute Details
#api_client ⇒ OCI::ApiClient (readonly)
Client used to make HTTP requests.
12 13 14 |
# File 'lib/oci/core/compute_management_client.rb', line 12 def api_client @api_client end |
#endpoint ⇒ String (readonly)
Fully qualified endpoint URL
16 17 18 |
# File 'lib/oci/core/compute_management_client.rb', line 16 def endpoint @endpoint end |
#region ⇒ String
The region, which will usually correspond to a value in Regions::REGION_ENUM.
26 27 28 |
# File 'lib/oci/core/compute_management_client.rb', line 26 def region @region end |
#retry_config ⇒ OCI::Retry::RetryConfig (readonly)
The default retry configuration to apply to all operations in this service client. This can be overridden on a per-operation basis. The default retry configuration value is nil, which means that an operation will not perform any retries
22 23 24 |
# File 'lib/oci/core/compute_management_client.rb', line 22 def retry_config @retry_config end |
Instance Method Details
#create_instance_configuration(create_instance_configuration, opts = {}) ⇒ Response
Creates an instance configuration
117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 |
# File 'lib/oci/core/compute_management_client.rb', line 117 def create_instance_configuration(create_instance_configuration, opts = {}) logger.debug 'Calling operation ComputeManagementClient#create_instance_configuration.' if logger raise "Missing the required parameter 'create_instance_configuration' when calling create_instance_configuration." if create_instance_configuration.nil? path = '/instanceConfigurations' operation_signing_strategy = :standard # rubocop:disable Style/NegatedIf # Query Params query_params = {} # Header Params header_params = {} header_params[:accept] = 'application/json' header_params[:'content-type'] = 'application/json' header_params[:'opc-retry-token'] = opts[:opc_retry_token] if opts[:opc_retry_token] # rubocop:enable Style/NegatedIf header_params[:'opc-retry-token'] ||= OCI::Retry.generate_opc_retry_token post_body = @api_client.object_to_http_body(create_instance_configuration) # rubocop:disable Metrics/BlockLength OCI::Retry.(applicable_retry_config(opts), call_name: 'ComputeManagementClient#create_instance_configuration') do @api_client.call_api( :POST, path, endpoint, header_params: header_params, query_params: query_params, operation_signing_strategy: operation_signing_strategy, body: post_body, return_type: 'OCI::Core::Models::InstanceConfiguration' ) end # rubocop:enable Metrics/BlockLength end |
#create_instance_pool(create_instance_pool_details, opts = {}) ⇒ Response
Create an instance pool.
175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 |
# File 'lib/oci/core/compute_management_client.rb', line 175 def create_instance_pool(create_instance_pool_details, opts = {}) logger.debug 'Calling operation ComputeManagementClient#create_instance_pool.' if logger raise "Missing the required parameter 'create_instance_pool_details' when calling create_instance_pool." if create_instance_pool_details.nil? path = '/instancePools' operation_signing_strategy = :standard # rubocop:disable Style/NegatedIf # Query Params query_params = {} # Header Params header_params = {} header_params[:accept] = 'application/json' header_params[:'content-type'] = 'application/json' header_params[:'opc-retry-token'] = opts[:opc_retry_token] if opts[:opc_retry_token] # rubocop:enable Style/NegatedIf header_params[:'opc-retry-token'] ||= OCI::Retry.generate_opc_retry_token post_body = @api_client.object_to_http_body(create_instance_pool_details) # rubocop:disable Metrics/BlockLength OCI::Retry.(applicable_retry_config(opts), call_name: 'ComputeManagementClient#create_instance_pool') do @api_client.call_api( :POST, path, endpoint, header_params: header_params, query_params: query_params, operation_signing_strategy: operation_signing_strategy, body: post_body, return_type: 'OCI::Core::Models::InstancePool' ) end # rubocop:enable Metrics/BlockLength end |
#delete_instance_configuration(instance_configuration_id, opts = {}) ⇒ Response
Deletes an instance configuration.
231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 |
# File 'lib/oci/core/compute_management_client.rb', line 231 def delete_instance_configuration(instance_configuration_id, opts = {}) logger.debug 'Calling operation ComputeManagementClient#delete_instance_configuration.' if logger raise "Missing the required parameter 'instance_configuration_id' when calling delete_instance_configuration." if instance_configuration_id.nil? raise "Parameter value for 'instance_configuration_id' must not be blank" if OCI::Internal::Util.blank_string?(instance_configuration_id) path = '/instanceConfigurations/{instanceConfigurationId}'.sub('{instanceConfigurationId}', instance_configuration_id.to_s) operation_signing_strategy = :standard # rubocop:disable Style/NegatedIf # Query Params query_params = {} # Header Params header_params = {} header_params[:accept] = 'application/json' header_params[:'content-type'] = 'application/json' header_params[:'if-match'] = opts[:if_match] if opts[:if_match] # rubocop:enable Style/NegatedIf post_body = nil # rubocop:disable Metrics/BlockLength OCI::Retry.(applicable_retry_config(opts), call_name: 'ComputeManagementClient#delete_instance_configuration') do @api_client.call_api( :DELETE, path, endpoint, header_params: header_params, query_params: query_params, operation_signing_strategy: operation_signing_strategy, body: post_body ) end # rubocop:enable Metrics/BlockLength end |
#get_instance_configuration(instance_configuration_id, opts = {}) ⇒ Response
Gets the specified instance configuration
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/oci/core/compute_management_client.rb', line 283 def get_instance_configuration(instance_configuration_id, opts = {}) logger.debug 'Calling operation ComputeManagementClient#get_instance_configuration.' if logger raise "Missing the required parameter 'instance_configuration_id' when calling get_instance_configuration." if instance_configuration_id.nil? raise "Parameter value for 'instance_configuration_id' must not be blank" if OCI::Internal::Util.blank_string?(instance_configuration_id) path = '/instanceConfigurations/{instanceConfigurationId}'.sub('{instanceConfigurationId}', instance_configuration_id.to_s) operation_signing_strategy = :standard # rubocop:disable Style/NegatedIf # Query Params query_params = {} # Header Params header_params = {} header_params[:accept] = 'application/json' header_params[:'content-type'] = 'application/json' # rubocop:enable Style/NegatedIf post_body = nil # rubocop:disable Metrics/BlockLength OCI::Retry.(applicable_retry_config(opts), call_name: 'ComputeManagementClient#get_instance_configuration') do @api_client.call_api( :GET, path, endpoint, header_params: header_params, query_params: query_params, operation_signing_strategy: operation_signing_strategy, body: post_body, return_type: 'OCI::Core::Models::InstanceConfiguration' ) end # rubocop:enable Metrics/BlockLength end |
#get_instance_pool(instance_pool_id, opts = {}) ⇒ Response
Gets the specified instance pool
336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 |
# File 'lib/oci/core/compute_management_client.rb', line 336 def get_instance_pool(instance_pool_id, opts = {}) logger.debug 'Calling operation ComputeManagementClient#get_instance_pool.' if logger raise "Missing the required parameter 'instance_pool_id' when calling get_instance_pool." if instance_pool_id.nil? raise "Parameter value for 'instance_pool_id' must not be blank" if OCI::Internal::Util.blank_string?(instance_pool_id) path = '/instancePools/{instancePoolId}'.sub('{instancePoolId}', instance_pool_id.to_s) operation_signing_strategy = :standard # rubocop:disable Style/NegatedIf # Query Params query_params = {} # Header Params header_params = {} header_params[:accept] = 'application/json' header_params[:'content-type'] = 'application/json' # rubocop:enable Style/NegatedIf post_body = nil # rubocop:disable Metrics/BlockLength OCI::Retry.(applicable_retry_config(opts), call_name: 'ComputeManagementClient#get_instance_pool') do @api_client.call_api( :GET, path, endpoint, header_params: header_params, query_params: query_params, operation_signing_strategy: operation_signing_strategy, body: post_body, return_type: 'OCI::Core::Models::InstancePool' ) end # rubocop:enable Metrics/BlockLength end |
#launch_instance_configuration(instance_configuration_id, instance_configuration, opts = {}) ⇒ Response
Launch an instance from an instance configuration
396 397 398 399 400 401 402 403 404 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 |
# File 'lib/oci/core/compute_management_client.rb', line 396 def launch_instance_configuration(instance_configuration_id, instance_configuration, opts = {}) logger.debug 'Calling operation ComputeManagementClient#launch_instance_configuration.' if logger raise "Missing the required parameter 'instance_configuration_id' when calling launch_instance_configuration." if instance_configuration_id.nil? raise "Missing the required parameter 'instance_configuration' when calling launch_instance_configuration." if instance_configuration.nil? raise "Parameter value for 'instance_configuration_id' must not be blank" if OCI::Internal::Util.blank_string?(instance_configuration_id) path = '/instanceConfigurations/{instanceConfigurationId}/actions/launch'.sub('{instanceConfigurationId}', instance_configuration_id.to_s) operation_signing_strategy = :standard # rubocop:disable Style/NegatedIf # Query Params query_params = {} # Header Params header_params = {} header_params[:accept] = 'application/json' header_params[:'content-type'] = 'application/json' header_params[:'opc-retry-token'] = opts[:opc_retry_token] if opts[:opc_retry_token] # rubocop:enable Style/NegatedIf header_params[:'opc-retry-token'] ||= OCI::Retry.generate_opc_retry_token post_body = @api_client.object_to_http_body(instance_configuration) # rubocop:disable Metrics/BlockLength OCI::Retry.(applicable_retry_config(opts), call_name: 'ComputeManagementClient#launch_instance_configuration') do @api_client.call_api( :POST, path, endpoint, header_params: header_params, query_params: query_params, operation_signing_strategy: operation_signing_strategy, body: post_body, return_type: 'OCI::Core::Models::Instance' ) end # rubocop:enable Metrics/BlockLength end |
#list_instance_configurations(compartment_id, opts = {}) ⇒ Response
Lists the available instanceConfigurations in the specific compartment.
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 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 |
# File 'lib/oci/core/compute_management_client.rb', line 475 def list_instance_configurations(compartment_id, opts = {}) logger.debug 'Calling operation ComputeManagementClient#list_instance_configurations.' if logger raise "Missing the required parameter 'compartment_id' when calling list_instance_configurations." if compartment_id.nil? if opts[:sort_by] && !%w[TIMECREATED DISPLAYNAME].include?(opts[:sort_by]) raise 'Invalid value for "sort_by", must be one of TIMECREATED, DISPLAYNAME.' end if opts[:sort_order] && !%w[ASC DESC].include?(opts[:sort_order]) raise 'Invalid value for "sort_order", must be one of ASC, DESC.' end path = '/instanceConfigurations' operation_signing_strategy = :standard # rubocop:disable Style/NegatedIf # Query Params query_params = {} query_params[:compartmentId] = compartment_id query_params[:limit] = opts[:limit] if opts[:limit] query_params[:page] = opts[:page] if opts[:page] query_params[:sortBy] = opts[:sort_by] if opts[:sort_by] query_params[:sortOrder] = opts[:sort_order] if opts[:sort_order] # Header Params header_params = {} header_params[:accept] = 'application/json' header_params[:'content-type'] = 'application/json' # rubocop:enable Style/NegatedIf post_body = nil # rubocop:disable Metrics/BlockLength OCI::Retry.(applicable_retry_config(opts), call_name: 'ComputeManagementClient#list_instance_configurations') do @api_client.call_api( :GET, path, endpoint, header_params: header_params, query_params: query_params, operation_signing_strategy: operation_signing_strategy, body: post_body, return_type: 'Array<OCI::Core::Models::InstanceConfigurationSummary>' ) end # rubocop:enable Metrics/BlockLength end |
#list_instance_pool_instances(compartment_id, instance_pool_id, opts = {}) ⇒ Response
List the instances in the specified instance pool.
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 603 604 605 606 607 608 609 610 611 612 613 614 615 |
# File 'lib/oci/core/compute_management_client.rb', line 565 def list_instance_pool_instances(compartment_id, instance_pool_id, opts = {}) logger.debug 'Calling operation ComputeManagementClient#list_instance_pool_instances.' if logger raise "Missing the required parameter 'compartment_id' when calling list_instance_pool_instances." if compartment_id.nil? raise "Missing the required parameter 'instance_pool_id' when calling list_instance_pool_instances." if instance_pool_id.nil? if opts[:sort_by] && !%w[TIMECREATED DISPLAYNAME].include?(opts[:sort_by]) raise 'Invalid value for "sort_by", must be one of TIMECREATED, DISPLAYNAME.' end if opts[:sort_order] && !%w[ASC DESC].include?(opts[:sort_order]) raise 'Invalid value for "sort_order", must be one of ASC, DESC.' end raise "Parameter value for 'instance_pool_id' must not be blank" if OCI::Internal::Util.blank_string?(instance_pool_id) path = '/instancePools/{instancePoolId}/instances'.sub('{instancePoolId}', instance_pool_id.to_s) operation_signing_strategy = :standard # rubocop:disable Style/NegatedIf # Query Params query_params = {} query_params[:compartmentId] = compartment_id query_params[:displayName] = opts[:display_name] if opts[:display_name] query_params[:limit] = opts[:limit] if opts[:limit] query_params[:page] = opts[:page] if opts[:page] query_params[:sortBy] = opts[:sort_by] if opts[:sort_by] query_params[:sortOrder] = opts[:sort_order] if opts[:sort_order] # Header Params header_params = {} header_params[:accept] = 'application/json' header_params[:'content-type'] = 'application/json' # rubocop:enable Style/NegatedIf post_body = nil # rubocop:disable Metrics/BlockLength OCI::Retry.(applicable_retry_config(opts), call_name: 'ComputeManagementClient#list_instance_pool_instances') do @api_client.call_api( :GET, path, endpoint, header_params: header_params, query_params: query_params, operation_signing_strategy: operation_signing_strategy, body: post_body, return_type: 'Array<OCI::Core::Models::InstanceSummary>' ) end # rubocop:enable Metrics/BlockLength end |
#list_instance_pools(compartment_id, opts = {}) ⇒ Response
Lists the instance pools in the specified compartment.
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 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 |
# File 'lib/oci/core/compute_management_client.rb', line 659 def list_instance_pools(compartment_id, opts = {}) logger.debug 'Calling operation ComputeManagementClient#list_instance_pools.' if logger raise "Missing the required parameter 'compartment_id' when calling list_instance_pools." if compartment_id.nil? if opts[:sort_by] && !%w[TIMECREATED DISPLAYNAME].include?(opts[:sort_by]) raise 'Invalid value for "sort_by", must be one of TIMECREATED, DISPLAYNAME.' end if opts[:sort_order] && !%w[ASC DESC].include?(opts[:sort_order]) raise 'Invalid value for "sort_order", must be one of ASC, DESC.' end if opts[:lifecycle_state] && !OCI::Core::Models::InstancePoolSummary::LIFECYCLE_STATE_ENUM.include?(opts[:lifecycle_state]) raise 'Invalid value for "lifecycle_state", must be one of the values in OCI::Core::Models::InstancePoolSummary::LIFECYCLE_STATE_ENUM.' end path = '/instancePools' operation_signing_strategy = :standard # rubocop:disable Style/NegatedIf # Query Params query_params = {} query_params[:compartmentId] = compartment_id query_params[:displayName] = opts[:display_name] if opts[:display_name] query_params[:limit] = opts[:limit] if opts[:limit] query_params[:page] = opts[:page] if opts[:page] query_params[:sortBy] = opts[:sort_by] if opts[:sort_by] query_params[:sortOrder] = opts[:sort_order] if opts[:sort_order] query_params[:lifecycleState] = opts[:lifecycle_state] if opts[:lifecycle_state] # Header Params header_params = {} header_params[:accept] = 'application/json' header_params[:'content-type'] = 'application/json' # rubocop:enable Style/NegatedIf post_body = nil # rubocop:disable Metrics/BlockLength OCI::Retry.(applicable_retry_config(opts), call_name: 'ComputeManagementClient#list_instance_pools') do @api_client.call_api( :GET, path, endpoint, header_params: header_params, query_params: query_params, operation_signing_strategy: operation_signing_strategy, body: post_body, return_type: 'Array<OCI::Core::Models::InstancePoolSummary>' ) end # rubocop:enable Metrics/BlockLength end |
#logger ⇒ Logger
Returns The logger for this client. May be nil.
95 96 97 |
# File 'lib/oci/core/compute_management_client.rb', line 95 def logger @api_client.config.logger end |
#reset_instance_pool(instance_pool_id, opts = {}) ⇒ Response
Performs the reset (power off and power on) action on the specified instance pool, which performs the action on all the instances in the pool.
740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 |
# File 'lib/oci/core/compute_management_client.rb', line 740 def reset_instance_pool(instance_pool_id, opts = {}) logger.debug 'Calling operation ComputeManagementClient#reset_instance_pool.' if logger raise "Missing the required parameter 'instance_pool_id' when calling reset_instance_pool." if instance_pool_id.nil? raise "Parameter value for 'instance_pool_id' must not be blank" if OCI::Internal::Util.blank_string?(instance_pool_id) path = '/instancePools/{instancePoolId}/actions/reset'.sub('{instancePoolId}', instance_pool_id.to_s) operation_signing_strategy = :standard # rubocop:disable Style/NegatedIf # Query Params query_params = {} # Header Params header_params = {} header_params[:accept] = 'application/json' header_params[:'content-type'] = 'application/json' header_params[:'opc-retry-token'] = opts[:opc_retry_token] if opts[:opc_retry_token] header_params[:'if-match'] = opts[:if_match] if opts[:if_match] # rubocop:enable Style/NegatedIf header_params[:'opc-retry-token'] ||= OCI::Retry.generate_opc_retry_token post_body = nil # rubocop:disable Metrics/BlockLength OCI::Retry.(applicable_retry_config(opts), call_name: 'ComputeManagementClient#reset_instance_pool') do @api_client.call_api( :POST, path, endpoint, header_params: header_params, query_params: query_params, operation_signing_strategy: operation_signing_strategy, body: post_body, return_type: 'OCI::Core::Models::InstancePool' ) end # rubocop:enable Metrics/BlockLength end |
#softreset_instance_pool(instance_pool_id, opts = {}) ⇒ Response
Performs the softreset (ACPI shutdown and power on) action on the specified instance pool, which performs the action on all the instances in the pool.
806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 |
# File 'lib/oci/core/compute_management_client.rb', line 806 def softreset_instance_pool(instance_pool_id, opts = {}) logger.debug 'Calling operation ComputeManagementClient#softreset_instance_pool.' if logger raise "Missing the required parameter 'instance_pool_id' when calling softreset_instance_pool." if instance_pool_id.nil? raise "Parameter value for 'instance_pool_id' must not be blank" if OCI::Internal::Util.blank_string?(instance_pool_id) path = '/instancePools/{instancePoolId}/actions/softreset'.sub('{instancePoolId}', instance_pool_id.to_s) operation_signing_strategy = :standard # rubocop:disable Style/NegatedIf # Query Params query_params = {} # Header Params header_params = {} header_params[:accept] = 'application/json' header_params[:'content-type'] = 'application/json' header_params[:'opc-retry-token'] = opts[:opc_retry_token] if opts[:opc_retry_token] header_params[:'if-match'] = opts[:if_match] if opts[:if_match] # rubocop:enable Style/NegatedIf header_params[:'opc-retry-token'] ||= OCI::Retry.generate_opc_retry_token post_body = nil # rubocop:disable Metrics/BlockLength OCI::Retry.(applicable_retry_config(opts), call_name: 'ComputeManagementClient#softreset_instance_pool') do @api_client.call_api( :POST, path, endpoint, header_params: header_params, query_params: query_params, operation_signing_strategy: operation_signing_strategy, body: post_body, return_type: 'OCI::Core::Models::InstancePool' ) end # rubocop:enable Metrics/BlockLength end |
#start_instance_pool(instance_pool_id, opts = {}) ⇒ Response
Performs the start (power on) action on the specified instance pool, which performs the action on all the instances in the pool.
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 |
# File 'lib/oci/core/compute_management_client.rb', line 872 def start_instance_pool(instance_pool_id, opts = {}) logger.debug 'Calling operation ComputeManagementClient#start_instance_pool.' if logger raise "Missing the required parameter 'instance_pool_id' when calling start_instance_pool." if instance_pool_id.nil? raise "Parameter value for 'instance_pool_id' must not be blank" if OCI::Internal::Util.blank_string?(instance_pool_id) path = '/instancePools/{instancePoolId}/actions/start'.sub('{instancePoolId}', instance_pool_id.to_s) operation_signing_strategy = :standard # rubocop:disable Style/NegatedIf # Query Params query_params = {} # Header Params header_params = {} header_params[:accept] = 'application/json' header_params[:'content-type'] = 'application/json' header_params[:'opc-retry-token'] = opts[:opc_retry_token] if opts[:opc_retry_token] header_params[:'if-match'] = opts[:if_match] if opts[:if_match] # rubocop:enable Style/NegatedIf header_params[:'opc-retry-token'] ||= OCI::Retry.generate_opc_retry_token post_body = nil # rubocop:disable Metrics/BlockLength OCI::Retry.(applicable_retry_config(opts), call_name: 'ComputeManagementClient#start_instance_pool') do @api_client.call_api( :POST, path, endpoint, header_params: header_params, query_params: query_params, operation_signing_strategy: operation_signing_strategy, body: post_body, return_type: 'OCI::Core::Models::InstancePool' ) end # rubocop:enable Metrics/BlockLength end |
#stop_instance_pool(instance_pool_id, opts = {}) ⇒ Response
Performs the stop (power off) action on the specified instance pool, which performs the action on all the instances in the pool.
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 970 971 972 973 974 975 976 |
# File 'lib/oci/core/compute_management_client.rb', line 938 def stop_instance_pool(instance_pool_id, opts = {}) logger.debug 'Calling operation ComputeManagementClient#stop_instance_pool.' if logger raise "Missing the required parameter 'instance_pool_id' when calling stop_instance_pool." if instance_pool_id.nil? raise "Parameter value for 'instance_pool_id' must not be blank" if OCI::Internal::Util.blank_string?(instance_pool_id) path = '/instancePools/{instancePoolId}/actions/stop'.sub('{instancePoolId}', instance_pool_id.to_s) operation_signing_strategy = :standard # rubocop:disable Style/NegatedIf # Query Params query_params = {} # Header Params header_params = {} header_params[:accept] = 'application/json' header_params[:'content-type'] = 'application/json' header_params[:'opc-retry-token'] = opts[:opc_retry_token] if opts[:opc_retry_token] header_params[:'if-match'] = opts[:if_match] if opts[:if_match] # rubocop:enable Style/NegatedIf header_params[:'opc-retry-token'] ||= OCI::Retry.generate_opc_retry_token post_body = nil # rubocop:disable Metrics/BlockLength OCI::Retry.(applicable_retry_config(opts), call_name: 'ComputeManagementClient#stop_instance_pool') do @api_client.call_api( :POST, path, endpoint, header_params: header_params, query_params: query_params, operation_signing_strategy: operation_signing_strategy, body: post_body, return_type: 'OCI::Core::Models::InstancePool' ) end # rubocop:enable Metrics/BlockLength end |
#terminate_instance_pool(instance_pool_id, opts = {}) ⇒ Response
Terminate the specified instance pool.
996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 |
# File 'lib/oci/core/compute_management_client.rb', line 996 def terminate_instance_pool(instance_pool_id, opts = {}) logger.debug 'Calling operation ComputeManagementClient#terminate_instance_pool.' if logger raise "Missing the required parameter 'instance_pool_id' when calling terminate_instance_pool." if instance_pool_id.nil? raise "Parameter value for 'instance_pool_id' must not be blank" if OCI::Internal::Util.blank_string?(instance_pool_id) path = '/instancePools/{instancePoolId}'.sub('{instancePoolId}', instance_pool_id.to_s) operation_signing_strategy = :standard # rubocop:disable Style/NegatedIf # Query Params query_params = {} # Header Params header_params = {} header_params[:accept] = 'application/json' header_params[:'content-type'] = 'application/json' header_params[:'if-match'] = opts[:if_match] if opts[:if_match] # rubocop:enable Style/NegatedIf post_body = nil # rubocop:disable Metrics/BlockLength OCI::Retry.(applicable_retry_config(opts), call_name: 'ComputeManagementClient#terminate_instance_pool') do @api_client.call_api( :DELETE, path, endpoint, header_params: header_params, query_params: query_params, operation_signing_strategy: operation_signing_strategy, body: post_body ) end # rubocop:enable Metrics/BlockLength end |
#update_instance_configuration(instance_configuration_id, update_instance_configuration_details, opts = {}) ⇒ Response
Updates the freeFormTags, definedTags, and display name of an instance configuration.
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 1091 1092 1093 1094 1095 1096 1097 |
# File 'lib/oci/core/compute_management_client.rb', line 1058 def update_instance_configuration(instance_configuration_id, update_instance_configuration_details, opts = {}) logger.debug 'Calling operation ComputeManagementClient#update_instance_configuration.' if logger raise "Missing the required parameter 'instance_configuration_id' when calling update_instance_configuration." if instance_configuration_id.nil? raise "Missing the required parameter 'update_instance_configuration_details' when calling update_instance_configuration." if update_instance_configuration_details.nil? raise "Parameter value for 'instance_configuration_id' must not be blank" if OCI::Internal::Util.blank_string?(instance_configuration_id) path = '/instanceConfigurations/{instanceConfigurationId}'.sub('{instanceConfigurationId}', instance_configuration_id.to_s) operation_signing_strategy = :standard # rubocop:disable Style/NegatedIf # Query Params query_params = {} # Header Params header_params = {} header_params[:accept] = 'application/json' header_params[:'content-type'] = 'application/json' header_params[:'opc-retry-token'] = opts[:opc_retry_token] if opts[:opc_retry_token] header_params[:'if-match'] = opts[:if_match] if opts[:if_match] # rubocop:enable Style/NegatedIf header_params[:'opc-retry-token'] ||= OCI::Retry.generate_opc_retry_token post_body = @api_client.object_to_http_body(update_instance_configuration_details) # rubocop:disable Metrics/BlockLength OCI::Retry.(applicable_retry_config(opts), call_name: 'ComputeManagementClient#update_instance_configuration') do @api_client.call_api( :PUT, path, endpoint, header_params: header_params, query_params: query_params, operation_signing_strategy: operation_signing_strategy, body: post_body, return_type: 'OCI::Core::Models::InstanceConfiguration' ) end # rubocop:enable Metrics/BlockLength end |
#update_instance_pool(instance_pool_id, update_instance_pool_details, opts = {}) ⇒ Response
Update the specified instance pool. The OCID of the instance pool remains the same.
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 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 |
# File 'lib/oci/core/compute_management_client.rb', line 1126 def update_instance_pool(instance_pool_id, update_instance_pool_details, opts = {}) logger.debug 'Calling operation ComputeManagementClient#update_instance_pool.' if logger raise "Missing the required parameter 'instance_pool_id' when calling update_instance_pool." if instance_pool_id.nil? raise "Missing the required parameter 'update_instance_pool_details' when calling update_instance_pool." if update_instance_pool_details.nil? raise "Parameter value for 'instance_pool_id' must not be blank" if OCI::Internal::Util.blank_string?(instance_pool_id) path = '/instancePools/{instancePoolId}'.sub('{instancePoolId}', instance_pool_id.to_s) operation_signing_strategy = :standard # rubocop:disable Style/NegatedIf # Query Params query_params = {} # Header Params header_params = {} header_params[:accept] = 'application/json' header_params[:'content-type'] = 'application/json' header_params[:'opc-retry-token'] = opts[:opc_retry_token] if opts[:opc_retry_token] header_params[:'if-match'] = opts[:if_match] if opts[:if_match] # rubocop:enable Style/NegatedIf header_params[:'opc-retry-token'] ||= OCI::Retry.generate_opc_retry_token post_body = @api_client.object_to_http_body(update_instance_pool_details) # rubocop:disable Metrics/BlockLength OCI::Retry.(applicable_retry_config(opts), call_name: 'ComputeManagementClient#update_instance_pool') do @api_client.call_api( :PUT, path, endpoint, header_params: header_params, query_params: query_params, operation_signing_strategy: operation_signing_strategy, body: post_body, return_type: 'OCI::Core::Models::InstancePool' ) end # rubocop:enable Metrics/BlockLength end |