Constructor
new Job(connection, jobId)
Creates an object representing a batch job stored at the back-end.
Parameters:
Name | Type | Description |
---|---|---|
connection |
Connection | A Connection object representing an established connection to an openEO back-end. |
jobId |
string | The batch job ID. |
Extends
Methods
debugJob() → {Logs}
Get logs for the batch job from the back-end.
Returns:
- Type
- Logs
(async) deleteJob()
Deletes the batch job from the back-end.
Throws:
(async) describeJob() → {Job}
Updates the batch job data stored in this object by requesting the metadata from the back-end.
Throws:
Returns:
The update job object (this).
- Type
- Job
(async) downloadResults(targetFolder) → {Array.<string>}
Downloads the results to the specified target folder. The specified target folder must already exist!
NOTE: This method is only supported in a NodeJS environment. In a browser environment this method throws an exception!
Parameters:
Name | Type | Description |
---|---|---|
targetFolder |
string | A target folder to store the file to, which must already exist. |
Throws:
Returns:
A list of file paths of the newly created files.
- Type
- Array.<string>
(async) estimateJob() → {object}
Calculate an estimate (potentially time/costs/volume) for a batch job.
Throws:
Returns:
A response compatible to the API specification.
- Type
- object
get(name) → {*}
Get a value from the additional data that is not part of the core model, i.e. from proprietary extensions.
Parameters:
Name | Type | Description |
---|---|---|
name |
string | Name of the property. |
- Overrides:
- Source:
Returns:
The value, which could be of any type.
- Type
- *
getAll() → {object}
Returns all data in the model.
- Overrides:
- Source:
Returns:
- Type
- object
(async) getResultsAsItem() → {object}
Retrieves the STAC Item produced for the job results.
Throws:
Returns:
The JSON-based response compatible to the API specification, but also including a costs
property if present in the headers.
- Type
- object
(async) listResults() → {object}
Retrieves download links.
Throws:
Returns:
A list of links (object with href, rel, title and type).
- Type
- object
monitorJob(callback, intervalopt) → {function}
Checks for status changes and new log entries every x seconds.
On every status change observed or on new log entries (if supported by the back-end), the callback is executed. It is also executed once at the beginning. The callback receives the job (this object) and the logs (array) passed.
The monitoring stops once the job has finished, was canceled or errored out.
This is only supported if describeJob is supported by the back-end.
Returns a function that can be called to stop monitoring the job manually.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
callback |
function | |||
interval |
integer |
<optional> |
60 |
Throws:
Returns:
- Type
- function
setAll(metadata) → {this}
Converts the data from an API response into data suitable for our JS client models.
Parameters:
Name | Type | Description |
---|---|---|
metadata |
object | JSON object originating from an API response. |
- Overrides:
- Source:
Returns:
Returns the object itself.
- Type
- this
(async) startJob() → {Job}
Starts / queues the batch job for processing at the back-end.
Throws:
Returns:
The updated job object (this).
- Type
- Job
(async) stopJob() → {Job}
Stops / cancels the batch job processing at the back-end.
Throws:
Returns:
The updated job object (this).
- Type
- Job
(async) updateJob(parameters) → {Job}
Modifies the batch job at the back-end and afterwards updates this object, too.
Parameters:
Name | Type | Description | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
parameters |
object | An object with properties to update, each of them is optional, but at least one of them must be specified. Additional properties can be set if the server supports them. Properties
|
Throws:
Returns:
The updated job object (this).
- Type
- Job