Portainer icon

Portainer

Work with Portainer API data to manage Docker

Config → Delete

AI-generated

Overview

This node operation deletes a Docker Swarm config in a specified environment using the Portainer API. It is useful for managing Docker Swarm configurations by removing obsolete or unwanted configs programmatically.

Use Case Examples

  1. Deleting a Docker Swarm config by specifying its Config ID and Environment ID in Portainer.
  2. Force deleting a config even if it is currently in use.

Properties

Name Meaning
Environment ID The ID of the environment/endpoint in Portainer where the config exists.
Config ID The ID of the Docker Swarm config to be deleted.
Force Delete Whether to force deletion even if the config is currently in use.

Output

JSON

  • statusCode - HTTP status code of the delete operation response.
  • body - Response body from the Portainer API after attempting to delete the config.

Dependencies

  • Portainer API with an API key credential for authentication

Troubleshooting

  • Ensure the Environment ID and Config ID are correct and exist in Portainer.
  • If forceDelete is false and the config is in use, deletion will fail; set forceDelete to true to override.
  • Check API key permissions to ensure the user has rights to delete configs.
  • Common error messages include 404 Not Found if the config does not exist, or 403 Forbidden if the API key lacks permissions.

Links

Discussion