Create a Stack
/paas/api/v1.1/instancemgmt/{identityDomainId}/services/stack/instances
Request
- multipart/form-data
-
identityDomainId: string
Name of the Oracle Cloud identity domain
-
description(optional): string
Description of the new stack
-
name: string
Name of the stack to create
-
parameterFile(optional): file
A JSON file containing the template parameter input values. Each parameter is a name:value pair.
-
parameterValues(optional): string
Template parameter input values as a JSON object. Each parameter is a name:value pair.
-
tags(optional): string
Tags assigned to this stack as a JSON array. Each array item is a JSON object with two name:value pairs, key and value. A tag key can contain letters, numbers, dashes (-), and underscores ( _ ).
-
template: string
Name of an existing template that will be used to create the stack
Response
- application/json
202 Response
object
-
details(optional):
object details
The response body contains information about the requested stack operation.
object
-
jobId(optional):
string
Job ID
-
message(optional):
string
Message
400 Response
500 Response
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" } }