@oceanum/datamesh / Connector
Defined in: packages/datamesh/src/lib/connector.ts:17
new Connector(
token
,options?
):Connector
Defined in: packages/datamesh/src/lib/connector.ts:43
Datamesh connector constructor
string
= ...
Your datamesh access token. Defaults to environment variable DATAMESH_TOKEN is defined else as literal string “DATAMESH_TOKEN”. DO NOT put your Datamesh token directly into public facing browser code.
Constructor options.
string
URL of gateway service. Defaults to “https://gateway.
string
JWT for Oceanum service.
boolean
Disable caching of datamesh results.
string
URL of datamesh service. Defaults to environment variable DATAMESH_SERVICE or “https://datamesh.oceanum.io”.
number
The desired length of time for acquired datamesh sessions in hours. Will be 1 hour by default.
Connector
optional
gateway:string
Defined in: packages/datamesh/src/lib/connector.ts:28
optional
service:string
Defined in: packages/datamesh/src/lib/connector.ts:27
static
LAZY_LOAD_SIZE:number
=1e8
Defined in: packages/datamesh/src/lib/connector.ts:18
get host():
string
Defined in: packages/datamesh/src/lib/connector.ts:126
Get datamesh host.
string
The datamesh server host.
closeSession(
finaliseWrite
):Promise
<void
>
Defined in: packages/datamesh/src/lib/connector.ts:389
Close the current session if one exists.
boolean
= false
Whether to finalise any write operations. Defaults to false.
Promise
<void
>
A promise that resolves when the session is closed.
createSession(
options
):Promise
<Session
>
Defined in: packages/datamesh/src/lib/connector.ts:168
Create a new session.
Session options.
number
The desired length of time for the session in hours. Defaults to the value set in the constructor or 1 hour.
Promise
<Session
>
A new session instance.
getDatasource(
datasourceId
):Promise
<Datasource
>
Defined in: packages/datamesh/src/lib/connector.ts:356
Get a datasource instance from the datamesh.
string
Unique datasource ID.
Promise
<Datasource
>
The datasource instance.
getSession():
Promise
<Session
>
Defined in: packages/datamesh/src/lib/connector.ts:181
Get the current session or create a new one if none exists.
Promise
<Session
>
The current session.
loadDatasource(
datasourceId
,parameters
):Promise
<null
|Dataset
<HttpZarr
|TempZarr
>>
Defined in: packages/datamesh/src/lib/connector.ts:374
Load a datasource into the work environment.
string
Unique datasource ID.
Record
<string
, string
| number
> = {}
Additional datasource parameters.
Promise
<null
| Dataset
<HttpZarr
| TempZarr
>>
The dataset.
query(
query
,options
):Promise
<null
|Dataset
<HttpZarr
|TempZarr
>>
Defined in: packages/datamesh/src/lib/connector.ts:295
Execute a query to the datamesh.
The query to execute.
number
Additional options for the query.
Promise
<null
| Dataset
<HttpZarr
| TempZarr
>>
The response from the server.
stageRequest(
query
):Promise
<null
|Stage
>
Defined in: packages/datamesh/src/lib/connector.ts:266
Stage a query to the datamesh.
The query to stage.
Promise
<null
| Stage
>
The staged response.
status():
Promise
<boolean
>
Defined in: packages/datamesh/src/lib/connector.ts:135
Check the status of the metadata server.
Promise
<boolean
>
True if the server is up, false otherwise.