Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ComputeClient

Hierarchy

  • ComputeClient

Constructors

Properties

Accessors

Methods

Constructors

constructor

Properties

Protected _defaultHeaders

_defaultHeaders: any

Protected _endpoint

_endpoint: string = ""

Protected _httpClient

_httpClient: HttpClient

Protected _waiters

_waiters: ComputeWaiter

Static Protected serviceEndpointTemplate

serviceEndpointTemplate: string = "https://iaas.{region}.{secondLevelDomain}"

Accessors

endpoint

  • set endpoint(endpoint: string): void

region

  • set region(region: Region): void
  • Sets the region to call (ex, Region.US_PHOENIX_1). Note, this will call {@link #endpoint(String) endpoint} after resolving the endpoint.

    Parameters

    • region: Region

      The region of the service.

    Returns void

regionId

  • set regionId(regionId: string): void
  • Sets the regionId to call (ex, 'us-phoenix-1').

    Note, this will first try to map the region ID to a known Region and call {@link #region(Region) region}. If no known Region could be determined, it will create an endpoint assuming its in default Realm OC1 and then call {@link #endpoint(String) endpoint}.

    Note, this will first try to map the region ID to a known Region and call {@link #region(Region) region}. If no known Region could be determined, it will create an endpoint assuming its in default Realm OC1 and then call {@link #endpoint(String) endpoint}.

    Parameters

    • regionId: string

      The public region ID.

    Returns void

Methods

addImageShapeCompatibilityEntry

attachBootVolume

attachVnic

attachVolume

captureConsoleHistory

  • 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.

    1. 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. 2. 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). 3. Use `GetConsoleHistoryContent` to get the actual console history data (not the metadata). 4. Optionally, use `DeleteConsoleHistory` to delete the console history metadata and the console history data.

    throws

    OciError when an error occurs

    Parameters

    Returns Promise<CaptureConsoleHistoryResponse>

    CaptureConsoleHistoryResponse

changeDedicatedVmHostCompartment

changeImageCompartment

changeInstanceCompartment

createAppCatalogSubscription

createDedicatedVmHost

createImage

  • 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](https://docs.cloud.oracle.com/Content/Compute/Tasks/managingcustomimages.htm).

    When importing an exported image from Object Storage, you specify the source information in {@link #imageSourceDetails(ImageSourceDetailsRequest) imageSourceDetails}.

    When importing an image based on the namespace, bucket name, and object name, use {@link #imageSourceViaObjectStorageTupleDetails(ImageSourceViaObjectStorageTupleDetailsRequest) imageSourceViaObjectStorageTupleDetails}.

    When importing an image based on the Object Storage URL, use {@link #imageSourceViaObjectStorageUriDetails(ImageSourceViaObjectStorageUriDetailsRequest) imageSourceViaObjectStorageUriDetails}. See [Object Storage URLs](https://docs.cloud.oracle.com/Content/Compute/Tasks/imageimportexport.htm#URLs) and [Using Pre-Authenticated Requests](https://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](https://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 {@link #updateImage(UpdateImageRequest) updateImage}. Avoid entering confidential information.

    throws

    OciError when an error occurs

    Parameters

    Returns Promise<CreateImageResponse>

    CreateImageResponse

createInstanceConsoleConnection

  • Creates a new console connection to the specified instance. After 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](https://docs.cloud.oracle.com/Content/Compute/References/serialconsole.htm).

    throws

    OciError when an error occurs

    Parameters

    Returns Promise<CreateInstanceConsoleConnectionResponse>

    CreateInstanceConsoleConnectionResponse

createWaiters

  • Creates a new ComputeWaiter for resources for this service.

    Parameters

    • workRequestClient: WorkRequestClient

      The work request service client used to query for work request status

    • Optional config: common.WaiterConfiguration

      The waiter configuration for termination and delay strategy

    Returns ComputeWaiter

    The service waiters.

deleteAppCatalogSubscription

deleteConsoleHistory

deleteDedicatedVmHost

  • Deletes the specified dedicated virtual machine host.

    If any VM instances are assigned to the dedicated virtual machine host, the delete operation will fail and the service will return a 409 response code.

    throws

    OciError when an error occurs

    Parameters

    Returns Promise<DeleteDedicatedVmHostResponse>

    DeleteDedicatedVmHostResponse

deleteImage

deleteInstanceConsoleConnection

detachBootVolume

  • 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.

    throws

    OciError when an error occurs

    Parameters

    Returns Promise<DetachBootVolumeResponse>

    DetachBootVolumeResponse

detachVnic

  • 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](https://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.

    throws

    OciError when an error occurs

    Parameters

    Returns Promise<DetachVnicResponse>

    DetachVnicResponse

detachVolume

  • 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.

    throws

    OciError when an error occurs

    Parameters

    Returns Promise<DetachVolumeResponse>

    DetachVolumeResponse

exportImage

  • 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](https://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](https://docs.cloud.oracle.com/Content/Identity/Concepts/commonpolicies.htm#Let4).

    See [Object Storage URLs](https://docs.cloud.oracle.com/Content/Compute/Tasks/imageimportexport.htm#URLs) and [Using Pre-Authenticated Requests](https://docs.cloud.oracle.com/Content/Object/Tasks/usingpreauthenticatedrequests.htm) for constructing URLs for image import/export.

    throws

    OciError when an error occurs

    Parameters

    Returns Promise<ExportImageResponse>

    ExportImageResponse

getAppCatalogListing

getAppCatalogListingAgreements

getAppCatalogListingResourceVersion

getBootVolumeAttachment

getConsoleHistory

  • Shows the metadata for the specified console history. See {@link #captureConsoleHistory(CaptureConsoleHistoryRequest) captureConsoleHistory} for details about using the console history operations.

    throws

    OciError when an error occurs

    Parameters

    Returns Promise<GetConsoleHistoryResponse>

    GetConsoleHistoryResponse

getConsoleHistoryContent

getDedicatedVmHost

getImage

getImageShapeCompatibilityEntry

getInstance

getInstanceConsoleConnection

getVnicAttachment

getVolumeAttachment

getWaiters

getWindowsInstanceInitialCredentials

instanceAction

  • Performs one of the following power actions on the specified instance:

    - **START** - Powers on the instance.

    - **STOP** - Powers off the instance.

    - **RESET** - Powers off the instance and then powers it back on.

    - **SOFTSTOP** - Gracefully shuts down the instance by sending a shutdown command to the operating system. If the applications that run on the instance take a long time to shut down, they could be improperly stopped, resulting in data corruption. To avoid this, shut down the instance using the commands available in the OS before you softstop the instance.

    - **SOFTRESET** - Gracefully reboots the instance by sending a shutdown command to the operating system, and then powers the instance back on.

    For more information, see [Stopping and Starting an Instance](https://docs.cloud.oracle.com/Content/Compute/Tasks/restartinginstance.htm).

    throws

    OciError when an error occurs

    Parameters

    Returns Promise<InstanceActionResponse>

    InstanceActionResponse

launchInstance

  • Creates a new instance in the specified compartment and the specified availability domain. For general information about instances, see Overview of the Compute Service.

    For information about access control and compartments, see [Overview of the IAM Service](https://docs.cloud.oracle.com/Content/Identity/Concepts/overview.htm).

    For information about availability domains, see [Regions and Availability Domains](https://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 {@link #listVnicAttachments(ListVnicAttachmentsRequest) listVnicAttachments} operation to get the VNIC ID for the instance, and then call {@link #getVnic(GetVnicRequest) getVnic} with the VNIC ID.

    You can later add secondary VNICs to an instance. For more information, see [Virtual Network Interface Cards (VNICs)](https://docs.cloud.oracle.com/Content/Network/Tasks/managingVNICs.htm).

    throws

    OciError when an error occurs

    Parameters

    Returns Promise<LaunchInstanceResponse>

    LaunchInstanceResponse

listAllAppCatalogListingResourceVersions

listAllAppCatalogListingResourceVersionsResponses

listAllAppCatalogListings

  • Creates a new async iterator which will iterate over the models.AppCatalogListingSummary objects contained in responses from the listAppCatalogListings operation. This iterator will fetch more data from the server as needed.

    Parameters

    Returns AsyncIterableIterator<AppCatalogListingSummary>

listAllAppCatalogListingsResponses

listAllAppCatalogSubscriptions

listAllAppCatalogSubscriptionsResponses

listAllBootVolumeAttachments

  • Creates a new async iterator which will iterate over the models.BootVolumeAttachment objects contained in responses from the listBootVolumeAttachments operation. This iterator will fetch more data from the server as needed.

    Parameters

    Returns AsyncIterableIterator<BootVolumeAttachment>

listAllBootVolumeAttachmentsResponses

listAllConsoleHistories

  • Creates a new async iterator which will iterate over the models.ConsoleHistory objects contained in responses from the listConsoleHistories operation. This iterator will fetch more data from the server as needed.

    Parameters

    Returns AsyncIterableIterator<ConsoleHistory>

listAllConsoleHistoriesResponses

listAllDedicatedVmHostInstanceShapes

listAllDedicatedVmHostInstanceShapesResponses

listAllDedicatedVmHostInstances

listAllDedicatedVmHostInstancesResponses

listAllDedicatedVmHostShapes

listAllDedicatedVmHostShapesResponses

listAllDedicatedVmHosts

  • Creates a new async iterator which will iterate over the models.DedicatedVmHostSummary objects contained in responses from the listDedicatedVmHosts operation. This iterator will fetch more data from the server as needed.

    Parameters

    Returns AsyncIterableIterator<DedicatedVmHostSummary>

listAllDedicatedVmHostsResponses

listAllImageShapeCompatibilityEntries

listAllImageShapeCompatibilityEntriesResponses

listAllImages

  • Creates a new async iterator which will iterate over the models.Image objects contained in responses from the listImages operation. This iterator will fetch more data from the server as needed.

    Parameters

    Returns AsyncIterableIterator<Image>

listAllImagesResponses

  • Creates a new async iterator which will iterate over the responses received from the listImages operation. This iterator will fetch more data from the server as needed.

    Parameters

    Returns AsyncIterableIterator<ListImagesResponse>

listAllInstanceConsoleConnections

listAllInstanceConsoleConnectionsResponses

listAllInstanceDevices

  • Creates a new async iterator which will iterate over the models.Device objects contained in responses from the listInstanceDevices operation. This iterator will fetch more data from the server as needed.

    Parameters

    Returns AsyncIterableIterator<Device>

listAllInstanceDevicesResponses

listAllInstances

  • Creates a new async iterator which will iterate over the models.Instance objects contained in responses from the listInstances operation. This iterator will fetch more data from the server as needed.

    Parameters

    Returns AsyncIterableIterator<Instance>

listAllInstancesResponses

  • Creates a new async iterator which will iterate over the responses received from the listInstances operation. This iterator will fetch more data from the server as needed.

    Parameters

    Returns AsyncIterableIterator<ListInstancesResponse>

listAllShapes

  • Creates a new async iterator which will iterate over the models.Shape objects contained in responses from the listShapes operation. This iterator will fetch more data from the server as needed.

    Parameters

    Returns AsyncIterableIterator<Shape>

listAllShapesResponses

  • Creates a new async iterator which will iterate over the responses received from the listShapes operation. This iterator will fetch more data from the server as needed.

    Parameters

    Returns AsyncIterableIterator<ListShapesResponse>

listAllVnicAttachments

  • Creates a new async iterator which will iterate over the models.VnicAttachment objects contained in responses from the listVnicAttachments operation. This iterator will fetch more data from the server as needed.

    Parameters

    Returns AsyncIterableIterator<VnicAttachment>

listAllVnicAttachmentsResponses

listAllVolumeAttachments

  • Creates a new async iterator which will iterate over the models.VolumeAttachment objects contained in responses from the listVolumeAttachments operation. This iterator will fetch more data from the server as needed.

    Parameters

    Returns AsyncIterableIterator<VolumeAttachment>

listAllVolumeAttachmentsResponses

listAppCatalogListingResourceVersions

listAppCatalogListings

listAppCatalogSubscriptions

listBootVolumeAttachments

listConsoleHistories

listDedicatedVmHostInstanceShapes

listDedicatedVmHostInstances

listDedicatedVmHostShapes

listDedicatedVmHosts

  • Returns the list of dedicated virtual machine hosts that match the specified criteria in the specified compartment.

    You can limit the list by specifying a dedicated virtual machine host display name. The list will include all the identically-named dedicated virtual machine hosts in the compartment.

    throws

    OciError when an error occurs

    Parameters

    Returns Promise<ListDedicatedVmHostsResponse>

    ListDedicatedVmHostsResponse

listImageShapeCompatibilityEntries

listImages

listInstanceConsoleConnections

listInstanceDevices

listInstances

  • 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).

    throws

    OciError when an error occurs

    Parameters

    Returns Promise<ListInstancesResponse>

    ListInstancesResponse

listShapes

  • 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.

    throws

    OciError when an error occurs

    Parameters

    Returns Promise<ListShapesResponse>

    ListShapesResponse

listVnicAttachments

  • 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.

    throws

    OciError when an error occurs

    Parameters

    Returns Promise<ListVnicAttachmentsResponse>

    ListVnicAttachmentsResponse

listVolumeAttachments

removeImageShapeCompatibilityEntry

terminateInstance

  • 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.

    throws

    OciError when an error occurs

    Parameters

    Returns Promise<TerminateInstanceResponse>

    TerminateInstanceResponse

updateConsoleHistory

updateDedicatedVmHost

updateImage

updateInstance

  • 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.

    throws

    OciError when an error occurs

    Parameters

    Returns Promise<UpdateInstanceResponse>

    UpdateInstanceResponse