Export Stack Template
/paas/api/v1.1/instancemgmt/{identityDomainId}/services/stack/instances/{stackName}/template
Request
-
identityDomainId: string
Name of the Oracle Cloud identity domain
-
stackName: string
Name of the stack whose template you want to export
Response
- text/plain
200 Response
object
-
message(optional):
string
Template contents in YAML format.
400 Response
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