Copy from Object Store (v2)

Use the Copy from Object Store (v2) REST API to copy a file or a backup snapshot from the Oracle Object Storage Cloud (the source) to the cloud environment (the target). If you are copying a backup snapshot, this API copies it from the Object Storage bucket and extracts its contents in Oracle Enterprise Performance Management Cloud.

This topic describes the simplified v2 version of this REST API. This version contains all parameters in the payload and does not require URL encoding while calling the REST APIs. This makes the v2 API easier to use. This API is backwards compatible.

Before using the REST resources, you must understand how to access the REST resources and other important concepts. See About the REST APIs. Using this REST API requires prerequisites. See Prerequisites.

This REST API is version v2.

Required Roles

Service Administrator

REST Resource

POST /interop/rest/v2/objectstorage/copyfrom

Supported Media Types: application/json

Table 8-65 Tasks

Task Request REST Resource
Trigger copyfromobjectstore POST /interop/rest/v2/objectstorage/copyfrom
Retrieve copyfromobjectstore  status GET /interop/rest/v2/status/jobs/777

Parameters:

The following table summarizes the request parameters.

Table 8-66 Parameters

Name Description Type Required Default
url

The URL for Oracle Cloud Object Storage, appended with the bucket name and an optional object name.

This is the URL format: :

https://swiftobjectstorage.region_identifier.oraclecloud.com/v1/namespace/bucket_name/object_name

Components of this URL:

  • region_identifier is a Oracle Cloud Infrastructure hosting region.
  • namespace is the top-level container for all buckets and objects. Each Oracle Cloud Infrastructure tenant is assigned a unique system-generated and immutable Object Storage namespace name at account creation time. Your tenancy's namespace name, for example, axaxnpcrorw5, is effective across all regions.
  • bucket_name is the name of a logical container where you store your data and files. Buckets are organized and maintained under compartments. A system-generated bucket name, for example, bucket-20210301-1359 reflects the current year, month, day, and time.
  • object_name is the name of the snapshot or file that you want to copy from Oracle Object Storage Cloud.

For more information, see these topics in Oracle Cloud Infrastructure Documentation:

Payload Yes None
userName The name of the user who has access to the Object Store Payload Yes None
password

The password for the user who has access to the Object Store.

Payload Yes None
targetFile

Name of the target filename (with path) of the downloaded artifact. When copying snapshots, do not specify the ZIP extension.

Examples: Artifact Snapshot_24_Sept_2020, inbox/File_new.txt

Payload Yes None

Example URL and Payload

https://<SERVICE_NAME>-<TENANT_NAME>.<SERVICE_TYPE>.<dcX>.oraclecloud.com/interop/rest/v2/objectstorage/copyfrom
{
	"url":"https://swiftobjectstorage.<region_identifier>.oraclecloud.com/v1/namespace/bucket_name/object_name",
	"userName": "epm_user",
	"password": "epm_password",
	"targetFile": "Artifact snapshot"
}

Response

Supported Media Types: application/json

Parameters:

Table 8-67 Parameters

Name Description
details In the case of errors, details are published with the error string
status See Migration Status Codes
links Detailed information about the link
href Links to API call or status API
action The HTTP call type
rel Possible values: self or Job Status. If the value is set to Job Status, you can use the href to get the status
data Parameters as key value pairs passed in the request

Example of Response Body

The following shows an example of the response body in JSON format.

{
    "details": null,
    "status": -1,
    "items": null,
    "links": [
        {
            "href": " https://<SERVICE_NAME>-<TENANT_NAME>.<SERVICE_TYPE>.<dcX>.oraclecloud.com /interop/rest/v2/objectstorage/copyfrom",
            "action": "POST",
            "rel": "self",
            "data": null
        },
        {
            "href": " https://<SERVICE_NAME>-<TENANT_NAME>.<SERVICE_TYPE>.<dcX>.oraclecloud.com /interop/rest/v2/status/jobs/4003051833546274",
            "action": "GET",
            "rel": "Job Status",
            "data": null
        }
    ]
}

Sample cURL Command

curl -X POST -s -u '<USERNAME>:<PASSWORD>' -o response.txt -D respHeader.txt -H 'Content-Type: application/json' -d '{"url":"OBJECT_STORAGE_URL","userName":"USER_NAME","password":"PASSWORD","targetFile":"FILEPATH/FILENAME"}' 'https://<SERVICE_NAME>-<TENANT_NAME>.<SERVICE_TYPE>.<dcX>.oraclecloud.com/interop/rest/v2/objectstorage/copyfrom'
Common Functions