core.download

Call a job that produces downloadable output and get a URL to retrieve the result.

This method executes jobs that generate files or streaming data for download. The job writes its output to a pipe, and this method returns a time-limited, single-use download URL.

  1. Call core.download with the target job method, arguments, and desired filename

  2. Receive an array containing the job ID and download URL

  3. Make an HTTP GET request to the download URL to retrieve the data

  4. The download URL expires after a timeout and can only be used once

Jobs that can be downloaded:

Type: object

Type: array
No Additional Items

Tuple Validation

Parameter 1: method

method

Type: string

Method name to execute for generating download content.

Parameter 2: args

args

Type: array

Array of arguments to pass to the method.

No Additional Items
Each item of this array must be:
Type: object
Parameter 3: filename

filename

Type: string

Filename for the downloaded file.

Parameter 4: buffered

buffered

Type: boolean Default: false

Non-buffered downloads will allow job to write to pipe as soon as download URL is requested, job will stay blocked meanwhile. buffered downloads must wait for job to complete before requesting download URL, job's pipe output will be buffered to ramfs.

Result

Type: array

Job ID and the URL for download.

Must contain a minimum of 2 items

Must contain a maximum of 2 items

No Additional Items

Tuple Validation

Item at 1 must be:
Type: integer
Item at 2 must be:
Type: string


Required roles: