Portainer icon

Portainer

Trabalhe com dados da API do Portainer para gerenciar Docker

Overview

This node integrates with the Portainer API to manage Docker Swarm configs. Specifically, the Config - Get operation retrieves detailed information about a specific Docker Swarm config by its ID within a given environment (endpoint). This is useful for automation workflows that need to fetch configuration data used in Docker Swarm services or stacks managed via Portainer.

Common scenarios:

  • Fetching config details before updating or deploying services.
  • Auditing or backing up Docker Swarm configs programmatically.
  • Integrating Docker Swarm config data into other systems or dashboards.

Practical example:
You want to retrieve the content and metadata of a Docker Swarm config named "my_config" in your production environment (environment ID 1) to verify its settings before applying changes.

Properties

Name Meaning
Environment ID The ID of the Portainer environment/endpoint where the Docker Swarm config resides.
Config ID The unique identifier of the Docker Swarm config to retrieve.

Output

The node outputs JSON data representing the retrieved Docker Swarm config object from Portainer. This includes all properties returned by the Portainer API for the config resource, such as:

  • Config metadata (ID, name, creation date, labels).
  • Base64-encoded config data content.
  • Any associated labels or annotations.

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

Troubleshooting

  • Invalid Environment ID or Config ID: If the IDs are incorrect or do not exist, the API will return a 404 error. Verify the IDs in Portainer.
  • Authentication errors: Ensure the API key credential is valid and has sufficient permissions to read configs.
  • Network issues: Confirm that n8n can reach the Portainer API endpoint.
  • Malformed Config ID: Make sure the Config ID is provided as a string matching the expected format.

Links and References

Discussion