Portainer icon

Portainer

Work with Portainer API data to manage Docker

Stack → Delete

AI-generated

Overview

This node operation deletes a Docker Compose stack in Portainer. It is useful for managing and cleaning up stacks that are no longer needed in a Docker environment managed by Portainer. For example, if a user wants to remove a specific stack from their environment, they can use this operation to delete it by specifying the stack ID and environment ID.

Use Case Examples

  1. Deleting a stack by providing its stack ID and the environment ID where it is deployed.
  2. Force deleting a stack even if it is currently in use by setting the 'Force Delete' option to true.

Properties

Name Meaning
Environment ID The ID of the environment/endpoint in Portainer where the stack is deployed. This is required to specify the target environment for the stack deletion.
Stack ID The ID of the stack to be deleted. This uniquely identifies the stack within the specified environment.
Force Delete A boolean option to force the deletion of the stack even if the resource is currently in use. Defaults to false.

Output

JSON

  • response - The response from the Portainer API after attempting to delete the stack, indicating success or failure.

Dependencies

  • Requires Portainer API access with an API key credential.

Troubleshooting

  • Ensure the Environment ID and Stack ID are correct and correspond to existing resources in Portainer.
  • If deletion fails due to the stack being in use, try enabling the 'Force Delete' option.
  • Check API key permissions to ensure the user has rights to delete stacks.
  • Verify network connectivity to the Portainer API endpoint.

Links

Discussion