Portainer icon

Portainer

Work with Portainer API data to manage Docker

Node → Update

AI-generated

Overview

This node operation updates a Docker Swarm node within a specified environment in Portainer. It allows users to modify the node's role, availability, and labels by sending an update request to the Portainer API. This is useful for managing the configuration and status of nodes in a Docker Swarm cluster, such as changing a node's role from worker to manager or adjusting its availability status.

Use Case Examples

  1. Updating a node's role and availability in a Docker Swarm cluster to manage workload distribution.
  2. Modifying node labels to organize and filter nodes within the Portainer environment.

Properties

Name Meaning
Environment ID The ID of the environment/endpoint in Portainer where the node exists.
Node ID The unique identifier of the Docker Swarm node to update.
Version The object version number required for the update operation to ensure concurrency control.
Role The new role to assign to the node (e.g., manager or worker).
Availability The availability status of the node (e.g., active, pause, drain).
Labels Optional labels to assign to the node for organizational purposes, provided as a JSON object.

Output

JSON

  • body - The JSON response from the Portainer API after updating the node, typically containing the updated node details or status.

Dependencies

  • Portainer API with an API key credential for authentication

Troubleshooting

  • Ensure the Environment ID and Node ID are correct and correspond to existing resources in Portainer.
  • Verify that the version number matches the current version of the node object to avoid update conflicts.
  • Check that the API key credential has sufficient permissions to perform node updates.
  • If SSL issues occur, consider enabling the option to ignore SSL certificate validation in the request options.

Links

Discussion