Download Application Snapshot (v2)
The Download Application Snapshot (v2) REST API downloads the application snapshot from EPM repository to the local location from where client is being run.
This API is version v2.
Required Roles
Service Administrator
Power User assigned to the Migration Administrator Profitability and Cost Management application role
REST Resource
POST /interop/rest/v2/files/download
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-58 Tasks for Download Application Snapshot
Task | Request | REST Resource |
---|---|---|
Initiate download | POST | /interop/rest/v2/files/download |
Status of compression of file | GET | /interop/rest/v2/status/download/7234359469022936 |
Download link | GET | /interop/rest/v2/files/download/7234359469022936 |
Deletion of temporary file (Applicable to snapshots) | DELETE | /interop/rest/v2/files/download/7234359469022936 |
Request
Supported Media Types: application/json
The following table summarizes the GET request parameters.
Table 9-59 Parameters
Name | Description | Type | Required | Default |
---|---|---|---|---|
fileName |
Application snapshot name or to download (for example,
|
Payload | Yes | None |
Response
Supported Media Types: application/json
Response Header
fileExtension
:This will have the file extension that can be used to
create a file locally. Can contain values such as zip
or
csv
.
Table 9-60 Parameters
Attribute | Description |
---|---|
details |
In 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 |
action |
The HTTP call type |
rel |
Possible value: self |
data |
Parameters as key value pairs passed in the request |
Example of Downloading with Postman
To download a file named snapshot.zip
, select
Basic Authorization header for all the requests.
Example URL and Payload to Initiate Download
Request Method: POST
Supported Media Types:
application/json
https://<BASE URL>/interop/rest/v2/files/download
{
"fileName": "snapshot.zip"
}
Example Response 1{
"details": null,
"status": -1,
"links": [
{
"href": " https://<BASE URL>/interop/rest/v2/files/download",
"action": "POST",
"rel": "self",
"data": null
},
{
"href": " https://<BASE URL>/interop/rest/v2/status/download/7236073834203988",
"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
'{"fileName":"snapshot.zip"}' 'https:///interop/rest/v2/files/download'
Example URL for Status of Compression File
Request Method: GET
Supported
Media Types:
application/json
https://<BASE URL>/interop/rest/v2/status/download/7236073834203988
Example Response 2
{
"details": null,
"status": 0,
"items": null,
"links": [
{
"href": " https://<BASE URL>/v2/status/download/7236073834203988",
"action": "GET",
"rel": "self",
"data": null
},
{
"href": "https://<BASE URL>/v2/files/download/7236073834203988",
"action": "GET",
"rel": "Download link",
"data": null
}
]
}
Sample cURL command
curl -X GET -s -u '<USERNAME>:<PASSWORD>' -o response.txt -D respHeader.txt -H 'Content-Type: application/json'
'https://<BASE URL>/interop/rest/v2/status/download/7237042873146169'
Example URL and Payload for Download Link
Request method: POST
Supported
Media Types:
application/json
https://<BASE URL>/interop/rest/v2/files/download/7236073834203988
Example Response 3
After receiving the response, if the content type is
application/json
, then there would be an error on the server
and refer to details. Otherwise, if it’s application/octet-stream
,
then the content to be downloaded is part of the response and can read from the
response body.
Sample cURL command
curl -X GET -s -u '<USERNAME>:<PASSWORD>' -o snapshot.zip -D respHeader.txt -H 'Content-Type: application/json'
'https://<BASE URL>/interop/rest/v2/files/download/7237042873146169'
Example URL and Payload for Deletion of Temporary File
Request method: DELETE
Supported Media Types:
application/json
https://<BASE URL>/interop/rest/v2/files/download/7236073834203988
Example Response 4
{
"details": null,
"status": 0,
"links": [
{
"href": " https://<BASE URL>/interop/rest/v2/files/download/7236073834203988",
"action": "DELETE",
"rel": "self",
"data": null
}
]
}
Sample cURL command
curl -X DELETE -s -u '<USERNAME>:<PASSWORD>' -o response.txt -D respHeader.txt -H 'Content-Type: application/json'
'https://<BASE URL>/interop/rest/v2/files/download/7237042873146169'