Docker icon

Docker

Interact with Docker via Portainer API

Actions107

Overview

This node allows users to update a Docker Swarm configuration via the Portainer API. It is useful for managing and modifying swarm clusters programmatically, such as updating swarm settings or rotating security tokens. Practical scenarios include automating swarm maintenance tasks, rotating join tokens for security, or applying configuration changes without manual intervention.

Properties

Name Meaning
EndpointID Name or ID The identifier of the Docker endpoint to access. Users can select from a list or specify an ID directly.
Version The version number of the swarm object being updated; required to prevent conflicting writes.
Body JSON string representing the body of the swarm update request.
Additional Fields Optional flags to rotate various swarm tokens:
- Rotate Worker Token (boolean)
- Rotate Manager Token (boolean)
- Rotate Manager Unlock Key (boolean)

Output

The node outputs the JSON response from the Portainer API after attempting to update the swarm. This typically includes the updated swarm state or confirmation of the applied changes. There is no binary data output.

Dependencies

  • Requires connection to a Portainer API instance.
  • Needs an API key credential for authentication with Portainer.
  • The node uses the selected Docker endpoint within Portainer to target the correct swarm.
  • No additional external dependencies beyond the Portainer API and its authentication.

Troubleshooting

  • Common issues:
    • Incorrect or missing endpointId may cause failure to connect to the desired Docker endpoint.
    • Providing an outdated version number can lead to conflict errors due to concurrent modifications.
    • Malformed JSON in the Body property will result in request errors.
  • Error messages:
    • Conflict errors indicating version mismatch: Ensure you provide the current swarm version.
    • Authentication errors: Verify that the API key credential is valid and has sufficient permissions.
    • Validation errors on the body: Check the JSON structure matches the expected schema for swarm updates.

Links and References

Discussion