Create an Application

post

/paas/service/apaas/api/v1.1/apps/{identityDomainId}

Creates an Oracle Application Container Cloud Service Application. In addition to the path parameters, you must provide additional parameters and a manifest file. You can specify additional optional parameters, such as memory, number of instances, and service bindings, in a deployment file. See the Examples tab for details.

Request

Supported Media Types
Path Parameters
Form Parameters
Back to Top

Response

Supported Media Types

202 Response

Accepted
Body ()
The response body contains information about the application.
Root Schema : ondemand-response
Type: object
The response body contains information about the application.
Show Source
Nested Schema : latestDeployment
Type: array
Shows all deployments currently in progress.
Show Source
Nested Schema : viewDeploy
Type: object
Show Source

400 Response

Bad Request. Returned if there is bad input.

404 Response

Not Found. Returned if the application does not exist.

429 Response

Too Many Requests. Returned if the quota of instances has been exceeded.

500 Response

Server Error. Returned if a server error has occurred.
Back to Top

Examples

Examples of Creating an Application on Oracle Cloud Infrastructure Classic

The following example shows how to create an Oracle Application Cloud Service application by submitting a POST request on the REST resource using cURL. For more information about cURL, see Use cURL. For more information about endpoint URL structure, including how to determine your region, see Send Requests.

curl -X POST -u joe@example.com:Welcome1! \
-H "X-ID-TENANT-NAME:ExampleIdentityDomain" \
-H "Content-Type: multipart/form-data" \
-F "name=MyFirstApp" -F "runtime=java" -F "subscription=Monthly" \
-F "manifest=@manifest.json" -F "deployment=@deployment.json" \
-F "archiveURL=MyFirstApp/myapp.zip" \
-F "notificationEmail=jane@example.com" -F "authType=oauth"\
-F "notes=notes for deployment" -F "repository=dockerhub" \
-F "tags=[{'key': 'owner', 'value': 'Some owner'}, {'key':'env', 'value":'prod'}]" \
https://apaas.us.oraclecloud.com/paas/service/apaas/api/v1.1/apps/ExampleIdentityDomain

The following example shows how to create an Oracle Application Cloud Service Java application from a GitHub repository. The gitUserName and gitPassword parameters are required if your repository is private.

curl -X POST -u joe@example.com:password\
https://apaas.oraclecloud.com/paas/service/apaas/api/v1.1/apps/ExampleIdentityDomain \
-H "Cache-Control: no-cache" \
-H "content-type: multipart/form-data;" \
-F "name=MyJavaApp" \
-F "runtime=java" \
-F "subscription=MONTHLY" \
-F "deployment=@Local-path-to-deployment-json\deployment.json" \
-F "gitRepoUrl=https://github.com/YourGitProject/hello-world-war.git" \
-F "manifest=@Local-path-to-manifest-json\manifest.json" \
-F "gitUserName=YourUserName" \
-F "gitPassword=YourPassword"

Example of Manifest File

You can include the manifest file in your application archive (.zip or .tgz file) or specify it separately as in this example. If you do both, the manifest file specified in the cURL command takes precedence.

The following example shows the contents of the manifest file in JSON format.

{
  "runtime": {
    "majorVersion": "7"
  },
  "command": "sh target/bin/start",
  "release": {
    "build": "150520.1154",
    "commit": "d8c2596364d9584050461",
    "version": "15.1.0"
  },
  "notes": "notes related to release",
  "mode": "rolling"
}

Example of Deployment File

The deployment file is optional unless:

  • You want to change the amount of memory or the number of application instances.

  • You need to specify service bindings to an Oracle Database Cloud Service database, an Oracle MySQL Cloud Service database, or an Oracle Java Cloud Service instance.

The following example shows the contents of the deployment file in JSON format.

{
  "memory": "2G",
  "instances": "1", 
  "environment": {
    "NO_OF_CONNECTIONS":"25",
    "TWITTER_ID":"JAVA"
  },
  "services": [{
    "identifier": "ProdService",
    "name": "Jaas Service",
    "type": "JAAS"
    "username": "username",
    "password": "password" 
  }]
}

For more information about what values to use in the manifest and deployment files, see Creating Meta Data Files.

Example of Response Header

The following shows an example of the response header.

Date Fri, 25 Sep 2015 09:46:39 GMT 
 Location  http://apaas.us.oraclecloud.com/paas/service/apaas/api/v1.1/apps/ExampleIdentityDomain/MyFirstApp/opStatus/2001 
 Retry-After 5 
 Service-URI  https://apaas.us.oraclecloud.com/paas/service/apaas/api/v1.1/apps/ExampleIdentityDomain/MyFirstApp 
 Transfer-Encoding chunked 
 X-Frame-Options DENY 
 X-Powered-By Servlet/2.5 JSP/2.1

Example of Response Body

The following example shows the contents of the response body in JSON format.

{
  "identityDomain": "ExampleIdentityDomain",
  "appId": "996b4bcd-89c3-4231-9c0d-2cd7322268e9",
  "name": "MyFirstApp",
  "status": "NEW",
  "createdBy": "weblogic",
  "creationTime": "2015-09-25T02:46:54.165-0700",
  "lastModifiedTime": "2015-09-25T02:46:53.943-0700",
  "subscriptionType": "MONTHLY",
  "instances": [],
  "lastestDeployment": {
    "deploymentId": "ee9714dc-a2d0-4d6e-8b3c-8f0d185577b2",
    "deploymentStatus": "READY",
    "deploymentURL": "http://apaas.us.oraclecloud.com/paas/service/apaas/api/v1.1/apps/ExampleIdentityDomain/MyFirstApp/deployments/ee9714dc-a2d0-4d6e-8b3c-8f0d185577b2"
  },
  "currentOngoingActivity": "Creating Application",
  "appURL": "http://apaas.us.oraclecloud.com/paas/service/apaas/api/v1.1/apps/ExampleIdentityDomain/MyFirstApp",
  "message": []
}
Back to Top