Docker icon

Docker

Interact with Docker via Portainer API

Overview

This node allows users to interact with Docker through the Portainer API, specifically targeting Docker nodes management. The "Node List" operation fetches a list of Docker nodes from a specified Portainer endpoint. This is useful for scenarios where you want to automate monitoring, inventory, or management of Docker nodes within your infrastructure managed by Portainer.

Practical examples include:

  • Automatically retrieving and processing the list of Docker nodes to monitor their status.
  • Filtering nodes based on labels, roles, or membership status for targeted operations.
  • Integrating Docker node data into dashboards or alerting systems.

Properties

Name Meaning
EndpointID Name or ID The identifier of the Portainer endpoint to access Docker nodes. You can select from a dynamically loaded list of available endpoints or specify an ID using an expression.
Additional Fields Optional additional parameters to refine the node list request. Currently supports:
- Filters: JSON-encoded filters to narrow down the nodes returned. Available filters include:
id, label, membership (accepted or pending), name, node.label, and role (manager or worker).

Output

The node outputs a JSON array containing the list of Docker nodes retrieved from the specified Portainer endpoint. Each item in the array represents a Docker node object with its associated properties as returned by the Portainer API.

No binary data output is involved.

Dependencies

  • Requires a valid Portainer API authentication token configured in the node credentials.
  • Access to a Portainer instance URL and appropriate permissions to query endpoints and Docker nodes.
  • The node uses the Portainer API endpoint /api/endpoints/{endpointId}/docker/nodes to retrieve node information.

Troubleshooting

  • Common issues:

    • Invalid or missing endpoint ID: Ensure that the selected endpoint exists and is accessible.
    • Authentication errors: Verify that the API key or token used has sufficient permissions.
    • Incorrect filter syntax: Filters must be valid JSON strings matching the expected format; invalid JSON will cause request failures.
    • Network connectivity problems between n8n and the Portainer server.
  • Error messages:

    • Unauthorized or 401 errors indicate credential issues; recheck API keys.
    • 404 errors may mean the endpoint ID does not exist or the path is incorrect.
    • Malformed filter errors usually result from invalid JSON in the filters field; validate JSON before use.

Links and References

Discussion