Deleting an API Deployment
Find out how to delete API deployments that you previously created with the API Gateway service.
After you have deployed an API on an API gateway by creating an API deployment, you might decide that the API deployment is no longer required. You can delete individual API deployments on an API gateway, one at a time. When you delete an API deployment, its API deployment specification is permanently removed.
Deleted API deployments continue to be shown in the Console for 90 days, with a status of Deleted. After 90 days, deleted API deployments are no longer shown.
- On the Gateways list page, select the API gateway containing the API deployment that you want to delete. If you need help finding the list page or the API gateway, see Listing API Gateways.
- Under Resources, select Deployments.
The Deployments list page opens. All API deployments in the selected API gateway are displayed in a table.
- From the
The API deployment and its API deployment specification are permanently removed.
for the API deployment, select Delete.
To delete API deployments using the CLI:
- Configure your client environment to use the CLI (Configuring Your Client Environment to use the CLI for API Gateway Development).
-
To delete an existing API deployment:
-
Open a command prompt and run
oci api-gateway deployment delete
to delete the API deployment:oci api-gateway deployment delete --deployment-id <deployment-ocid>
where:
<deployment-ocid>
is the OCID of the API deployment to delete. To find out the API deployment's OCID, see Listing API Gateways.
For example:
oci api-gateway deployment delete --deployment-id ocid1.apideployment.oc1..aaaaaaaaab______pwa
The response to the command includes:
- The lifecycle state (for example, ACTIVE, DELETED).
- The id of the work request to delete the API deployment (details of work requests are available for seven days after completion, cancellation, or failure).
If you want the command to wait to return control until the API deployment is active (or the request has failed), include either or both the following parameters:
--wait-for-state DELETED
--wait-for-state FAILED
For example:
oci api-gateway deployment delete --deployment-id ocid1.apideployment.oc1..aaaaaaaaab______pwa --wait-for-state DELETED
-
(Optional) To see the status of the work request that is deleting the API deployment, enter:
oci api-gateway work-request get --work-request-id <work-request-ocid>
-
(Optional) To view the logs of the work request that is deleting the API deployment, enter:
oci api-gateway work-request-log list --work-request-id <work-request-ocid>
-
(Optional) If the work request that is deleting the API deployment fails and you want to review the error logs, enter:
oci api-gateway work-request-error --work-request-id <work-request-ocid>
-
(Optional) To verify that the API deployment has been deleted, enter the following command and confirm that the API deployment 's lifecycle state is DELETED:
oci api-gateway deployment get --deployment-id <deployment-ocid>
-
For more information about using the CLI, see Command Line Interface (CLI). For a complete list of flags and options available for CLI commands, see CLI Help.
Run the DeleteDeployment operation to delete an API deployment.