Create Machine Image

post

/appstore/publisher/v1/machineimages

Multi part Upload - Image file gets uploaded in one step.

Request

Supported Media Types
Header Parameters
  • Name of the file to be uploaded.
  • 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
  • This parameter has to specified only when machine images are to be uploaded in chunks. It denotes the total number of chunks. In the final submit, it will verify the chunk number with the uploaded chunks.
Body ()
Root Schema : schema
Type: string
Back to Top

Response

Supported Media Types

200 Response

Successful Operation
Body ()
Root Schema : acknowledgement
Type: object
Show Source

400 Response

Invalid Parameter Value

401 Response

Not Authorized

404 Response

Entity Not Found

500 Response

System Error
Back to Top

Examples

1.Upload Whole Machine Image

The following example uploads the machineimage, 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" -F "json=JSON-data-as-shown-in-following-example" "https://ocm-apis.cloud.oracle.com/appstore/publisher/v1/machineimages"

Request Header

X-Oracle-UserId: fname.lname@oracle.com 
Authorization: Bearer Access-token 
X-File-Name: machineImage.tar.gz

Request Body

[form-data]

file: File Upload (machineImage.tar.gz)
json: {"application": "My_Machine_Image","version":"1.0","operatingSystem":"linux","overwriteStorageFile":true}

HTTP Status Code:

200 OK

JSON Response:

{
  "message": "OK",
  "entityId": "7934470"
}

2.Initiate Machine Image in chunks upload

The following example initiates the machineimage chunks upload and uploads the first 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-Number-Of-Chunks: Total number of Chunks" -F "json=JSON-data-as-shown-in-following-example" -F "uploadType as shown in the following example" "https://ocm-apis.cloud.oracle.com/appstore/publisher/v1/machineimages"

Request Header

X-Oracle-UserId: fname.lname@oracle.com 
Authorization: Bearer Access-token 
X-File-Name: machineImage.tar.gz
X-Number-Of-Chunks: 3

Request Body

[form-data]

json: {"application": "My_Machine_Image_chunk","version":"1.0","operatingSystem":"linux"}
uploadType : {Chunk}

HTTP Status Code:

200 OK

JSON Response:

{
  "message": "OK",
  "entityId": "7934472"
}
Back to Top