Delete a Stack

put

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

Delete an existing stack and terminate its resources

Request

Supported Media Types
Path Parameters
Query Parameters
  • 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.
  • 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.
Form Parameters
  • Path to a JSON file containing any deletion parameters for the resources in this stack. These parameters are specific to each resource type.
Back to Top

Response

Supported Media Types

202 Response

Accepted. The stack deletion 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.

404 Response

Not Found. Returned if the stack does not exist.

500 Response

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

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"
  }
}
Back to Top