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 and resources. Specifically, for the Stack - Get operation, it retrieves detailed information about a specific Docker stack managed by Portainer. This is useful when you want to programmatically access the configuration or status of a particular stack in your Docker environment.

Common scenarios include:

  • Automating monitoring or auditing of Docker stacks.
  • Fetching stack details before performing updates or deletions.
  • Integrating stack information into dashboards or reports.

Example: You have multiple Docker Compose stacks deployed via Portainer and want to fetch the configuration or metadata of a specific stack by its ID to verify its current state or settings.

Properties

Name Meaning
Environment ID The ID of the Portainer environment/endpoint where the stack resides.
Stack ID The unique identifier of the stack to retrieve information for.

Output

The node outputs JSON data representing the full details of the specified stack as returned by the Portainer API. This typically includes:

  • Stack metadata (ID, name, creation date).
  • Configuration details such as the stack file content (docker-compose.yml or equivalent).
  • Associated environment variables.
  • Deployment status and related endpoint information.

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.
  • The base URL of the Portainer API must be set in the credentials.

Troubleshooting

  • Invalid Environment or Stack ID: If the provided IDs do not exist or are incorrect, the API will return an error indicating the resource was not found. Verify the IDs are correct.
  • Authentication Errors: Ensure the API key credential is valid and has sufficient permissions to access the stack resource.
  • Network Issues: Confirm that n8n can reach the Portainer API endpoint (correct base URL and network connectivity).
  • API Rate Limits or Timeouts: Large stacks or slow networks might cause timeouts; consider retrying or increasing timeout settings if available.

Links and References

Discussion