Create a Stack

post

/paas/api/v1.1/instancemgmt/{identityDomainId}/services/stack/instances

Create a cloud stack from an existing template

Request

Supported Media Types
Path Parameters
Form Parameters
Back to Top

Response

Supported Media Types

202 Response

Accepted. Stack creation is in progress.
Body ()
Root Schema : ondemand-response
Type: object
Show Source
Nested Schema : details
Type: object
The response body contains information about the requested stack operation.
Show Source

400 Response

Bad Request. Returned if there is bad input.

500 Response

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

Examples

The following example shows how to create a stack in Oracle Cloud Stack by submitting a POST request to the stacks endpoint. The stack name, description and template are form parameters. Any template parameters can be sent as a single form parameter whose value is a JSON object, or as a file that contains the JSON object. Any tags assigned to the stack are sent as a single form parameter whose value is an array of JSON objects.

cURL Command

curl -i -X POST \
-u yourUsername:yourPassword \
-H "Content-Type:multipart/form-data" \
-H "X-ID-TENANT-NAME:MyIdentityDomain" \
-F "name=MyStack" \
-F "template=MyTemplate" \
-F 'tags=[{"key":"stage","value":"dev"},{"key":"priority","value":"4"}]' \
-F 'parameterValues={"sshKey":"yourKey","dbShape":"oc3"}' \
https://psm.us.oraclecloud.com/paas/api/v1.1/instancemgmt/MyIdentityDomain/services/stack/instances

Note: This example uses the URL prefix for the United States. For information about the URL prefixes for other regions of the world, see Send Requests.

Note: On Windows, you must escape the quotation mark characters found in the tags and parameterValues JSON object. For example:

-F "parameterValues={\"sshKey\":\"yourKey\",\"dbShape\":\"oc3\"}"

Alternatively, you can provide the template parameters as an external JSON file. For example:

-F 'parameterFile=@stack-params.json'

The contents of stack-params.json:
{
  "sshKey":"yourKey",
  "dbShape":"oc3"
}

Example of Response Header

The following shows an example of the response header, which includes the REST endpoints of the creation job and the new stack.

HTTP/1.1 202 Accepted
Date: Thu, 25 Aug 2016 18:50:14 GMT
Transfer-Encoding: chunked
Location: https://psm.us.oraclecloud.com/paas/api/v1.1/activitylog/MyIdentityDomain/job/101231
Content-Type: application/json
Service-URI: https://psm.us.oraclecloud.com/paas/api/v1.1/instancemgmt/MyIdentityDomain/services/stack/instances/MyStack
Retry-After: 60

Example of Response Body

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

{
  "details":{
    "message":"Submitted job to create stack [MyStack] in domain [MyIdentityDomain].",
    "jobId":"101231"
  }
}
Back to Top