Copy to Object Store (v2)

Use the Copy to Object Store (v2) REST API to copy a file or a backup snapshot from the current cloud environment (the source) to the Oracle Object Storage Cloud (the target). You can copy any file or snapshot available in the EPM Cloud. For example, if you export data to a file, the exported file is stored in the Outbox. You can then use this API to copy the directly to Oracle Object Storage, assuming you have an account.

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.

Note:

The Object Storage requires an Other Web Services Provider type. Ensure that you have access to the Web service you are connecting. You must also have URLs for the Web service and an login details if required. For information see, Connecting to External Web Services in Administering Planning.

This REST API is version v2.

Required Roles

Service Administrator

REST Resource

POST /interop/rest/v2/objectstorage/copyto

Note:

Before using the REST resources, you must understand how to access the REST resources and other important concepts. See Implementation Best Practices for EPM Cloud REST APIs. Using this REST API requires prerequisites. See Prerequisites.

Table 9-81 Tasks

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

Request

Supported Media Types: application/json

The following table summarizes the request parameters.

Table 9-82 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 without the object name:

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

This is the URL format with the object name:

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, optionally, is a name that you want to use for the file on Oracle Object Storage Cloud. If an object name is not specified, the file will be copied with its original name.

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

Payload Yes None
userName

The ID of a user who has the required access rights to write to Oracle Object Storage Cloud.

For users created in a federated identity provider, specify the fully-qualified name of the user (for example, exampleIdP/jdoe or exampleIdP/john.doe@example.com, where exampleIdP is the name of the federated identity provider). For other users, provide the User ID.

Payload Yes None
password

The Swift password or auth token associated with the user. This password is not the same as the password that you use to sign into the Object Storage Console. Auth token is an Oracle-generated token that you use to authenticate with third-party APIs, for example to authenticate with a Swift client. For instructions to create this token, see To create an auth token in Oracle Cloud Infrastructure Documentation .

Payload Yes None
filePath

Name of the file (with path) to be copied to the Object Store. If you are copying a snapshot, do not specify the ZIP extension.

Examples: Artifact Snapshot, inbox/File.txt

Payload Yes None

Example URL and Payload

https://<BASE URL>/interop/rest/v2/objectstorage/copyto
{
	"url": "https://swiftobjectstorage.<region_identifier>.oraclecloud.com/v1/epmclouddev/epm_artifact_snapshot",
	"userName": "username",
	"password": "password",
	"filePath": "Artifact Snapshot"
}

Response

Supported Media Types: application/json

Table 9-83 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.

{
	"status": -1,
	"items": null,
	"links": [{
		"rel": "self",
		"href": "https://<BASE URL>/interop/rest/v2/objectstorage/copyto",
		"data": null,
		"action": "POST"
	}, {
		"rel": "Job Status",
		"href": "https://<BASE URL>/interop/rest/v2/status/jobs/1502357937045",
		"data": null,
		"action": "GET"
	}],
	"details": 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","filePath":"FILEPATH/FILENAME"}' 'https://<BASE URL>/interop/rest/v2/objectstorage/copyto'
Common Functions