Copy to SFTP

Copies a file or a backup snapshot from the current cloud environment (the source) to the SFTP server (the target).

You can copy any file or snapshot available in Oracle Enterprise Performance Management 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 file directly to an SFTP server where you have an account.

This API is version v2.

Note:

If IP allowlist is enabled for the SFTP server, you must add the outbound IP address of the OCI region that hosts the EPM Cloud environments to the IP allowlist of the SFTP server. See Outbound IP Addresses of EPM Cloud Data Centers and Regions in Oracle Enterprise Performance Management Cloud Operations Guide for the outbound IP addresses of OCI regions.

Required Roles

Service Administrator

REST Resource

POST /interop/rest/v2/config/services/copytosftp

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.

Request

Supported Media Types: application/json

The following table summarizes the POST request parameters.

Table 9-85 Parameters

Name Description Type Required Default
userName ID of a user who has the required access rights to write to the SFTP server Payload Yes None
password Password associated with the user Payload Yes None
url

URL for the source file on the SFTP server in the following format:

sftp://myserver/mydir/File_New.txt

Payload Yes None
filePath

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

Examples:

Artifact Snapshot_24_Sept_2020

inbox/File_new.txt

Payload Yes None

Example of Request Body

{
    "userName" : "username",
    "password" : "password",
    "url"      : "sftp://mysever/mydir/File_New.txt",
    "filePath" : "inbox/File_new.txt"
}

Response

Supported Media Types: application/json

Table 9-86 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 and HTTP call type
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 of the job
data Parameters as key value pairs passed in the request

Example of Response Body

{
    "details": null,
    "status": -1,
    "items": null,
    "links": [
        {
           "href"  : "https://<BASE URL>/interop/rest/v2/config/services/copytosftp",
           "action": "POST",
           "rel"   : "self",
           "data"  : null
        },
        {
           "href"  : "https://<BASE URL>/interop/rest/v2/config/status/service/copytosftp/1716282748110",
           "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":"SFTP_URL ","userName":"USER_NAME","password":"PASSWORD","filePath":"FILEPATH/FILENAME"}'\
'https://<BASE URL>/interop/rest/v2/config/services/copytosftp'