Jobs

Jobs

Metafold jobs endpoint.

Constructor

new Jobs()

Source:

Classes

Jobs

Methods

(async) get(id)

Get a job.
Source:
Parameters:
Name Type Description
id string ID of job to get.
Returns:
Job resource.

(async) list(paramsopt)

List jobs.
Source:
Parameters:
Name Type Attributes Description
params Object <optional>
Optional list parameters.
Name Type Attributes Description
sort string <optional>
Sort string. For details on syntax see the Metafold API docs. Supported sorting fields are: "id", "name", or "created".
q string <optional>
Query string. For details on syntax see the Metafold API docs. Supported search fields are: "id", "name", "type", and "state".
Returns:
List of job resources.

poll(url, timeoutopt, everyopt)

Poll the given URL every one second. Helpful for waiting on job results given a status URL.
Source:
Parameters:
Name Type Attributes Default Description
url string Job status url.
timeout number <optional>
12000 Time in seconds to wait for a result.
every number <optional>
1 Frequency in seconds.
Returns:
HTTP response.

(async) run(type, params, nameopt, timeoutopt)

Dispatch a new job and wait for the result. See Metafold API docs for the full list of jobs.
Source:
Parameters:
Name Type Attributes Default Description
type string Job type.
params Object Job parameters.
name string <optional>
Job name.
timeout number <optional>
12000 Time in seconds to wait for a result.
Returns:
Completed job resource.

(async) runStatus(type, params, nameopt) → {string}

Dispatch a new job and return immediately without waiting for result. See Metafold API docs for the full list of jobs.
Source:
Parameters:
Name Type Attributes Description
type string Job type.
params Object Job parameters.
name string <optional>
Job name.
Returns:
Type:
string
Job status url.

(async) update(id, paramsopt)

Update a job.
Source:
Parameters:
Name Type Attributes Description
id string ID of job to update.
params Object <optional>
Optional update parameters.
Name Type Attributes Description
name string <optional>
New job name. The existing name remains unchanged if undefined.
Returns:
Updated job resource.