Portainer icon

Portainer

Trabalhe com dados da API do Portainer para gerenciar Docker

Overview

The node provides integration with the Portainer API to manage Docker environments and Docker Swarm resources. It allows users to perform various operations such as inspecting, retrieving, creating, updating, and deleting Docker nodes and other Docker-related resources (containers, images, volumes, networks, stacks, services, secrets, configs, etc.) through Portainer endpoints.

For the Node resource with the Inspect operation, this node fetches detailed information about a specific Docker Swarm node by its ID within a given Portainer environment. This is useful for administrators or automation workflows that need to monitor or audit the state and configuration of individual nodes in a Docker Swarm cluster managed via Portainer.

Practical examples:

  • Inspecting a node to retrieve its current status, role, availability, labels, and other metadata.
  • Automating health checks or audits on Docker Swarm nodes.
  • Integrating node details into dashboards or reports.

Properties

Name Meaning
Environment ID The ID of the Portainer environment/endpoint where the Docker Swarm node resides.
Node ID The unique identifier of the Docker Swarm node to inspect.

These properties are required to specify which node in which environment should be inspected.

Output

The output will contain the JSON response from the Portainer API representing the detailed information of the specified Docker Swarm node. This typically includes:

  • Node metadata (ID, hostname, description)
  • Status information (state, availability)
  • Role in the swarm (manager/worker)
  • Labels and attributes assigned to the node
  • Version and update index
  • Other Docker Swarm node-specific details

The output is structured as a JSON object under the json field of the node's output data. There is no binary data output for this operation.

Dependencies

  • Requires an active Portainer API instance accessible via a base URL.
  • Requires an API key credential for authenticating requests to the Portainer API.
  • The node uses HTTP GET requests to the Portainer API endpoint /endpoints/{environmentId}/docker/nodes/{nodeId} to retrieve node details.

Troubleshooting

  • Invalid Environment ID or Node ID: If either ID is incorrect or does not exist, the API will return an error (e.g., 404 Not Found). Verify the IDs are correct and correspond to existing resources in Portainer.
  • Authentication errors: Ensure the API key credential is valid and has sufficient permissions to access node information.
  • Network connectivity issues: Confirm that the n8n instance can reach the Portainer API endpoint URL.
  • API rate limits or timeouts: Large clusters or slow network may cause delays; consider retry logic or increasing timeout settings if applicable.

Links and References

Discussion