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 Swarm resources. The "Swarm Inspect" operation retrieves detailed information about a Docker Swarm instance associated with a specified endpoint. This is useful for monitoring and managing Docker Swarm clusters programmatically within an n8n workflow.

Practical examples include:

  • Automatically fetching the current state and configuration of a Docker Swarm cluster.
  • Integrating Docker Swarm status checks into deployment pipelines.
  • Triggering alerts or actions based on the Swarm's health or configuration details.

Properties

Name Meaning
EndpointID Name or ID The identifier of the Docker endpoint to access. You can select from a list of available endpoints or specify an ID using an expression. This determines which Docker Swarm instance will be inspected.

Output

The node outputs JSON data representing the detailed inspection result of the Docker Swarm instance at the specified endpoint. This includes all relevant Swarm configuration and status information as returned by the Portainer API.

No binary data output is indicated.

Dependencies

  • Requires connection to a Portainer API instance.
  • Needs an API key credential configured in n8n to authenticate requests to the Portainer API.
  • The node dynamically loads available Docker endpoints from the Portainer API to populate the endpoint selection property.

Troubleshooting

  • Common issues:

    • Invalid or missing endpoint ID: Ensure the selected endpoint exists and is accessible.
    • Authentication failures: Verify that the API key credential is correctly set up and has sufficient permissions.
    • Network connectivity problems between n8n and the Portainer API server.
  • Error messages:

    • Errors related to endpoint retrieval usually indicate misconfiguration or lack of access rights.
    • API request failures may return HTTP error codes; check the Portainer API documentation for specific meanings.

Resolving these typically involves verifying credentials, endpoint availability, and network settings.

Links and References

Discussion