Create Application Package

post

/appstore/publisher/v1/applications/{listingVersionId}/packages

Create a package for the given application. A package is an orchestration template that describes the application install/uninstall/upgrade steps. 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. - actions: Include the list of actions to invoke for the deployment. Each service has a list of supported actions. - operations: Three types of operations are supported (install, uninstall, and upgrade). Provide an ordered list of actions for each of these options. The install and uninstall operations are mandatory.Upgrades are needed for newer versions only if the application can be upgraded.

Request

Supported Media Types
Path Parameters
Body ()
Upload the required files and provide required information.
Root Schema : PackageVersion
Type: object
Show Source
Nested Schema : accessURLs
Type: array
Show Source
Nested Schema : actions
Type: array
Show Source
Nested Schema : dependentServices
Type: array
Show Source
Nested Schema : Resource
Type: object
Show Source
Nested Schema : operations
Type: array
Show Source
Nested Schema : resources
Type: array
Show Source
Nested Schema : AccessURL
Type: object
Show Source
Nested Schema : parameters
Type: array
Show Source
Nested Schema : AccessURLParam
Type: object
Show Source
Nested Schema : Action
Type: object
Show Source
Nested Schema : Authentication
Type: object
Show Source
Nested Schema : requestProperties
Type: array
Show Source
Nested Schema : ResourceMap
Type: object
Show Source
Nested Schema : ActionProperty
Type: object
Show Source
Nested Schema : parameters
Type: array
Show Source
Nested Schema : values
Type: array
Show Source
Nested Schema : PackageParam
Type: object
Show Source
Nested Schema : Service
Type: object
Show Source
Nested Schema : customProperties
Type: array
Show Source
Nested Schema : InputStream
Type: object
Nested Schema : standardProperties
Type: array
Show Source
Nested Schema : Operation
Type: object
Show Source
Nested Schema : actionExecutionSequence
Type: array
Show Source
Nested Schema : OperationAction
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.jar" "https://ocm-apis.cloud.oracle.com/appstore/publisher/v1/applications/2806005/packages"

Request Header

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

Request Body for Custom Actions

{
  "name":"REST API Test App01.0",
  "description":"Complete Package with Custom Action for listing 359107",
  "version":"2.0",
  "namespacePrefix":"Rest Package Snippet",
  "deploymentMode":"ASYNC",
  "type":"UNMANAGED",
  "status":"new",
  "dependentServices":[
    {
      "tag":"Java Service",
      "serviceName":"JAVA",
      "minVersion":"1",
      "maxVersion":"10",
      "isDedicatedToAppFlag":true,
      "minSize":"1275",
      "maxSize":"1311"
    }
  ],
  "resources":[
    {
      "tag":"marketplaceUi.war",
      "version":"2.0",
      "standardProperties":[
        {
          "name":"APPLICATION_NAME",
          "source":"BLUEPRINT_STATIC",
          "value":"Marketplace App"          
        },
        {
          "name":"platform",
          "source":"BLUEPRINT_STATIC",
          "value":"linux"
        },
        {  
           "name":"windows_kms",
           "source":"BLUEPRINT_STATIC",
           "value":"10"
        }
      ]
    }
  ],
  "actions":[
    {
      "tag":"Deploy War",
      "dependentServiceTag":"Java Service",
      "actionName":"deploy",
      "type":"OUT_OF_THE_BOX_ACTION",
      "resourceMap":{
        "resourceTag":"APPLICATION_DEPLOYABLE_FILE",
        "name":"marketplaceUi.war"
      },
      "requestProperties":[
        {
          "name":"FORCE",
          "source":"BLUEPRINT_STATIC",
          "value":"true"
        }
      ]
    },
    {
      "tag":"Restart Test",
      "dependentServiceTag":"Java Service",
      "actionName":"restartservice",
      "type":"OUT_OF_THE_BOX_ACTION",
      "requestProperties":[
        {
          "name":"FORCE",
          "source":"BLUEPRINT_STATIC",
          "value":"true"
        },
        {
          "name":"RESTART_TIMEOUT_SECS",
          "source":"BLUEPRINT_STATIC",
          "value":"200"
        }
      ]
    },
    {
      "tag": "Custom Action Test",
      "type": "CUSTOM_ACTION",
      "uri": "https://oracle.com",
      "authentication": {
          "type": "BASIC",
          "authHeader": "Basic"
      },
      "requestProperties": 
      [
        {
          "name": "Custom Action Property",
          "source": "DYNAMIC",
          "value": "${P1}",
          "parameters": [
            {
              "tag": "P1",
              "type": "TAS_PROVISIONING_PROPERTY",
              "dependentServiceTag": "Java Service",
              "referencedProperty": "TAS_IDM_DOMAIN_NAME"
            }
          ]
        }, 
        {
          "name": "UserProperty1",
          "source": "USER",
          "displayName": "test",
          "dataType": "STRING",
          "mandatory": "false"
        }, 
        {
          "name": "UserProperty2",
          "source": "USER",
          "displayName": "test",
          "dataType": "PICKLIST",
          "mandatory": "true",
          "values": ["one", "two", "three"]
        }
      ]
    },
    {
      "tag":"Un Deploy War",
      "dependentServiceTag":"Java Service",
      "actionName":"undeploy",
      "type":"OUT_OF_THE_BOX_ACTION",
      "requestProperties":[
        {
          "name":"APPLICATION_NAME",
          "source":"BLUEPRINT_STATIC",
          "value":"Marketplace App"
        }
      ]
    }
  ],
  "operations":[
    {
      "type":"INSTALL",
      "actionExecutionSequence":[
        {
          "sequenceNumber":1,
          "actionTag":"Deploy War"
        },
        {
          "sequenceNumber":2,
          "actionTag":"Restart Test"
        },
        {
          "sequenceNumber":3,
         "actionTag":"Custom Action Test"
        }
      ]
    },
    {
      "type":"UNINSTALL",
      "actionExecutionSequence":[
        {
          "sequenceNumber":1,
          "actionTag":"Un Deploy War"
        }
      ]
    }
  ],
  "accessURLs":[
    {
      "name":"static",
      "type":"STATIC",
      "description":"Test URL",
      "staticURL":"https://www.oracle.co.in/?gws_rd=ssl"
    }
  ]
}

Request Body for Deploy, Undeploy, and Restart Services

{
  "name":"Complete Package with Deploy, Undeploy and Restart Service Actions - 3047418V1.0",
  "description":"Complete Package with Deploy, Undeploy and Restart Service Actions for 3047418",
  "version":"1.0",
  "namespacePrefix":"Rest Package Snippet",
  "deploymentMode":"ASYNC",
  "type":"UNMANAGED",
  "status":"new",
  "dependentServices":[
    {
      "tag":"Java Service",
      "serviceName":"JAVA",
      "minVersion":"1",
      "maxVersion":"10",
      "isDedicatedToAppFlag":true,
      "minSize":"1275",
      "maxSize":"1311"
    }
  ],
  "resources":[
    {
      "tag":"marketplaceUi.war",
      "version":"1.0",
      "standardProperties":[
        {
          "name":"APPLICATION_NAME",
          "source":"BLUEPRINT_STATIC",
          "value":"Marketplace App"          
        },
        {
          "name":"platform",
          "source":"BLUEPRINT_STATIC",
          "value":"linux"
        },
        {  
           "name":"windows_kms",
           "source":"BLUEPRINT_STATIC",
           "value":"10"
        }
      ]
    }
  ],
  "actions":[
    {
      "tag":"Deploy War",
      "dependentServiceTag":"Java Service",
      "actionName":"deploy",
      "type":"OUT_OF_THE_BOX_ACTION",
      "resourceMap":{
        "resourceTag":"APPLICATION_DEPLOYABLE_FILE",
        "name":"marketplaceUi.war"
      },
      "requestProperties":[
        {
          "name":"FORCE",
          "source":"BLUEPRINT_STATIC",
          "value":"true"
        }
      ]
    },
    {
      "tag":"Restart Test",
      "dependentServiceTag":"Java Service",
      "actionName":"restartservice",
      "type":"OUT_OF_THE_BOX_ACTION",
      "requestProperties":[
        {
          "name":"FORCE",
          "source":"BLUEPRINT_STATIC",
          "value":"true"
        },
        {
          "name":"RESTART_TIMEOUT_SECS",
          "source":"BLUEPRINT_STATIC",
          "value":"200"
        }
      ]
    },
    {
      "tag":"Un Deploy War",
      "dependentServiceTag":"Java Service",
      "actionName":"undeploy",
      "type":"OUT_OF_THE_BOX_ACTION",
      "requestProperties":[
        {
          "name":"APPLICATION_NAME",
          "source":"BLUEPRINT_STATIC",
          "value":"Marketplace App"
        }
      ]
    }
  ],
  "operations":[
    {
      "type":"INSTALL",
      "actionExecutionSequence":[
        {
          "sequenceNumber":1,
          "actionTag":"Deploy War"
        },
        {
          "sequenceNumber":2,
          "actionTag":"Restart Test"
        }
      ]
    },
    {
      "type":"UNINSTALL",
      "actionExecutionSequence":[
        {
          "sequenceNumber":1,
          "actionTag":"Un Deploy War"
        }
      ]
    }
  ],
  "accessURLs":[
    {
      "name":"static",
      "type":"STATIC",
      "description":"Test URL",
      "staticURL":"https://www.oracle.co.in/?gws_rd=ssl"
    }
  ]
}

Request Body for Add and Delete Data Source Alias

{
  "name":"Add datasource alias package : soude - 2016-01-29 [try #1]",
  "description":"Rest Package Snippet",
  "version":"1.0",
  "namespacePrefix":"Rest Package Snippet",
  "deploymentMode":"ASYNC",
  "type":"UNMANAGED",
  "status":"new",
  "dependentServices":[
    {
      "tag":"Java Service",
      "serviceName":"JAVA",
      "minVersion":"1",
      "maxVersion":"10",
      "isDedicatedToAppFlag":true,
      "minSize":"1275",
      "maxSize":"1311"
    }
  ],
  "actions":[
    {
      "tag":"Add datasource alias",
      "dependentServiceTag":"Java Service",
      "actionName":"adddatasourcealias",
      "type":"OUT_OF_THE_BOX_ACTION",
      "requestProperties":[
        {
          "name":"ALIAS_NAME",
          "source":"BLUEPRINT_STATIC",
          "value":"datasource_alias_soude"
        }
      ]
    },
    {
      "tag":"Delete datasource alias",
      "dependentServiceTag":"Java Service",
      "actionName":"deletedatasourcealias",
      "type":"OUT_OF_THE_BOX_ACTION",
      "requestProperties":[
        {
          "name":"ALIAS_NAME",
          "source":"BLUEPRINT_STATIC",
          "value":"datasource_alias_soude"
        }
      ]
    }
  ],
  "operations":[
    {
      "type":"INSTALL",
      "actionExecutionSequence":[
        {
          "sequenceNumber":1,
          "actionTag":"Add datasource alias"
        }
      ]
    },
    {
      "type":"UNINSTALL",
      "actionExecutionSequence":[
        {
          "sequenceNumber":1,
          "actionTag":"Delete datasource alias"
        }
      ]
    }
  ],
  "accessURLs":[
    {
      "name":"static",
      "type":"STATIC",
      "description":"Test URL",
      "staticURL":"https://www.oracle.co.in/?gws_rd=ssl"
    }
  ]
}

Request Body for Add and Delete Credential

{
  "name":"Add credential package : soude - 2016-01-29 [try #1]",
  "description":"Rest Package Snippet",
  "version":"1.0",
  "namespacePrefix":"Rest Package Snippet",
  "deploymentMode":"ASYNC",
  "type":"UNMANAGED",
  "status":"new",
  "dependentServices":[
    {
      "tag":"Java Service",
      "serviceName":"JAVA",
      "minVersion":"1",
      "maxVersion":"10",
      "isDedicatedToAppFlag":true,
      "minSize":"1275",
      "maxSize":"1311"
    }
  ],
  "actions":[
    {
      "tag":"Add credential",
      "dependentServiceTag":"Java Service",
      "actionName":"addcredential",
      "type":"OUT_OF_THE_BOX_ACTION",
      "requestProperties":[
        {
          "name":"CREDENTIAL_MAP_NAME",
          "source":"BLUEPRINT_STATIC",
          "value":"user.custom.map"
        },
        {
          "name":"DESCRIPTION",
          "source":"BLUEPRINT_STATIC",
          "value":"Test action for addcredential - soude"
        },
        {
          "name":"KEY",
          "source":"BLUEPRINT_STATIC",
          "value":"ADD_CRED_TEST"
        },
        {
          "name":"KEY_USER",
          "source":"BLUEPRINT_STATIC",
          "value":"ADD_CRED_TEST_SOUDE"
        },
        {
          "name":"KEY_PASSWORD",
          "source":"BLUEPRINT_STATIC",
          "value":"Welcome1"
        }
      ]
    },
    {
      "tag":"Delete credential",
      "dependentServiceTag":"Java Service",
      "actionName":"deletecredential",
      "type":"OUT_OF_THE_BOX_ACTION",
      "requestProperties":[
        {
          "name":"CREDENTIAL_MAP_NAME",
          "source":"BLUEPRINT_STATIC",
          "value":"user.custom.map"
        },
        {
          "name":"KEY",
          "source":"BLUEPRINT_STATIC",
          "value":"ADD_CRED_TEST"
        }
      ]
    }
  ],
  "operations":[
    {
      "type":"INSTALL",
      "actionExecutionSequence":[
        {
          "sequenceNumber":1,
          "actionTag":"Add credential"
        }
      ]
    },
    {
      "type":"UNINSTALL",
      "actionExecutionSequence":[
        {
          "sequenceNumber":1,
          "actionTag":"Delete credential"
        }
      ]
    }
  ],
  "accessURLs":[
    {
      "name":"static",
      "type":"STATIC",
      "description":"Test URL",
      "staticURL":"https://www.oracle.co.in/?gws_rd=ssl"
    }
  ]
}

Request Body for Deploy Library, Start, Stop, and Undeploy Library Actions

{
  "name":"Deploy & Undeploy library test package creation - soude 2016/01/29 [try #1]",
  "description":"Rest Package Snippet for 2680216",
  "version":"1.0",
  "namespacePrefix":"Rest Package Snippet",
  "deploymentMode":"ASYNC",
  "type":"UNMANAGED",
  "status":"new",
  "dependentServices":[
    {
      "tag":"Java Service",
      "serviceName":"JAVA",
      "minVersion":"1",
      "maxVersion":"10",
      "isDedicatedToAppFlag":true,
      "minSize":"1275",
      "maxSize":"1311"
    }
  ],
  "resources":[
    {
      "tag":"marketplaceUi.jar",
      "version":"1.0",
      "standardProperties":[
        {
          "name":"APPLICATION_NAME",
          "source":"BLUEPRINT_STATIC",
          "value":"Marketplace App"          
        },
        {
          "name":"IMPLEMENTATION_VERSION",
          "source":"BLUEPRINT_STATIC",
          "value":"1.0"          
        },
        {
          "name":"SPECIFICATION_VERSION",
          "source":"BLUEPRINT_STATIC",
          "value":"1.0"
        },
        {
          "name":"platform",
          "source":"BLUEPRINT_STATIC",
          "value":"linux"
        },
        {  
           "name":"windows_kms",
           "source":"BLUEPRINT_STATIC",
           "value":"10"
        }
      ]
    }
  ],
  "actions":[
    {
      "tag":"Deploy Library Jar",
      "dependentServiceTag":"Java Service",
      "actionName":"deploylibrary",
      "type":"OUT_OF_THE_BOX_ACTION",
      "resourceMap":{
        "resourceTag":"APPLICATION_DEPLOYABLE_FILE",
        "name":"marketplaceUi.jar"
      }
    },
    {
      "tag":"Start Test",
      "dependentServiceTag":"Java Service",
      "actionName":"start",
      "type":"OUT_OF_THE_BOX_ACTION",
      "requestProperties":[
        {
          "name":"APPLICATION_NAME",
          "source":"BLUEPRINT_STATIC",
          "value":"Marketplace App"
        }
      ]
    },
    {
      "tag":"Stop Test",
      "dependentServiceTag":"Java Service",
      "actionName":"stop",
      "type":"OUT_OF_THE_BOX_ACTION",
      "requestProperties":[
        {
          "name":"APPLICATION_NAME",
          "source":"BLUEPRINT_STATIC",
          "value":"Marketplace App"
        }
      ]
    },
    {
      "tag":"Un Deploy Library Jar",
      "dependentServiceTag":"Java Service",
      "actionName":"undeploylibrary",
      "type":"OUT_OF_THE_BOX_ACTION",
      "requestProperties":[
        {
          "name":"APPLICATION_NAME",
          "source":"BLUEPRINT_STATIC",
          "value":"Marketplace App"
        }
      ]
    }
  ],
  "operations":[
    {
      "type":"INSTALL",
      "actionExecutionSequence":[
        {
          "sequenceNumber":1,
          "actionTag":"Deploy Library Jar"
        },
        {
          "sequenceNumber":2,
          "actionTag":"Stop Test"
        },
        {
          "sequenceNumber":3,
          "actionTag":"Start Test"
        }
      ]
    },
    {
      "type":"UNINSTALL",
      "actionExecutionSequence":[
        {
          "sequenceNumber":1,
          "actionTag":"Un Deploy Library Jar"
        }
      ]
    }
  ],
  "accessURLs":[
    {
      "name":"static",
      "type":"STATIC",
      "description":"Test URL",
      "staticURL":"https://www.oracle.co.in/?gws_rd=ssl"
    }
  ]
}

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/v1/applications/2806005/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",
    "status":"NEW",
    "dependentServices": [
        {
            "tag": "Compute",
            "serviceName":"Compute"
        }
    ],
    "resources": [
        {
            "tag": "ubuntu-14.04-server-cloudimg-amd64.tar.gz",
            "location": "partnercontainername/mi/ubuntu-trusty/14.04-20160314/14.04/ubuntu-14.04-server-cloudimg-amd64.tar.gz",
            "version": "14.04",
            "standardProperties": [
                {
                    "name": "imageName",
                    "source":"BLUEPRINT_STATIC",
                    "value": "Ubuntu.14.04-LTS.amd64.20160314"
                },
                  {
                    "name": "defaultShape",
                    "source":"BLUEPRINT_STATIC",
                    "value": "oc2m"
                },
                {
                    "name": "unsupportedShapes",
                    "source":"BLUEPRINT_STATIC",
                    "value": "oc1m,oc2m,oc3"
                },
               {
                    "name": "size",
                    "source":"BLUEPRINT_STATIC",
                    "value": "10737418240"
                },
                {
                    "name": "minimumDiskSize",
                    "source":"BLUEPRINT_STATIC",
                    "value": "10"
                },
        {
          "name":"platform",
          "source":"BLUEPRINT_STATIC",
          "value":"linux"
        },
        {  
           "name":"windows_kms",
           "source":"BLUEPRINT_STATIC",
           "value":"10"
        }
            ],
            "customProperties": []
        }
    ],
    "actions": [
        {
            "tag": "Create Machine Image",
            "dependentServiceTag":"Compute",
            "actionName": "createMachineImage",
            "type":"OUT_OF_THE_BOX_ACTION",
            "resourceMap": {
                "resourceTag":"IMAGE",
                "name":"ubuntu-14.04-server-cloudimg-amd64.tar.gz"
            }
        },
        {
            "tag": "Delete Machine Image",
            "dependentServiceTag":"Compute",
            "actionName": "deleteMachineImage",
            "type":"OUT_OF_THE_BOX_ACTION",
            "requestProperties": [
                {
                    "name": "imageName",
                    "source":"BLUEPRINT_STATIC",
                    "value": "Ubuntu.14.04-LTS.amd64.20160314"
                }
            ]
        }
    ],
    "operations": [
        {
            "type": "INSTALL",
            "actionExecutionSequence":[
                {
                  "sequenceNumber":1,
                  "actionTag":"Create Machine Image"
                }
            ]
        },
        {
            "type": "UNINSTALL",
            "actionExecutionSequence":[
                {
                  "sequenceNumber":1,
                  "actionTag":"Delete Machine Image"
                }
            ]
        }
    ]
}

HTTP Status Code:

201 Created

JSON Response:

{
  "message": "Listing Package saved with package version = Ubuntu 14.04-LTS(20160314 amd64) - V1 and packageVersionId = 2806054",
  "entityId": "2806054"
}
Back to Top