2.54.2
The Javascript SDK that lets you use the Waylay REST Services.
(Object?)
Configuration options for this waylay client
Name | Description |
---|---|
options.gateway string?
|
Sets the gateway host or url prefix that will be used as an endpoint prefix for each service. |
options.clientID string?
|
[Deprecated] The clientID (apiKey) to authenticate this client |
options.secret string?
|
[Deprecated] The secret (apiSecret) to authenticate this client |
options.domain string?
|
[Deprecated] The tenant domain used by this client (for authentication and as default endpoint). Note that any domain in the token takes precedence. |
options.token string?
|
The jwt token to authenticate this client (alternative to clientId, secret, domain arguments). |
options.globalSettings Object?
|
The organisation settings to use for this client (see withSettings ). |
options.enforceGateway boolean
(default false )
|
If true, only allow the waylay client to use API gateway endpoints (except those configured through
options.<service>.baseUrl
).
|
options.enforceConfigured boolean
(default false )
|
If true, only allow the waylay client to use configured enpoints (no fallback to hardcoded production endpoints or legacy domain api). |
(Data?)
: The
data
service
(Resources?)
: The
resources
service
(Types?)
: The
types
service
(Constraints?)
: The
constraints
service
(Alarms?)
: The
alarms
service
(Transformers?)
: The
transformers
service
(Tasks?)
: The
tasks
service
(Templates?)
: The
templates
service
(Sensors?)
: The
sensors
service
(Actuators?)
: The
actuators
service
(Converter?)
: The
converter
service
(Webscripts?)
: The
webscripts
service
(Byoml?)
: The
byoml
service
(Queries?)
: The
queries
service
(Storage?)
: The
storage
service
(Registry?)
: (PREVIEW) The
registry v2
service
(Account?)
: The
account
service
(Settings?)
: The
settings
service
(Vault?)
: The
vault
service
(Users?)
: The
users
service
(Tenants?)
: The
tenants
service
(Roles?)
: The
roles
service
(PredefinedRoles?)
: The
predefinedRoles
service
(Permissions?)
: The
permissions
service
(TwoFA?)
: The
twoFA
service
(Hoard?)
: The
hoard
service
(Analytics?)
: (DEPRECATED) the
analytics
service
(Stats?)
: (DEPRECATED) the
stats
service
const Waylay = require('@waylay/client')
const gateway = 'https://api-io.waylay.io'
// authenticate with apiKey/apiSecret
const waylay = new Waylay({ gateway })
await waylay.authenticate(myApiKey, myApiSecret)
// ... or login with username/password
const waylay = new Waylay({ gateway })
await waylay.login(username, password, domain)
// ... or initialise with waylay token
const waylay = new Waylay({ gateway, token: myStoredWaylayJwtToken})
// Legacy configuration without gateway:
// configure waylay endpoints from tenant configuration automatically
const waylay = new Waylay({ domain: 'my-domain.waylay.io', clientID: mayApiKey, secret: myApiSecret })
await waylay.loadSettings()
// ... or provide the tenant organisation settings yourself
const waylay = waylay.withSettings(myOrgSettings)
The jwt token used by this client (if any).
The token property is initialised by options.token
in constructor.
string
:
the jwt token used by this client (if any)
Set (update or clear) the jwt token used by this client (if any)
(string)
The domain effectively used by this client, with the following precedence:
waylay_domain
)The domain property is initialised by options.domain
in constructor.
any
:
a tenant domain name such as
example.waylay.io
Obtain a login token using username and password.
As a side effect, the token is used by this client for subsequent calls (token)
(string)
(string)
(string?)
Required if domain is not specified at initialization of client.
(string?)
Required if 2 factor authentication is enforced.
Promise<{access_token: string, expires_at: number, token_type: string}>
:
const { access_token, expires_at } = waylay.login('my-username', 'and-password')
console.log(`token ${access_token} will expire at ${new Date(expires_at)}`)
Update this client with organisation settings from the organisationSettings service, in that way configuring default endpoints.
See withSettings to see how the retrieved settings impact the lookup of services.
Promise<Waylay>
:
this client, with updated organisation settings.
Update this client with organisation settings for the default endpoints (globalSettings). Any previous settings are overwritten by this call.
Any service on this client resolves its baseUrl
with the following precedence:
options.<service>.baseUrl
options.gateway
or the organisation setting
settings.waylay_gateway
(see gateway)settings.waylay_<service>
as described below, and set by this methodapi
and domain
configuration)The organisation settings can be intialised by the options.globalSettings
argument in the constructor.
A user can initialise organisation settings either from an existing object:
const waylay = new Waylay({token, globalSettings: myCachedSettings})
or using the client itself (using the default OrganisationSettings service, requires an async call)
const waylay = await new Waylay({token}).loadSettings()
or explicitely using this method.
Note that any waylay plugin sandbox (e.g. for sensors and actuators) does this initialization for you before handing over the waylay client.
This call only affects the organisation setting used by this client object. See organisationSettings to manage the settings for all your users.
(Object?)
The organisation settings containing default endpoints for waylay services. A null argument clears all settings.
Name | Description |
---|---|
settings.waylay_gateway string?
|
The gateway endpoint used for all services that are not explicitely configured. Overridden by the
constructor
argument
options.gateway
.
Note that all remaining global settings are ignored when using a gateway. Non-gateway access of the waylay services is deprecated and being phased out gradually.
Set options.enforceGateway to The waylay default |
settings.waylay_data string?
|
[Deprecated] The default endpoint used for the
data
service. Overridden by the
constructor
argument
options.data.baseUrl
.
The waylay default is |
settings.waylay_alarms string?
|
[Deprecated] The default endpoint used for the
alarms
service, overriden by the
constructor
argument
options.alarms.baseUrl
.
The waylay default is |
settings.waylay_vault string?
|
[Deprecated] The default endpoint used for the
vault
service, overriden by the
constructor
argument
options.vault.baseUrl
.
The waylay default is |
settings.waylay_webscripts string?
|
[Deprecated] The default endpoint used for the
webscripts
service, overriden by the
constructor
argument
options.webscripts.baseUrl
.
The waylay default is |
settings.waylay_analytics string?
|
[Deprecated] The default endpoint used for the
analytics
service, overriden by the
constructor
argument
options.analytics.baseUrl
.
The waylay default is |
settings.waylay_accounts string?
|
[Deprecated] The default endpoint used for the
accounts
service, overriden by the
constructor
argument
options.accounts.baseUrl
.
The waylay default is |
settings.waylay_byoml string?
|
[Deprecated] The default endpoint used for the
byoml
service, overriden by the
constructor
argument
options.byoml.baseUrl
.
The waylay default is |
settings.waylay_stats string?
|
[Deprecated] The default endpoint used for the
stats
service, overriden by the
constructor
argument
options.stats.baseUrl
.
The waylay default is |
settings.waylay_converter string?
|
[Deprecated] The default endpoint used for the
converter
service, overriden by the
constructor
argument
options.converter.baseUrl
.
The waylay default is |
settings.waylay_storage string?
|
[Deprecated] The default endpoint used for the
storage
service, overriden by the
constructor
argument
options.storage.baseUrl
.
The waylay default is |
settings.waylay_api string?
|
[Deprecated] The default endpoint used for the waylay api services:
actuators
,
sensors
,
transformers
,
types
,
tasks
,
resources
and
templates
,
overriden by the corresponding
constructor
argument
options.<service>.baseUrl
.
Default endpoint for the
organisationSettings
service,
overriden by
constructor
argument
options.api.baseUrl
The waylay default is computed by baseUrl (depending on the |
settings.waylay_domain string?
|
[Deprecated] The tenant domain to which these setting apply. Used as default
baseUrl
for all other services provided by this client.
|
Waylay
:
this client, with updated organisation settings
The default base url for (unconfigured) services, using the api
and domain
configuration.
Uses the first that is defined from:
api.baseUrl
constructor argument of this clientsettings.waylay_api
organisation settingdomain
constructor argument of this clientsettings.waylay_domain
organisation settingdomain
as stated in the current JWT TokenNote the token domain has least precedence, contrary to the definition of the domain property, where it has greatest precendence.
Type: string
string
:
a base URL depending on the
api
and
domain
configuration.
Set the gateway url to be used by this client.
Intialized by the options.gateway
constructor argument.
Can be a gateway url prefix, hostname or id (production
, on-demand
, ...).
If set, the client uses the API gateway on each service, (unless overridden by options.<service>.baseUrl
).
In that case organisation settings for the service endpoints are ignored.
See withSettings for the impact on service endpoint resolution.
Get the service gateway url used by this client. This is, in descending priority:
options.gateway
constructor argument, which can be changed by setting the gateway attribute.waylay_gateway
global setting (see withSettings or options.globalSettings
contructor argument)api.waylay.io
(only if options.enforceGateway is true
and options.enforceConfigured is false
)Note that, if defined, all services use this gateway, unless an explicit overide was set (global settings are ignored, see withSettings).
(string | undefined)
:
A gateway url to be used by this client, if defined.
The Waylay client gives access to the following REST Resources.
Extends Resource
Retrieve a series of measurement from a resource
Alias of getMessage()
(string)
Name of the resources to retrieve measurements from
(Object)
Object containing parameters for the query
Name | Description |
---|---|
params.limit number?
|
Limit the amount of datapoints |
params.until number?
|
Timestamp in milliseconds |
params.from number?
|
Timestamp in milliseconds |
params.window string?
|
ISO-8601 duration See https://en.wikipedia.org/wiki/ISO_8601#Durations |
params.metadata string?
|
metadata of the series |
Promise<Array<any>>
:
await waylay.data.getSeries('testresource',{limit: 10, window: 'PT1H'})
// Response on resolve
[{
"temperature": 32.22983748538228,
"timestamp": 1617093236578
},{...},{...},{...},{...},{...},{...},{...},{...},{...}]
Post a series of measurement to one or multiple resources. The resource should be defined in the message object. See https://docs.waylay.io/#/api/broker/?id=posting-array-of-data
(Object)
Additional querystring parameters
Promise<Object>
:
await waylay.data.postSeries([
{
"resource": "testresource",
"test": 1,
"timestamp": 1617088527380
},
{
"resource": "testresource",
"test": 2,
"timestamp": 1617088527381
}
])
// Response on resolve
{
"message": "Batch uploaded 2 messages for resource testresource",
"content": {}
}
Post a series of measurement to a resource
Alias of postMessages()
See https://docs.waylay.io/#/api/broker/?id=posting-data-towards-broker
(Object)
Promise<Object>
:
Object containg conformation of the action.
await waylay.data.postSeries('testresource',
{
'test': 1
}
, { store: true, forward: true })
// Response on resolve
{
"message": "Published message async for testresource",
"content": {
"test": 1,
"timestamp": 1617108869013
}
}
Remove a series of data from a resource
Promise<{message: string}>
:
Promise object that resolves when the metrics have been deleted
Query the time series storage for a particular resource.
To disable aggregation, pass the value none
for aggregate
in the options object.
See https://docs.waylay.io/#/api/broker/?id=time-series-data-retrieval
(string)
ResourceId
(string)
The resource metric
(Object)
Options to pass to the query
Name | Description |
---|---|
options.aggregate string?
|
Possible options: none, mean, median, min, max, sum, count, count-numeric, count-non-numeric, first, last, std (standard deviation), percentile(n) (where 0 < n <= 1) |
options.grouping string
(default 'auto' )
|
ISO-8601 duration: PnDTnHnMn.nS |
options.from (string | number)?
|
ISO-8601 date times or timestamp in milliseconds since epoch |
options.until (string | number)?
|
ISO-8601 date times or timestamp in milliseconds since epoch |
options.window string?
|
ISO-8601 duration: PnDTnHnMn.nS Should be used in combination with the from key. |
options.grouping string?
|
ISO-8601 duration: PnDTnHnMn.nS Should be used in combination with the from key. |
Promise<Object>
:
Object containing the array of datapoints
getMetricSeries('resource', 'metric', { aggregate: 'none' })
getMetricSeries('resource', 'metric', { aggregate: 'median', grouping: 'PT15M' })
await waylay.data.getMetricSeries('testresource','test', { aggregate: 'max',from: 1617088439000, window:'PT1H', grouping: 'PT1H' })
// Response on resolve
{
"query": {
"from": 1617088439000,
"until": 1617110061759,
"metric": "test",
"aggregates": [
"max"
],
"grouping": "PT1H",
"resources": [
"testresource"
],
"aggregate": "max"
},
"series": [
[1617088439000,2],[...],[...],[...],[...],[...],
]
}
Query the time series storage for the latest n datapoints for a particular metric from a resource
See https://docs.waylay.io/#/api/broker/#post-timeseries-query
Promise<Object>
:
Object containing the array of datapoints
await waylay.data.getLastDatapointsForMetric('testresource','test', { limit: 10})
{
"query": {
"from": null,
"until": 1617172322107,
"metric": "test",
"aggregates": null,
"grouping": "auto",
"resources": [
"testresource"
],
"limit": 10
},
"series": [[...],[...],[...],[...],[...],[...],[...],[...],[...],[...]]
}
Query the time series storage for the latest n datapoints for a particular resource and metric and get them raw
See https://docs.waylay.io/#/api/broker/#getting-time-series-data
Promise<Object>
:
Object containing the array of raw datapoints
await waylay.data.getDatapointsForMetricRaw('testresource','test', { limit: 10})
{
"query": {
"from": 1616569296535,
"until": 1617174096535,
"metric": "test",
"aggregates": null,
"grouping": "auto",
"resources": [
"testresource"
],
"limit": 10
},
"series": [
[1617093236579, 1],[...],[...],[...],[...],[...],[...],[...],[...],[...],
]
}
Perform a free-form time series query.
This method allows aggregating a metric over one or more resources, using one or more aggregate operations.
An example query object would be as follows:
The response includes a 'series' field which contains an array of measurement arrays. Each of the nested measurement arrays contains a timestamp value at index 0, and then one value per aggregate in the order that the aggregates were supplied in the request. In the example request above, this results in values containing
An example of output from the above query would be as follows:
See https://docs.waylay.io/#/api/broker/?id=time-series-data-retrieval for more information on the query definition.
(Object)
as specified in the API docs for a POST time series query
Name | Description |
---|---|
query.from (string | number)
|
ISO-8601 date times or timestamp in milliseconds since epoch |
query.until (string | number)
|
ISO-8601 date times or timestamp in milliseconds since epoch |
query.window string
|
ISO-8601 duration: PnDTnHnMn.nS Should be used in combination with the from key. |
query.resources Array<string>
|
Array of resources you wish to query |
query.aggregates Array<string>
|
Array of aggregates: mean, median, min, max, sum, count, count-numeric, count-non-numeric, first, last, std (standard deviation), percentile(n) (where 0 < n <= 1) |
query.metric string
|
The resource metric |
query.grouping string
|
Group data using ISO-8601 duration: PnDTnHnMn.nS |
Promise<Object>
:
An object containing an array of measurement arrays
await waylay.data.queryTimeSeries({
"window": "PT2H",
"resources": ["testresource"],
"aggregates": ["mean", "min", "max"],
"metric": "test",
"grouping": "PT1M"
})
// Response on resolve
{
"query": {
"from": 1617167966555,
"until": 1617175166555,
"metric": "test",
"aggregates": [
"mean",
"min",
"max"
],
"grouping": "PT1M",
"resources": [
"testresource"
]
},
"series": [Array(120)]
}
You can retrieve messages for multiple resources from the message storage in one REST api call.
The messages will always be grouped per resource. They will be sorted by timestamp in descending order.
An example query object would be as follows:
See https://docs.waylay.io/#/api/broker/#querying-messages-for-multiple-resources for more information on the query definition and response payload format.
Promise<{results: Array<{messages: Array<any>}>}>
:
Retrieve up to the last 100 messages sent to a resource, allowing an optional filter object.
see https://docs.waylay.io/#/api/broker/#querying-messages-for-multiple-resources
Promise<Array<Object>>
:
await waylay.data.getLatestMessages('testresource', { limit: 10 })
// Response on resolve
[
{
"test": 1,
"timestamp": 1617108869013
},
{
"test": 1,
"timestamp": 1617093236579
},{...},{...},{...},{...},{...},{...},{...},{...}
]
baseUrl abstraction to make sure that this entity first falls back to the api/engine config
Create a new Waylay resource
Promise<Object>
:
Promise with the status of the creation of the resource
await waylay.resources.create({ id: 'testSDKDocs', name: 'test' })
// Response on resolve
{
"statusCode": 201,
"uri": "/api/resources/testSDKDocs",
"entity": {
"id": "testSDKDocs",
"name": "test"
}
}
Retrieves the child resources of the specified resource.
(string)
The resourceId
(Object?)
Parameters you want to pass to the request
Name | Description |
---|---|
params.limit number
(default 10 )
|
Maximum number of entries fetched |
params.skip number
(default 0 )
|
Number of entries that will be skipped |
params.denormalized boolean?
|
To retrieve the normalized representation of the children. |
Promise<Object>
:
await waylay.resources.children('testresource', { skip: 0, limit: 100, denormalized: false })
// Response on resolve
{
"values": [{...},{...},{...},{...},{...}],
"skip": 0,
"limit": 100,
"total": 5
}
Retrieves the parent resource of the specified resource.
(string)
The resourceId
Promise<Object>
:
On resolve returns the metadata structure of the parent resource
await waylay.resources.parent('testresource')
// Response on resolve
{
"id": "testresourceParent"
"resourceTypeId": "SampleResourceType"
}
Retrieves the referrer resources of the specified resource.
(string)
The resourceId
Promise<Object>
:
await waylay.resources.referrers('testresource', { skip: 0, limit: 100 })
// Response on resolve
{
"values": [{...},{...},{...},{...},{...}],
"skip": 0,
"limit": 100,
"total": 5
}
Update a resource, allows partial updates
Promise<Object>
:
Returns a Promise for the object of the updated resource
await waylay.resources.update('testresource', {
exampleKey1: 'value1',
exampleKey2: 2,
exampleKey3: true
})
// Response on resolve
{
"id": "testresource",
"parentId": "Bearing_1",
"name": "testresource",
"exampleKey1": "value1",
"exampleKey2": 2,
"exampleKey3": true
}
Replace a resource, overwrites the existing resource.
(string)
The resourceId
(Object)
The metadata you want to replace the current metadata with
Promise<Object>
:
await waylay.resources.replace('testresource', {
exampleKey1: 'value1',
exampleKey2: 2,
exampleKey3: true
})
// Response on resolve
{
"id": "testresource",
"exampleKey1": "value1",
"exampleKey2": 2,
"exampleKey3": true
}
Search for a resource matching the filter
See https://docs.waylay.io/#/api/resources/#query-resources for more information
(Object)
Parameters to specify query
Name | Description |
---|---|
params.filter string?
|
partial match on multiple fields |
params.tag string?
|
Whole word match on resource tags |
params.id string?
|
Whole word match on the resourceId |
params.provider string?
|
Whole word match on resource provider |
params.customer string?
|
Whole word match on resource customer |
params.resourceTypeId string?
|
Whole word match on resourceType |
params.distance string?
|
find resource within distance (e.g. 100km, 200km, 500m) for resources where location metadata is defined. lat and lon must also be specified in the query |
params.lat number?
|
|
params.lon number?
|
|
params.query string?
|
Metadata query string See https://docs.waylay.io/#/api/resources/?id=metadata-query-language |
params.toplevelOnly boolean?
|
Will only return resource without parent when set to
true
|
params.limit number?
|
Maximum number of entries fetched |
params.skip number?
|
Number of entries that will be skipped |
(Object?
= {}
)
Add options you want to pass to the request library
Promise<Object>
:
await waylay.resources.search({
filter: 'a',
skip: 0,
limit: 100
})
// Response on resolve { "values": [{...},{...},{...},{...},{...},{...},{...},{...}], "skip": 0", "limit": 100, "total": 8 }
Executes a command defined on ResourceType / Resource level
(string)
(string)
The name of the command that needs to be executed (defined on the resourceType)
(Object)
An object with the properties that are the input for the defined actuator in the command
Promise<Object>
:
await waylay.resources.executeCommand('testresource', 'testCommand')
// Response on resolve
{
"message": "Published command for testresource",
"content": {
"name": "testCommand",
"timestamp": 1616743972539
}
}
This returns a paged list with the command logs.
See https://docs.waylay.io/#/api/resources/?id=retrieve-resource-command-log for more information
(string)
Promise<Object>
:
await waylay.resources.commandLogs('testresource', { skip: 0, limit: 10 })
// Response on resolve
{
"values": [
{
"name": "testCommand",
"executionTime": "2021-03-26T07:32:52.539Z",
"errorMessage": "Resource 'testresource' not found"
}
],
"skip": 0,
"limit": 10,
"total": 1
}
Fetch resource history
See https://docs.waylay.io/#/api/resources/#retrieve-resource-change-log for more information
(string)
Promise<Object>
:
await waylay.resources.changelog('testresource', { skip: 0, limit: 10 })
// Response on resolve
{
"values": [
{
"time": "2021-03-25T09:56:46.193Z",
"resourceId": "testresource",
"userId": "292ffd11-231a-4b70-9457-e48e61018f21",
"change": "updated",
"resource": {
"id": "testresource",
"parentId": "testresourceParent",
"name": "testresource",
"testRef1": {
"$ref": "/resources/testresourceParent"
}
}
},{...},{...},{...},{...},{...},{...},{...},{...},{...}
],
"skip": 0,
"limit": 10,
"total": 21
}
Create a new resource type
See https://docs.waylay.io/#/api/rest/#create-resource-type
Promise<Object>
:
await waylay.types.create({ id: 'testType', test: 123 })
// Response on resolve
{
"statusCode": 201,
"uri": "/api/resourcetypes/testType",
"entity": {
"id": "testType",
"name": "testType",
"test": 123
"$constraints": [],
"$bulkOperation": "64c759ea-02cd-44da-a7ea-0d8f242872bb"
}
}
Update a resource type
Does not keep the existing metadata fields, use patch
to do partial update
Promise<Object>
:
await waylay.types.update('testType', { name:'testType', test2: 456 })
// Response on resolve
{
"id": "testType",
"$constraints": [],
"$bulkOperation": "be27101d-520e-4549-bfc6-6ec02ad07706",
"test2": 456
}
Get the constraints of a specific resource type
Promise<Object>
:
await waylay.types.constraints('testType')
// Response on resolve
{
"id": "merged",
"name": "Constraints for resourceType 'ID: ResourceType(testType,None,None,None,None,None,None,None,Map(),Set(),None,Some({\"test2\":456})).id'",
"description": "The reserved keywords as defined on docs as resource constraints",
"attributes": [Array(16)]
}
Fetch resource type history
See https://docs.waylay.io/#/api/rules/#retrieve-resource-type-change-log for more information
(string)
The resourceTypeId
Promise<Object>
:
await waylay.types.changelog('testType', {limit: 25})
// Response on resolve
{
"values": [
{
"time": "2021-03-31T08:29:26.182Z",
"resourceTypeId": "testType",
"userId": "292ffd11-231a-4b70-9457-e48e61018f21",
"change": "updated",
"resourceType": {
"id": "testType",
"$constraints": [],
"test2": 456
}
},{...},{...},{...}
],
"skip": 0,
"limit": 25,
"total": 4
}
list all resource constraints
Promise<(Array<ResourceConstraint> | AxiosResponse<Array<ResourceConstraint>>)>
:
A list of resource constraints or an Axios full response object containing data as the list of resource constraints
Create a new alarm
(Object)
Object w/ properties to create an alarm
Name | Description |
---|---|
alarm.type string
|
Type of the alarm (free string) |
alarm.text string
|
Description of the alarm |
alarm.severity string
|
The severity of the alarm: CRITICAL, MAJOR, MINOR or WARNING |
alarm.source Object
|
Object containing the ID of the resource you want to create the alarm for |
alarm.status string
(default ACTIVE )
|
Can be: ACTIVE, ACKNOWLEDGED or CLEARED |
alarm.timestamp string?
|
ISO date string or number (indicating milliseconds since epoch) (if not specified, timestamp will be set to the receive time) |
alarm.assignee string?
|
String field to indicate an assignee for the alarm |
Promise<Object>
:
Returns a promise for the created alarm
await waylay.alarms.create({
type: 'TEST_ALARM',
severity: 'MINOR',
text: 'Alarm to test Node SDK',
source: { id: 'testresource' }
})
// Response on resolve
{
"id": "ab5dd822-734c-4db4-ae77-7ff1d5426413",
"self": "/alarms/v1/alarms/ab5dd822-734c-4db4-ae77-7ff1d5426413",
"creationTime": "2021-03-26T08:12:10.353149Z",
"type": "TEST_ALARM",
"text": "Alarm to test Node SDK",
"timestamp": "2021-03-26T08:12:10.353115Z",
"source": {
"id": "testresource"
},
"severity": "MINOR",
"status": "ACTIVE",
"count": 1,
"history": [
{
"id": "66208008-603c-46a6-84ba-82cd169cc20a",
"type": "io.waylay.alarm.AlarmRaised",
"text": "Alarm raised",
"timestamp": "2021-03-26T08:12:10.353151Z"
}
]
}
Get information about an alarm
(string)
Unique id given to alarm on creation
Promise<Alarm>
:
Returns a promise for the alarm
await waylay.alarms.get('ab5dd822-734c-4db4-ae77-7ff1d5426413')
// Response on resolve
{
"id": "ab5dd822-734c-4db4-ae77-7ff1d5426413",
"self": "/alarms/v1/alarms/ab5dd822-734c-4db4-ae77-7ff1d5426413",
"creationTime": "2021-03-26T08:12:10.353Z",
"type": "TEST_ALARM",
"text": "Alarm to test Node SDK",
"timestamp": "2021-03-26T08:12:10.353Z",
"source": {
"id": "testresource"
},
"severity": "MINOR",
"status": "ACTIVE",
"count": 1,
"history": [
{
"id": "66208008-603c-46a6-84ba-82cd169cc20a",
"type": "io.waylay.alarm.AlarmRaised",
"text": "Alarm raised",
"timestamp": "2021-03-26T08:12:10.353151Z"
}
]
}
Search for multiple alarms
(Object)
Name | Description |
---|---|
query.type string?
|
Filter on the alarm type |
query.status Array<string>?
|
Filter on the alarm status |
query.history boolean?
|
|
query.sort string?
|
sort on an alarm's property |
query.order string?
|
order ascending or descending: asc | desc |
query.severity string?
|
Filter on the alarm severity |
query.source string?
|
Filter on the id of the alarm resource |
query.task string?
|
Filter on a taskId |
query.dateFrom number?
|
Filter on timestamp (milliseconds) |
query.dateTo number?
|
Filter on timestamp (milliseconds) |
query.assignee string?
|
Filter on assignee |
query.page number
(default 1 )
|
Paging returns page x |
query.size number
(default 50 )
|
Size of the page |
Promise<{self: string, alarms: Array<Alarm>, total: number, prev: string}>
:
Returns a promise for an Object containing an array of alarms
// Response on resolve
{
"self": "/alarms/v1/alarms?severity=major&page=2&size=10",
"alarms": [{...},{...}],
"total": 12
"prev": "/alarms/v1/alarms?severity=major&size=10"
}
Get the alarm history timeline for one or multiple resources, this is used to get a timeseries like array of alarms.
(long?)
Timestamp in milliseconds
(long?)
Timestamp in milliseconds
Promise<Array<Alarm>>
:
Returns a promise for an array of alarms
await waylay.alarms.timeline(['testresource'])
// Response on resolve
[
{
"timestamp": 1616746330353,
"type": "io.waylay.alarm.AlarmRaised"
"Alarm": {...}
},
{...}
]
Update an alarm You can only update an ACTIVE or ACKNOWLEDGED alarm. Updating a CLEARED alarm will result in a response code 412 Precondition Failed
(string)
Id of the alarm you want to update
Promise<Object>
:
A promise for the updated alarm object
await waylay.alarms.update('56fa5a52-a02c-4551-93ac-197b13fe36db', { severity: 'WARNING', status: 'ACKNOWLEDGED'})
{
"id": "56fa5a52-a02c-4551-93ac-197b13fe36db",
"self": "/alarms/v1/alarms/56fa5a52-a02c-4551-93ac-197b13fe36db",
"creationTime": "2021-03-26T09:15:58.474Z",
"type": "TEST_ALARM",
"text": "Alarm to test Node SDK",
"timestamp": "2021-03-26T09:15:58.474Z",
"source": {
"id": "testresource"
},
"severity": "WARNING",
"status": "ACKNOWLEDGED",
"count": 1,
"history": [
{
"id": "4fdb9180-04ad-498f-a4f5-6e2b7213f04b",
"type": "io.waylay.alarm.AlarmRaised",
"text": "Alarm raised",
"timestamp": "2021-03-26T09:15:58.474282Z"
},
{
"id": "5ba38c0f-8e54-4e32-b7d2-6d6a192dbc06",
"type": "io.waylay.alarm.AlarmUpdated",
"text": "Alarm updated",
"timestamp": "2021-03-26T09:17:05.954729Z",
"changes": [
{
"attribute": "severity",
"type": "io.waylay.alarm.change.severity",
"oldValue": "MINOR",
"newValue": "WARNING"
},
{
"attribute": "status",
"type": "io.waylay.alarm.change.status",
"oldValue": "ACTIVE",
"newValue": "ACKNOWLEDGED"
}
]
}
]}
Remove all alarms matching a filter
(Object)
Filter object
Name | Description |
---|---|
filter.type string?
|
Filter on the alarm type |
filter.status string?
|
Filter on the alarm status |
filter.severity string?
|
Filter on the alarm severity |
filter.source string?
|
Filter on the id of the alarm resource |
filter.history boolean?
|
Filter on the id of the alarm resource |
filter.source string?
|
Filter on the id of the alarm resource |
filter.dateFrom long?
|
Filter on timestamp (milliseconds) |
filter.dateTo long?
|
Filter on timestamp (milliseconds) |
filter.assignee string?
|
Filter on assignee |
Promise<any>
:
await waylay.alarms.remove({ type: 'TEST_ALARM' })
Extends Plugs
Extends Resource
Perform a patch operation on one or more templates
(TemplateFilterParams)
: filter parameters that select templates
(PatchCommand)
Promise<Object>
:
Extends Plugs
Extends Plugs
Execute one individual plug
See https://docs.waylay.io/#/api/rules/#execute-plug
"latest"
), body: PlugExecutionData): Promise<{observedState: Object}>(string)
The name of the plug to execute
((string | "latest"
))
The version on the plug to execute
(PlugExecutionData)
Data to send to the plug
Promise<{observedState: Object}>
:
Execution result
Remove specific plug version
Promise<Object>
:
Returns a promise confirming the deprecation or deletion of specified plug version, or an Axios error response in case of failure
// Deprecate specific plug version
await waylay.sensors.removeVersion({
name: 'MySensor',
version: '1.0.0'
})
// Response
{ statusCode: 200, message: 'Sensor MySensor 1.0.0 deprecated' }
// Delete specific plug version
await waylay.sensors.removeVersion({
name: 'MySensor',
version: '1.0.0',
{ force: true }
})
// Response
{ statusCode: 200, message: 'Sensor MySensor 1.0.0 deleted' }
Get all versions of a plug
Promise<Array<PlugVersion>>
:
An array with every plug version
Updates the metadata of a plug
"latest"
), metadata: Object): Promise<{observedState: Object}>(string)
The name of the plug
((string | "latest"
))
The version on the plug
(Object)
Promise<{observedState: Object}>
:
Updates the metadata of a plug
"latest"
), documentation: Object): Promise<{observedState: Object}>(string)
The name of the plug
((string | "latest"
))
The version on the plug
(Object)
Promise<{observedState: Object}>
:
List plug tags by plug tag options
(ListPlugTagParams)
Tag list parameter options.
Promise<Array<PlugTag>>
:
Configure and test converter configurations for channels
the Waylay Webscripts service
(WebscriptLogs?)
: Access
logs
for webscripts using
/webscripts/
API endpoint
API methods for webscripts _logs.
Extends Resource
Get the url of an SSE stream for webscript logs.
(WebscriptURLParams?)
Query parameters in REST API.
Name | Description |
---|---|
params.href string?
|
An optional existing URL, e.g. as received from HAL links. |
EventSourceResponse
:
The necessary url and header to connect to the event stream.
await waylay.webscripts.logs.getEventStreamUrl()
Search for webscript logs matching provided filter
(WebscriptLogsRequestBody)
optional filter properties for the result. If missing, will return results from all webscripts
(Object)
optional http library properties
Promise<Object>
:
await waylay.webscripts.logs.search({ name: "testLogging", pageSize: 1, from: "2023-10-16T10:05:00.919Z" })
// Response on resolve
{
"entries": [
{
"time": "2023-10-16T11:05:00.919Z",
"message": "GET / 200",
"level": "INFO",
"context": {
"request": {
"id": "acfddc57-a1d2-4d5f-a4ef-346045ac3ff9"
},
"response": {}
},
"function": {
"name": "testLogging",
"version": "1.0.9",
"type": "webscripts",
"archiveFormat": "node",
"runtime": "web-legacy",
"runtimeVersion": "0.2.0",
"baseImage": "eu.gcr.io/example/web-legacy-node18:latest",
"image": "eu.gcr.io/example/d0c67ddde66c292beedfghfgyt49189fa652:1.0.9"
}
}
],
"nextPageToken": "end=2023-10-16T11:05:00.919Z"
}
Type: WebscriptLogs
Send data to a webscript
"latest"
)?, body: Object?, options: Object?): Promise<Object>(string)
Your unique webscripts namespace
(string)
The name of the webscript to execute
((string | "latest"
)?
= 'latest'
)
The version on the webscript to execute
(Object?)
Data to send to the webscript
Promise<Object>
:
waylay.webscripts.call('d15a29d7-4290-4bfa-aceb-d3f2e791737c', 'my-webscript', 'latest', { key: 'value' }, {headers : { key : 'value' } })
.then(response => console.log(response))
.catch(err => console.error(error))
// calls a webscript with GET method and url params (`GET .../my-webscript?includeDetails=true`)
const resp = waylay.webscripts.call('d15a29d7-4290-4bfa-aceb-d3f2e791737c', 'my-webscript', undefined, undefined, { method: 'GET', params: { includeDetails: true }})
List your webscripts
Promise<(WebscriptList | AxiosResponse<WebscriptList>)>
:
A list of webscripts or an Axios full response object containing the webscripts listing
Execute multivariate timeseries queries. Query definitions can be stored and called by name. (doc)
Execute a named (or given) query (doc).
((String | QueryDefinition))
The name of a stored query OR a query definition itself.
(Object?)
Extra query parameters for this REST request. Top-level attributes of a query definition
can be overriden by parameters. E.g.
{ window: 'P2D' }
will override the top-level
window
attribute of
the named or given query.
Name | Description |
---|---|
params.render Object?
|
Parameters that influence rendering of the dataset. |
params.render.mode String
(default 'RENDER_MODE_COMPACT_WS' )
|
The render mode for the returned dataset.
Supported values are
see docs
:
RENDER_MODE_COMPACT_WS
(default),
RENDER_MODE_SERIES
,
RENDER_MODE_UPLOAD
.
|
params.iso_timestamp boolean
(default false )
|
Include an iso8601 timestamp. Regular timestamps are unix epoch milliseconds. |
params.include_window_spec boolean
(default true )
|
Include the time window in the response. |
(Object?)
Extra http client parameter for this REST request
Name | Description |
---|---|
options.wantsFullResponse boolean
(default false )
|
If set, an http response object is returned, rather than the payload data or a thrown exception. |
options.headers Object?
|
Additional http headers. |
options.headers.Accept string?
|
Set accept header to 'text/csv' to receive a CSV dataset. |
Promise<QueryResponse>
:
List stored query definitions. (doc)
(Object?)
Extra query parameters for this REST request.
Name | Description |
---|---|
params.q SearchFilter
(default '' )
|
Query filter string. |
params.limit Number
(default 10 )
|
Page size |
params.offset Number
(default 0 )
|
Skipped entries |
(Object?)
Extra http client parameter for this REST request
Promise<QueryDefinitionListResponse>
:
Create a new stored query. (doc)
(string)
(QueryDefinition)
(UserAttributes?)
User defined attributes to classify this query definition
(Object?)
Extra query parameters for this REST request.
(Object?)
Extra http client parameter for this REST request
Promise<QueryDefinitionResponse>
:
Update an existing stored query. (doc)
(string)
(QueryDefinition)
(UserAttributes?)
User defined attributes to classify this query definition
(Object?)
Extra query parameters for this REST request.
(Object?)
Extra http client parameter for this REST request
Promise<QueryDefinitionResponse>
:
The waylay Storage service that interacts with file storage objects.
(StorageBucket?)
: Manage the
buckets
using the
/bucket/
API.
(StorageObject?)
: Manage the
file objects
using the
/bucket/{bucket}/{object_path}
API.
(StorageFolder?)
: Manage the
folder objects
using the
/bucket/{bucket}/{folder_path}/
API.
(StorageContent?)
: Access and modify the actual content of file objects, using signed urls.
(StorageSubscription?)
: Manage the
subscriptions
of the storage service using the
/subscription
API.
Storage API methods on a bucket.
Extends Resource
List all buckets for which the user is authorized.
(URLParams?
= {}
)
Optional arguments, url parameters in REST API.
Promise<(PagedListResponse | {buckets: Array<StorageBucketEntity>})>
:
A paged list response with a
buckets
listing.
Get the representation for a named bucket.
(string)
The name of the bucket that contains the objects. One of
assets
,
public
,
etl-import
,
etl-export
.
(URLParams?
= {}
)
Optional arguments, url parameters in REST API.
Promise<(StorageBucketEntity | HALResponse)>
:
A response object representing the bucket.
Storage API methods on a file object.
Extends Resource
List objects in a bucket with a given path prefix.
(string)
The name of the bucket that contains the objects
(string
= ''
)
The path prefix for the objects. The empty string (default) selects all paths.
(ListParams?
= {}
)
Optional arguments, url parameters in REST API.
Name | Description |
---|---|
params.recursive boolean?
|
When
false
(default), includes folders that have the given path prefix,
but does not recurse into them. When
true
, recursively lists all objects with this prefix, ignoring folders.
|
params.all boolean?
|
When
false
(default) excludes
hidden
objects whose basename start with
.
.
When
true
includes
hidden
objects and render advanced metadata properties for each object.
|
params.max_keys number?
|
[Paging] Page size: maximum number of objects returned in a list. When not specified, a server default is applied (normally 200). The server also sets a limit to what a user can specify (normally 1000). |
params.start_after string?
|
[Paging] Path prefix from after which the listing should start. |
Promise<(PagedListResponse | {objects: Array<StorageObjectEntity>})>
:
Has a
objects
property containing one page of list results.
Get a representation of the file object at a specific path.
(string)
The name of the bucket that contains the objects
(string)
The file object for which metadata should be retrieved.
Promise<(StorageObjectEntity | HALResponse)>
:
The file object metadata.
Create a signed GET url to fetch the file content at a specific path.
The returned url contains all authentication, and expires after (by default) 300 seconds. The total expiry period cannot exceed 7 days.
(string)
The name of the bucket that contains the objects
(string)
The path of the file object from which content should be retrieved.
(SignParams?
= {}
)
Optional arguments, url parameters in REST API.
Name | Description |
---|---|
params.get_as_attachment boolean?
|
If true, the file will be served with a
content-disposition
header.
Browsers will treat this as an attachment that is meant to be saved to file.
|
params.expiry_days number?
|
Number of days to add to the expiry interval for this signed url. |
params.expiry_hours number?
|
Number of hours to add to the expiry interval for this signed url. |
params.expiry_seconds number?
|
Number of seconds to add to the expiry interval for this signed url. |
Promise<HALResponse>
:
a HAL response containing a
get_object
fetch url.
const signResp = await waylay.storage.object.signGet('assets', 'abc.json')
const resp = await fetch(signResp._links.get_object.href)
const myAbcData = resp.json()
Create a signed PUT url to upload a file at a specific path. The returned url contains all authentication, and expires after (by default) 300 seconds.
(string)
The name of the bucket that contains the objects
(string)
The path at which the file object should be updated.
(SignParams?
= {}
)
Optional arguments, url parameters in REST API.
Name | Description |
---|---|
params.expiry_days number?
|
Number of days to add to the expiry interval for this signed url. |
params.expiry_hours number?
|
Number of hours to add to the expiry interval for this signed url. |
params.expiry_seconds number?
|
Number of seconds to add to the expiry interval for this signed url. |
params.content_type string?
|
Policy requirement on the content type of uploads. |
params.all boolean?
|
When
false
(default), do not allow the upload to hidden paths.
|
Promise<HALResponse>
:
a HAL response containing a
put_object
upload url.
Create a signed POST url and form parameters to upload a file at or below a specific path. The returned url and parameters contain all authentication, and expire after (by default) 300 seconds.
(string)
The name of the bucket that contains the objects.
(string
= ''
)
The path at which the file object should be POST-ed.
(SignParams?
= {}
)
Optional arguments, url parameters in REST API.
Name | Description |
---|---|
params.expiry_days number?
|
Number of days to add to the expiry interval for this signed url. |
params.expiry_hours number?
|
Number of hours to add to the expiry interval for this signed url. |
params.expiry_seconds number?
|
Number of seconds to add to the expiry interval for this signed url. Default
300
(5 minutes).
|
params.content_type string?
|
Policy requirement on the content type of uploads. |
params.content_length_min number?
|
Policy requirement on the minimum size of uploads. |
params.content_length_max number?
|
Policy requirement on the maximum size of uploads. |
params.all boolean?
|
When
false
(default), do not allow the upload to hidden paths.
|
Promise<HALResponse>
:
a HAL response containing a
post_object
link containing the POST
url and form parameters in
post_object.form_data
.
const signResp = await waylay.storage.object.signPost('assets', 'abc.txt')
const postUrl = signResp._links.post_object.href
const formData = signResp._links.post_object.form_data
formData['content-type'] = 'text/plain'
const postForm = new FormData(formData)
// file is input of a <input type="file"> form
postForm.append('file', file)
const postResp = await fetch(postUrl, {
method: 'POST',
body: postForm
})
window.alert(postResp.ok ? 'File upload done', 'File upload failed')
Remove the file object at a specific path.
(string)
The name of the bucket that contains the objects
(string)
The full object path.
(URLParams?
= {}
)
Optional arguments, url parameters in REST API.
Promise<HALResponse>
:
a HAL response with a
removed
link
Remove all file objects whose path starts with a given prefix.
This method only deletes one page of objects (normally a default of 200 objects),
and will respond with a next
link to delete a next page of objects.
(string)
name of the bucket that contains the folder
(string)
prefix path of objects to be removed
(Object?
= {}
)
Optional arguments, url parameters in REST API.
Name | Description |
---|---|
params.all boolean?
|
When
false
(default), the presence of
hidden
objects will fail the request.
|
params.max_keys number?
|
[Paging] Page size: maximum number of objects deleted in one request. When not specified, a server default is applied (normally 200). The server also sets a limit to what a user can specify (normally 1000). |
params.start_after string?
|
[Paging] Path prefix from after which the deletion should start. |
Promise<PagedRemoveResponse>
:
A HAL response containing a
removed
link to the removed objects.
A
next
link might contain a reference to a next page of deletions.
Storage API methods on a folder object.
Extends Resource
List the content of a folder.
(string)
Name of the bucket that contains the folder
(Object?
= {}
)
Optional arguments, url parameters in REST API.
Name | Description |
---|---|
params.recursive boolean?
|
When
false
(default), includes subfolders of this folder,
but does not recurse into them. When
true
, recursively lists all objects in this folder, ignoring folders.
|
params.all boolean?
|
When
false
(default) excludes
hidden
objects whose basename start with
.
.
When
true
includes
hidden
objects and render advanced metadata properties for each object.
|
params.max_keys number?
|
[Paging] Page size: maximum number of objects returned in a list. When not specified, a server default is applied (normally 200). The server also sets a limit to what a user can specify (normally 1000). |
params.start_after string?
|
[Paging] Path prefix from after which the listing should start. |
Promise<(PagedListResponse | {objects: Array<StorageObjectEntity>})>
:
A response object having a
objects
property, containing one page
of listing results.
Get the metadata representation of a folder.
Promise<(StorageObjectEntity | HALResponse)>
:
Create a signed POST url and form parameters to upload a file at or below a specific folder.
The returned url and parameters contain all authentication, and expire after (by default)
300 seconds.
When using the form parameters to POST, the key
property must be set to the intended object path.
On upload, the key
parameter will be verified to have the path
parameter of this method as a prefix.
(string)
The name of the bucket that contains the objects.
(string)
The folder beneath which the file object should be POST-ed.
(Object?
= {}
)
Optional arguments, url parameters in REST API.
Name | Description |
---|---|
params.expiry_days number?
|
Number of days to add to the expiry interval for this signed url. |
params.expiry_hours number?
|
Number of hours to add to the expiry interval for this signed url. |
params.expiry_seconds number?
|
Number of seconds to add to the expiry interval for this signed url. |
params.content_type string?
|
Policy requirement on the content type of uploads. |
params.content_length_min number?
|
Policy requirement on the minimum size of uploads. |
params.content_length_max number?
|
Policy requirement on the maximum size of uploads. |
params.all boolean?
|
When
false
(default), do not allow the upload to hidden paths.
|
Promise<HALResponse>
:
A HAL response containing a
post_object
link containing the POST
url and form parameters in
post_object.form_data
.
const signResp = await waylay.storage.object.signPost('assets', 'myfolder/')
const postUrl = signResp._links.post_object.href
const formData = signResp._links.post_object.form_data
// you can still update the `key` and `content-type`, but they will
// be checked against the sign policy.
formData.key = 'myfolder/abc.json'
formData['content-type'] = 'application/json'
const postForm = new FormData(formData)
// fileData is e.g. from a <input type="file"> form
postForm.append('file', fileData )
const postResp = await fetch(postUrl, {
method: 'POST',
body: postForm
})
window.alert(postResp.ok ? 'File upload done', 'File upload failed')
Create a folder at the given path location.
(string)
Name of the bucket that contains the folder
(string)
Name of the new folder path
Promise<(StorageObjectEntity | HALResponse)>
:
A HAL response containing a link to the created object.
Remove a folder at the given location. The folder must be empty to succeed.
(string)
Name of the bucket that contains the folder
(string)
Name of the removed folder path
(URLParams?
= {}
)
Optional arguments, url parameters in REST API.
Promise<HALResponse>
:
A HAL response containing a
removed
link to the removed object.
Remove a folder and all its content at the given location.
This method only deletes one page of objects (normally a default of 200 objects),
and will respond with a next
link to delete a next page of objects.
(string)
Name of the bucket that contains the folder
(string)
Name of the removed folder path
(Object?
= {}
)
Optional arguments, url parameters in REST API.
Name | Description |
---|---|
params.all boolean?
|
When
false
(default), the presence of
hidden
objects will fail the request.
|
params.max_keys number?
|
[Paging] Page size: maximum number of objects deleted in one request. When not specified, a server default is applied (normally 200). The server also sets a limit to what a user can specify (normally 1000). |
params.start_after string?
|
[Paging] Path prefix from after which the deletion should start. |
Promise<PagedRemoveResponse>
:
A HAL response containing a
removed
link to the removed objects.
A
next
link might contain a reference to a next page of deletions.
Storage API methods on _subscriptions.
Extends Resource
List the active subscriptions on this bucket.
The listing contains one page of results, and contains a next
HAL link when additional
pages are present.
(string)
Name of the bucket that contains the subscription
(Object?
= {}
)
Optional arguments, url parameters in REST API.
Name | Description |
---|---|
params.prefix string?
|
[Search filter] Only list subscriptions that are affected by any object with this prefix. |
params.suffix string?
|
[Search filter] Only list subscriptions that are affected by any object with this suffix. |
params.event_type string?
|
[Search filter] Only list subscriptions that are affected by changes of this type. One of
put
,
delete
.
|
params.channel_type string?
|
[Search filter] Only list subscriptions that target a channel of this type. One of
webscript
,
system
,
webhook
.
|
params.channel_id string?
|
[Search filter] Only list subscriptions that target a channel having an id containing this string. For
webscript
channels, this is the script name.
|
params.max_keys number?
|
[Paging] Page size: maximum number of subscriptions listed in one request. When not specified, a server default is applied (normally 200). The server also sets a limit to what a user can specify (normally 1000). |
params.start_after string?
|
[Paging] Id prefix from after which the listing should start. |
Promise<(PagedListResponse | {bucket: StorageBucketEntity, subscriptions: Array<StorageSubscriptionEntity>})>
:
one page of subscriptions.
Get the subscription with the given id.
(string)
Name of the bucket that contains the subscription
(string)
Id of the subscription
(URLParams?
= {}
)
Optional arguments, url parameters in REST API.
Promise<(StorageSubscriptionEntity | HALResponse)>
:
Representation of the subscription
Create a new subscription.
(string)
Name of the bucket that contains the subscription
(StorageSubscriptionEntity)
Representation of a new subscription. See API documentation. When no
id
property is specified, a generated id will be assigned. When a specified
id
conflics
(URLParams?
= {}
)
Optional arguments, url parameters in REST API.
Promise<(StorageSubscriptionEntity | HALResponse)>
:
A HAL response containing the created subscription.
This will fail if a
subscription
with the specified
subscription.id
already exists.
Replace the definition of a subscription.
(string)
Name of the bucket that contains the subscription
(string)
Id of the subscription to be replaced. If no such subscription exists,
a new subscription will be created.
(StorageSubscriptionEntity)
Representation of a new subscription. See API documentation.
(URLParams?
= {}
)
Optional arguments, url parameters in REST API.
Promise<(StorageSubscriptionEntity | HALResponse)>
:
A HAL response containing the created or updated subscription.
Remove a subscription.
(string)
Name of the bucket that contains the subscription
(string)
Id of the subscription to be removed.
(URLParams?
= {}
)
Optional arguments, url parameters in REST API.
Promise<HALResponse>
:
A HAL response containing a link to the removed subscription.
Remove (one page of) subscriptions that satisfy a query.
(string)
Name of the bucket that contains the subscriptions
(DeleteParams?
= {}
)
Optional arguments, url parameters in REST API.
Name | Description |
---|---|
params.prefix string?
|
[Search filter] Only delete subscriptions that are affected by any object with this prefix. |
params.suffix string?
|
[Search filter] Only delete subscriptions that are affected by any object with this suffix. |
params.event_type string?
|
[Search filter] Only delete subscriptions that are affected by changes of this type. One of
put
,
delete
.
|
params.channel_type string?
|
[Search filter] Only delete subscriptions that target a channel of this type. One of
webscript
,
system
,
webhook
.
|
params.channel_id string?
|
[Search filter] Only delete subscriptions that target a channel having an id containing this string. For
webscript
channels, this is the script name.
|
params.max_keys number?
|
[Paging] Page size: maximum number of subscriptions deleted in one request. When not specified, a server default is applied (normally 200). The server also sets a limit to what a user can specify (normally 1000). |
params.start_after string?
|
[Paging] Id prefix from after which the deletion should start. |
Promise<PagedRemoveResponse>
:
A HAL response containing a link to the removed subscriptions.
If a
next
HAL link is present, more subscriptions are left to be deleted
(Options)
(Client)
Get the content of the file object at a given location. This combines a storage.object.signGet with a storage.content.getSigned.
(string)
Name of the bucket
(string)
object path at which a file should be uploaded
(URLParams?
= {}
)
Optional parameters used when signing the get url.
Promise<Object>
:
the response data
Get content of a file object, based on a response of a storage.object.signGet request.
Promise<Object>
:
the response of the put request.
Upload local data to a file object at a given location. This combines a storage.object.signPut with a storage.content.putSigned.
(string)
Name of the bucket
(string)
object path at which a file should be uploaded
(URLParams?
= {}
)
Optional parameters to be used when signing and uploading content.
Name | Description |
---|---|
params.expiry_days number?
|
Number of days to add to the expiry interval for this signed url. |
params.expiry_hours number?
|
Number of hours to add to the expiry interval for this signed url. |
params.expiry_seconds number?
|
Number of seconds to add to the expiry interval for this signed url. |
params.content_type string?
|
content type with which the file should be stored. |
params.content_length string?
|
content length for the file to be stored (needed for streamed content). |
Promise<Object>
:
the response message of the file upload
Put the content of local data to a file object at a given location, based on a response of a storage.object.signPut request.
Promise<Object>
:
the response of the put request.
Upload local content to a file object at a given location. This combines a storage.object.signPost with a storage.content.postSigned.
(string)
Name of the bucket
(string)
object path at which a file should be uploaded
(URLParams?
= {}
)
Optional parameters
Name | Description |
---|---|
params.expiry_days number?
|
Number of days to add to the expiry interval for the signed url. |
params.expiry_hours number?
|
Number of hours to add to the expiry interval for the signed url. |
params.expiry_seconds number?
|
Number of seconds to add to the expiry interval for the signed url. Default
300
(5 minutes).
|
params.content_type string?
|
Policy requirement on the content type of uploads for the signed url. |
params.content_length_min number?
|
Policy requirement on the minimum size of upload for the signed url. |
params.content_length_max number?
|
Policy requirement on the maximum size of upload for the signed url. |
params.all boolean?
|
When
false
(default), do not allow the upload to hidden paths.
|
params.content_type string?
|
content type with which the file should be stored. |
params.content_length string?
|
content length for the file to be stored (needed for streamed content). |
Promise<Object>
:
the response message of the file upload
Upload local content to a file object at a given location, based on a response of a storage.object.signPost request.
(URLParams?
= {}
)
Optional parameters
Name | Description |
---|---|
params.path string?
|
exact path at which to upload the file. This might be different from the file name. |
params.content_type string?
|
content type with which the file should be stored. |
params.content_length string?
|
content length for the file to be stored.
but should contain the
path
from the original signPost request as a prefix.
|
Promise<Object>
:
the response message of the file upload
The following services manage users, authorizations and settings for the Waylay platform.
The following services are preview features
The waylay Plug Registry service that manages the life cycle of functions. This SDK uses the registry v2 REST api and superseeds the legacy lifecyle management calls in sensors, actuators, transformers and webscripts.
(Registry.Runtimes?)
: Access and list the supported
runtimes
for functions.
(Registry.Jobs?)
: Access and List
jobs
and their corresponding events.
(Registry.Webscripts?)
: List and manage
webscripts
.
(Registry.Plugs?)
: List and manage
plugs
.
(Registry.Models?)
: List and manage
models
.
Runtime API methods.
Extends Resource
(Registry.Runtimes.Example?)
: Access and list the content of a runtime example.
Runtime example API methods.
(Runtimes)
Get the example archive of a runtime.
(string)
The name of the runtime.
(string)
The version of the runtime.
(RegistryURLParams?)
Query parameters in REST API.
Name | Description |
---|---|
params.includeDeprecated boolean
(default true )
|
If
true
, it includes deprecated runtimes.
|
(FunctionDownloadOptions?)
Additional HTTP request options.
Name | Description |
---|---|
options.responseType string?
|
Alternative response type. |
Promise<RegistryResponse>
:
Example archive content.
Get a single asset (file) from the example archive of a runtime.
(string)
The name of the runtime.
(string)
The version of the runtime.
(string)
The path of the file in the archive.
(RegistryURLParams?)
Query parameters in REST API.
Name | Description |
---|---|
params.includeDeprecated boolean
(default true )
|
If
true
, it includes deprecated runtimes.
|
(FunctionDownloadOptions?)
Additional HTTP request options.
Name | Description |
---|---|
options.responseType string?
|
Alternative response type. |
Promise<RegistryResponse>
:
File content.
List the content of the example archive of a runtime.
(string)
The name of the runtime.
(string)
The version of the runtime.
(string
= ''
)
(RegistryURLParams?)
Query parameters in REST API.
Name | Description |
---|---|
params.includeDeprecated boolean
(default true )
|
If
true
, it includes deprecated runtimes.
|
Promise<RegistryResponse>
:
Example archive content listing.
List the runtimes that plug registry supports.
(RegistryURLParams?)
Query parameters in REST API.
Name | Description |
---|---|
params.name string?
|
Filter on name. Case-insensitive. Supports
?
and
*
wildcards.
|
params.version string?
|
Filter on runtime version. Supports version ranges (see https://devhints.io/semver ). |
params.functionType Array<(
|
Filter on function type. |
params.archiveFormat Array<(
|
Filter on archive format. |
params.includeDeprecated boolean
(default false )
|
If
true
, the result includes deprecated runtimes.
|
params.latest (
(default 'minor' )
|
Filter on the level of latest versions that will be included in the query.
major
will result in at most one latest version per name and major release.
minor
will result in at most one latest version per name and minor release.
patch
or
false
will result in each matching patch version.
true
will result in the latest matching version.
This filter is applied after all other selection criteria.
|
Promise<RegistryResponse>
:
The runtimes listing.
Get a runtime version.
(string)
The name of the runtime.
(string)
The version of the runtime.
(RegistryURLParams?)
Query parameters in REST API.
Name | Description |
---|---|
params.includeDeprecated boolean
(default true )
|
If
true
, the result includes deprecated runtimes.
|
Promise<RegistryResponse>
:
The runtimes listing.
Get the latest runtime version.
(string)
The name of the runtime.
(RegistryURLParams?)
Query parameters in REST API.
Name | Description |
---|---|
params.version string?
|
Filter on runtime version. Supports version ranges (see https://devhints.io/semver ). |
params.includeDeprecated boolean
(default false )
|
If
true
, the result includes deprecated runtimes.
|
Promise<RegistryResponse>
:
The runtimes listing.
List the supported versions of a specific runtime.
(string)
The name of the runtime.
(RegistryURLParams?)
Query parameters in REST API.
Name | Description |
---|---|
params.version string?
|
Filter on runtime version. Supports version ranges (see https://devhints.io/semver ). |
params.includeDeprecated boolean
(default false )
|
If
true
, the result includes deprecated runtimes.
|
params.latest (
(default 'minor' )
|
Filter on the level of latest versions that will be included in the query.
major
will result in at most one latest version per name and major release.
minor
will result in at most one latest version per name and minor release.
patch
or
false
will result in each matching patch version.
true
will result in the latest matching version.
This filter is applied after all other selection criteria.
|
Promise<RegistryResponse>
:
The runtimes listing.
Get the schema used for validating an asset.
(string)
The name of the runtime.
(string)
The version of the runtime.
(AssetRole)
The role of the asset.
(RegistryURLParams?)
Query parameters in REST API.
Promise<(RegistryResponse | undefined)>
:
The schema.
Jobs API methods.
Extends Resource
List jobs.
(RegistryURLParams?)
Query parameters in REST API.
Name | Description |
---|---|
params.type (
|
Filter on job type. |
params.state Array<(
|
Filter on job state. |
params.functionType Array<(
|
Filter on function type. |
params.createdBefore string?
|
Filter on jobs created before the given timestamp or age |
params.createdAfter string?
|
Filter on jobs created after the given timestamp or age |
params.limit number?
|
Maximum number of items to be returned from this query. |
Promise<RegistryResponse>
:
The job status listing.
Get a job representation.
(string)
The type of the job.
(string)
The id of the job.
(RegistryURLParams?)
Query parameters in REST API.
Promise<RegistryResponse>
:
The status of the job.
Get the job representation.
(string)
The HAL link to a job.
(RegistryURLParams?)
Query parameters in REST API.
Promise<RegistryResponse>
:
The status of the job.
Get the url of an SSE stream of job events.
(RegistryURLParams?)
Query parameters in REST API.
Name | Description |
---|---|
params.href string?
|
An optional existing URL, e.g. as received from HAL links. |
params.type (
|
Filter by job type. |
params.id string?
|
Select on job id. |
params.children boolean
(default false )
|
Include jobs that are preconditions for the matching jobs. |
EventSourceResponse
:
The necessary url and header to connect to the event stream.
Webscripts API methods.
Extends Functions
((Options | null))
(Client?)
List your webscripts.
(RegistryURLParams?)
Query parameters in REST API.
Name | Description |
---|---|
params.page number
(default 0 )
|
Number of pages to skip when returning result to this query. |
params.limit number?
|
The maximum number of items to be return from this query. |
params.name string?
|
Filter on the name of the function. Case-insensitive. Supports wild-cards
?
and
*
.
|
params.version string?
|
Filter on the version of the function. Case-sensitive. Supports wild-cards
?
and
*
.
|
params.status (
|
Filter on the deployment status of the function. |
params.createdBy string?
|
Filter on the user that created the function. Use the
@me
token to filter on the authenticated user.
|
params.updatedBy string?
|
Filter on the user that last updated the function. Use the
@me
token to filter on the authenticated user.
|
Promise<RegistryResponse>
:
A list of webscripts.
Get details of one individual webscript.
(string)
The name of the webscript.
(string)
The version of the webscript.
(RegistryURLParams?)
Query parameters in REST API.
Promise<RegistryResponse>
:
Get details of the latest webscript version.
(string)
The name of the webscript.
(RegistryURLParams?)
Query parameters in REST API.
Promise<RegistryResponse>
:
Check if a webscript exists.
(string)
The name of the webscript.
(string?)
The version of the webscript. If set, it checks if that specific version exists.
(RegistryURLParams?)
Query parameters in REST API.
Promise<boolean>
:
Get versions of a webscript.
(string)
The name of the webscript.
(RegistryURLParams?)
Query parameters in REST API.
Promise<RegistryResponse>
:
List jobs of a webscript.
(string)
The name of the webscript.
(string)
The version of the webscript.
(RegistryURLParams?)
Query parameters in REST API.
Promise<RegistryResponse>
:
Get the specification archive of a webscript.
(string)
The name of the webscript.
(string)
The version of the webscript.
(RegistryURLParams?)
Query parameters in REST API.
(FunctionDownloadOptions?)
Additional HTTP request options.
Name | Description |
---|---|
options.responseType string?
|
Alternative response type. |
Promise<RegistryResponse>
:
Archive content.
Get a file from the specification archive of a webscript.
(string)
The name of the webscript.
(string)
The version of the webscript.
(string)
The path of the file in the archive.
(RegistryURLParams?)
Query parameters in REST API.
(FunctionDownloadOptions?)
Additional HTTP request options.
Name | Description |
---|---|
options.responseType string?
|
Alternative response type. |
Promise<RegistryResponse>
:
File content.
List the content of the specification archive of a webscript.
(string)
The name of the webscript.
(string)
The version of the webscript.
(string
= ''
)
(RegistryURLParams?)
Query parameters in REST API.
Promise<RegistryResponse>
:
Archive content listing.
Register a new webscript and start a build
, deploy
and verify
background job.
((FormData | FunctionArchiveContent))
Webscript creation content.
This is either a
tar
archive buffer, file or stream, optionally with gzip
compression.(AsyncQueryParams?)
Query parameters in REST API.
(FunctionUploadOptions?)
Additional HTTP request options.
Promise<RegistryResponse>
:
Patch the metadata of a webscript.
(string)
The name of the webscript.
(string)
The version of the webscript.
(MetadataBody)
The new metadata.
(RegistryURLParams?)
Query parameters in REST API.
Promise<RegistryResponse>
:
Start an undeploy
background job and remove a webscript version.
(string)
The name of the webscript.
(string)
The specific version to be removed.
(AsyncQueryParams?)
Query parameters in REST API.
Promise<RegistryResponse>
:
Start undeploy
background jobs for each versions of a webscript.
(string)
The name of the webscript.
(AsyncQueryParams?)
Query parameters in REST API.
Promise<RegistryResponse>
:
Check whether the function runtime requires a rebuild, and start build
, deploy
, verify
background jobs if required.
(string)
The name of the webscript.
(string)
The version of the webscript.
(EmptyRequest)
The request body (ignored).
(AsyncQueryParams?)
Query parameters in REST API.
Name | Description |
---|---|
params.force (
(default 'patch' )
|
The runtime version selection policy. |
params.dryRun boolean
(default false )
|
Flag to indicate whether the rebuild should be a dry run. |
Promise<RegistryResponse>
:
Start a verify
background job to check the health of this function.
(string)
The name of the webscript.
(string)
The version of the webscript.
(EmptyRequest)
The request body (ignored).
(AsyncQueryParams?)
Query parameters in REST API.
Promise<RegistryResponse>
:
Plugs API methods.
Extends Functions
((Options | null))
(Client?)
List your plugs.
(RegistryURLParams?)
Query parameters in REST API.
Name | Description |
---|---|
params.page number
(default 0 )
|
Number of pages to skip when returning result to this query. |
params.limit number?
|
The maximum number of items to be return from this query. |
params.name string?
|
Filter on the name of the function. Case-insensitive. Supports wild-cards
?
and
*
.
|
params.version string?
|
Filter on the version of the function. Case-sensitive. Supports wild-cards
?
and
*
.
|
params.status (
|
Filter on the deployment status of the function. |
params.createdBy string?
|
Filter on the user that created the function. Use the
@me
token to filter on the authenticated user.
|
params.updatedBy string?
|
Filter on the user that last updated the function. Use the
@me
token to filter on the authenticated user.
|
params.includeDeprecated boolean
(default false )
|
If
true
, the result includes deprecated plugs.
|
params.type (
|
Filter on plug type. |
params.tags (string | Array<string>)?
|
Filter on tags, entities must have all the given tags. |
Promise<RegistryResponse>
:
A listing of plugs.
Get details of a plug version.
(string)
The name of the plug.
(string)
The version of the plug.
(RegistryURLParams?)
Query parameters in REST API.
Promise<RegistryResponse>
:
Get details of the latest plug version.
(string)
The name of the plug.
(RegistryURLParams?)
Query parameters in REST API.
Name | Description |
---|---|
params.includeDeprecated boolean
(default false )
|
If
true
include deprecated plugs.
|
Promise<RegistryResponse>
:
Check if a plug exists.
(string)
The name of the plug.
(string?)
The version of the plug. If set, it checks if that specific version exists.
(RegistryURLParams?)
Query parameters in REST API.
Promise<boolean>
:
Get versions of a plug.
(string)
The name of the plug.
(RegistryURLParams?)
Query parameters in REST API.
Promise<RegistryResponse>
:
List jobs of a plug.
(string)
The name of the plug.
(string)
The version of the plug.
(RegistryURLParams?)
Query parameters in REST API.
Promise<RegistryResponse>
:
Get the specification archive of a plug.
(string)
The name of the plug.
(string)
The version of the plug.
(RegistryURLParams?)
Query parameters in REST API.
(FunctionDownloadOptions?)
Additional HTTP request options.
Name | Description |
---|---|
options.responseType string?
|
Alternative response type. |
Promise<RegistryResponse>
:
Archive content.
Get a file from the specification archive of a plug.
(string)
The name of the plug.
(string)
The version of the plug.
(string)
The path of the file in the archive.
(RegistryURLParams?)
Query parameters in REST API.
(FunctionDownloadOptions?)
Additional HTTP request options.
Name | Description |
---|---|
options.responseType string?
|
Alternative response type. |
Promise<RegistryResponse>
:
File content.
List the content of the specification archive of a plug.
(string)
The name of the plug.
(string)
The version of the plug.
(string
= ''
)
(RegistryURLParams?)
Query parameters in REST API.
Promise<RegistryResponse>
:
Archive content listing.
Create a new plug.
((FormData | FunctionArchiveContent))
Plug creation content.
This is either a
tar
archive buffer, file or stream, optionally with gzip
compression.(AsyncQueryParams?)
Query parameters in REST API.
(FunctionUploadOptions?)
Additional HTTP request options.
Promise<RegistryResponse>
:
Patch the metadata of a plug.
(string)
The name of the plug.
(string)
The version of the plug.
(MetadataBody)
The new metadata.
(RegistryURLParams?)
Query parameters in REST API.
Promise<RegistryResponse>
:
Patch the interface documentation of a plug version.
(string)
The name of the plug.
(string)
The version of the plug.
(PlugInterfaceBody)
The new interface.
(RegistryURLParams?)
Query parameters in REST API.
Promise<RegistryResponse>
:
Deprecate, or start an undeploy
background job and remove a plug version.
(string)
The name of the plug.
(AsyncQueryParams?)
Query parameters in REST API.
Name | Description |
---|---|
params.force boolean
(default false )
|
By default, the plug is only deprecated (removed from listing). |
Promise<RegistryResponse>
:
Deprecate or undeploy all versions of a plug.
(string)
The name of the plug.
(AsyncQueryParams?)
Query parameters in REST API.
Name | Description |
---|---|
params.force boolean
(default false )
|
By default, the plug is only deprecated (removed from listing). |
Promise<RegistryResponse>
:
Check whether the function runtime requires a rebuild, and start build
, deploy
, verify
background jobs if required.
(string)
The name of the plug.
(string)
The version of the plug.
(EmptyRequest)
The request body (ignored).
(AsyncQueryParams?)
Query parameters in REST API.
Name | Description |
---|---|
params.force (
(default 'patch' )
|
The runtime version selection policy. |
params.dryRun boolean
(default false )
|
Flag to indicate whether the rebuild should be a dry run. |
Promise<RegistryResponse>
:
Start a verify
background job to check the health of this function.
(string)
The name of the plug.
(string)
The version of the plug.
(Object)
The request body (ignored).
(AsyncQueryParams?)
Query parameters in REST API.
Promise<RegistryResponse>
:
Models API methods.
Extends Functions
((Options | null))
(Client?)
List your models.
(RegistryURLParams?)
Query parameters in REST API.
Name | Description |
---|---|
params.page number
(default 0 )
|
Number of pages to skip when returning result to this query. |
params.limit number?
|
The maximum number of items to be return from this query. |
params.name string?
|
Filter on the name of the function. Case-insensitive. Supports wild-cards
?
and
*
.
|
params.version string?
|
Filter on the version of the function. Case-sensitive. Supports wild-cards
?
and
*
.
|
params.status (
|
Filter on the deployment status of the function. |
params.createdBy string?
|
Filter on the user that created the function. Use the
@me
token to filter on the authenticated user.
|
params.updatedBy string?
|
Filter on the user that last updated the function. Use the
@me
token to filter on the authenticated user.
|
Promise<RegistryResponse>
:
A list of models.
Get details of one model version.
(string)
The name of the model.
(string)
The version of the model.
(RegistryURLParams?)
Query parameters in REST API.
Promise<RegistryResponse>
:
Get details the latest model version.
(string)
The name of the model.
(RegistryURLParams?)
Query parameters in REST API.
Promise<RegistryResponse>
:
Check if a model exists.
(string)
The name of the model.
(string?)
The version of the model. If set, it checks if that specific version exists.
(RegistryURLParams?)
Query parameters in REST API.
Promise<boolean>
:
Get versions of a model.
(string)
The name of the model.
(RegistryURLParams?)
Query parameters in REST API.
Promise<RegistryResponse>
:
List jobs of a model.
(string)
The name of the model.
(string)
The version of the model.
(RegistryURLParams?)
Query parameters in REST API.
Promise<RegistryResponse>
:
Get the specification archive of a model.
(string)
The name of the model.
(string)
The version of the model.
(RegistryURLParams?)
Query parameters in REST API.
(FunctionDownloadOptions?)
Additional HTTP request options.
Name | Description |
---|---|
options.responseType string?
|
Alternative response type. |
Promise<RegistryResponse>
:
Archive content.
Get a file from the specification archive of a model.
(string)
The name of the model.
(string)
The version of the model.
(string)
The path of the file in the archive.
(RegistryURLParams?)
Query parameters in REST API.
(FunctionDownloadOptions?)
Additional HTTP request options.
Name | Description |
---|---|
options.responseType string?
|
Alternative response type. |
Promise<RegistryResponse>
:
File content.
List the content of the specification archive of a model.
(string)
The name of the model.
(string)
The version of the model.
(string
= ''
)
(RegistryURLParams?)
Query parameters in REST API.
Promise<RegistryResponse>
:
Archive content listing.
Create a new model.
((FormData | FunctionArchiveContent))
Model creation content.
This is either a
tar
archive buffer, file or stream, optionally with gzip
compression.(AsyncQueryParams?)
Query parameters in REST API.
(FunctionUploadOptions?)
Additional HTTP request options.
Promise<RegistryResponse>
:
Patch the metadata of a model.
(string)
The name of the model.
(string)
The version of the model.
(MetadataBody)
The new metadata.
(RegistryURLParams?)
Query parameters in REST API.
Promise<RegistryResponse>
:
Start an undeploy
background job and remove a model version.
(string)
The name of the model.
(AsyncQueryParams?)
Query parameters in REST API.
Promise<RegistryResponse>
:
Undeploy all versions of a model.
(string)
The name of the model.
(AsyncQueryParams?)
Query parameters in REST API.
Promise<RegistryResponse>
:
Check whether the function runtime requires a rebuild, and start build
, deploy
, verify
background jobs if required.
(string)
The name of the model.
(string)
The version of the model.
(EmptyRequest)
The request body (ignored).
(AsyncQueryParams?)
Query parameters in REST API.
Name | Description |
---|---|
params.force (
(default 'patch' )
|
The runtime version selection policy. |
params.dryRun boolean
(default false )
|
Flag to indicate whether the rebuild should be a dry run. |
Promise<RegistryResponse>
:
Start a verify
background job to check the health of this function.
(string)
The name of the model.
(string)
The version of the model.
(EmptyRequest)
The request body (ignored).
(AsyncQueryParams?)
Query parameters in REST API.
Promise<RegistryResponse>
:
Analytics allows you to calculate anomalies and predict future values of timeseries
Get a subset of all queries using an optional filter string
(Object?
= {}
)
options for getting queries, this object can contain:
Name | Description |
---|---|
options.filter string
(default '' )
|
the filter string as specified in the query DSL, leave empty to get all queries |
options.offset number
(default 0 )
|
the number of queries to skip as offset |
options.limit number
(default 100 )
|
the number of queries per page |
Promise<Object>
:
Allows you to retrieve Waylay application statistics
Request/Response message objects for Waylay Storage
Representation of a Storage Bucket.
Type: Object
(string)
Full, globally unique name of the storage bucket.
(string)
Short name of the bucket: string, unique in tenant scope.
(StorageStoreEntity)
Backend store supporting this bucket.
Representation of a Storage Object.
Type: Object
(string)
The full name of the file object, including its path.
(StorageBucketEntity)
The bucket in which this object is stored.
(string)
Last modification date (ISO-8601 timestamp)
(string)
ETag caching header value used in content urls.
(number)
Size of the stored content.
(string)
Registered content type.
(boolean)
True if the entity represents a (virtual) folder. Folders in an object store
are only prefixes of stored object that end in a
'/'
.
Representation of a Storage Store, representing the actual storage solution for which the storage API controls access.
Type: Object
Representation of a storage subcription
Type: Object
(string)
The unique identifier for the subscription, optional when creating a subscriptions.
(string)
A display title for this subscription.
(string)
A description for this subscription.
(SubscriptionChannel)
The specification of the target to which notifications must be forwarded.
(Array<SubscriptionFilter>)
The event filters that specify what changes will trigger the notification.
Representation of a Subscription Channel, a target to send object change notifications to.
Type: Object
(string)
Type of the channel. One of
webscript
,
system
,
webhook
.
Users can only create subscriptions for
webscript
channels.
(string)
Http method to use when invoking the (webscript) channel.
One of
GET
POST
PUT
.
When
POST
or
PUT
is used, the webscript will receive a body of
type
StorageNotification
.
(string)
(optional) The version of the webscript.
(string)
A user description of the invoked channel.
(Object)
Specification of the period in which forwarded messages should remain usable.
This influences the expiry of signed urls and authentication tokens that are present in the forwarded message.
The total expiry period can not be larger than 7 days.
If not specified, an expiry of 300 seconds (5 minutes) holds.
Name | Description |
---|---|
expiry.seconds string
|
Seconds to add to the expiry period. |
expiry.hours string
|
Hours to add to the expiry period. |
expiry.days string
|
Days to add to the expiry period. |
Name | Description |
---|---|
payload.signed_links Array<string>
|
Signed links that must be present in the message as HAL link. This enables the receiver of the message (the webscript) to retrieve or update the content of the object without additional authentication. |
payload.reference any
|
Fixed json value that will be included in the message. |
(Object)
Specification of the authentication method used to call the (webscript) channel.
If not specified, a default mechanism is used.
Name | Description |
---|---|
authentication.method string
|
The authentication method.
One of
DEFAULT
,
NONE
,
API_KEY
,
TOKEN
,
WAYLAY_APP
,
WAYLAY_TOKEN
,
WEBSCRIPT
.
|
authentication.key string
|
The authentication key, only relevant for
API_KEY
and
WAYLAY_TOKEN
method.
|
authentication.secret string
|
The authentication secret, relevant for
API_KEY
,
TOKEN
,
WAYLAY_TOKEN
and
WEBSCRIPT
methods.
Note that this value gets encrypted to a read-only value with an enc: prefix when retrieved from the server.
The value should be unencrypted in a subscription create or update request.
|
Filter condition on a object change notification.
Type: Object
(string)
If present, the path of the changed object must have this prefix.
(string)
If present, the path of the changed object must have this suffix.
(string)
A user description for this filter.
(string)
Readonly id of the notification queue that is handling the subscription.
When present, it is a proof that the subscription is correctly registered.
Should be left empty when creating or updating a subscription.
Notification message as sent to a channel
Type: Object
(StorageObjectEntity)
The storage object that changed, including HAL links.
(string)
The event time (ISO8601 string) of the object change.
(any)
The json value as configured in
channel.payload.reference
of the subscription.
(string)
The id of the Waylay tenant that owns this object.
(string)
The name of the storage backend store that originated this change event.
Response object containing linked REST actions.
The storage api uses the following link roles as keys in the _links
object
self
: the url of the resource that is represented in the response.list
, remove
, update
, create
basic CRUD actions on a storage entity.sign_get
, sign_put
, sign_post
: REST actions that create signed urls to the content of a storage object.get_object
, put_object
, post_object
: The resulting signed url link to the object content.get
, put
, post
: public links to the content of storage objects (these do not require signing).first
, next
: paging links used in paged listing and deletion.removed
: links to deleted entities.store
, bucket
, subscriptions
: links to related (parent or child) entities.The storage server includes links according to the authorization level of the authenticated user. Link roles that are present can hence be used to present a user the authorized actions for a given resource.
(Note: combined types are annotated with a union type (| HALResponse
), but should be read as an intersection type (& HALResponse
))
Type: Object
HAL response for paged listings.
List response objects have an property (objects
, buckets
, subscriptions
) that
contains the listed entities.
(Note: combined types are annotated with a union type (| PagedListResponse
), but should be read as an intersection type (& PagedListResponse
))
Type: HALResponse
HAL response for paged deletion.
Type: HALResponse
Request/Response message objects for Waylay Query
The regular response object when executing queries (render mode RENDER_MODE_COMPACT_WS
)
Type: Object
(Array<(RowDataResponse | SeriesDataResponse | Array<Object>)>?)
The resulting multivariate data sets, in most cases this is a single data set.
(Array<MessageObject>?)
The 2 dimensional data array (array observation vectors)
(QueryDefinition?)
Query specification that was executed.
The regular dataset format when executing queries (render mode RENDER_MODE_COMPACT_WS
)
Type: Object
The dataset format when executing queries with render mode RENDER_MODE_SERIES
Type: Object
A message object encapsulating a error, warning or information about the execution of the query.
Type: Object
An object specifying a multivariate query. (doc)
Type: Object
(String?)
Waylay resource identifier of the time series (default)
(String?)
Waylay metric identifier of the time series (default)
(String?)
Aggregation method (default)
(Object?)
Interpolation method (default)
Name | Description |
---|---|
interpolation.method Object?
|
Interpolation method name |
interpolation.value Number?
|
Interpolation fixed value |
interpolation.order Number?
|
Interpolation order |
(String?)
timeline sampling interval
(String?)
timeline window size
(Number?)
timeline number of datapoints
(Array<SeriesDefinition>)
Specification of the series in the Query
Specifies a single series in a query definition. (doc). All attributes (except name) default to the corresponding attribute in the parent QueryDefinition.
Type: Object
Query Definition Listing
Type: Object
(Array<QueryDefinitionEntry>)
(number)
Query name
(number)
Query name
(number)
Query name
(number)
Query name
(HALLinks)
HAL links
Name | Description |
---|---|
_links.self HALLink
|
The link to this query. |
_links.next HALLink
|
Link to the next page of results. |
_links.last HALLink
|
Link to the last page of results. |
_links.first HALLink
|
Link to the first page of results. |
_links.prev HALLink
|
Link to the previous page of results. |
Query Definition List Entry.
Type: Object
(string)
Query name
(SystemAttributes)
Query definition system defined attributes
(UserAttributes)
Query definition user defined attributes
Query Definition Item.
Type: QueryDefinitionEntry
(QueryDefinition)
The query definition
Request/Response message objects for the rule Engine
Specification of patch command on templates
Type: Object
(string)
the name of the patch operation, e.g. 'updatePlugin'
(Array<UpdatePlugPatch>)
the updates to be applied
(boolean)
whether to reload tasks on completion
Task information.
Type: Object
(string)
(string)
(string)
(TaskStatus)
(string)
(string?)
(string?)
(number)
(number)
(number)
(number?)
(boolean)
(Object)
(string?)
(string?)
(boolean)
(Object?)
(Object)
(Object)
(Object?)
Task status.
Type: (running | stopped | failed)
Request/Response message objects for Registry
Plug interface.
Type: Object
(string?)
(Array<InterfacePropertyEntity>?)
(Array<InterfacePropertyEntity>?)
(Array<InterfacePropertyEntity>?)
Url parameters passed onto the REST request.
Type: Record<string, any>
A file, buffer or readable stream containing a tar archive of assets that define the function. Optionally can have gzip compression.
Type: Object
Additional request options to configure a download of function assets.
Extends RequestOptions
(string?)
Override of the response type.
Additional request options to configure an upload of function assets.
Extends RequestOptions