Portainer icon

Portainer

Trabalhe com dados da API do Portainer para gerenciar Docker

Overview

This node integrates with the Portainer API to manage Docker images within specified environments (endpoints). The Image: Get operation retrieves detailed information about a specific Docker image by its ID from a given environment. This is useful for scenarios where you need to inspect image metadata, verify image existence, or gather details before performing further actions like deployment or cleanup.

Practical examples:

  • Fetching image details to display in a dashboard.
  • Verifying an image's presence and properties before triggering container creation.
  • Auditing images across multiple Docker environments managed via Portainer.

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 retrieve information about.

Output

The node outputs JSON data representing the detailed information of the requested Docker image. This includes all metadata returned by the Portainer API for that image, such as tags, size, creation date, layers, and other Docker image attributes.

No binary data output is involved in this operation.

Dependencies

  • Requires a configured Portainer API credential with:
    • Base URL of the Portainer instance.
    • An API key for authentication.
  • The node sends HTTP GET requests to the Portainer API endpoint corresponding to the specified environment and image ID.

Troubleshooting

  • Common issues:

    • Invalid or missing Environment ID or Image ID parameters will cause the request to fail.
    • Incorrect API credentials or insufficient permissions may result in authorization errors.
    • Network connectivity problems to the Portainer server can cause timeouts or connection errors.
    • If the image ID does not exist in the specified environment, the API will return a "not found" error.
  • Error messages and resolutions:

    • 401 Unauthorized: Check that the API key credential is correct and has sufficient permissions.
    • 404 Not Found: Verify that the Environment ID and Image ID are correct and that the image exists.
    • Network Error / Timeout: Ensure the Portainer base URL is reachable from n8n and there are no firewall restrictions.

Links and References

Discussion