Create Application Package - V2
post
/appstore/publisher/v2/applications/{listingVersionId}/packages
Create a package for the given application. A package is an orchestration template that describes the application resources and its properties. At a high level a package defines the following elements. - dependentServices: Provide the service details where the app is to be deployed. - resources: Describe the resources to use for the deployment. This includes the location of the resource and properties for the resource.
Request
Supported Media Types
- multipart/form-data
Path Parameters
-
listingVersionId: integer(int64)
Unique identifier of the application for which to create the package
Upload the required files and provide required information.
Nested Schema : Link
Type:
Show Source
object
-
href(optional):
string
-
rel(optional):
string
Allowed Values:
[ "SELF", "CANONICAL", "NEXT", "TEMPLATE", "PREV" ]
Response
Supported Media Types
- application/json;qs=1
- application/xml;qs=.5
200 Response
Successful Operation
400 Response
Bad Request
401 Response
Not Authorized
404 Response
Entity Not Found
500 Response
System Error
Examples
The following example creates a package for an application 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 "Content-Type: application/json -F "json=data in JSON format: as shown in following examples" -F "file=@marketplaceUi.war" "https://ocm-apis.cloud.oracle.com/appstore/publisher/v2/applications/{listingVersionId}/packages"
Request Header
X-Oracle-UserId: fname.lname@oracle.com Authorization: Bearer Access-token Content-Type: application/json
Request Body for JAVA with Data Source and Application archive resources
{ "description": "Acme is a pre-configured, ready to run image for running Acme on Oracle Cloud. ", "version": "1.2", "namespacePrefix": "Rest Package Snippet", "tncId": "2528849", "serviceType" : "JAVA", "resources": [{ "type": "datasourcealias", "properties": [{ "name": "ALIAS_NAME", "value": "datasource_alias_soude-1" }] },{ "type": "datasourcealias", "properties": [{ "name": "ALIAS_NAME", "value": "datasource_alias_soude-2" }] }, { "serviceType" : "JAVA", "type": "applicationarchive", "properties": [{ "name": "APPLICATION_NAME", "value": "marketplaceUi.war" }] }] }
HTTP Status Code:
201 Created
JSON Response:
{ "message": "Listing Package saved with package version = 1.2 and packageVersionId = 148637096", "entityId": "148637096" }
cURL Example for Acme (Compute)
curl -X POST -H "X-Oracle-UserId: partner-email" -H "Authorization: Bearer Access-token" -H "Content-Type: application/json" -F "json=data in JSON format: as shown in examples below" "https://ocm-apis.cloud.oracle.com/appstore/publisher/v2/applications/{listingVersionId}/packages"
Request Body for Acme (Compute)
{ "description": "REST API Test App14.04-LTS (20160314 amd64) for Oracle Cloud Platform", "version": "Ubuntu 14.04-LTS(20160314 amd64) - V1", "namespacePrefix": "Rest Package Snippet", "tncId": "2528849", "resources": [{ "serviceType" : "Compute", "type": "machineimage", "properties": [{ "name": "imageLocation", "value": "partnercontainername/mi/ubuntu-trusty/14.04-20160314/14.04/ubuntu-14.04-server-cloudimg-amd64.tar.gz" }, { "name": "imageName", "value": "Ubuntu.14.04-LTS.amd64.20160314" }, { "name": "defaultShape", "value": "oc2m" }, { "name": "unsupportedShapes", "value": "oc1m,oc3" }, { "name": "size", "value": "10737418240" }, { "name": "minimumDiskSize", "value": "10" }] }] }
HTTP Status Code:
201 Created
JSON Response:
{ "message": "Listing Package saved with package version = Ubuntu 14.04-LTS(20160314 amd64) - V1 and packageVersionId = 148637096", "entityId": "148637096" }Back to Top