Portainer icon

Portainer

Trabalhe com dados da API do Portainer para gerenciar Docker

Overview

This node integrates with the Portainer API to manage Docker environments, specifically Docker Swarm nodes in this context. The "Node" resource with the "Get" operation allows users to retrieve detailed information about a specific Docker Swarm node by its ID within a given environment (endpoint).

Common scenarios where this node is beneficial include:

  • Monitoring and managing individual nodes in a Docker Swarm cluster.
  • Automating infrastructure audits or inventory by fetching node details.
  • Integrating node status checks into CI/CD pipelines or alerting systems.

Practical example:

  • You want to get the current state and configuration of a particular Docker Swarm node identified by its Node ID in your Portainer-managed environment. This node will call the Portainer API to fetch that data and output it for further processing or logging.

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 retrieve information about.

Output

The node outputs JSON data representing the detailed information of the specified Docker Swarm node as returned by the Portainer API. This typically includes properties such as node status, role, availability, labels, and other metadata related to the node's configuration and state within the swarm.

No binary data output is involved in this operation.

Dependencies

  • Requires an active Portainer API instance accessible via a base URL.
  • Requires an API key credential for authentication with the Portainer API.
  • The node uses HTTP requests to the Portainer API endpoints, so network connectivity to the Portainer server is necessary.

Troubleshooting

  • Common issues:

    • Invalid or missing Environment ID or Node ID parameters will cause the API request to fail.
    • Network connectivity problems between n8n and the Portainer server can prevent successful API calls.
    • Incorrect or expired API key credentials will result in authentication errors.
  • Common error messages:

    • 401 Unauthorized: Check that the API key credential is valid and has sufficient permissions.
    • 404 Not Found: Verify that the provided Node ID exists in the specified environment.
    • 500 Internal Server Error: Could indicate issues on the Portainer server side; retry later or check server logs.
  • Resolutions:

    • Ensure all required input properties are correctly set.
    • Confirm network access and correct base URL configuration.
    • Validate API key credentials and their permissions in Portainer.

Links and References

Discussion