Portainer icon

Portainer

Trabalhe com dados da API do Portainer para gerenciar Docker

Overview

This node allows you to create a new Edge Group in Portainer, which is a management tool for Docker environments and edge computing. An Edge Group is a collection of edge endpoints that can be managed collectively. The node supports creating either static groups (with specific endpoint IDs) or dynamic groups (based on tags).

Common scenarios where this node is useful include:

  • Organizing edge devices/endpoints into logical groups for easier management.
  • Automatically grouping endpoints based on tags for dynamic environments.
  • Deploying edge stacks or configurations to specific groups of edge endpoints.

Example use case:

  • You want to create a dynamic edge group that automatically includes all edge endpoints tagged with "production" and "region-us". You provide the tag IDs corresponding to those tags, and the group will update dynamically as endpoints are tagged or untagged.

Properties

Name Meaning
Edge Group Name The name of the edge group to create.
Is Dynamic Boolean flag indicating if the group is dynamic (true) or static (false).
Tag IDs Comma-separated list of tag IDs used to define a dynamic group. Required if Is Dynamic=true.
Endpoint IDs Comma-separated list of endpoint IDs for a static group. Required if Is Dynamic=false.

Output

The output JSON contains the response from the Portainer API after creating the edge group. This typically includes details about the newly created edge group such as its ID, name, whether it is dynamic, associated tag IDs, and endpoint IDs.

No binary data output is involved.

Dependencies

  • Requires an API key credential for authenticating with the Portainer API.
  • The base URL of the Portainer instance must be configured in the credentials.
  • The node sends a POST request to /edge_groups endpoint of the Portainer API.

Troubleshooting

  • Invalid or missing API key: Ensure the API key credential is correctly set up and has sufficient permissions.
  • Incorrect tag or endpoint IDs format: Tag IDs and Endpoint IDs must be comma-separated strings of numeric IDs without spaces. Invalid formatting may cause API errors.
  • Conflicting parameters: If Is Dynamic is true, Tag IDs must be provided; if false, Endpoint IDs must be provided. Omitting required fields will result in errors.
  • Network connectivity issues: Verify that the n8n instance can reach the Portainer API URL.
  • API permission errors: The API key must have rights to create edge groups.

Links and References

Discussion