Copy To Object Store (v3)
Use this asynchronous API to copy a file or backup snapshot as a single non-segmented file from the current environment to an Oracle Object Storage bucket. This command uses API signing authentication to digitally sign the request to ensure security; which is a more secure authentication method compared to basic authentication used by the previous versions.
This version contains all parameters in the payload and does not require URL encoding while calling the REST APIs, making it easy to use.
Required Roles
Service Administrator
Method and URI
REST Resource: POST /interop/rest/v3/objectstorage/copyto
Example: POST
https://<BASE-URL>/interop/rest/v3/objectstorage/copyto
| Task | Request | REST Resource |
|---|---|---|
Trigger copytoobjectstore |
POST | /interop/rest/v3/objectstorage/copyto |
Retrieve copytoobjectstore status
|
GET | /interop/rest/v3/status/jobs/777 |
Request
Supported Media Types: application/json
Table 9-85 Parameters
| Name | Description | Required | Type |
|---|---|---|---|
url |
The Object Storage URL, including the name of the bucket to which
you want to copy the file. This value can include an object name.
Components of this URL:
For more information, see these topics in Oracle Cloud Infrastructure Documentation: |
Yes | Payload |
tenancyOcid |
The OCID of the tenancy to which you want to copy the file from the environment. This ID is available on the Tenancy details page of the Oracle Cloud Identity Console. | Yes | Payload |
userOcid |
The Oracle Cloud Identity of the user who has the access privileges to copy the file to the Object Storage. This ID is available on the User details page of the Oracle Cloud Identity Console. | Yes | Payload |
fingerprint |
The fingerprint (hash) of the RSA public API key. You can
retrieve the RSA asymmetric cryptography algorithm fingerprint by
running the OpenSSL command openssl rsa -pubout -outform DER
-in ~/.oci/oci_api_key.pem | openssl md5 -cs |
Yes | Payload |
privateKey |
Contents of the base 64 encoded private key (PEM) file. | Yes | Payload |
filePath |
The unique name for the file, including its path, in the current environment that you want to copy to the Object Storage. For snapshots, do not include the .ZIP extension. Examples: Artifact Snapshot, inbox/File.txt | Yes | Payload |
Example Payload
{
"url": "https://objectstorage.<region_identifier>.oraclecloud.com/n/namespace/b/bucket_name/o/object_name",
"tenancyOcid": "ocid1.tenancy.oc1...aaa",
"userOcid": "ocid1.user.oc1....aaa",
"fingerprint": "08:7f:86:8e....a2:2b:96",
"privateKey": "<Base64-encoded content of the privateKey file>",
"filePath": "Artifact Snapshot"
}
Response
Supported Media Types:
application/json
Example of Response Body
The following shows an example of the response body in JSON format.
{
"status": 0,
"items": null,
"links": [{
"rel": "self",
"href": "https://<BASE-URL>/interop/rest/v3/objectstorage/copyto",
"data": null,
"action": "POST"
}, {
"rel": "Job Status",
"href": "https://<BASE-URL>/interop/rest/v3/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","tenancyOcid":"TENANCY_OCID","userOcid":"USER_OCID","fingerprint":"FINGER_PRINT","privateKey":"Base64-Encoded PRIVATE_KEY","filePath":"FILEPATH/FILENAME"}' 'https://<BASE-URL>/interop/rest/v3/objectstorage/copyto'