Export Stack Template

get

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

Export the template used to create a stack as a YAML file

Request

Path Parameters
Back to Top

Response

Supported Media Types

200 Response

OK
Body ()
Root Schema : exporttemplate-response
Type: object
The response body contains template contents in YAML format.
Show Source

400 Response

Bad Request. Returned if unable to export template.
Back to Top

Examples

The following example shows how to export the template that was used to create an existing stack in Oracle Cloud Stack by submitting a GET request to the template endpoint for the stack. The response is a text document with the template definition in YAML syntax.

cURL Command

curl -i -X GET \
-u yourUsername:yourPassword \
-H "X-ID-TENANT-NAME:MyIdentityDomain" \
https://psm.us.oraclecloud.com/paas/api/v1.1/instancemgmt/MyIdentityDomain/services/stack/instances/MyStack/template

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.

Example of Response Header

The following shows an example of the response header.

HTTP/1.1 200 OK
Date: Thu, 25 Aug 2016 18:50:14 GMT
Content-Length: 5329
Content-Type: text/plain

Example of Response Body

A line with three dashes is typically used to indicate the start of a YAML document.

---
  template: 
    templateName: MyTemplate
    templateVersion: 1.0.0
    . . .

Redirection to a File

You can also redirect the cURL standard output stream (the YAML document) to a new file. For example:

curl -X GET \
-u yourUsername:yourPassword \
-H "X-ID-TENANT-NAME:MyIdentityDomain" \
https://psm.us.oraclecloud.com/paas/api/v1.1/instancemgmt/MyIdentityDomain/services/stack/instances/MyStack/template \
>MyTemplate.yaml
Back to Top