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 Inspect operation for the Config resource retrieves detailed information about a specific Docker Swarm config by its ID within a given environment (endpoint). This is useful when you need to view metadata and content details of a config object managed by Portainer.

Typical use cases include:

  • Auditing or reviewing configuration data used in Docker Swarm services.
  • Debugging or verifying the contents and properties of a config before deployment.
  • Automating infrastructure management workflows that require fetching config details dynamically.

Example: You have a Docker Swarm config named "app-config" deployed in an environment with ID 1. Using this node's Inspect operation, you can fetch all details about "app-config" including its name, labels, creation date, and encoded data.

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 inspect.

Output

The node outputs JSON data representing the full details of the inspected Docker Swarm config as returned by the Portainer API. This typically includes:

  • Config metadata such as ID, name, labels, creation timestamp.
  • The base64-encoded config data content.
  • Other Docker Swarm config attributes relevant to the config object.

No binary data output is involved in this operation.

Dependencies

  • Requires a valid connection to a Portainer instance with API access.
  • An API key credential must be configured in n8n to authenticate requests to the Portainer API.
  • The node uses the Portainer API endpoint /api/endpoints/{environmentId}/docker/configs/{configId} with HTTP GET method.

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 are correct and correspond to existing resources in Portainer.
  • Authentication Errors: Missing or invalid API key credentials will cause authentication failures. Ensure the API key is correctly set up in n8n credentials.
  • Network Issues: Connectivity problems to the Portainer server will result in request timeouts or connection errors. Check network access and Portainer server availability.
  • Permission Denied: The API key used must have sufficient permissions to read configs in the specified environment.

Links and References

Discussion