Docker icon

Docker

Interact with Docker via Portainer API

Overview

This node enables interaction with Docker through the Portainer API, specifically targeting Docker endpoints managed by Portainer. The "Swarm Unlockkey" operation under the "Swarm" resource is designed to retrieve the unlock key for a Docker Swarm cluster on a specified endpoint. This is useful in scenarios where you need to manage or automate Docker Swarm clusters, such as unlocking a locked swarm manager or integrating swarm management into workflows.

Practical examples include:

  • Automating retrieval of the swarm unlock key for backup or audit purposes.
  • Integrating swarm unlock key retrieval into deployment pipelines.
  • Managing multiple Docker endpoints centrally via Portainer and n8n.

Properties

Name Meaning
EndpointID Name or ID The identifier of the Docker endpoint managed by Portainer to access. Choose from a list or specify an ID using an expression.

Output

The node outputs JSON data containing the response from the Portainer API related to the swarm unlock key of the specified Docker endpoint. The exact structure depends on the Portainer API response but typically includes the unlock key string and possibly metadata about the swarm state.

No binary data output is indicated.

Dependencies

  • Requires a valid Portainer API URL and an associated API authentication token configured as credentials in n8n.
  • Depends on the Portainer API being accessible and the specified endpoint existing and being reachable.
  • Uses an internal helper method to load available endpoints dynamically.

Troubleshooting

  • Common issues:
    • Invalid or missing endpoint ID: Ensure the endpoint exists in Portainer and is correctly selected or specified.
    • Authentication errors: Verify that the API key credential is valid and has sufficient permissions.
    • Network connectivity problems: Confirm that n8n can reach the Portainer API URL.
  • Error messages:
    • Unauthorized or 401 errors indicate invalid credentials.
    • 404 errors may mean the endpoint ID does not exist.
    • Timeout or network errors suggest connectivity issues.

Resolving these usually involves checking credentials, endpoint IDs, and network configurations.

Links and References

Discussion