Update Application Package - V2

put

/appstore/publisher/v2/applications/{listingVersionId}/packages/{packageVersionId}

Update the specified package. If the package was validated it will need to be validated again after the update.Packages of an already published listing cannot be updated.

Request

Supported Media Types
Path Parameters
Body ()
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

Invalid Parameter Value

401 Response

Not Authorized

404 Response

Entity Not Found

500 Response

System Error
Back to Top

Examples

The following example updates an existing package for an application, by submitting a PUT request on the REST resource using cURL.

cURL Example

curl -X PUT -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 of POST package" -F "file=@marketplaceUi.war" "https://ocm-apis.cloud.oracle.com/appstore/publisher/v2/applications/{listingVersionId}/packages/{packageVersionId}"

Request Header

X-Oracle-UserId: fname.lname@oracle.com 
Authorization: Bearer Access-token 
Content-Type: application/json

Request Body for JAVA to update header, Data Source and Application archive resources

Note : You can add multiple resources of type datasourcealias but can add only one resource of type applicationarchive.
{
  "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"
    }]
  }, {
    "type": "applicationarchive",
    "properties": [{
      "name": "APPLICATION_NAME",
      "value": "marketplaceUi.war"
    }]
  }]
}

Request Body for JAVA to update header only.

Note : When header only is updated the existing resources will not be deleted.
{
  "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"
}

Request Body for JAVA to update a resource of type datasourcealias.

Note : The given resource only will be updated and other existing resources will not be deleted. If Id is not provided new datasource will be created. 
{
  "resources": [{
    "id:: 20160222,
    "type": "datasourcealias",
    "properties": [{
      "name": "ALIAS_NAME",
      "value": "datasource_alias_soude-1"
    }]
  }]
}

Request Body for JAVA to update a resource of type applicationarchive.

Note : The given resource only will be updated and other existing resources will not be deleted. If Id is not provided new datasource will be created. 
{
  "resources": [{
    "id:: 20160223,
    "serviceType" : "JAVA",
    "type": "applicationarchive",
    "properties": [{
      "name": "APPLICATION_NAME",
      "value": "marketplaceUi.war"
    }]
  }]
}

HTTP Status Code:

200 OK

JSON Response:

{
  "message":"Listing Package saved with package version = REST API Test App14.04-LTS (20160222 amd64)-mod",
  "entityId":"3569978",
  "uri":"3569978"
}
Back to Top