Portainer icon

Portainer

Trabalhe com dados da API do Portainer para gerenciar Docker

Overview

The node integrates with the Portainer API to manage Docker resources programmatically. Specifically, for the Image resource and the Inspect operation, it retrieves detailed metadata and configuration information about a specific Docker image within a given Portainer environment.

This node is beneficial in scenarios where you need to automate Docker image management tasks such as auditing image details, verifying image configurations, or integrating image inspection into CI/CD pipelines. For example, you could use this node to fetch image metadata before deploying containers or to monitor image changes across environments.

Properties

Name Meaning
Environment ID The ID of the Portainer environment/endpoint where the Docker image resides.
Image ID The unique identifier of the Docker image to inspect.

Output

  • The node outputs JSON data containing detailed information about the specified Docker image.
  • This includes metadata such as image layers, creation date, size, tags, labels, and configuration details.
  • The output structure corresponds directly to the response from the Portainer API's image inspection endpoint.
  • 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 the Portainer API.
  • The Portainer API base URL and API key must be set in the node credentials.
  • The target Portainer environment (endpoint) must exist and be accessible.

Troubleshooting

  • Common Issues:

    • Invalid or missing Environment ID or Image ID will cause the request to fail.
    • Network connectivity issues between n8n and the Portainer server can prevent successful API calls.
    • Insufficient permissions or invalid API key may result in authorization errors.
    • If the specified image does not exist in the environment, the API will return a "not found" error.
  • Error Messages:

    • 404 Not Found: The image ID does not correspond to any image in the specified environment. Verify the Image ID and Environment ID.
    • 401 Unauthorized: API key is invalid or lacks necessary permissions. Check the API key credential.
    • Network Errors: Ensure that the Portainer server URL is correct and reachable from the n8n instance.

Links and References

Discussion