Delete a Stack
/paas/api/v1.1/instancemgmt/{identityDomainId}/services/stack/instances/{stackName}
Request
- multipart/form-data
-
identityDomainId: string
Name of the Oracle Cloud identity domain
-
stackName: string
Name of the stack to be deleted
-
force(optional): string
By default, Cloud Stack forcibly deletes all resources in the stack if an error occurs. Set to false to stop the deletion of the stack if there is an error.
-
retain-resources(optional): string
Comma-separated list of tags. Any resources in the stack that are assigned at least one of these tags will not be deleted. To delete the stack without deleting any of its resources, set this parameter to the value _all.
-
config-payload(optional): string
Path to a JSON file containing any deletion parameters for the resources in this stack. These parameters are specific to each resource type.
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
404 Response
500 Response
Examples
The following example shows how to delete an existing stack in Oracle Cloud Stack by submitting a PUT request to the endpoint for the stack.
cURL Command
curl -i -X PUT \ -u yourUsername:yourPassword \ -H "X-ID-TENANT-NAME:MyIdentityDomain" \ https://psm.us.oraclecloud.com/paas/api/v1.1/instancemgmt/MyIdentityDomain/services/stack/instances/MyStack
If any resources in the stack support deletion parameters, you can specify these parameters as a JSON file on your local file system. The file is sent as a form parameter.
curl -i -X PUT \ -u yourUsername:yourPassword \ -H "X-ID-TENANT-NAME:MyIdentityDomain" \ -F "config-payload=@MyStackDelete.json" \ https://psm.us.oraclecloud.com/paas/api/v1.1/instancemgmt/MyIdentityDomain/services/stack/instances/MyStack
Below is a sample payload configuration file for the deletion of a stack containing an Oracle Java Cloud Service instance.
{ "operationType": "DELETE", "jcs": { "parameters": { "serviceParameters": { "dbaName": "yourDBUsername", "dbaPaasword": "yourDBPassword" }, } } }
The following example deletes the stack but retains any resources that have been assigned the tag named "prod" or the tag named "shared".
curl -i -X PUT \ -u yourUsername:yourPassword \ -H "X-ID-TENANT-NAME:MyIdentityDomain" \ https://psm.us.oraclecloud.com/paas/api/v1.1/instancemgmt/MyIdentityDomain/services/stack/instances/MyStack?retain-resources=prod,shared
Note: These examples 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, which includes the REST endpoint of the deletion job.
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
Example of Response Body
The following shows an example of the response body in JSON format.
{ "details":{ "message":"Submitted job to delete stack [MyStack] in domain [MyIdentityDomain].", "jobId":"101231" } }