Portainer icon

Portainer

Interact with Portainer via API

Actions190

Edge Jobs → Edge Job Create File

AI-generated

Overview

This node operation, Edge Job Create File, allows users to create a scheduled edge job by uploading a stack file and defining its execution parameters. It is designed for managing edge computing jobs that run on specified edge groups and environments according to a cron schedule. This is useful in scenarios where automated deployment or execution of containerized workloads at the network edge is required, such as IoT device management, distributed application updates, or edge data processing.

For example, a user can upload a Docker Compose stack file, specify which edge groups and endpoints should run it, and set a cron expression to schedule recurring deployments automatically.

Properties

Name Meaning
File Content of the stack file to be deployed as part of the edge job.
Name The name assigned to the stack/job for identification.
Cron Expression A cron format string that schedules when the edge job will run.
Edge Groups JSON stringified array containing IDs of edge groups where the job will be deployed.
Endpoints JSON stringified array containing IDs of environment endpoints targeted by the job.
Recurring Boolean flag indicating whether the job should recur according to the cron schedule.

Output

The node outputs JSON data representing the created edge job's details as returned by the API. This typically includes identifiers, status, scheduling info, and metadata about the deployed stack. There is no binary output involved.

Dependencies

  • Requires an API key credential for authenticating with the Portainer API.
  • Needs the base URL of the Portainer instance configured in credentials.
  • Depends on the Portainer API endpoint /api to create edge jobs.
  • Input properties must be correctly formatted, especially the JSON stringified arrays for Edge Groups and Endpoints.

Troubleshooting

  • Invalid JSON strings: If the Edge Groups or Endpoints inputs are not valid JSON arrays, the API call will fail. Ensure these fields contain properly stringified JSON arrays.
  • Cron expression errors: An invalid cron expression may cause scheduling failures. Validate the cron syntax before submission.
  • Authentication issues: Missing or incorrect API credentials will result in authorization errors.
  • File content issues: The stack file content must be valid and compatible with the target edge environment; otherwise, deployment may fail.
  • API connectivity: Network or URL misconfiguration can prevent communication with the Portainer API.

Links and References

Discussion