Actions107
- Node Actions
- Network Actions
- Container Actions
- Container List
- Container Create
- Container Inspect
- Container Top
- Container Logs
- Container Changes
- Container Export
- Container Stats
- Container Resize
- Container Start
- Container Stop
- Container Restart
- Container Kill
- Container Update
- Container Rename
- Container Pause
- Container Unpause
- Container Attach
- Container Attach Websocket
- Container Wait
- Container Delete
- Container Archive Info
- Container Archive
- Put Container Archive
- Container Prune
- Image Actions
- Volume Actions
- Swarm Actions
- Secret Actions
- System Actions
- Exec Actions
- Service Actions
- Task Actions
- Config Actions
- Plugin Actions
- Distribution Actions
- Session Actions
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
endpointIdmay cause failure to connect to the desired Docker endpoint. - Providing an outdated
versionnumber can lead to conflict errors due to concurrent modifications. - Malformed JSON in the
Bodyproperty will result in request errors.
- Incorrect or missing
- 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.