Upload Application Snapshot

This API uploads an application snapshot to the Planning repository. The client needs to call upload API multiple times based on the size of file to be uploaded. The client needs to break the existing stream into number of chunks depending on the logic that each chunk size is not greater than 50 * 1024 * 1024 bytes.

This API is version v1.

REST Resource

POST /interop/rest/{api_version}/applicationsnapshots/{applicationSnapshotName}/contents?q={"isLast":false,"isFirst": true,"chunkSize":14,"fileSize":55445}

Supported Media Types: application/json

Parameters:

The following table summarizes the client request.

Table 6-26 Parameters

Name Description Type Default
api_version Specific API version Path N/A
applicationSnapshotName Name of the application snapshot to be uploaded. A file with this name is created in the Planning repository. If a file or folder with this name exists in the repository, an error is thrown indicating that a file or folder exists. Path N/A
isLast If the chunk being passed is the last one then set to true Query N/A
chunkSize Size of the chunk being passed in bytes Query N/A
isFirst If the chunk being passed is the first one and there will be subsequent requests for upload then set as true Query N/A
fileSize The size of the file being uploaded Query N/A

Response

Supported Media Types: application/json

Parameters:

Table 6-27 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

Example of Response Body

The following shows an example of the response body in JSON format.

{
	"status":0,
	"details":null,
	"links":[{
		"data":null,
		"action":"POST",
		"href":"https://<SERVICE_NAME>-<TENANT_NAME>.<SERVICE_TYPE>.<dcX>.oraclecloud.com/interop/rest/v1/applicationsnapshots/ss2.zip/contents?q={"isLast":false,"isFirst":true,"chunkSize":14,"fileSize":55445},
		"rel":"self"
	}]
}

Upload Application Snapshot Sample Code

For the following code samples, see Upload:

  • Java Sample — See uploadFile.java

  • cURL Sample — See UploadFile.sh

  • Groovy Sample — See UploadFile.groovy