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
Path Parameters
Body ()
Upload the required files and provide required information.
Root Schema : Package
Type: object
Show Source
Nested Schema : resources
Type: array
Show Source
Nested Schema : PackageResource
Type: object
Show Source
Nested Schema : properties
Type: array
Show Source
Nested Schema : ResourceProperty
Type: object
Show Source
Back to Top

Response

Supported Media Types

200 Response

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

400 Response

Bad Request

401 Response

Not Authorized

404 Response

Entity Not Found

500 Response

System Error
Back to Top

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