Upload Application Snapshot (v2)

REST Resource

POST /interop/rest/v2/files/upload

Table 2-210 Tasks for Upload Application Snapshot

Task Request REST Resource
Create file POST /interop/rest/v2/files/upload
Upload content PATCH

/interop/rest/v2/files/upload/<JOB-ID>

Extract the content out of zip file POST /interop/rest/v2/files/upload/<JOB-ID>/complete
Extraction status GET /interop/rest/v2/status/jobs/<JOB-ID>

Request

Supported Media Types: application/json

Table 2-211 Parameters

Name Description Type Required Default
fileName Name of the application snapshot to upload. A file with this name is created in Oracle Fusion Cloud Enterprise Performance Management. 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 2-212 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": "<FILE-SIZE>"
}
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":"<FILE-SIZE>"}' '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/<JOB-ID>

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/<JOB-ID>",
            "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: <CHUNK-RANGE>' --data-binary '@snapshot.zip' 'https://<BASE URL>/interop/rest/v2/files/upload/<JOB-ID>'

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/<JOB-ID>/complete 

Example Response 3

{
    "details": null,
    "status": -1,
    "links": [
        {
            "href": "https://<BASE-URL>/interop/rest/v2/files/upload/<JOB-ID>/complete",
            "action": "POST",
            "rel": "self",
            "data": null
        },
        {
            "href": "https://<BASE-URL>/interop/rest/v2/status/jobs/<JOB-ID>",
            "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/<JOB-ID>/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/<JOB-ID>

Example Response 4

{
    "details": null,
    "status": 0,
    "links": [
        {
            "href": "https://<BASE-URL>/interop/rest/v2/status/jobs/<JOB-ID>",
            "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/<JOB-ID>'