Portainer icon

Portainer

Trabalhe com dados da API do Portainer para gerenciar Docker

Overview

This node integrates with the Portainer API to manage Docker stacks and other Docker-related resources. Specifically, for the Stack - Get Many operation, it retrieves a list of all Docker Compose stacks managed by Portainer. This is useful for scenarios where you want to programmatically fetch and monitor all existing stacks in your Docker environment via Portainer.

Practical examples include:

  • Automating inventory or reporting of all Docker stacks.
  • Triggering workflows based on the presence or status of certain stacks.
  • Integrating stack data into dashboards or monitoring tools.

Properties

Name Meaning
Environment ID The ID of the Portainer environment/endpoint where the stacks are managed (required).

Output

The node outputs JSON data representing the list of Docker stacks retrieved from Portainer. Each item in the output array corresponds to a stack object as returned by the Portainer API's /stacks endpoint.

The structure typically includes details such as stack ID, name, creation date, associated environment, and stack configuration metadata.

No binary data output is involved in this operation.

Dependencies

  • Requires an active connection to a Portainer instance with API access.
  • Needs an API key credential configured in n8n to authenticate requests to Portainer.
  • The base URL of the Portainer API must be set in the credentials.

Troubleshooting

  • Common issues:

    • Invalid or missing API key credential will cause authentication failures.
    • Incorrect Environment ID may result in empty or no data returned.
    • Network connectivity issues to the Portainer server can cause request timeouts or errors.
  • Error messages:

    • Authentication errors usually indicate invalid API keys; verify and update credentials.
    • 404 Not Found errors may mean the specified resource or endpoint does not exist; check Environment ID.
    • 500 Internal Server Error indicates server-side problems; retry later or check Portainer logs.

Links and References

Discussion