Class: OCI::Core::ComputeClient
- Inherits:
-
Object
- Object
- OCI::Core::ComputeClient
- Defined in:
- lib/oci/core/compute_client.rb
Overview
API covering the [Networking](/iaas/Content/Network/Concepts/overview.htm), [Compute](/iaas/Content/Compute/Concepts/computeoverview.htm), and [Block Volume](/iaas/Content/Block/Concepts/overview.htm) services. Use this API to manage resources such as virtual cloud networks (VCNs), compute instances, and block storage volumes.
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
-
#attach_boot_volume(attach_boot_volume_details, opts = {}) ⇒ Response
Attaches the specified boot volume to the specified instance.
-
#attach_vnic(attach_vnic_details, opts = {}) ⇒ Response
Creates a secondary VNIC and attaches it to the specified instance.
-
#attach_volume(attach_volume_details, opts = {}) ⇒ Response
Attaches the specified storage volume to the specified instance.
-
#capture_console_history(capture_console_history_details, opts = {}) ⇒ Response
Captures the most recent serial console data (up to a megabyte) for the specified instance.
-
#change_image_compartment(image_id, change_image_compartment_details, opts = {}) ⇒ Response
Moves an image into a different compartment within the same tenancy.
-
#change_instance_compartment(instance_id, change_instance_compartment_details, opts = {}) ⇒ Response
Moves an instance into a different compartment within the same tenancy.
-
#create_app_catalog_subscription(create_app_catalog_subscription_details, opts = {}) ⇒ Response
Create a subscription for listing resource version for a compartment.
-
#create_image(create_image_details, opts = {}) ⇒ Response
Creates a boot disk image for the specified instance or imports an exported image from the Oracle Cloud Infrastructure Object Storage service.
-
#create_instance_console_connection(create_instance_console_connection_details, opts = {}) ⇒ Response
Creates a new console connection to the specified instance.
-
#delete_app_catalog_subscription(listing_id, compartment_id, resource_version, opts = {}) ⇒ Response
Delete a subscription for a listing resource version for a compartment.
-
#delete_console_history(instance_console_history_id, opts = {}) ⇒ Response
Deletes the specified console history metadata and the console history data.
-
#delete_image(image_id, opts = {}) ⇒ Response
Deletes an image.
-
#delete_instance_console_connection(instance_console_connection_id, opts = {}) ⇒ Response
Deletes the specified instance console connection.
-
#detach_boot_volume(boot_volume_attachment_id, opts = {}) ⇒ Response
Detaches a boot volume from an instance.
-
#detach_vnic(vnic_attachment_id, opts = {}) ⇒ Response
Detaches and deletes the specified secondary VNIC.
-
#detach_volume(volume_attachment_id, opts = {}) ⇒ Response
Detaches a storage volume from an instance.
-
#export_image(image_id, export_image_details, opts = {}) ⇒ Response
Exports the specified image to the Oracle Cloud Infrastructure Object Storage service.
-
#get_app_catalog_listing(listing_id, opts = {}) ⇒ Response
Gets the specified listing.
-
#get_app_catalog_listing_agreements(listing_id, resource_version, opts = {}) ⇒ Response
Retrieves the agreements for a particular resource version of a listing.
-
#get_app_catalog_listing_resource_version(listing_id, resource_version, opts = {}) ⇒ Response
Gets the specified listing resource version.
-
#get_boot_volume_attachment(boot_volume_attachment_id, opts = {}) ⇒ Response
Gets information about the specified boot volume attachment.
-
#get_console_history(instance_console_history_id, opts = {}) ⇒ Response
Shows the metadata for the specified console history.
-
#get_console_history_content(instance_console_history_id, opts = {}) ⇒ Response
Gets the actual console history data (not the metadata).
-
#get_image(image_id, opts = {}) ⇒ Response
Gets the specified image.
-
#get_instance(instance_id, opts = {}) ⇒ Response
Gets information about the specified instance.
-
#get_instance_console_connection(instance_console_connection_id, opts = {}) ⇒ Response
Gets the specified instance console connection’s information.
-
#get_vnic_attachment(vnic_attachment_id, opts = {}) ⇒ Response
Gets the information for the specified VNIC attachment.
-
#get_volume_attachment(volume_attachment_id, opts = {}) ⇒ Response
Gets information about the specified volume attachment.
-
#get_windows_instance_initial_credentials(instance_id, opts = {}) ⇒ Response
Gets the generated credentials for the instance.
-
#initialize(config: nil, region: nil, endpoint: nil, signer: nil, proxy_settings: nil, retry_config: nil) ⇒ ComputeClient
constructor
Creates a new ComputeClient.
-
#instance_action(instance_id, action, opts = {}) ⇒ Response
Performs one of the following power actions on the specified instance:.
-
#launch_instance(launch_instance_details, opts = {}) ⇒ Response
Creates a new instance in the specified compartment and the specified availability domain.
-
#list_app_catalog_listing_resource_versions(listing_id, opts = {}) ⇒ Response
Gets all resource versions for a particular listing.
-
#list_app_catalog_listings(opts = {}) ⇒ Response
Lists the published listings.
-
#list_app_catalog_subscriptions(compartment_id, opts = {}) ⇒ Response
Lists subscriptions for a compartment.
-
#list_boot_volume_attachments(availability_domain, compartment_id, opts = {}) ⇒ Response
Lists the boot volume attachments in the specified compartment.
-
#list_console_histories(compartment_id, opts = {}) ⇒ Response
Lists the console history metadata for the specified compartment or instance.
-
#list_images(compartment_id, opts = {}) ⇒ Response
Lists the available images in the specified compartment, including both [Oracle-provided images](docs.cloud.oracle.com/Content/Compute/References/images.htm) and [custom images](docs.cloud.oracle.com/Content/Compute/Tasks/managingcustomimages.htm) that have been created.
-
#list_instance_console_connections(compartment_id, opts = {}) ⇒ Response
Lists the console connections for the specified compartment or instance.
-
#list_instance_devices(instance_id, opts = {}) ⇒ Response
Gets a list of all the devices for given instance.
-
#list_instances(compartment_id, opts = {}) ⇒ Response
Lists the instances in the specified compartment and the specified availability domain.
-
#list_shapes(compartment_id, opts = {}) ⇒ Response
Lists the shapes that can be used to launch an instance within the specified compartment.
-
#list_vnic_attachments(compartment_id, opts = {}) ⇒ Response
Lists the VNIC attachments in the specified compartment.
-
#list_volume_attachments(compartment_id, opts = {}) ⇒ Response
Lists the volume attachments in the specified compartment.
-
#logger ⇒ Logger
The logger for this client.
-
#terminate_instance(instance_id, opts = {}) ⇒ Response
Terminates the specified instance.
-
#update_console_history(instance_console_history_id, update_console_history_details, opts = {}) ⇒ Response
Updates the specified console history metadata.
-
#update_image(image_id, update_image_details, opts = {}) ⇒ Response
Updates the display name of the image.
-
#update_instance(instance_id, update_instance_details, opts = {}) ⇒ Response
Updates certain fields on the specified instance.
Constructor Details
#initialize(config: nil, region: nil, endpoint: nil, signer: nil, proxy_settings: nil, retry_config: nil) ⇒ ComputeClient
Creates a new ComputeClient. Notes:
If a config is not specified, then the global OCI.config will be used.
This client is not thread-safe
Either a region or an endpoint must be specified. If an endpoint is specified, it will be used instead of the
region. A region may be specified in the config or via or the region parameter. If specified in both, then the
region parameter will be used.
56 57 58 59 60 61 62 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 |
# File 'lib/oci/core/compute_client.rb', line 56 def initialize(config: nil, region: nil, endpoint: 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 if endpoint @endpoint = endpoint + '/20160918' else region ||= config.region region ||= signer.region if signer.respond_to?(:region) self.region = region end logger.info "ComputeClient endpoint set to '#{@endpoint}'." if logger end |
Instance Attribute Details
#api_client ⇒ OCI::ApiClient (readonly)
Client used to make HTTP requests.
16 17 18 |
# File 'lib/oci/core/compute_client.rb', line 16 def api_client @api_client end |
#endpoint ⇒ String (readonly)
Fully qualified endpoint URL
20 21 22 |
# File 'lib/oci/core/compute_client.rb', line 20 def endpoint @endpoint end |
#region ⇒ String
The region, which will usually correspond to a value in Regions::REGION_ENUM.
30 31 32 |
# File 'lib/oci/core/compute_client.rb', line 30 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
26 27 28 |
# File 'lib/oci/core/compute_client.rb', line 26 def retry_config @retry_config end |
Instance Method Details
#attach_boot_volume(attach_boot_volume_details, opts = {}) ⇒ Response
Attaches the specified boot volume to the specified instance.
128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 |
# File 'lib/oci/core/compute_client.rb', line 128 def attach_boot_volume(attach_boot_volume_details, opts = {}) logger.debug 'Calling operation ComputeClient#attach_boot_volume.' if logger raise "Missing the required parameter 'attach_boot_volume_details' when calling attach_boot_volume." if attach_boot_volume_details.nil? path = '/bootVolumeAttachments/' 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(attach_boot_volume_details) # rubocop:disable Metrics/BlockLength OCI::Retry.(applicable_retry_config(opts), call_name: 'ComputeClient#attach_boot_volume') 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::BootVolumeAttachment' ) end # rubocop:enable Metrics/BlockLength end |
#attach_vnic(attach_vnic_details, opts = {}) ⇒ Response
Creates a secondary VNIC and attaches it to the specified instance. For more information about secondary VNICs, see [Virtual Network Interface Cards (VNICs)](docs.cloud.oracle.com/Content/Network/Tasks/managingVNICs.htm).
189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 |
# File 'lib/oci/core/compute_client.rb', line 189 def attach_vnic(attach_vnic_details, opts = {}) logger.debug 'Calling operation ComputeClient#attach_vnic.' if logger raise "Missing the required parameter 'attach_vnic_details' when calling attach_vnic." if attach_vnic_details.nil? path = '/vnicAttachments/' 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(attach_vnic_details) # rubocop:disable Metrics/BlockLength OCI::Retry.(applicable_retry_config(opts), call_name: 'ComputeClient#attach_vnic') 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::VnicAttachment' ) end # rubocop:enable Metrics/BlockLength end |
#attach_volume(attach_volume_details, opts = {}) ⇒ Response
Attaches the specified storage volume to the specified instance.
248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 |
# File 'lib/oci/core/compute_client.rb', line 248 def attach_volume(attach_volume_details, opts = {}) logger.debug 'Calling operation ComputeClient#attach_volume.' if logger raise "Missing the required parameter 'attach_volume_details' when calling attach_volume." if attach_volume_details.nil? path = '/volumeAttachments/' 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(attach_volume_details) # rubocop:disable Metrics/BlockLength OCI::Retry.(applicable_retry_config(opts), call_name: 'ComputeClient#attach_volume') 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::VolumeAttachment' ) end # rubocop:enable Metrics/BlockLength end |
#capture_console_history(capture_console_history_details, opts = {}) ⇒ Response
Captures the most recent serial console data (up to a megabyte) for the specified instance.
The ‘CaptureConsoleHistory` operation works with the other console history operations as described below.
-
Use ‘CaptureConsoleHistory` to request the capture of up to a megabyte of the
most recent console history. This call returns a ‘ConsoleHistory` object. The object will have a state of REQUESTED.
-
Wait for the capture operation to succeed by polling ‘GetConsoleHistory` with
the identifier of the console history metadata. The state of the ‘ConsoleHistory` object will go from REQUESTED to GETTING-HISTORY and then SUCCEEDED (or FAILED).
-
Use ‘GetConsoleHistoryContent` to get the actual console history data (not the
metadata).
-
Optionally, use ‘DeleteConsoleHistory` to delete the console history metadata
and the console history data.
323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 |
# File 'lib/oci/core/compute_client.rb', line 323 def capture_console_history(capture_console_history_details, opts = {}) logger.debug 'Calling operation ComputeClient#capture_console_history.' if logger raise "Missing the required parameter 'capture_console_history_details' when calling capture_console_history." if capture_console_history_details.nil? path = '/instanceConsoleHistories/' 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(capture_console_history_details) # rubocop:disable Metrics/BlockLength OCI::Retry.(applicable_retry_config(opts), call_name: 'ComputeClient#capture_console_history') 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::ConsoleHistory' ) end # rubocop:enable Metrics/BlockLength end |
#change_image_compartment(image_id, change_image_compartment_details, opts = {}) ⇒ Response
Moves an image into a different compartment within the same tenancy. For information about moving resources between compartments, see [Moving Resources to a Different Compartment](docs.cloud.oracle.com/iaas/Content/Identity/Tasks/managingcompartments.htm#moveRes).
392 393 394 395 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 |
# File 'lib/oci/core/compute_client.rb', line 392 def change_image_compartment(image_id, change_image_compartment_details, opts = {}) logger.debug 'Calling operation ComputeClient#change_image_compartment.' if logger raise "Missing the required parameter 'image_id' when calling change_image_compartment." if image_id.nil? raise "Missing the required parameter 'change_image_compartment_details' when calling change_image_compartment." if change_image_compartment_details.nil? raise "Parameter value for 'image_id' must not be blank" if OCI::Internal::Util.blank_string?(image_id) path = '/images/{imageId}/actions/changeCompartment'.sub('{imageId}', image_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] header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id] 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(change_image_compartment_details) # rubocop:disable Metrics/BlockLength OCI::Retry.(applicable_retry_config(opts), call_name: 'ComputeClient#change_image_compartment') 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 ) end # rubocop:enable Metrics/BlockLength end |
#change_instance_compartment(instance_id, change_instance_compartment_details, opts = {}) ⇒ Response
Moves an instance into a different compartment within the same tenancy. For information about moving resources between compartments, see [Moving Resources to a Different Compartment](docs.cloud.oracle.com/iaas/Content/Identity/Tasks/managingcompartments.htm#moveRes).
When you move an instance to a different compartment, associated resources such as boot volumes and VNICs are not moved.
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/oci/core/compute_client.rb', line 467 def change_instance_compartment(instance_id, change_instance_compartment_details, opts = {}) logger.debug 'Calling operation ComputeClient#change_instance_compartment.' if logger raise "Missing the required parameter 'instance_id' when calling change_instance_compartment." if instance_id.nil? raise "Missing the required parameter 'change_instance_compartment_details' when calling change_instance_compartment." if change_instance_compartment_details.nil? raise "Parameter value for 'instance_id' must not be blank" if OCI::Internal::Util.blank_string?(instance_id) path = '/instances/{instanceId}/actions/changeCompartment'.sub('{instanceId}', instance_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] header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id] 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(change_instance_compartment_details) # rubocop:disable Metrics/BlockLength OCI::Retry.(applicable_retry_config(opts), call_name: 'ComputeClient#change_instance_compartment') 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 ) end # rubocop:enable Metrics/BlockLength end |
#create_app_catalog_subscription(create_app_catalog_subscription_details, opts = {}) ⇒ Response
Create a subscription for listing resource version for a compartment. It will take some time to propagate to all regions.
529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 |
# File 'lib/oci/core/compute_client.rb', line 529 def create_app_catalog_subscription(create_app_catalog_subscription_details, opts = {}) logger.debug 'Calling operation ComputeClient#create_app_catalog_subscription.' if logger raise "Missing the required parameter 'create_app_catalog_subscription_details' when calling create_app_catalog_subscription." if create_app_catalog_subscription_details.nil? path = '/appCatalogSubscriptions' 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_app_catalog_subscription_details) # rubocop:disable Metrics/BlockLength OCI::Retry.(applicable_retry_config(opts), call_name: 'ComputeClient#create_app_catalog_subscription') 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::AppCatalogSubscription' ) end # rubocop:enable Metrics/BlockLength end |
#create_image(create_image_details, opts = {}) ⇒ Response
Creates a boot disk image for the specified instance or imports an exported image from the Oracle Cloud Infrastructure Object Storage service.
When creating a new image, you must provide the OCID of the instance you want to use as the basis for the image, and the OCID of the compartment containing that instance. For more information about images, see [Managing Custom Images](docs.cloud.oracle.com/Content/Compute/Tasks/managingcustomimages.htm).
When importing an exported image from Object Storage, you specify the source information in image_source_details.
When importing an image based on the namespace, bucket name, and object name, use image_source_via_object_storage_tuple_details.
When importing an image based on the Object Storage URL, use image_source_via_object_storage_uri_details. See [Object Storage URLs](docs.cloud.oracle.com/Content/Compute/Tasks/imageimportexport.htm#URLs) and [Using Pre-Authenticated Requests](docs.cloud.oracle.com/Content/Object/Tasks/usingpreauthenticatedrequests.htm) for constructing URLs for image import/export.
For more information about importing exported images, see [Image Import/Export](docs.cloud.oracle.com/Content/Compute/Tasks/imageimportexport.htm).
You may optionally specify a *display name* for the image, which is simply a friendly name or description. It does not have to be unique, and you can change it. See update_image. Avoid entering confidential information.
610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 |
# File 'lib/oci/core/compute_client.rb', line 610 def create_image(create_image_details, opts = {}) logger.debug 'Calling operation ComputeClient#create_image.' if logger raise "Missing the required parameter 'create_image_details' when calling create_image." if create_image_details.nil? path = '/images' 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_image_details) # rubocop:disable Metrics/BlockLength OCI::Retry.(applicable_retry_config(opts), call_name: 'ComputeClient#create_image') 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::Image' ) end # rubocop:enable Metrics/BlockLength end |
#create_instance_console_connection(create_instance_console_connection_details, opts = {}) ⇒ Response
Creates a new console connection to the specified instance. Once the console connection has been created and is available, you connect to the console using SSH.
For more information about console access, see [Accessing the Console](docs.cloud.oracle.com/Content/Compute/References/serialconsole.htm).
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 |
# File 'lib/oci/core/compute_client.rb', line 673 def create_instance_console_connection(create_instance_console_connection_details, opts = {}) logger.debug 'Calling operation ComputeClient#create_instance_console_connection.' if logger raise "Missing the required parameter 'create_instance_console_connection_details' when calling create_instance_console_connection." if create_instance_console_connection_details.nil? path = '/instanceConsoleConnections' 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_console_connection_details) # rubocop:disable Metrics/BlockLength OCI::Retry.(applicable_retry_config(opts), call_name: 'ComputeClient#create_instance_console_connection') 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::InstanceConsoleConnection' ) end # rubocop:enable Metrics/BlockLength end |
#delete_app_catalog_subscription(listing_id, compartment_id, resource_version, opts = {}) ⇒ Response
Delete a subscription for a listing resource version for a compartment.
728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 |
# File 'lib/oci/core/compute_client.rb', line 728 def delete_app_catalog_subscription(listing_id, compartment_id, resource_version, opts = {}) logger.debug 'Calling operation ComputeClient#delete_app_catalog_subscription.' if logger raise "Missing the required parameter 'listing_id' when calling delete_app_catalog_subscription." if listing_id.nil? raise "Missing the required parameter 'compartment_id' when calling delete_app_catalog_subscription." if compartment_id.nil? raise "Missing the required parameter 'resource_version' when calling delete_app_catalog_subscription." if resource_version.nil? path = '/appCatalogSubscriptions' operation_signing_strategy = :standard # rubocop:disable Style/NegatedIf # Query Params query_params = {} query_params[:listingId] = listing_id query_params[:compartmentId] = compartment_id query_params[:resourceVersion] = resource_version # 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: 'ComputeClient#delete_app_catalog_subscription') 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 |
#delete_console_history(instance_console_history_id, opts = {}) ⇒ Response
Deletes the specified console history metadata and the console history data.
787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 |
# File 'lib/oci/core/compute_client.rb', line 787 def delete_console_history(instance_console_history_id, opts = {}) logger.debug 'Calling operation ComputeClient#delete_console_history.' if logger raise "Missing the required parameter 'instance_console_history_id' when calling delete_console_history." if instance_console_history_id.nil? raise "Parameter value for 'instance_console_history_id' must not be blank" if OCI::Internal::Util.blank_string?(instance_console_history_id) path = '/instanceConsoleHistories/{instanceConsoleHistoryId}'.sub('{instanceConsoleHistoryId}', instance_console_history_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: 'ComputeClient#delete_console_history') 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 |
#delete_image(image_id, opts = {}) ⇒ Response
Deletes an image.
842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 |
# File 'lib/oci/core/compute_client.rb', line 842 def delete_image(image_id, opts = {}) logger.debug 'Calling operation ComputeClient#delete_image.' if logger raise "Missing the required parameter 'image_id' when calling delete_image." if image_id.nil? raise "Parameter value for 'image_id' must not be blank" if OCI::Internal::Util.blank_string?(image_id) path = '/images/{imageId}'.sub('{imageId}', image_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: 'ComputeClient#delete_image') 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 |
#delete_instance_console_connection(instance_console_connection_id, opts = {}) ⇒ Response
Deletes the specified instance console connection.
897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 |
# File 'lib/oci/core/compute_client.rb', line 897 def delete_instance_console_connection(instance_console_connection_id, opts = {}) logger.debug 'Calling operation ComputeClient#delete_instance_console_connection.' if logger raise "Missing the required parameter 'instance_console_connection_id' when calling delete_instance_console_connection." if instance_console_connection_id.nil? raise "Parameter value for 'instance_console_connection_id' must not be blank" if OCI::Internal::Util.blank_string?(instance_console_connection_id) path = '/instanceConsoleConnections/{instanceConsoleConnectionId}'.sub('{instanceConsoleConnectionId}', instance_console_connection_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: 'ComputeClient#delete_instance_console_connection') 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 |
#detach_boot_volume(boot_volume_attachment_id, opts = {}) ⇒ Response
Detaches a boot volume from an instance. You must specify the OCID of the boot volume attachment.
This is an asynchronous operation. The attachment’s ‘lifecycleState` will change to DETACHING temporarily until the attachment is completely removed.
956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 |
# File 'lib/oci/core/compute_client.rb', line 956 def detach_boot_volume(, opts = {}) logger.debug 'Calling operation ComputeClient#detach_boot_volume.' if logger raise "Missing the required parameter 'boot_volume_attachment_id' when calling detach_boot_volume." if .nil? raise "Parameter value for 'boot_volume_attachment_id' must not be blank" if OCI::Internal::Util.blank_string?() path = '/bootVolumeAttachments/{bootVolumeAttachmentId}'.sub('{bootVolumeAttachmentId}', .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: 'ComputeClient#detach_boot_volume') 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 |
#detach_vnic(vnic_attachment_id, opts = {}) ⇒ Response
Detaches and deletes the specified secondary VNIC. This operation cannot be used on the instance’s primary VNIC. When you terminate an instance, all attached VNICs (primary and secondary) are automatically detached and deleted.
Important: If the VNIC has a PrivateIp that is the [target of a route rule](docs.cloud.oracle.com/Content/Network/Tasks/managingroutetables.htm#privateip), deleting the VNIC causes that route rule to blackhole and the traffic will be dropped.
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 |
# File 'lib/oci/core/compute_client.rb', line 1021 def detach_vnic(, opts = {}) logger.debug 'Calling operation ComputeClient#detach_vnic.' if logger raise "Missing the required parameter 'vnic_attachment_id' when calling detach_vnic." if .nil? raise "Parameter value for 'vnic_attachment_id' must not be blank" if OCI::Internal::Util.blank_string?() path = '/vnicAttachments/{vnicAttachmentId}'.sub('{vnicAttachmentId}', .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: 'ComputeClient#detach_vnic') 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 |
#detach_volume(volume_attachment_id, opts = {}) ⇒ Response
Detaches a storage volume from an instance. You must specify the OCID of the volume attachment.
This is an asynchronous operation. The attachment’s ‘lifecycleState` will change to DETACHING temporarily until the attachment is completely removed.
1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 |
# File 'lib/oci/core/compute_client.rb', line 1080 def detach_volume(, opts = {}) logger.debug 'Calling operation ComputeClient#detach_volume.' if logger raise "Missing the required parameter 'volume_attachment_id' when calling detach_volume." if .nil? raise "Parameter value for 'volume_attachment_id' must not be blank" if OCI::Internal::Util.blank_string?() path = '/volumeAttachments/{volumeAttachmentId}'.sub('{volumeAttachmentId}', .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: 'ComputeClient#detach_volume') 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 |
#export_image(image_id, export_image_details, opts = {}) ⇒ Response
Exports the specified image to the Oracle Cloud Infrastructure Object Storage service. You can use the Object Storage URL, or the namespace, bucket name, and object name when specifying the location to export to.
For more information about exporting images, see [Image Import/Export](docs.cloud.oracle.com/Content/Compute/Tasks/imageimportexport.htm).
To perform an image export, you need write access to the Object Storage bucket for the image, see [Let Users Write Objects to Object Storage Buckets](docs.cloud.oracle.com/Content/Identity/Concepts/commonpolicies.htm#Let4).
See [Object Storage URLs](docs.cloud.oracle.com/Content/Compute/Tasks/imageimportexport.htm#URLs) and [Using Pre-Authenticated Requests](docs.cloud.oracle.com/Content/Object/Tasks/usingpreauthenticatedrequests.htm) for constructing URLs for image import/export.
1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 |
# File 'lib/oci/core/compute_client.rb', line 1152 def export_image(image_id, export_image_details, opts = {}) logger.debug 'Calling operation ComputeClient#export_image.' if logger raise "Missing the required parameter 'image_id' when calling export_image." if image_id.nil? raise "Missing the required parameter 'export_image_details' when calling export_image." if export_image_details.nil? raise "Parameter value for 'image_id' must not be blank" if OCI::Internal::Util.blank_string?(image_id) path = '/images/{imageId}/actions/export'.sub('{imageId}', image_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(export_image_details) # rubocop:disable Metrics/BlockLength OCI::Retry.(applicable_retry_config(opts), call_name: 'ComputeClient#export_image') 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::Image' ) end # rubocop:enable Metrics/BlockLength end |
#get_app_catalog_listing(listing_id, opts = {}) ⇒ Response
Gets the specified listing.
1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 |
# File 'lib/oci/core/compute_client.rb', line 1208 def get_app_catalog_listing(listing_id, opts = {}) logger.debug 'Calling operation ComputeClient#get_app_catalog_listing.' if logger raise "Missing the required parameter 'listing_id' when calling get_app_catalog_listing." if listing_id.nil? raise "Parameter value for 'listing_id' must not be blank" if OCI::Internal::Util.blank_string?(listing_id) path = '/appCatalogListings/{listingId}'.sub('{listingId}', listing_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: 'ComputeClient#get_app_catalog_listing') 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::AppCatalogListing' ) end # rubocop:enable Metrics/BlockLength end |
#get_app_catalog_listing_agreements(listing_id, resource_version, opts = {}) ⇒ Response
Retrieves the agreements for a particular resource version of a listing.
1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 |
# File 'lib/oci/core/compute_client.rb', line 1262 def get_app_catalog_listing_agreements(listing_id, resource_version, opts = {}) logger.debug 'Calling operation ComputeClient#get_app_catalog_listing_agreements.' if logger raise "Missing the required parameter 'listing_id' when calling get_app_catalog_listing_agreements." if listing_id.nil? raise "Missing the required parameter 'resource_version' when calling get_app_catalog_listing_agreements." if resource_version.nil? raise "Parameter value for 'listing_id' must not be blank" if OCI::Internal::Util.blank_string?(listing_id) raise "Parameter value for 'resource_version' must not be blank" if OCI::Internal::Util.blank_string?(resource_version) path = '/appCatalogListings/{listingId}/resourceVersions/{resourceVersion}/agreements'.sub('{listingId}', listing_id.to_s).sub('{resourceVersion}', resource_version.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: 'ComputeClient#get_app_catalog_listing_agreements') 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::AppCatalogListingResourceVersionAgreements' ) end # rubocop:enable Metrics/BlockLength end |
#get_app_catalog_listing_resource_version(listing_id, resource_version, opts = {}) ⇒ Response
Gets the specified listing resource version.
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 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 |
# File 'lib/oci/core/compute_client.rb', line 1318 def get_app_catalog_listing_resource_version(listing_id, resource_version, opts = {}) logger.debug 'Calling operation ComputeClient#get_app_catalog_listing_resource_version.' if logger raise "Missing the required parameter 'listing_id' when calling get_app_catalog_listing_resource_version." if listing_id.nil? raise "Missing the required parameter 'resource_version' when calling get_app_catalog_listing_resource_version." if resource_version.nil? raise "Parameter value for 'listing_id' must not be blank" if OCI::Internal::Util.blank_string?(listing_id) raise "Parameter value for 'resource_version' must not be blank" if OCI::Internal::Util.blank_string?(resource_version) path = '/appCatalogListings/{listingId}/resourceVersions/{resourceVersion}'.sub('{listingId}', listing_id.to_s).sub('{resourceVersion}', resource_version.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: 'ComputeClient#get_app_catalog_listing_resource_version') 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::AppCatalogListingResourceVersion' ) end # rubocop:enable Metrics/BlockLength end |
#get_boot_volume_attachment(boot_volume_attachment_id, opts = {}) ⇒ Response
Gets information about the specified boot volume attachment.
1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 |
# File 'lib/oci/core/compute_client.rb', line 1373 def (, opts = {}) logger.debug 'Calling operation ComputeClient#get_boot_volume_attachment.' if logger raise "Missing the required parameter 'boot_volume_attachment_id' when calling get_boot_volume_attachment." if .nil? raise "Parameter value for 'boot_volume_attachment_id' must not be blank" if OCI::Internal::Util.blank_string?() path = '/bootVolumeAttachments/{bootVolumeAttachmentId}'.sub('{bootVolumeAttachmentId}', .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: 'ComputeClient#get_boot_volume_attachment') 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::BootVolumeAttachment' ) end # rubocop:enable Metrics/BlockLength end |
#get_console_history(instance_console_history_id, opts = {}) ⇒ Response
Shows the metadata for the specified console history. See capture_console_history for details about using the console history operations.
1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 |
# File 'lib/oci/core/compute_client.rb', line 1429 def get_console_history(instance_console_history_id, opts = {}) logger.debug 'Calling operation ComputeClient#get_console_history.' if logger raise "Missing the required parameter 'instance_console_history_id' when calling get_console_history." if instance_console_history_id.nil? raise "Parameter value for 'instance_console_history_id' must not be blank" if OCI::Internal::Util.blank_string?(instance_console_history_id) path = '/instanceConsoleHistories/{instanceConsoleHistoryId}'.sub('{instanceConsoleHistoryId}', instance_console_history_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: 'ComputeClient#get_console_history') 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::ConsoleHistory' ) end # rubocop:enable Metrics/BlockLength end |
#get_console_history_content(instance_console_history_id, opts = {}) ⇒ Response
Gets the actual console history data (not the metadata). See capture_console_history for details about using the console history operations.
1486 1487 1488 1489 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 |
# File 'lib/oci/core/compute_client.rb', line 1486 def get_console_history_content(instance_console_history_id, opts = {}) logger.debug 'Calling operation ComputeClient#get_console_history_content.' if logger raise "Missing the required parameter 'instance_console_history_id' when calling get_console_history_content." if instance_console_history_id.nil? raise "Parameter value for 'instance_console_history_id' must not be blank" if OCI::Internal::Util.blank_string?(instance_console_history_id) path = '/instanceConsoleHistories/{instanceConsoleHistoryId}/data'.sub('{instanceConsoleHistoryId}', instance_console_history_id.to_s) operation_signing_strategy = :standard # rubocop:disable Style/NegatedIf # Query Params query_params = {} query_params[:offset] = opts[:offset] if opts[:offset] query_params[:length] = opts[:length] if opts[:length] # 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: 'ComputeClient#get_console_history_content') 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: 'String' ) end # rubocop:enable Metrics/BlockLength end |
#get_image(image_id, opts = {}) ⇒ Response
Gets the specified image.
1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 |
# File 'lib/oci/core/compute_client.rb', line 1540 def get_image(image_id, opts = {}) logger.debug 'Calling operation ComputeClient#get_image.' if logger raise "Missing the required parameter 'image_id' when calling get_image." if image_id.nil? raise "Parameter value for 'image_id' must not be blank" if OCI::Internal::Util.blank_string?(image_id) path = '/images/{imageId}'.sub('{imageId}', image_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: 'ComputeClient#get_image') 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::Image' ) end # rubocop:enable Metrics/BlockLength end |
#get_instance(instance_id, opts = {}) ⇒ Response
Gets information about the specified instance.
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 |
# File 'lib/oci/core/compute_client.rb', line 1593 def get_instance(instance_id, opts = {}) logger.debug 'Calling operation ComputeClient#get_instance.' if logger raise "Missing the required parameter 'instance_id' when calling get_instance." if instance_id.nil? raise "Parameter value for 'instance_id' must not be blank" if OCI::Internal::Util.blank_string?(instance_id) path = '/instances/{instanceId}'.sub('{instanceId}', instance_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: 'ComputeClient#get_instance') 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::Instance' ) end # rubocop:enable Metrics/BlockLength end |
#get_instance_console_connection(instance_console_connection_id, opts = {}) ⇒ Response
Gets the specified instance console connection’s information.
1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 |
# File 'lib/oci/core/compute_client.rb', line 1646 def get_instance_console_connection(instance_console_connection_id, opts = {}) logger.debug 'Calling operation ComputeClient#get_instance_console_connection.' if logger raise "Missing the required parameter 'instance_console_connection_id' when calling get_instance_console_connection." if instance_console_connection_id.nil? raise "Parameter value for 'instance_console_connection_id' must not be blank" if OCI::Internal::Util.blank_string?(instance_console_connection_id) path = '/instanceConsoleConnections/{instanceConsoleConnectionId}'.sub('{instanceConsoleConnectionId}', instance_console_connection_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: 'ComputeClient#get_instance_console_connection') 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::InstanceConsoleConnection' ) end # rubocop:enable Metrics/BlockLength end |
#get_vnic_attachment(vnic_attachment_id, opts = {}) ⇒ Response
Gets the information for the specified VNIC attachment.
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 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 |
# File 'lib/oci/core/compute_client.rb', line 1700 def (, opts = {}) logger.debug 'Calling operation ComputeClient#get_vnic_attachment.' if logger raise "Missing the required parameter 'vnic_attachment_id' when calling get_vnic_attachment." if .nil? raise "Parameter value for 'vnic_attachment_id' must not be blank" if OCI::Internal::Util.blank_string?() path = '/vnicAttachments/{vnicAttachmentId}'.sub('{vnicAttachmentId}', .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: 'ComputeClient#get_vnic_attachment') 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::VnicAttachment' ) end # rubocop:enable Metrics/BlockLength end |
#get_volume_attachment(volume_attachment_id, opts = {}) ⇒ Response
Gets information about the specified volume attachment.
1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 |
# File 'lib/oci/core/compute_client.rb', line 1753 def (, opts = {}) logger.debug 'Calling operation ComputeClient#get_volume_attachment.' if logger raise "Missing the required parameter 'volume_attachment_id' when calling get_volume_attachment." if .nil? raise "Parameter value for 'volume_attachment_id' must not be blank" if OCI::Internal::Util.blank_string?() path = '/volumeAttachments/{volumeAttachmentId}'.sub('{volumeAttachmentId}', .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: 'ComputeClient#get_volume_attachment') 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::VolumeAttachment' ) end # rubocop:enable Metrics/BlockLength end |
#get_windows_instance_initial_credentials(instance_id, opts = {}) ⇒ Response
Gets the generated credentials for the instance. Only works for instances that require password to log in (E.g. Windows). For certain OS’es, users will be forced to change the initial credentials.
1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 |
# File 'lib/oci/core/compute_client.rb', line 1808 def get_windows_instance_initial_credentials(instance_id, opts = {}) logger.debug 'Calling operation ComputeClient#get_windows_instance_initial_credentials.' if logger raise "Missing the required parameter 'instance_id' when calling get_windows_instance_initial_credentials." if instance_id.nil? raise "Parameter value for 'instance_id' must not be blank" if OCI::Internal::Util.blank_string?(instance_id) path = '/instances/{instanceId}/initialCredentials'.sub('{instanceId}', instance_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: 'ComputeClient#get_windows_instance_initial_credentials') 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::InstanceCredentials' ) end # rubocop:enable Metrics/BlockLength end |
#instance_action(instance_id, action, opts = {}) ⇒ Response
Performs one of the following power actions on the specified instance:
-
START - Powers on the instance.
-
STOP - Powers off the instance.
-
SOFTRESET - Gracefully reboots instance by sending a shutdown command to the operating system and then powers the instance back on.
-
SOFTSTOP - Gracefully shuts down instance by sending a shutdown command to the operating system.
-
RESET - Powers off the instance and then powers it back on.
For more information see [Stopping and Starting an Instance](docs.cloud.oracle.com/Content/Compute/Tasks/restartinginstance.htm).
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 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 |
# File 'lib/oci/core/compute_client.rb', line 1885 def instance_action(instance_id, action, opts = {}) logger.debug 'Calling operation ComputeClient#instance_action.' if logger raise "Missing the required parameter 'instance_id' when calling instance_action." if instance_id.nil? raise "Missing the required parameter 'action' when calling instance_action." if action.nil? unless %w[STOP START SOFTRESET RESET SOFTSTOP].include?(action) raise "Invalid value for 'action', must be one of STOP, START, SOFTRESET, RESET, SOFTSTOP." end raise "Parameter value for 'instance_id' must not be blank" if OCI::Internal::Util.blank_string?(instance_id) path = '/instances/{instanceId}'.sub('{instanceId}', instance_id.to_s) operation_signing_strategy = :standard # rubocop:disable Style/NegatedIf # Query Params query_params = {} query_params[:action] = action # 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: 'ComputeClient#instance_action') 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 |
#launch_instance(launch_instance_details, opts = {}) ⇒ Response
Creates a new instance in the specified compartment and the specified availability domain. For general information about instances, see [Overview of the Compute Service](docs.cloud.oracle.com/Content/Compute/Concepts/computeoverview.htm).
For information about access control and compartments, see [Overview of the IAM Service](docs.cloud.oracle.com/Content/Identity/Concepts/overview.htm).
For information about availability domains, see [Regions and Availability Domains](docs.cloud.oracle.com/Content/General/Concepts/regions.htm). To get a list of availability domains, use the ‘ListAvailabilityDomains` operation in the Identity and Access Management Service API.
All Oracle Cloud Infrastructure resources, including instances, get an Oracle-assigned, unique ID called an Oracle Cloud Identifier (OCID). When you create a resource, you can find its OCID in the response. You can also retrieve a resource’s OCID by using a List API operation on that resource type, or by viewing the resource in the Console.
To launch an instance using an image or a boot volume use the ‘sourceDetails` parameter in LaunchInstanceDetails.
When you launch an instance, it is automatically attached to a virtual network interface card (VNIC), called the *primary VNIC*. The VNIC has a private IP address from the subnet’s CIDR. You can either assign a private IP address of your choice or let Oracle automatically assign one. You can choose whether the instance has a public IP address. To retrieve the addresses, use the list_vnic_attachments operation to get the VNIC ID for the instance, and then call get_vnic with the VNIC ID.
You can later add secondary VNICs to an instance. For more information, see [Virtual Network Interface Cards (VNICs)](docs.cloud.oracle.com/Content/Network/Tasks/managingVNICs.htm).
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 2014 2015 2016 2017 |
# File 'lib/oci/core/compute_client.rb', line 1981 def launch_instance(launch_instance_details, opts = {}) logger.debug 'Calling operation ComputeClient#launch_instance.' if logger raise "Missing the required parameter 'launch_instance_details' when calling launch_instance." if launch_instance_details.nil? path = '/instances/' 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(launch_instance_details) # rubocop:disable Metrics/BlockLength OCI::Retry.(applicable_retry_config(opts), call_name: 'ComputeClient#launch_instance') 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_app_catalog_listing_resource_versions(listing_id, opts = {}) ⇒ Response
Gets all resource versions for a particular listing.
2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 |
# File 'lib/oci/core/compute_client.rb', line 2047 def list_app_catalog_listing_resource_versions(listing_id, opts = {}) logger.debug 'Calling operation ComputeClient#list_app_catalog_listing_resource_versions.' if logger raise "Missing the required parameter 'listing_id' when calling list_app_catalog_listing_resource_versions." if listing_id.nil? 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 'listing_id' must not be blank" if OCI::Internal::Util.blank_string?(listing_id) path = '/appCatalogListings/{listingId}/resourceVersions'.sub('{listingId}', listing_id.to_s) operation_signing_strategy = :standard # rubocop:disable Style/NegatedIf # Query Params query_params = {} query_params[:limit] = opts[:limit] if opts[:limit] query_params[:page] = opts[:page] if opts[:page] 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: 'ComputeClient#list_app_catalog_listing_resource_versions') 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::AppCatalogListingResourceVersionSummary>' ) end # rubocop:enable Metrics/BlockLength end |
#list_app_catalog_listings(opts = {}) ⇒ Response
Lists the published listings.
2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 |
# File 'lib/oci/core/compute_client.rb', line 2124 def list_app_catalog_listings(opts = {}) logger.debug 'Calling operation ComputeClient#list_app_catalog_listings.' if logger 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 = '/appCatalogListings' operation_signing_strategy = :standard # rubocop:disable Style/NegatedIf # Query Params query_params = {} query_params[:limit] = opts[:limit] if opts[:limit] query_params[:page] = opts[:page] if opts[:page] query_params[:sortOrder] = opts[:sort_order] if opts[:sort_order] query_params[:publisherName] = opts[:publisher_name] if opts[:publisher_name] query_params[:publisherType] = opts[:publisher_type] if opts[:publisher_type] query_params[:displayName] = opts[:display_name] if opts[:display_name] # 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: 'ComputeClient#list_app_catalog_listings') 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::AppCatalogListingSummary>' ) end # rubocop:enable Metrics/BlockLength end |
#list_app_catalog_subscriptions(compartment_id, opts = {}) ⇒ Response
Lists subscriptions for a compartment.
2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 |
# File 'lib/oci/core/compute_client.rb', line 2209 def list_app_catalog_subscriptions(compartment_id, opts = {}) logger.debug 'Calling operation ComputeClient#list_app_catalog_subscriptions.' if logger raise "Missing the required parameter 'compartment_id' when calling list_app_catalog_subscriptions." 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 = '/appCatalogSubscriptions' 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] query_params[:listingId] = opts[:listing_id] if opts[:listing_id] # 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: 'ComputeClient#list_app_catalog_subscriptions') 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::AppCatalogSubscriptionSummary>' ) end # rubocop:enable Metrics/BlockLength end |
#list_boot_volume_attachments(availability_domain, compartment_id, opts = {}) ⇒ Response
Lists the boot volume attachments in the specified compartment. You can filter the list by specifying an instance OCID, boot volume OCID, or both.
2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 |
# File 'lib/oci/core/compute_client.rb', line 2291 def (availability_domain, compartment_id, opts = {}) logger.debug 'Calling operation ComputeClient#list_boot_volume_attachments.' if logger raise "Missing the required parameter 'availability_domain' when calling list_boot_volume_attachments." if availability_domain.nil? raise "Missing the required parameter 'compartment_id' when calling list_boot_volume_attachments." if compartment_id.nil? path = '/bootVolumeAttachments/' operation_signing_strategy = :standard # rubocop:disable Style/NegatedIf # Query Params query_params = {} query_params[:availabilityDomain] = availability_domain query_params[:compartmentId] = compartment_id query_params[:limit] = opts[:limit] if opts[:limit] query_params[:page] = opts[:page] if opts[:page] query_params[:instanceId] = opts[:instance_id] if opts[:instance_id] query_params[:bootVolumeId] = opts[:boot_volume_id] if opts[:boot_volume_id] # Header Params header_params = {} header_params[:accept] = 'application/json, application/x-json-stream' 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: 'ComputeClient#list_boot_volume_attachments') 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::BootVolumeAttachment>' ) end # rubocop:enable Metrics/BlockLength end |
#list_console_histories(compartment_id, opts = {}) ⇒ Response
Lists the console history metadata for the specified compartment or instance.
2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 2432 2433 2434 |
# File 'lib/oci/core/compute_client.rb', line 2380 def list_console_histories(compartment_id, opts = {}) logger.debug 'Calling operation ComputeClient#list_console_histories.' if logger raise "Missing the required parameter 'compartment_id' when calling list_console_histories." 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::ConsoleHistory::LIFECYCLE_STATE_ENUM.include?(opts[:lifecycle_state]) raise 'Invalid value for "lifecycle_state", must be one of the values in OCI::Core::Models::ConsoleHistory::LIFECYCLE_STATE_ENUM.' end path = '/instanceConsoleHistories/' operation_signing_strategy = :standard # rubocop:disable Style/NegatedIf # Query Params query_params = {} query_params[:compartmentId] = compartment_id query_params[:availabilityDomain] = opts[:availability_domain] if opts[:availability_domain] query_params[:limit] = opts[:limit] if opts[:limit] query_params[:page] = opts[:page] if opts[:page] query_params[:instanceId] = opts[:instance_id] if opts[:instance_id] 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: 'ComputeClient#list_console_histories') 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::ConsoleHistory>' ) end # rubocop:enable Metrics/BlockLength end |
#list_images(compartment_id, opts = {}) ⇒ Response
Lists the available images in the specified compartment, including both [Oracle-provided images](docs.cloud.oracle.com/Content/Compute/References/images.htm) and [custom images](docs.cloud.oracle.com/Content/Compute/Tasks/managingcustomimages.htm) that have been created. The list of images returned is ordered to first show all Oracle-provided images, then all custom images.
The order of images returned may change when new images are released.
2494 2495 2496 2497 2498 2499 2500 2501 2502 2503 2504 2505 2506 2507 2508 2509 2510 2511 2512 2513 2514 2515 2516 2517 2518 2519 2520 2521 2522 2523 2524 2525 2526 2527 2528 2529 2530 2531 2532 2533 2534 2535 2536 2537 2538 2539 2540 2541 2542 2543 2544 2545 2546 2547 2548 2549 2550 |
# File 'lib/oci/core/compute_client.rb', line 2494 def list_images(compartment_id, opts = {}) logger.debug 'Calling operation ComputeClient#list_images.' if logger raise "Missing the required parameter 'compartment_id' when calling list_images." 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::Image::LIFECYCLE_STATE_ENUM.include?(opts[:lifecycle_state]) raise 'Invalid value for "lifecycle_state", must be one of the values in OCI::Core::Models::Image::LIFECYCLE_STATE_ENUM.' end path = '/images' 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[:operatingSystem] = opts[:operating_system] if opts[:operating_system] query_params[:operatingSystemVersion] = opts[:operating_system_version] if opts[:operating_system_version] query_params[:shape] = opts[:shape] if opts[:shape] 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: 'ComputeClient#list_images') 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::Image>' ) end # rubocop:enable Metrics/BlockLength end |
#list_instance_console_connections(compartment_id, opts = {}) ⇒ Response
Lists the console connections for the specified compartment or instance.
For more information about console access, see [Accessing the Console](docs.cloud.oracle.com/Content/Compute/References/serialconsole.htm).
2580 2581 2582 2583 2584 2585 2586 2587 2588 2589 2590 2591 2592 2593 2594 2595 2596 2597 2598 2599 2600 2601 2602 2603 2604 2605 2606 2607 2608 2609 2610 2611 2612 2613 2614 2615 2616 2617 2618 |
# File 'lib/oci/core/compute_client.rb', line 2580 def list_instance_console_connections(compartment_id, opts = {}) logger.debug 'Calling operation ComputeClient#list_instance_console_connections.' if logger raise "Missing the required parameter 'compartment_id' when calling list_instance_console_connections." if compartment_id.nil? path = '/instanceConsoleConnections' operation_signing_strategy = :standard # rubocop:disable Style/NegatedIf # Query Params query_params = {} query_params[:compartmentId] = compartment_id query_params[:instanceId] = opts[:instance_id] if opts[:instance_id] query_params[:limit] = opts[:limit] if opts[:limit] query_params[:page] = opts[:page] if opts[:page] # 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: 'ComputeClient#list_instance_console_connections') 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::InstanceConsoleConnection>' ) end # rubocop:enable Metrics/BlockLength end |
#list_instance_devices(instance_id, opts = {}) ⇒ Response
Gets a list of all the devices for given instance. You can optionally filter results by device availability.
2665 2666 2667 2668 2669 2670 2671 2672 2673 2674 2675 2676 2677 2678 2679 2680 2681 2682 2683 2684 2685 2686 2687 2688 2689 2690 2691 2692 2693 2694 2695 2696 2697 2698 2699 2700 2701 2702 2703 2704 2705 2706 2707 2708 2709 2710 2711 2712 2713 2714 2715 |
# File 'lib/oci/core/compute_client.rb', line 2665 def list_instance_devices(instance_id, opts = {}) logger.debug 'Calling operation ComputeClient#list_instance_devices.' if logger raise "Missing the required parameter 'instance_id' when calling list_instance_devices." if instance_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_id' must not be blank" if OCI::Internal::Util.blank_string?(instance_id) path = '/instances/{instanceId}/devices'.sub('{instanceId}', instance_id.to_s) operation_signing_strategy = :standard # rubocop:disable Style/NegatedIf # Query Params query_params = {} query_params[:isAvailable] = opts[:is_available] if !opts[:is_available].nil? query_params[:name] = opts[:name] if opts[: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' header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id] # rubocop:enable Style/NegatedIf post_body = nil # rubocop:disable Metrics/BlockLength OCI::Retry.(applicable_retry_config(opts), call_name: 'ComputeClient#list_instance_devices') 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::Device>' ) end # rubocop:enable Metrics/BlockLength end |
#list_instances(compartment_id, opts = {}) ⇒ Response
Lists the instances in the specified compartment and the specified availability domain. You can filter the results by specifying an instance name (the list will include all the identically-named instances in the compartment).
2766 2767 2768 2769 2770 2771 2772 2773 2774 2775 2776 2777 2778 2779 2780 2781 2782 2783 2784 2785 2786 2787 2788 2789 2790 2791 2792 2793 2794 2795 2796 2797 2798 2799 2800 2801 2802 2803 2804 2805 2806 2807 2808 2809 2810 2811 2812 2813 2814 2815 2816 2817 2818 2819 2820 |
# File 'lib/oci/core/compute_client.rb', line 2766 def list_instances(compartment_id, opts = {}) logger.debug 'Calling operation ComputeClient#list_instances.' if logger raise "Missing the required parameter 'compartment_id' when calling list_instances." 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::Instance::LIFECYCLE_STATE_ENUM.include?(opts[:lifecycle_state]) raise 'Invalid value for "lifecycle_state", must be one of the values in OCI::Core::Models::Instance::LIFECYCLE_STATE_ENUM.' end path = '/instances/' operation_signing_strategy = :standard # rubocop:disable Style/NegatedIf # Query Params query_params = {} query_params[:compartmentId] = compartment_id query_params[:availabilityDomain] = opts[:availability_domain] if opts[:availability_domain] 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, application/x-json-stream' 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: 'ComputeClient#list_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::Instance>' ) end # rubocop:enable Metrics/BlockLength end |
#list_shapes(compartment_id, opts = {}) ⇒ Response
Lists the shapes that can be used to launch an instance within the specified compartment. You can filter the list by compatibility with a specific image.
2853 2854 2855 2856 2857 2858 2859 2860 2861 2862 2863 2864 2865 2866 2867 2868 2869 2870 2871 2872 2873 2874 2875 2876 2877 2878 2879 2880 2881 2882 2883 2884 2885 2886 2887 2888 2889 2890 2891 2892 |
# File 'lib/oci/core/compute_client.rb', line 2853 def list_shapes(compartment_id, opts = {}) logger.debug 'Calling operation ComputeClient#list_shapes.' if logger raise "Missing the required parameter 'compartment_id' when calling list_shapes." if compartment_id.nil? path = '/shapes' operation_signing_strategy = :standard # rubocop:disable Style/NegatedIf # Query Params query_params = {} query_params[:compartmentId] = compartment_id query_params[:availabilityDomain] = opts[:availability_domain] if opts[:availability_domain] query_params[:limit] = opts[:limit] if opts[:limit] query_params[:page] = opts[:page] if opts[:page] query_params[:imageId] = opts[:image_id] if opts[:image_id] # 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: 'ComputeClient#list_shapes') 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::Shape>' ) end # rubocop:enable Metrics/BlockLength end |
#list_vnic_attachments(compartment_id, opts = {}) ⇒ Response
Lists the VNIC attachments in the specified compartment. A VNIC attachment resides in the same compartment as the attached instance. The list can be filtered by instance, VNIC, or availability domain.
2927 2928 2929 2930 2931 2932 2933 2934 2935 2936 2937 2938 2939 2940 2941 2942 2943 2944 2945 2946 2947 2948 2949 2950 2951 2952 2953 2954 2955 2956 2957 2958 2959 2960 2961 2962 2963 2964 2965 2966 2967 |
# File 'lib/oci/core/compute_client.rb', line 2927 def (compartment_id, opts = {}) logger.debug 'Calling operation ComputeClient#list_vnic_attachments.' if logger raise "Missing the required parameter 'compartment_id' when calling list_vnic_attachments." if compartment_id.nil? path = '/vnicAttachments/' operation_signing_strategy = :standard # rubocop:disable Style/NegatedIf # Query Params query_params = {} query_params[:compartmentId] = compartment_id query_params[:availabilityDomain] = opts[:availability_domain] if opts[:availability_domain] query_params[:instanceId] = opts[:instance_id] if opts[:instance_id] query_params[:limit] = opts[:limit] if opts[:limit] query_params[:page] = opts[:page] if opts[:page] query_params[:vnicId] = opts[:vnic_id] if opts[:vnic_id] # Header Params header_params = {} header_params[:accept] = 'application/json, application/x-json-stream' 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: 'ComputeClient#list_vnic_attachments') 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::VnicAttachment>' ) end # rubocop:enable Metrics/BlockLength end |
#list_volume_attachments(compartment_id, opts = {}) ⇒ Response
Lists the volume attachments in the specified compartment. You can filter the list by specifying an instance OCID, volume OCID, or both.
Currently, the only supported volume attachment type are IScsiVolumeAttachment and ParavirtualizedVolumeAttachment.
3004 3005 3006 3007 3008 3009 3010 3011 3012 3013 3014 3015 3016 3017 3018 3019 3020 3021 3022 3023 3024 3025 3026 3027 3028 3029 3030 3031 3032 3033 3034 3035 3036 3037 3038 3039 3040 3041 3042 3043 3044 |
# File 'lib/oci/core/compute_client.rb', line 3004 def (compartment_id, opts = {}) logger.debug 'Calling operation ComputeClient#list_volume_attachments.' if logger raise "Missing the required parameter 'compartment_id' when calling list_volume_attachments." if compartment_id.nil? path = '/volumeAttachments/' operation_signing_strategy = :standard # rubocop:disable Style/NegatedIf # Query Params query_params = {} query_params[:compartmentId] = compartment_id query_params[:availabilityDomain] = opts[:availability_domain] if opts[:availability_domain] query_params[:limit] = opts[:limit] if opts[:limit] query_params[:page] = opts[:page] if opts[:page] query_params[:instanceId] = opts[:instance_id] if opts[:instance_id] query_params[:volumeId] = opts[:volume_id] if opts[:volume_id] # Header Params header_params = {} header_params[:accept] = 'application/json, application/x-json-stream' 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: 'ComputeClient#list_volume_attachments') 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::VolumeAttachment>' ) end # rubocop:enable Metrics/BlockLength end |
#logger ⇒ Logger
Returns The logger for this client. May be nil.
106 107 108 |
# File 'lib/oci/core/compute_client.rb', line 106 def logger @api_client.config.logger end |
#terminate_instance(instance_id, opts = {}) ⇒ Response
Terminates the specified instance. Any attached VNICs and volumes are automatically detached when the instance terminates.
To preserve the boot volume associated with the instance, specify ‘true` for `PreserveBootVolumeQueryParam`. To delete the boot volume when the instance is deleted, specify `false` or do not specify a value for `PreserveBootVolumeQueryParam`.
This is an asynchronous operation. The instance’s ‘lifecycleState` will change to TERMINATING temporarily until the instance is completely removed.
3075 3076 3077 3078 3079 3080 3081 3082 3083 3084 3085 3086 3087 3088 3089 3090 3091 3092 3093 3094 3095 3096 3097 3098 3099 3100 3101 3102 3103 3104 3105 3106 3107 3108 3109 3110 3111 |
# File 'lib/oci/core/compute_client.rb', line 3075 def terminate_instance(instance_id, opts = {}) logger.debug 'Calling operation ComputeClient#terminate_instance.' if logger raise "Missing the required parameter 'instance_id' when calling terminate_instance." if instance_id.nil? raise "Parameter value for 'instance_id' must not be blank" if OCI::Internal::Util.blank_string?(instance_id) path = '/instances/{instanceId}'.sub('{instanceId}', instance_id.to_s) operation_signing_strategy = :standard # rubocop:disable Style/NegatedIf # Query Params query_params = {} query_params[:preserveBootVolume] = opts[:preserve_boot_volume] if !opts[:preserve_boot_volume].nil? # 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: 'ComputeClient#terminate_instance') 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_console_history(instance_console_history_id, update_console_history_details, opts = {}) ⇒ Response
Updates the specified console history metadata.
3132 3133 3134 3135 3136 3137 3138 3139 3140 3141 3142 3143 3144 3145 3146 3147 3148 3149 3150 3151 3152 3153 3154 3155 3156 3157 3158 3159 3160 3161 3162 3163 3164 3165 3166 3167 3168 3169 |
# File 'lib/oci/core/compute_client.rb', line 3132 def update_console_history(instance_console_history_id, update_console_history_details, opts = {}) logger.debug 'Calling operation ComputeClient#update_console_history.' if logger raise "Missing the required parameter 'instance_console_history_id' when calling update_console_history." if instance_console_history_id.nil? raise "Missing the required parameter 'update_console_history_details' when calling update_console_history." if update_console_history_details.nil? raise "Parameter value for 'instance_console_history_id' must not be blank" if OCI::Internal::Util.blank_string?(instance_console_history_id) path = '/instanceConsoleHistories/{instanceConsoleHistoryId}'.sub('{instanceConsoleHistoryId}', instance_console_history_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 = @api_client.object_to_http_body(update_console_history_details) # rubocop:disable Metrics/BlockLength OCI::Retry.(applicable_retry_config(opts), call_name: 'ComputeClient#update_console_history') 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::ConsoleHistory' ) end # rubocop:enable Metrics/BlockLength end |
#update_image(image_id, update_image_details, opts = {}) ⇒ Response
Updates the display name of the image. Avoid entering confidential information.
3196 3197 3198 3199 3200 3201 3202 3203 3204 3205 3206 3207 3208 3209 3210 3211 3212 3213 3214 3215 3216 3217 3218 3219 3220 3221 3222 3223 3224 3225 3226 3227 3228 3229 3230 3231 3232 3233 3234 3235 |
# File 'lib/oci/core/compute_client.rb', line 3196 def update_image(image_id, update_image_details, opts = {}) logger.debug 'Calling operation ComputeClient#update_image.' if logger raise "Missing the required parameter 'image_id' when calling update_image." if image_id.nil? raise "Missing the required parameter 'update_image_details' when calling update_image." if update_image_details.nil? raise "Parameter value for 'image_id' must not be blank" if OCI::Internal::Util.blank_string?(image_id) path = '/images/{imageId}'.sub('{imageId}', image_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_image_details) # rubocop:disable Metrics/BlockLength OCI::Retry.(applicable_retry_config(opts), call_name: 'ComputeClient#update_image') 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::Image' ) end # rubocop:enable Metrics/BlockLength end |
#update_instance(instance_id, update_instance_details, opts = {}) ⇒ Response
Updates certain fields on the specified instance. Fields that are not provided in the request will not be updated. Avoid entering confidential information.
Changes to metadata fields will be reflected in the instance metadata service (this may take up to a minute).
The OCID of the instance remains the same.
3269 3270 3271 3272 3273 3274 3275 3276 3277 3278 3279 3280 3281 3282 3283 3284 3285 3286 3287 3288 3289 3290 3291 3292 3293 3294 3295 3296 3297 3298 3299 3300 3301 3302 3303 3304 3305 3306 3307 3308 |
# File 'lib/oci/core/compute_client.rb', line 3269 def update_instance(instance_id, update_instance_details, opts = {}) logger.debug 'Calling operation ComputeClient#update_instance.' if logger raise "Missing the required parameter 'instance_id' when calling update_instance." if instance_id.nil? raise "Missing the required parameter 'update_instance_details' when calling update_instance." if update_instance_details.nil? raise "Parameter value for 'instance_id' must not be blank" if OCI::Internal::Util.blank_string?(instance_id) path = '/instances/{instanceId}'.sub('{instanceId}', instance_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_details) # rubocop:disable Metrics/BlockLength OCI::Retry.(applicable_retry_config(opts), call_name: 'ComputeClient#update_instance') 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::Instance' ) end # rubocop:enable Metrics/BlockLength end |