Upload Application Snapshot (v2)
The Upload Application Snapshot (v2) REST API uploads an application snapshot to Oracle Enterprise Performance Management Cloud. The client needs to call upload API multiple times based on the size of the file to upload. The client needs to break the existing stream into a number of chunks depending on the logic that each chunk size is not greater than 50 * 1024 * 1024 bytes.
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/upload
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-53 Tasks for Upload Application Snapshot
Task | Request | REST Resource |
---|---|---|
Create file | POST | /interop/rest/v2/files/upload |
Upload content | PATCH |
|
Extract the content out of zip file | POST | /interop/rest/v2/files/upload/7224986735511603/complete |
Extraction status | GET | /interop/rest/v2/status/jobs/7224986735511603 |
Request
Supported Media Types: application/json
The following table summarizes the client request.
Table 9-54 Parameters
Name | Description | Type | Required | Default |
---|---|---|---|---|
fileName |
Name of the application snapshot to upload. A file with this name is created in EPM Cloud. If a file or folder with this name already exists, an error is thrown indicating that a file or folder exists. | Payload | Yes | None |
fileSize |
The size of the file to upload | Payload | Yes | None |
Response
Supported Media Types: application/json
Table 9-55 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 |
action |
The HTTP call type |
rel |
Is self , which denotes the URL of this REST
API.
|
data |
Parameters as key value pairs passed in the request |
Examples of Uploading with Postman
To upload a file named snapshot.zip
of size
12606 bytes, select Basic Authorization header for all the
requests.
Example URL and Payload to Create the File
Request Method: POST
Supported Media Types:
application/json
https://<BASE URL>/interop/rest/v2/files/upload
{
"fileName": "snapshot.zip",
"fileSize": "2468889"
}
Example Response 1{
"status":0,
"details":null,
"links":[{
"data":null,
"action":"POST",
"href":"https://<BASE URL>/interop/rest/v2/interop/rest/v2/files/upload,
"rel":"self"
}]
}
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", "fileSize":"2468889"}' 'https://<BASE URL>/interop/rest/v2/files/upload'
Example URL and Payload to Upload the Content
Request Method: PATCH
Supported Media Types:
application/octet-stream
Chunk-Range has to be passed as a
Header parameter(0-2468889)
Note:
Ensure the value of the fileSize is equivalent to the total size of the file and end Range is set to fileSize -1.
https://<BASE URL>/interop/rest/v2/files/upload/7224986735511603
To
select the file: Select tab Body
, radio button
Binary
, and choose File
to
upload.
Example Response 2
{
"details": null,
"status": 0,
"links": [
{
"href": " https://<BASE URL>/interop/rest/v2/files/upload/7224986735511603",
"action": "PATCH",
"rel": "self",
"data": null
}
]
}
Sample cURL command
curl -X PATCH -s -u '<USERNAME>:<PASSWORD>' -o response.txt -D respHeader.txt -H 'Content-Type: application/octet-stream' -H
'Chunk-Range: 0-2468888' --data-binary '@snapshot.zip' 'https://<BASE URL>/interop/rest/v2/files/upload/7232824317092320'
Example URL and Payload to Extract the Content Out of the Zip File
Request method: POST
Supported Media Types:
application/json
https://<BASE URL>/interop/rest/v2/files/upload/7224986735511603/complete
Example Response 3
{
"details": null,
"status": -1,
"links": [
{
"href": "http://slcar282.usdv1.oraclecloud.com:13017/interop/rest/v2/files/upload/7224986735511603/complete",
"action": "POST",
"rel": "self",
"data": null
},
{
"href": "http://slcar282.usdv1.oraclecloud.com:13017/interop/rest/v2/status/jobs/7293659723083015",
"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'
'https://<BASE URL>/interop/rest/ v2/files/upload/7232824317092320/complete'
Example URL and Payload Extraction Status
Request method: POST
Supported
Media Types: application/json
This API request needs to be requested when the status code received in the example 3 response is -1.
https://<BASE URL>/interop/rest/v2/status/jobs/7293659723083015
Example Response 4
{
"details": null,
"status": 0,
"links": [
{
"href": " https://<BASE URL>/interop/rest/v2/status/jobs/7293659723083015",
"action": "GET",
"rel": "self",
"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/jobs/7293659723083015'