Portainer icon

Portainer

Trabalhe com dados da API do Portainer para gerenciar Docker

Overview

This node integrates with the Portainer API to manage Docker Swarm secrets. Specifically, the Delete Secret operation allows users to delete a Docker Swarm secret identified by its ID within a specified environment (endpoint). This is useful for cleaning up unused or sensitive secrets from your Docker Swarm cluster managed via Portainer.

Typical use cases include:

  • Automating cleanup of secrets that are no longer needed.
  • Managing secrets lifecycle as part of CI/CD pipelines.
  • Ensuring compliance by removing outdated or compromised secrets.

Example: You have a secret used by some services in your Docker Swarm cluster and want to remove it once those services are decommissioned. Using this node, you specify the environment and secret ID, then execute the delete operation to remove the secret securely.

Properties

Name Meaning
Environment ID The ID of the Portainer environment/endpoint where the secret exists.
Secret ID The unique identifier of the Docker Swarm secret to delete.
Force Delete Whether to force deletion even if the secret is currently in use by services or containers.

Output

The node outputs JSON data representing the response from the Portainer API after attempting to delete the secret. Typically, this will be an empty object or confirmation of successful deletion. If the deletion fails, error details will be included in the output.

No binary data is produced by this operation.

Dependencies

  • Requires a configured Portainer API credential with:
    • Base URL of the Portainer instance.
    • An API key or token with sufficient permissions to delete secrets.
  • The node sends HTTP DELETE requests to the Portainer API endpoint corresponding to the secret resource.

Troubleshooting

  • Common Issues:

    • Invalid or missing Environment ID or Secret ID parameters.
    • Insufficient permissions on the API key to delete secrets.
    • Attempting to delete a secret that does not exist.
    • Network connectivity issues to the Portainer API.
  • Error Messages & Resolutions:

    • 404 Not Found: The secret ID or environment ID may be incorrect or the secret no longer exists. Verify IDs.
    • 403 Forbidden: The API key lacks permission to delete secrets. Check API key scopes and roles.
    • 400 Bad Request: Parameters might be malformed; ensure all required fields are correctly set.
    • 500 Internal Server Error: Temporary server issue; retry later or check Portainer server logs.

Links and References

Discussion