Upload Chunkfile
post
/appstore/publisher/v1/machineimages/{uploadRequestId}/chunk
Upload part of a file in a chunk and specify the chunk number.
Request
Supported Media Types
- multipart/form-data
Path Parameters
-
uploadRequestId: integer(int64)
Upload request ID.
Header Parameters
-
X-Chunk-Number: string
The chunk number is used to merge the chunk based on the sequence number. The chunk files can be uploaded in any order, but the sequence numbers should be correct. An incorrect sequence number results in failure of the merge.
-
X-File-Name: string
Name of the file to be uploaded.
-
X-MD5-Checksum(optional): string
Md5 Checksum of the file or chunk to be upload. This is an optional parameter. If specified, server will verifies the uploaded file checksum with the given input
Response
Supported Media Types
- application/json;qs=1
- application/xml;qs=.5
400 Response
Invalid Parameter Value
401 Response
Not Authorized
404 Response
Entity Not Found
500 Response
System Error
Examples
The following example uploads the machineimage chunk, by submitting a POST request on the REST resource using cURL.
cURL Example
curl -X POST -H "X-Oracle-UserId: partner-email" -H "Authorization: Bearer Access-token" -H "X-File-Name: FileName to be uploaded" -H "X-Chunk-Number: Chunk number" "https://ocm-apis.cloud.oracle.com/appstore/publisher/v1/machineimages/7934880/chunk"
Request Header
X-Oracle-UserId: fname.lname@oracle.com Authorization: Bearer Access-token X-Chunk-Number:1
Request Body
[form-data] file: File Upload
HTTP Status Code:
200 OK
JSON Response:
{ "uploadRequestId": "8089067", "checksum": "4ccef7d656c4520e57a2af2974e012f0", "uploadedChunks": 2, "pendingChunks": 0 }
Upload chunk with MD5 Checksum
The following example uploads the machineimage chunk with checksum header, by submitting a POST request on the REST resource using CURL.
cURL Example
curl -X POST -H "X-Oracle-UserId: partner-email" -H "Authorization: Bearer Access-token" -H "X-File-Name: FileName to be uploaded" -H "X-Chunk-Number: Chunk number" -H "X-MD5-Checksum : MD5 checksum of the file to be uploaded" "https://ocm-apis.cloud.oracle.com/appstore/publisher/v1/machineimages/7934880/chunk"
Request Header
X-Oracle-UserId: fname.lname@oracle.com Authorization: Bearer Access-token X-Chunk-Number:1 X-MD5-Checksum :4ccef7d656c4520e57a2af2974e012f0
Request Body
[form-data] file: File Upload
HTTP Status Code:
200 OK
JSON Response:
{ "uploadRequestId": "8134858", "checksum": "4ccef7d656c4520e57a2af2974e012f0", "uploadedChunks": 1, "pendingChunks": 1 }Back to Top