Class: Connection

Connection(baseUrl)

A connection to a back-end.

Constructor

new Connection(baseUrl)

Creates a new Connection.
Parameters:
Name Type Description
baseUrl string URL to the back-end
Source:

Methods

(async) authenticateBasic(options) → {object}

Authenticate with HTTP Basic. Not required to be called explicitly if specified in `OpenEO.connect`.
Parameters:
Name Type Description
options object Options for Basic authentication.
Source:
Throws:
Error
Returns:
A response compatible to the API specification.
Type
object

(async) authenticateOIDC(options) → {object}

Authenticate with OpenID Connect (OIDC). Supported only in Browser environments. Not required to be called explicitly if specified in `OpenEO.connect`.
Parameters:
Name Type Description
options object Options for OIDC authentication.
Source:
To Do:
Throws:
Error
Returns:
Response of `desribeAccount()`.
Type
object

capabilities() → {Capabilities}

Returns the capabilities of the back-end.
Source:
Returns:
Capabilities
Type
Capabilities

(async) computeResult(processGraph, planopt, budgetopt) → {Stream|Blob}

Executes a process graph synchronously and returns the result as the response. Please note that requests can take a very long time of several minutes or even hours.
Parameters:
Name Type Attributes Default Description
processGraph object A process graph (JSON).
plan string <optional>
null The billing plan to use for this computation.
budget number <optional>
null The maximum budget allowed to spend for this computation.
Source:
Returns:
- Returns the data as `Stream` in NodeJS environments or as `Blob` in browsers (see `isNode`).
Type
Stream | Blob

(async) createJob(processGraph, titleopt, descriptionopt, planopt, budgetopt, additionalopt) → {Job}

Creates a new batch job at the back-end.
Parameters:
Name Type Attributes Default Description
processGraph object A process graph (JSON).
title string <optional>
null A title for the batch job.
description string <optional>
null A description for the batch job.
plan string <optional>
null The billing plan to use for this batch job.
budget number <optional>
null The maximum budget allowed to spend for this batch job.
additional object <optional>
{} Proprietary parameters to pass for the batch job.
Source:
Throws:
Error
Returns:
The stored batch job.
Type
Job

(async) createProcessGraph(processGraph, titleopt, descriptionopt) → {ProcessGraph}

Creates a new stored process graph at the back-end.
Parameters:
Name Type Attributes Default Description
processGraph object A process graph (JSON).
title string <optional>
null A title for the stored process graph.
description string <optional>
null A description for the stored process graph.
Source:
Throws:
Error
Returns:
The new stored process graph.
Type
ProcessGraph

(async) createService(processGraph, type, titleopt, descriptionopt, enabledopt, parametersopt, planopt, budgetopt) → {Service}

Creates a new secondary web service at the back-end.
Parameters:
Name Type Attributes Default Description
processGraph object A process graph (JSON).
type string The type of service to be created (see `Connection.listServiceTypes()`).
title string <optional>
null A title for the service.
description string <optional>
null A description for the service.
enabled boolean <optional>
true Enable the service (`true`, default) or not (`false`).
parameters object <optional>
{} Parameters to pass to the service.
plan string <optional>
null The billing plan to use for this service.
budget number <optional>
null The maximum budget allowed to spend for this service.
Source:
Throws:
Error
Returns:
The stored service.
Type
Service

(async) describeAccount() → {object}

Get information about the authenticated user.
Source:
Throws:
Error
Returns:
A response compatible to the API specification.
Type
object

(async) describeCollection(collectionId) → {object}

Get further information about a single collection.
Parameters:
Name Type Description
collectionId string Collection ID to request further metadata for.
Source:
Throws:
Error
Returns:
A response compatible to the API specification.
Type
object

(async) download(url, authorize) → {Stream|Blob}

Downloads data from a URL. May include authorization details where required.
Parameters:
Name Type Description
url string An absolute or relative URL to download data from.
authorize boolean Send authorization details (`true`) or not (`false`).
Source:
Returns:
- Returns the data as `Stream` in NodeJS environments or as `Blob` in browsers (see `isNode`).
Type
Stream | Blob

getBaseUrl() → {string}

Returns the URL of the back-end currently connected to.
Source:
Returns:
The URL or the back-end.
Type
string

(async) getJobById(id) → {Job}

Get all information about a batch job.
Parameters:
Name Type Description
id string Batch Job ID.
Source:
Throws:
Error
Returns:
The batch job.
Type
Job

(async) getProcessGraphById(id) → {ProcessGraph}

Get all information about a stored process graph.
Parameters:
Name Type Description
id string Process graph ID.
Source:
Throws:
Error
Returns:
The stored process graph.
Type
ProcessGraph

(async) getServiceById(id) → {Job}

Get all information about a secondary web service.
Parameters:
Name Type Description
id string Service ID.
Source:
Throws:
Error
Returns:
The service.
Type
Job

getUserId() → {string}

Returns the identifier of the user that is currently authenticated at the back-end.
Source:
Returns:
ID of the authenticated user.
Type
string

(async) init() → {Capabilities}

Initializes the connection by requesting the capabilities.
Source:
Returns:
Capabilities
Type
Capabilities

isLoggedIn() → {boolean}

Returns whether the user is authenticated (logged in) at the back-end or not.
Source:
Returns:
`true` if authenticated, `false` if not.
Type
boolean

(async) listCollections() → {object}

List all collections available on the back-end.
Source:
Throws:
Error
Returns:
A response compatible to the API specification.
Type
object

(async) listFiles(userIdopt) → {Array.<File>}

Lists all files from the user workspace.
Parameters:
Name Type Attributes Default Description
userId string <optional>
null User ID, defaults to authenticated user.
Source:
Throws:
Error
Returns:
A list of files.
Type
Array.<File>

(async) listFileTypes() → {object}

List the supported output file formats.
Source:
Throws:
Error
Returns:
A response compatible to the API specification.
Type
object

(async) listJobs() → {Array.<Job>}

Lists all batch jobs of the authenticated user.
Source:
Throws:
Error
Returns:
A list of jobs.
Type
Array.<Job>

(async) listProcesses() → {object}

List all processes available on the back-end.
Source:
Throws:
Error
Returns:
A response compatible to the API specification.
Type
object

(async) listProcessGraphs() → {Array.<ProcessGraph>}

Lists all process graphs of the authenticated user.
Source:
Throws:
Error
Returns:
A list of stored process graphs.
Type
Array.<ProcessGraph>

(async) listServices() → {Array.<Job>}

Lists all secondary web services of the authenticated user.
Source:
Throws:
Error
Returns:
A list of services.
Type
Array.<Job>

(async) listServiceTypes() → {object}

List the supported secondary service types.
Source:
Throws:
Error
Returns:
A response compatible to the API specification.
Type
object

(async) listUdfRuntimes() → {object}

List the supported UDF runtimes.
Source:
Throws:
Error
Returns:
A response compatible to the API specification.
Type
object

openFile(path, userIdopt) → {File}

Opens a (existing or non-existing) file without reading any information or creating a new file at the back-end.
Parameters:
Name Type Attributes Default Description
path string Path to the file, relative to the user workspace.
userId string <optional>
null User ID, defaults to authenticated user.
Source:
Throws:
Error
Returns:
A file.
Type
File

subscribe(topic, callback, parametersopt)

Subscribes to a topic.
Parameters:
Name Type Attributes Default Description
topic string The topic to subscribe to.
callback incomingMessageCallback A callback that is executed when a message for the topic is received.
parameters object <optional>
{} Parameters for the subscription request, for example a job id.
Source:
See:
Throws:
Error

unsubscribe(topic, parametersopt)

Unsubscribes from a topic.
Parameters:
Name Type Attributes Default Description
topic string The topic to unsubscribe from.
parameters object <optional>
{} Parameters that have been used to subsribe to the topic.
Source:
See:
Throws:
Error

(async) validateProcessGraph(processGraph)

Validates a process graph at the back-end.
Parameters:
Name Type Description
processGraph object Process graph to validate.
Source:
Throws:
Error