Skip to content
On this page

Services

Data Access and datasets

The Factory+ service that lets people and applications define, share and download named selections of recorded device history called datasets.

24 min read Edit this page
Central services
ACS implementationACS Data Access serviceSee how the AMRC Connectivity Stack implements this.View on GitHub

Data Access is the Factory+ service for datasets. A dataset is a named, permission-controlled selection of recorded device data that is defined in the Configuration Store, and the Data Access service resolves it to the underlying history and returns it as a CSV file.

A Factory+ installation records the history of every device. To analyse a machine trial, or to hand the data from one production run to a partner, a person has to say which devices, which metrics and which period of time they mean. That selection also needs a name that other people can find and reuse. Without datasets, every analyst writes their own query against the historian. Each analysis is then tied to one storage product, and there is no common way to control who may read what.

Data Access is a framework service with a well-known service function UUID, and clients find it through the Directory like any other service. It follows the service specification for authentication, versioned paths and errors. Its version 1 HTTP API, its change-notify interface, its Configuration Store classes and applications, and its permissions are framework contracts. Because the way the service stores or queries history is not a contract, an implementation can sit on any time-series store.

What a dataset is

A dataset is a Configuration Store object of the Dataset class. Its contents are decided by exactly one config entry for that object, filed under one of the structural applications listed below. The application that holds the entry is the dataset’s structure. The entry holds the details, such as which device the dataset reads or which other datasets it combines.

Datasets build on each other, because a structure can name other datasets as well as devices. A union combines several datasets, and a session takes a time slice of another dataset. A run of a machine trial can therefore be a session over a union of the datasets of the machines involved. At the time of each request, the service resolves this tree of datasets into a flat list of device sources. Each source has its own time window.

The service also records the tree as class relationships in the Configuration Store. A union is a superclass of each of its components. A session is a subclass of its source. The parts of a dataset are therefore its subclasses that are datasets, at any depth. They are the components of a union, the sessions taken from a dataset and, in turn, their own parts.

Structures

StructureUUIDConfigWhat it contains
UNS device0d4ac57f-76b5-45c9-9c2d-4b0812be08ff{ "source": "<device UUID>" }Every metric of one device in the UNS history
UNS device metricsbd9550fb-ef75-4523-81d6-25dd32c22925{ "source": "<device UUID>", "metrics": [...] }Chosen metrics of one device in the UNS history
Union components1c4ca454-de38-44d9-92fb-aa5218bfa257["<dataset UUID>", ...]Everything each component dataset contains
Session limits8754c000-3778-4ae6-b2b8-bbcd959bb775{ "source": "<dataset UUID>", "from": "<date-time>", "to": "<date-time>" }The part of another dataset inside a time window
Sparkplug source (deprecated)f5d550c4-2831-11f1-b0b0-83fda3035799{ "source": "<device UUID>" }Every metric of one device in the Sparkplug history
Sub-device (deprecated)7f7d40cc-4075-4f06-90cf-aa6261d68f18{ "source": "<device UUID>", "metrics": [...] }Chosen metrics of one device in the Sparkplug history

All six structural applications are members of the Dataset definition application group (eae2d4ae-164d-4dc6-b646-7e0320057bd9).

Two histories

A device structure reads one of two histories. The difference matters when datasets are compared.

  • The UNS history holds what the Unified Namespace carried for a device. Only a device with an ISA-95 placement is on the UNS. Only a placed device therefore has UNS history, and that history starts when the device first appeared on the UNS. It includes metrics marked transient. These are published to the UNS but not kept by the Sparkplug historian. It leaves out the birth metadata (Instance_UUID and Schema_UUID) and the Device Control metrics, because they are not published to the UNS. The i3X interface serves the same history. A UNS dataset therefore holds what i3X shows for the device.
  • The Sparkplug history holds what the Historian recorded from the device’s Sparkplug messages. It can reach back before the device was placed in the ISA-95 hierarchy.

The two UNS structures are the current way to select device data. The Sparkplug source and Sub-device structures are deprecated. A service MUST refuse a new dataset of either deprecated structure. A service MUST keep existing ones working. They can still be read, downloaded, edited, deleted and used in unions and sessions. A UNS dataset never falls back to the Sparkplug history for a time before the device joined the UNS.

UNS device

A UNS device dataset contains every metric of one device in the UNS history. The source MUST be a member of the Device class with an ISA-95 placement, because no other object has UNS history. The service makes exactly one UNS device dataset for each device, called its default dataset. A client cannot create another.

UNS device metrics and Sub-device

These two structures select chosen metrics of one device. UNS device metrics reads the UNS history, and Sub-device reads the Sparkplug history. They share the same config and rules. Each entry in metrics names one metric of the device by its place in the device’s origin map. The origin map is the originMap of the device’s Device Information config, and that config is part of the Edge Agent configuration.

  • instance is the Instance_UUID of the metric’s nearest enclosing object. For a metric with no enclosing object, it is the device UUID.
  • metric is the path from that object to the metric, such as Position/Actual. It never carries a datatype suffix. It can pass through plain folders that have no Instance_UUID of their own.

A reference holds an Instance_UUID rather than a full name. Renaming a folder above the object therefore does not break it. If a reference’s instance is no longer in the device’s origin map, the reference reads nothing. This most often follows a change of the device’s schema. Such a reference MUST NOT widen the read to the whole device.

On create and update, an entry MAY give the full Sparkplug metric name instead, as { "path": "Axes/X/Position/Actual" }. The service looks the path up in the device’s current origin map and stores the equivalent instance and metric entry. A stored config therefore always uses the instance form. The two forms can be mixed in one request. If a path does not name a metric recorded to the historian, the request is refused with 422 and nothing is created. The list MUST hold at least one entry, at most 500, and no entry twice.

The source of a UNS device metrics dataset is a placed device, as for a UNS device dataset. GET /v1/sparkplug-sources/{uuid}/metrics lists the references a device offers.

Union components

A union config is an array of other dataset UUIDs. The union contains everything its components contain. A component can be any dataset, including another union or a session. An empty array is valid. A dataset for a work order or a trial can then be created before anything is added to it.

Session limits

A session contains the part of another dataset that falls inside a time window. The source can be any dataset, including another session or a union. Both from and to are required. Each MUST be a real date and time written exactly in the form 2025-11-13T09:33:18.000Z, with milliseconds and a Z suffix.

Structurally invalid datasets

A dataset is structurally invalid in any of these cases:

  • It has no structural config entry.
  • It has entries under more than one structural application.
  • Its structure cannot be resolved. A union or session names a missing or invalid dataset, or the references form a loop.

The service reports an invalid dataset with the special UUID 696396a0-2831-11f1-9b12-33d63b8c5115 in place of a structure and null as its config.

An invalid dataset is left out of the metadata lists and cannot be downloaded. It does appear in the structure lists, where a person who may edit it can find and repair it. PUT /v1/structure/{uuid} on an invalid dataset removes every structural entry it has and writes the new one. The rules for a new dataset then apply. A deprecated structure is refused. A UNS device structure is also refused, because the device already has its default dataset.

Time windows

Every time window in Data Access is start-inclusive and end-exclusive, written [from, to). A reading timestamped exactly at from is in the window. A reading timestamped exactly at to is not. The rule applies to:

  • sessions
  • the window of a download or series request
  • the windows and pending ranges in a series answer
  • each series bucket

Two windows that meet never both hold the same reading. A run split into back-to-back sessions therefore downloads each reading once.

When windows nest, such as a session of a session or a request window over a session, the service takes the later of the two starts and the earlier of the two ends. The result is still [from, to).

Default device datasets

A device needs only one dataset that holds all its data. If every person who uses a device made their own, the same data would be shared under many names. The service therefore makes one UNS device dataset for every device with an ISA-95 placement and owns it itself. This is the device’s default dataset. A service MUST follow these rules for default datasets.

  • Its UUID follows from the device’s. The default dataset’s UUID is the version 5 UUID of the device UUID, written as a lower-case string, in the namespace 21892bf2-0d9d-4496-a84e-37ff1829b94c. A client can work out a device’s default dataset without a lookup. For example, the default dataset of device 55555555-5555-5555-5555-555555555555 is 575769eb-8e9a-541e-b339-34db16415672. GET /v1/metadata/{uuid}/contents goes the other way, from a dataset to its device.
  • It is the only UNS device dataset. A request to create a UNS device dataset gets 409 with the code use_default_dataset and the default dataset’s UUID. A change that points an existing UNS device dataset at a different device gets the same answer, because that device has a default dataset of its own.
  • Nobody can change or delete it. Its structure, name, tags, labels, kind and run details are fixed. A request to change any of them, or to delete the dataset, gets 409 with the code default_dataset, whatever the caller holds.
  • Its name is the device’s name. The service renames it when the device is renamed.
  • Access follows the device. Build datasets from device on the device gives Read dataset, Include in union and Use for session on its default dataset. It also lets the holder read the default dataset’s structure. It never gives Edit dataset or Delete dataset.
  • It outlives the placement and the device. A device that loses its placement keeps its default dataset, because unions and sessions may still use it. A device placed again uses the same one. A deleted device’s default dataset also stays so that its history can still be read. Its metadata then carries "device_deleted": true, and a client can use the flag to leave it out of its lists. The flag goes away if the device comes back.

A client SHOULD use the default dataset wherever a device goes into a union or a session. People who share a device then share one dataset for it.

Classification and metadata

Besides its structure, a dataset can be classified and described. A dataset’s function is the set of functional classes it belongs to. The functional classes are members of the Functional dataset group (86e5b048-e956-4820-939e-3abf3eda4e03). Configuration Store membership is transitive. A dataset in a subclass of a functional class is therefore reported as a member of both. A dataset’s kind is one of four functional classes, and a client sets it with PUT /v1/metadata/{uuid}/kind. The service keeps the dataset a direct member of at most one kind.

ClassUUIDMeaning
Published dataset414d2d10-6be8-4c27-8e9f-c716ef5432b9A dataset that has been released, under the terms in its Release policy entry
MES dataset586205bf-81c6-4091-9d2c-f3c0465ebdc4The superclass of the manufacturing kinds below
MES equipment (a kind)4c93ddc1-e610-4efe-91e3-a355f9ba1a09The data of one piece of equipment
Run (a kind)3c866b35-66a1-4cb8-8db2-dae284883cf8One run of a process or trial
MES operation (a kind)bd0354eb-b8f7-4bd9-8407-0588e545603cOne operation
MES product (a kind)4a089748-b26b-4f12-8f1a-164bfba97809One product
MES work orderb416e44c-c57e-4486-9431-64c425f1b2c6One work order

A dataset’s metadata is every config entry it has under an application in the Dataset metadata group (e3b9fd2c-9de1-470b-9675-739e2a55b77f). The service returns these entries keyed by application UUID. A client can therefore add its own metadata application to the group and read it back through Data Access.

ApplicationUUIDHolds
Dataset tagsc95e372e-2fbe-45b9-9937-3235f94e22a3{ "tags": [string] }
Equipment device labelsdfc3983b-658c-4099-b76a-01ce7c18bde1{ "labels": { "<dataset UUID>": string } }, a label for each component of an equipment dataset
Run metadata2b2b4dbc-e0a0-474e-93a8-257bbcbb7f7aAn object describing a run
Recording in progresscf3f6103-0f0e-4839-953a-ad2cedc78c30Whether an equipment dataset is recording now
Release policycb9b2307-3b82-4ffd-9665-0d214379ac21The terms a Published dataset is released under

The name, tags, labels, kind and run details have their own write routes in the API. A client SHOULD use these routes rather than writing to the Configuration Store. The Configuration Store checks a config write against the application for every object at once. A principal allowed to write these applications directly could change them for any dataset. The routes let a person who may edit one dataset change that dataset only.

Any other metadata is written straight to the Configuration Store under ordinary Configuration Store permissions. So is any other classification, such as adding a dataset to Published dataset.

Permissions

Data Access checks every request against grants held in the Auth service, following the authorisation model. Any of these permissions may therefore also be granted plural, against a class. All seven are members of the Data Access permission group (1e3cb5aa-a3f7-4bb6-9ef1-c3bc08427f60).

PermissionRead dataset
ec48462e-37eb-4f56-8efa-83d813e85559
Target: a dataset. Read its metadata and contents, download it, and read its series.
PermissionEdit dataset
af06b9e5-456a-43e4-b636-5b17de28fc7f
Target: a dataset. Read and change its structure and change its name, tags, labels, kind and run details.
PermissionCreate dataset
2d666b41-7a0d-4845-ad59-3113f25b469a
Target: a structural application, or the Dataset definition group as a plural grant. Needed only to create a dataset that names no source, which only an empty union does.
PermissionDelete dataset
6f301df8-0ad1-496f-8391-8de92c43ad8e
Target: a dataset. Delete it.
PermissionBuild datasets from device
788b049c-2831-11f1-99fd-2b0bf86d6f77
Target: a device, or an ISA-95 vocabulary node to cover every device placed at or under it. Use the device as the source of a device structure, read its series, list its metrics, and read and combine its default dataset.
PermissionUse for session
c089b9a9-06cd-4211-94fc-9ad52a759987
Target: a dataset. Use it as the source of a session.
PermissionInclude in union
94d51085-af83-4796-8059-fcd578e3f572
Target: a dataset. Use it as a component of a union.

Build datasets from device is a Data Access permission only. It gives no MQTT access. Older material may call it Use Sparkplug data.

Creating a dataset needs no role. Holding the source permission on everything a new dataset reads is enough on its own:

  • Build datasets from device on a device
  • Include in union on each component of a union
  • Use for session on the source of a session

Create dataset never stands in for a source permission. The service MUST record the authenticated caller as the owner of each dataset it creates. An installation can then let people manage their own datasets by granting the dataset permissions on the Mine special target of the authorisation model. Other people’s datasets are then reached through an explicit grant.

Grants on the ISA-95 hierarchy cover devices below them. A grant of Build datasets from device on an ISA-95 vocabulary node covers every device placed at or under that node. It includes devices placed there later and follows a device that moves. The service reads each device’s node from the ISA-95 placement application, and the nodes above it from the ISA-95 vocabulary application. Only Build datasets from device follows the hierarchy. A grant of any other Data Access permission on a node does nothing.

The Device data composite gives a device’s data in one grant. The Device data composite permission bundles Build datasets from device with i3X’s Read i3X objects. One grant of Device data on a device, or on an ISA-95 node, lets a person browse the device in i3X and build and read datasets from it. Each service sees its own half.

PermissionDevice data
6abc1879-429d-4c0f-a5e4-00a655a09f26
Composite permission holding Read i3X objects and Build datasets from device.

The v1 API

All routes are under /v1 at the URL the Directory gives for the Data Access service function. The full request and response shapes are in the API reference at the end of this page.

Every route is REQUIRED except POST /v1/series and GET /v1/coverage/status, which are OPTIONAL. A service that does not offer one of them answers 404, as for any route it does not have. A client MUST be ready to do without them.

RoutePurposeNeeds
GET /v1/metadataList datasets, with optional include fieldsNothing (lists what the caller may read)
GET /v1/metadata/{uuid}One dataset’s name, window, function, metadata and partsRead dataset
GET /v1/metadata/{uuid}/contentsThe devices and metrics a download readsRead dataset
PUT /v1/metadata/{uuid}/name, /tags, /labels, /kind, /run, PATCH .../runChange one piece of metadataEdit dataset
POST /v1/data/{uuid}Download the dataset as CSVRead dataset
POST /v1/seriesBucketed counts, means and last-data times (OPTIONAL)Read dataset, or Build datasets from device on each device
GET /v1/coverage/statusState of a count summary (OPTIONAL)Nothing for the basic fields
GET /v1/structureList datasets whose structure the caller may readNothing
POST /v1/structureCreate a datasetThe source permissions
GET /v1/structure/{uuid}Read a structureEdit dataset
PUT /v1/structure/{uuid}Change a structureEdit dataset and the source permissions
GET /v1/union-sources, GET /v1/session-sourcesList what the caller may combineNothing
GET /v1/sparkplug-sources/{uuid}/metricsList a device’s selectable metricsBuild datasets from device
GET /v1/delete/{uuid}Delete a datasetDelete dataset

Downloading a dataset

POST /v1/data/{uuid} resolves the dataset into its device sources. The time window of each source is narrowed by every session above it. The service streams every reading in those windows back as one CSV file named <dataset UUID>.csv.

The body MAY narrow the window with from and to. These never widen the dataset’s own window. Every source MUST end up with a start and an end. A device dataset, or a union of them, has no time window of its own. If the body of such a download has no from and to, the service refuses it with 422, because the download would read the device’s whole history. A session can be downloaded with an empty body.

The CSV has these columns, in this order. New columns are only ever added at the end. A client that reads columns by position therefore keeps working.

ColumnContent
deviceThe Sparkplug device ID the reading came from
metricThe metric name, with no datatype suffix
timestampISO 8601 timestamp
valueThe value as stored. 64-bit integers keep every digit
unitThe metric’s Eng_Unit string, if it has one
pathThe full Sparkplug metric name, such as Axes/X/Position/Actual, or the name alone for a metric at the top of the device
device_uuidThe device UUID, which is its top-level Instance_UUID
instance_uuidThe Instance_UUID of the nearest object around the metric, or the device UUID when there is none. This is the same value as instance in a metric reference
schema_uuidThe Schema_UUID of that object, or the device’s schema
typeThe stored datatype: double, int, uint, boolean or string

The columns are the same whichever history a row comes from. A UNS download and a Sparkplug download of the same device have the same device, metric, path and unit values. Overlapping sources are not merged. A union that reaches one metric twice returns its readings twice. This happens, for example, when a union holds a whole-device dataset and a metrics dataset of the same device.

The body MAY also carry metrics, a list of 1 to 100 metric selectors. An entry that contains / is a full metric name and matches that metric only. An entry without / matches that name at any path, including the top level of the device. Entries never carry a datatype suffix. An entry that ends in :i, :u, :d, :b or :s is refused. The older measurement filter names one stored measurement with its suffix and is deprecated. A request that sends both measurement and metrics is refused.

Series for timelines

POST /v1/series answers the questions a timeline or chart needs over a window, without downloading the data. It gives:

  • how many points each device wrote in each bucket
  • the mean of chosen metrics in each bucket
  • when each device last sent data

A request names either a dataset or a list of devices. A dataset request needs Read dataset and covers the dataset’s devices within the dataset’s windows, and a device request needs Build datasets from device on each device. Devices the caller may not read are listed in denied and left out. The request fails only when every device is denied. A device request reads the Sparkplug history unless store is uns. A dataset request reads each source from its own history.

The bucket size is one of 10s, 30s, 1m, 5m, 15m, 30m, 1h, 6h, 1d or 1w, or the server picks the smallest size that gives at most points buckets. Steps up to 6h align to UTC. 1d and 1w buckets follow the local calendar of a time zone that the installation sets. A day can therefore be 23 or 25 hours long when the clocks change.

Bucket rows are sparse, and a bucket with no data is absent. Each mean row is [start, mean, n]. A client can fold a live value v into the newest bucket with mean = (mean * n + v) / (n + 1).

An implementation sets its own limits on devices, metrics, buckets and time spans to protect its history store. It MUST refuse a request over a limit with 413 or 422 and a body that names the limit. An implementation MAY keep a summary of point counts to answer long timelines quickly. It MAY report the summary’s state through GET /v1/coverage/status. The source field of a series answer says whether its counts came from the raw history, the summary or both. pending lists ranges the summary cannot answer yet.

Reads after writes

The service SHOULD answer a write only once its own reads return the written value. A client that reads straight after a write then sees the change without waiting or retrying. This covers the metadata writes, structure creates and changes, and deletes. It cannot cover a grant, because grants come from the Auth service in its own time. It also cannot cover a write made straight to the Configuration Store. The service sees such a write only when the Configuration Store notifies it.

Errors

Because Data Access answers errors in three shapes, a client MUST look at the status code first and parse the body only where this section says it is JSON.

  1. Coded refusals are JSON objects with a stable error code and a human-readable message. Some carry more fields. They are used wherever a client can act on the reason.
  2. Download body refusals come from POST /v1/data/{uuid}. They are JSON objects with an error string only. The string is a sentence saying what to change.
  3. Other failures have a plain-text body. They include a body of the wrong shape on most routes, a missing permission and an unknown dataset. A 403 gives nothing away about whether the dataset exists.

A UUID in the path that is not a well-formed UUID gets 410 with a plain-text body, as the service specification requires. No resource can ever exist at that path.

StatuserrorWhen
409default_datasetA change to, or delete of, a default dataset. device and dataset name both
409use_default_datasetA request that would make a second UNS device dataset for a device. dataset is the default dataset and device the device
409dataset_in_useA delete of a dataset that other datasets refer to. referrers lists them as { "dataset", "structure" }
422structure_retiredA new Sparkplug source or Sub-device dataset. use lists the structures to use instead
422device_requiredThe source of a UNS structure is not a device. device names it
422placement_requiredThe device has no ISA-95 placement and is not on the UNS. device names it
422invalid_includeAn unknown field in include. unknown and fields list the bad and valid names
422invalid_requestA series request that breaks a rule. limit or every suggest a value where one applies
413too_many_devices, too_many_metrics, too_largeA series request or body over a limit. limit gives the limit
400bad_requestA body that is not valid JSON, or a series body that is not an object
415unsupported_media_typeA body in an encoding or character set the service does not accept
503uns_unavailableThe request reads the UNS history and the installation has none

The service makes its checks in an order that leaks nothing. It checks the caller’s permission on a source before it checks whether the source is a placed device or reads anything from its origin map. A caller without permission therefore learns nothing about the source. A change to a default dataset is refused only after the caller has passed the permission check.

Change notification

The service SHOULD offer the notify/v2 interface on the WebSocket path /notify/v2. With it a client can keep a list of datasets current without polling. The service registers these resources. Their paths start with v2/ even though the HTTP API is v1.

ResourceWhat it sends
WATCH v2/metadata/The UUIDs of the valid datasets the principal may read, as GET /v1/metadata lists them
SEARCH v2/metadata/One child per dataset in that list, whose body is the dataset’s metadata
WATCH v2/metadata/{uuid}One dataset’s metadata, and again each time it changes
WATCH v2/structure/The UUIDs of the datasets whose structure the principal may read, invalid ones included
SEARCH v2/structure/One child per dataset in that list, whose body is { structure, config }
WATCH v2/structure/{uuid}One dataset’s { structure, config }, and again each time it changes
WATCH v2/union-sources/The UUIDs the principal may include in a union
WATCH v2/session-sources/The UUIDs the principal may use as a session source

Each resource applies the permission rule of the HTTP route with the same name. A list WATCH sends the whole list each time a dataset joins or leaves it. It never sends a difference. The order of the UUIDs is not specified.

A SEARCH sends one snapshot holding every child and then only changes. Each change is a child update with one of these statuses:

  • 201 for a dataset that is new to the principal
  • 200 for a changed body
  • 404 for a dataset that is no longer visible

The single-dataset watches differ from the HTTP routes when there is no body to give. If a dataset does not exist, is invalid or cannot be read, WATCH v2/metadata/{uuid} sends status 200 with no body. The HTTP route answers 404 or 403 in those cases. WATCH v2/structure/{uuid} sends nothing at all in those cases, and it never sends the invalid-dataset marker. A client that needs to see invalid datasets uses the structure list or search.

If the service loses a source it depends on, a subscription gets a 500 and ends. The client can then subscribe again.

Well-known UUIDs

ServiceData Access
06cee697-29d3-4972-9479-bc392e24946e
The service function UUID. Clients look this up in the Directory to find the service.
ClassDataset
c31d3cbd-01cd-4833-8014-c4512aef1e5c
Every dataset is a member of this class.
ClassDataset group
17e37253-8626-4031-b217-28c6a03e91c1
The group class that holds the Dataset class.
ClassFunctional dataset group
86e5b048-e956-4820-939e-3abf3eda4e03
Its members are the functional classes that make up a dataset's function.
ApplicationDataset definition
eae2d4ae-164d-4dc6-b646-7e0320057bd9
The group of the six structural applications.
ApplicationDataset metadata
e3b9fd2c-9de1-470b-9675-739e2a55b77f
The group of the metadata applications whose entries the service returns as a dataset's metadata.
SpecialStructurally invalid dataset
696396a0-2831-11f1-9b12-33d63b8c5115
Reported in place of a structure for a dataset that cannot be resolved.
SpecialDefault dataset namespace
21892bf2-0d9d-4496-a84e-37ff1829b94c
The UUIDv5 namespace from which a device's default dataset UUID is derived.

The structures, functional classes, metadata applications and permissions are listed in their own sections above. The ISA-95 placement application is f9345c57-14e3-4027-b76d-2b0b67eb8fed. The ISA-95 vocabulary application is 11096075-acc6-4eae-b682-9b27d776384d. The ISA-95 hierarchy describes both. Every framework UUID is also collected in the well-known UUIDs list.

API reference

OpenAPI specificationView the full OpenAPI specification for the Data Access serviceView specification
get/v1/metadata
List the structurally valid datasets the caller may read.

Without include the answer is an array of dataset UUIDs. With include the answer is an array of objects, each holding uuid and the fields asked for, with the values GET /metadata/{uuid} gives for them. The list includes the default dataset of every device the caller holds Build datasets from device on. Structurally invalid datasets are left out.

Authentication: Any one of: HTTP Basic, Negotiate (Kerberos), Bearer token
Parameters
NameInRequiredTypeDescription
includequeryNostring

A comma-separated list of the fields name, from, to, function, metadata and device_deleted. The parameter may be repeated. uuid is accepted and changes nothing, and an empty value gives objects with uuid alone. parts is not available here.

Responses
200

The datasets the caller may read.

application/jsonuuid-list | array of metadata-entry
401

The request carried no valid credentials.

422

An unknown field in include. The error code is invalid_include, unknown lists the fields that were not recognised and fields lists the valid ones.

application/jsonrefusal
  • errorrequiredstring
  • messagerequiredstring
get/v1/metadata/{uuid}
Read the metadata of one dataset.

Requires Read dataset on the dataset.

Authentication: Any one of: HTTP Basic, Negotiate (Kerberos), Bearer token
Parameters
NameInRequiredTypeDescription
uuidpathYesuuid

The dataset UUID.

Responses
200

The dataset's metadata.

application/jsonmetadata
  • uuidrequireduuid
  • namerequiredstring

    The dataset's General Information name, or "UNKNOWN" if it has none.

  • fromdate-time

    The start of the window inherited from sessions in the structure. Omitted when unbounded.

    Fields
  • todate-time

    The end of that window. Omitted when unbounded.

    Fields
  • functionuuid-list

    The functional classes the dataset belongs to, including through subclasses.

    Fields
  • metadataobject

    Config entries keyed by application UUID, for every application in Dataset metadata.

  • partsrequireduuid-list

    Subclasses of the dataset, at any depth, that are datasets the caller may read.

    Fields
  • device_deletedtrue

    Present only on the default dataset of a deleted device.

401

The request carried no valid credentials.

403

The caller does not hold the permission the route needs. Plain-text body.

404

The dataset does not exist or is structurally invalid (for the read routes), or a dataset it refers to cannot be resolved. Plain-text body.

410

A UUID in the path is not a well-formed UUID. No resource can ever exist at that path, so the answer is 410 rather than 404. Plain-text body.

get/v1/metadata/{uuid}/contents
List the devices and metrics a download of the dataset reads.

Requires Read dataset on the dataset and nothing on the devices. The dataset is resolved in the same way as for a download, so the answer lists exactly what a download reads. A device reached through both history stores appears once for each.

Authentication: Any one of: HTTP Basic, Negotiate (Kerberos), Bearer token
Parameters
NameInRequiredTypeDescription
uuidpathYesuuid

The dataset UUID.

Responses
200

The dataset's contents.

application/jsoncontents
  • uuidrequireduuid
  • fromdate-time
  • todate-time
  • devicesrequiredarray of object
    Fields
    • uuidrequireduuid
    • namerequiredstring | null

      The device's name, which is its Sparkplug device ID.

    • storerequired"uns" | "sparkplug"

      Which history a download reads the device from.

    • metricsrequiredarray of device-metric
      Fields
      • instancerequireduuid

        The Instance_UUID of the metric's nearest enclosing object, or the device UUID if it has none.

        Fields
      • metricrequiredstring

        The path from that object to the metric.

      • pathrequiredstring

        The full Sparkplug metric name. It can be sent back as a { "path" } entry or a download selector.

      • typestring

        The Sparkplug type.

      • unitstring

        The Eng_Unit string

      • documentationstring
401

The request carried no valid credentials.

403

The caller does not hold the permission the route needs. Plain-text body.

404

The dataset does not exist or is structurally invalid (for the read routes), or a dataset it refers to cannot be resolved. Plain-text body.

410

A UUID in the path is not a well-formed UUID. No resource can ever exist at that path, so the answer is 410 rather than 404. Plain-text body.

put/v1/metadata/{uuid}/name
Set a dataset's name.

Requires Edit dataset. The name is trimmed and written to the dataset's General Information entry, keeping its other fields.

Authentication: Any one of: HTTP Basic, Negotiate (Kerberos), Bearer token
Parameters
NameInRequiredTypeDescription
uuidpathYesuuid

The dataset UUID.

Request body (required)
application/jsonobject
  • namerequiredstring
Responses
204

The name was written.

401

The request carried no valid credentials.

403

The caller does not hold the permission the route needs. Plain-text body.

404

The dataset does not exist or is structurally invalid (for the read routes), or a dataset it refers to cannot be resolved. Plain-text body.

409

default_dataset: the dataset is a device's default dataset, which nobody can change. device and dataset name both.

application/jsonrefusal
  • errorrequiredstring
  • messagerequiredstring
410

A UUID in the path is not a well-formed UUID. No resource can ever exist at that path, so the answer is 410 rather than 404. Plain-text body.

422

The body has the wrong shape. Plain-text body.

put/v1/metadata/{uuid}/tags
Set a dataset's tags.

Requires Edit dataset. An empty list removes the entry.

Authentication: Any one of: HTTP Basic, Negotiate (Kerberos), Bearer token
Parameters
NameInRequiredTypeDescription
uuidpathYesuuid

The dataset UUID.

Request body (required)
application/jsonobject
  • tagsrequiredarray of string
Responses
204

The tags were written.

401

The request carried no valid credentials.

403

The caller does not hold the permission the route needs. Plain-text body.

404

The dataset does not exist or is structurally invalid (for the read routes), or a dataset it refers to cannot be resolved. Plain-text body.

409

default_dataset: the dataset is a device's default dataset, which nobody can change. device and dataset name both.

application/jsonrefusal
  • errorrequiredstring
  • messagerequiredstring
410

A UUID in the path is not a well-formed UUID. No resource can ever exist at that path, so the answer is 410 rather than 404. Plain-text body.

422

The body has the wrong shape. Plain-text body.

put/v1/metadata/{uuid}/labels
Set an equipment dataset's device labels.

Requires Edit dataset. The labels map a component dataset UUID to a label string. An empty object removes the entry.

Authentication: Any one of: HTTP Basic, Negotiate (Kerberos), Bearer token
Parameters
NameInRequiredTypeDescription
uuidpathYesuuid

The dataset UUID.

Request body (required)
application/jsonobject
  • labelsrequiredmap of string
Responses
204

The labels were written.

401

The request carried no valid credentials.

403

The caller does not hold the permission the route needs. Plain-text body.

404

The dataset does not exist or is structurally invalid (for the read routes), or a dataset it refers to cannot be resolved. Plain-text body.

409

default_dataset: the dataset is a device's default dataset, which nobody can change. device and dataset name both.

application/jsonrefusal
  • errorrequiredstring
  • messagerequiredstring
410

A UUID in the path is not a well-formed UUID. No resource can ever exist at that path, so the answer is 410 rather than 404. Plain-text body.

422

The body has the wrong shape. Plain-text body.

put/v1/metadata/{uuid}/kind
Set a dataset's kind.

Requires Edit dataset. Makes the dataset a direct member of one kind class and removes it from the others. null removes it from all of them. The kinds are MES equipment (4c93ddc1-e610-4efe-91e3-a355f9ba1a09), Run (3c866b35-66a1-4cb8-8db2-dae284883cf8), MES operation (bd0354eb-b8f7-4bd9-8407-0588e545603c) and MES product (4a089748-b26b-4f12-8f1a-164bfba97809).

Authentication: Any one of: HTTP Basic, Negotiate (Kerberos), Bearer token
Parameters
NameInRequiredTypeDescription
uuidpathYesuuid

The dataset UUID.

Request body (required)
application/jsonobject
  • kindrequired"4c93ddc1-e610-4efe-91e3-a355f9ba1a09" | "3c866b35-66a1-4cb8-8db2-dae284883cf8" | "bd0354eb-b8f7-4bd9-8407-0588e545603c" | "4a089748-b26b-4f12-8f1a-164bfba97809" | null
Responses
204

The kind was written.

401

The request carried no valid credentials.

403

The caller does not hold the permission the route needs. Plain-text body.

404

The dataset does not exist or is structurally invalid (for the read routes), or a dataset it refers to cannot be resolved. Plain-text body.

409

default_dataset: the dataset is a device's default dataset, which nobody can change. device and dataset name both.

application/jsonrefusal
  • errorrequiredstring
  • messagerequiredstring
410

A UUID in the path is not a well-formed UUID. No resource can ever exist at that path, so the answer is 410 rather than 404. Plain-text body.

422

The body has the wrong shape. Plain-text body.

put/v1/metadata/{uuid}/run
Replace a dataset's run details.

Requires Edit dataset. The body replaces the Run metadata entry.

Authentication: Any one of: HTTP Basic, Negotiate (Kerberos), Bearer token
Parameters
NameInRequiredTypeDescription
uuidpathYesuuid

The dataset UUID.

Request body (required)
application/jsonobject
Responses
204

The run details were written.

401

The request carried no valid credentials.

403

The caller does not hold the permission the route needs. Plain-text body.

404

The dataset does not exist or is structurally invalid (for the read routes), or a dataset it refers to cannot be resolved. Plain-text body.

409

default_dataset: the dataset is a device's default dataset, which nobody can change. device and dataset name both.

application/jsonrefusal
  • errorrequiredstring
  • messagerequiredstring
410

A UUID in the path is not a well-formed UUID. No resource can ever exist at that path, so the answer is 410 rather than 404. Plain-text body.

422

The body has the wrong shape. Plain-text body.

patch/v1/metadata/{uuid}/run
Change a dataset's run details with a JSON merge patch.

Requires Edit dataset. The body is a JSON merge patch (RFC 7396) applied to the Run metadata entry, so two edits to different fields both stick.

Authentication: Any one of: HTTP Basic, Negotiate (Kerberos), Bearer token
Parameters
NameInRequiredTypeDescription
uuidpathYesuuid

The dataset UUID.

Request body (required)
application/merge-patch+jsonobject
application/jsonobject
Responses
204

The patch was applied.

401

The request carried no valid credentials.

403

The caller does not hold the permission the route needs. Plain-text body.

404

The dataset does not exist or is structurally invalid (for the read routes), or a dataset it refers to cannot be resolved. Plain-text body.

409

default_dataset: the dataset is a device's default dataset, which nobody can change. device and dataset name both.

application/jsonrefusal
  • errorrequiredstring
  • messagerequiredstring
410

A UUID in the path is not a well-formed UUID. No resource can ever exist at that path, so the answer is 410 rather than 404. Plain-text body.

422

The body has the wrong shape. Plain-text body.

post/v1/data/{uuid}
Download the contents of a dataset as CSV.

Requires Read dataset. The dataset is resolved into a list of device sources, each with a time window narrowed by every session above it, and every reading in those windows is streamed back as one CSV file named <dataset UUID>.csv. The request window narrows each source's window and never widens it. Every source must end up with both a start and an end, so a dataset with no time window of its own needs from and to in the body. The columns are device, metric, timestamp, value, unit, path, device_uuid, instance_uuid, schema_uuid and type, in that order. New columns are only ever added at the end.

Authentication: Any one of: HTTP Basic, Negotiate (Kerberos), Bearer token
Parameters
NameInRequiredTypeDescription
uuidpathYesuuid

The dataset UUID.

Request body
application/jsondownload-request
  • fromstring

    Start of the window, inclusive. ISO 8601.

  • tostring

    End of the window, exclusive. ISO 8601.

  • metricsarray of string

    Export only these metrics. An entry containing / is a full Sparkplug metric name and matches that metric only. An entry without / matches that metric name at any path. Entries never carry a datatype suffix. Duplicates are ignored, and a point is exported if it matches any entry.

  • measurementstringDeprecated

    Deprecated. A single stored measurement name, suffix included. Use metrics.

Responses
200

The dataset's readings.

text/csvstring
401

The request carried no valid credentials.

403

The caller does not hold the permission the route needs. Plain-text body.

404

The dataset does not exist or is structurally invalid (for the read routes), or a dataset it refers to cannot be resolved. Plain-text body.

410

A UUID in the path is not a well-formed UUID. No resource can ever exist at that path, so the answer is 410 rather than 404. Plain-text body.

422

The body is not acceptable: an invalid filter, an invalid or reversed window, a window outside the dataset's own, or no window for a dataset that has none. The body says what to change.

application/jsondownload-error
  • errorrequiredstring
503

The dataset reads the UNS history and this installation has none (uns_unavailable).

application/jsonrefusal
  • errorrequiredstring
  • messagerequiredstring
post/v1/series
Read bucketed counts, means and last-data times for timelines. OPTIONAL.

This route is OPTIONAL. A service that does not offer it answers 404, as for any route it does not have, so a client MUST be ready to do without it. Returns, for a set of devices or for one dataset over a time window, the number of points each device wrote per bucket, the mean of chosen metrics per bucket, and each device's newest data time. A dataset request needs Read dataset on the dataset and covers its devices within the dataset's windows. A device request needs Build datasets from device on each device. Devices the caller may not read are listed in denied and left out, and the request fails only when every device is denied. Bucket times are epoch milliseconds of the bucket start, and each bucket is [start, next start). Limits on devices, metrics, buckets and spans are set by the implementation, and a request over a limit gets 413 or 422 naming the limit. Buckets up to 6h align to UTC. 1d and 1w buckets follow the local calendar of a time zone that the installation sets, so a day can be 23 or 25 hours long when the clocks change.

Authentication: Any one of: HTTP Basic, Negotiate (Kerberos), Bearer token
Request body (required)
application/jsonseries-request
  • devicesuuid-list
  • datasetuuid
  • store"sparkplug" | "uns"

    Only with devices. Which history to read.

  • fromrequireddate-time
  • torequireddate-time
  • every"10s" | "30s" | "1m" | "5m" | "15m" | "30m" | "1h" | "6h" | "1d" | "1w"

    Bucket size. Without it the server picks the smallest step giving at most points buckets. Steps up to 6h align to UTC, and 1d and 1w follow the time zone the installation sets.

  • pointsinteger
  • countboolean

    Return per-device point counts. Birth metadata (Schema_UUID and Instance_UUID) does not count.

  • meanarray of object
    Fields
    • devicerequireduuid
    • metricrequiredstring

      The full Sparkplug metric name.

    • type"d" | "i" | "u" | "b" | "s"

      d double, i integer, u unsigned, b boolean, s string. Without it every numeric type is read and merged.

  • lastboolean | object

    Return each device's newest data time, within the lookback (default 30d).

Responses
200

The bucketed series.

Response headers
HeaderRequiredTypeDescription
Cache-ControlNostring

private, max-age=300 when the window ends well before the query time and nothing is pending, no-store otherwise.

application/jsonseries-response
  • fromrequireddate-time
  • torequireddate-time
  • everyrequiredstring
  • asOfrequireddate-time

    The server time the query ran. A bucket ending after it is partial.

    Fields
  • sourcerequired"raw" | "coverage" | "mixed"

    Where the counts came from. Means and last times always come from the raw history.

  • pendingarray of array of date-time

    Ranges with no counts yet, as [from, to) pairs. Present only when there are some.

  • devicesrequiredmap of object
  • metricsrequiredarray of object
    Fields
    • deviceuuid
    • metricstring
    • typestring | null
    • unitstring | null
    • pointsarray of array of number

      Sparse rows of [bucket start in epoch ms, mean, number of points].

  • deniedrequireduuid-list
400

The body is not valid JSON, or not a JSON object (bad_request).

application/jsonrefusal
  • errorrequiredstring
  • messagerequiredstring
401

The request carried no valid credentials.

403

The caller does not hold the permission the route needs. Plain-text body.

404

The dataset does not exist or is structurally invalid (for the read routes), or a dataset it refers to cannot be resolved. Plain-text body.

413

Too many devices (too_many_devices) or mean metrics (too_many_metrics), or a body that is too large (too_large). limit gives the limit.

application/jsonrefusal
  • errorrequiredstring
  • messagerequiredstring
422

The request is not valid (invalid_request). The message says what to change, and limit or every suggests a value where one applies.

application/jsonrefusal
  • errorrequiredstring
  • messagerequiredstring
500

The history store failed a query part way through.

503

The history store or the Auth service cannot be reached, or too many queries are waiting (with Retry-After), or the request reads the UNS history and this installation has none (uns_unavailable, JSON).

504

The request or one of its queries took longer than its time limit.

get/v1/coverage/status
Read the state of the service's count summary. OPTIONAL.

This route is OPTIONAL. A service that does not offer it answers 404, as for any route it does not have. An implementation that keeps a summary of point counts, to answer long timelines quickly, MAY report its state here. Any authenticated caller may read enabled, ready, stale and error. Further fields describe data across every device and are implementation-defined, so they are shown only to a caller with Build datasets from device on every device (a wildcard grant). When the UNS history has its own summary, uns holds its state in the same shape.

Authentication: Any one of: HTTP Basic, Negotiate (Kerberos), Bearer token
Responses
200

The summary's state.

application/jsoncoverage-status
  • enabledrequiredboolean
  • readyboolean
  • staleboolean
  • errorstring | null

    A code for the last failure, or null.

  • unsobject

    The UNS history's summary, in the same shape.

401

The request carried no valid credentials.

get/v1/structure
List the datasets whose structure the caller may read.

Those the caller holds Edit dataset on, and the default dataset of every device the caller holds Build datasets from device on. Unlike GET /metadata, this includes structurally invalid datasets, so they can be found and fixed.

Authentication: Any one of: HTTP Basic, Negotiate (Kerberos), Bearer token
Responses
200

Dataset UUIDs.

application/jsonuuid-list
401

The request carried no valid credentials.

post/v1/structure
Create a dataset.

The caller needs the source permission on everything the new dataset reads (Build datasets from device on a device, Include in union on each union component, Use for session on a session's source), and nothing else. An empty union names no source, so it needs Create dataset on the Union components app instead. The service creates a Dataset object owned by the caller, writes the config under the structure's app, and answers with the new dataset's UUID as a JSON string. Metric entries given as { "path" } are converted to { "instance", "metric" } before they are stored.

Authentication: Any one of: HTTP Basic, Negotiate (Kerberos), Bearer token
Request body (required)
application/jsonstructure-definition
  • uuiduuid

    Ignored if sent. The dataset is named by the path on PUT, and made by the service on POST.

    Fields
  • structurerequireduuid
  • configrequireddevice-config | device-metrics-config | union-config | session-config | null
Responses
200

The new dataset's UUID.

application/jsonuuid
401

The request carried no valid credentials.

403

The caller does not hold the permission the route needs. Plain-text body.

409

use_default_dataset: the structure is UNS device, and the device already has its default dataset. dataset gives its UUID and device names the device.

application/jsonrefusal
  • errorrequiredstring
  • messagerequiredstring
422

structure_retired (the structure can no longer be created, and use lists the structures to use instead), device_required (the source of a UNS kind is not a device) or placement_required (the device has no ISA-95 placement), as JSON. A config of the wrong shape, or a metric path that does not resolve, gets a plain-text 422.

application/jsonrefusal
  • errorrequiredstring
  • messagerequiredstring
503

uns_unavailable (JSON): this installation has no UNS history, so it cannot make datasets that read it.

application/jsonrefusal
  • errorrequiredstring
  • messagerequiredstring
get/v1/structure/{uuid}
Read a dataset's structure.

Requires Edit dataset, or Build datasets from device on the device when the dataset is a default dataset. A structurally invalid dataset answers with the invalid-dataset UUID as structure and null as config.

Authentication: Any one of: HTTP Basic, Negotiate (Kerberos), Bearer token
Parameters
NameInRequiredTypeDescription
uuidpathYesuuid

The dataset UUID.

Responses
200

The structure. The body does not hold the dataset UUID.

application/jsonstructure-definition
  • uuiduuid

    Ignored if sent. The dataset is named by the path on PUT, and made by the service on POST.

    Fields
  • structurerequireduuid
  • configrequireddevice-config | device-metrics-config | union-config | session-config | null
401

The request carried no valid credentials.

403

The caller does not hold the permission the route needs. Plain-text body.

404

The dataset does not exist or is structurally invalid (for the read routes), or a dataset it refers to cannot be resolved. Plain-text body.

410

A UUID in the path is not a well-formed UUID. No resource can ever exist at that path, so the answer is 410 rather than 404. Plain-text body.

put/v1/structure/{uuid}
Change a dataset's structure.

Requires Edit dataset on the dataset and the source permission on everything the new config reads. A valid dataset keeps its structure, so a different structure gets 409. A structurally invalid dataset has every structural entry removed and is written anew, so a deprecated structure or a UNS device structure is refused as it is on create. The new config is checked in full before anything is removed, so a refused request leaves the dataset as it was. Answers with the dataset's UUID as a JSON string.

Authentication: Any one of: HTTP Basic, Negotiate (Kerberos), Bearer token
Parameters
NameInRequiredTypeDescription
uuidpathYesuuid

The dataset UUID.

Request body (required)
application/jsonstructure-definition
  • uuiduuid

    Ignored if sent. The dataset is named by the path on PUT, and made by the service on POST.

    Fields
  • structurerequireduuid
  • configrequireddevice-config | device-metrics-config | union-config | session-config | null
Responses
200

The dataset's UUID.

application/jsonuuid
401

The request carried no valid credentials.

403

The caller does not hold the permission the route needs. Plain-text body.

404

The dataset does not exist or is structurally invalid (for the read routes), or a dataset it refers to cannot be resolved. Plain-text body.

409

default_dataset (a default dataset cannot be changed) or use_default_dataset (the change would make a second whole-device dataset for a device), as JSON, or a plain-text 409 for a change of structure.

application/jsonrefusal
  • errorrequiredstring
  • messagerequiredstring
410

A UUID in the path is not a well-formed UUID. No resource can ever exist at that path, so the answer is 410 rather than 404. Plain-text body.

422

As for POST /structure. structure_retired applies only when an invalid dataset is rewritten.

application/jsonrefusal
  • errorrequiredstring
  • messagerequiredstring
503

uns_unavailable, as for POST /structure.

application/jsonrefusal
  • errorrequiredstring
  • messagerequiredstring
get/v1/union-sources
List the valid datasets the caller may include in a union.

Datasets the caller holds Include in union on.

Authentication: Any one of: HTTP Basic, Negotiate (Kerberos), Bearer token
Responses
200

Dataset UUIDs.

application/jsonuuid-list
401

The request carried no valid credentials.

get/v1/session-sources
List the valid datasets the caller may use as a session source.

Datasets the caller holds Use for session on.

Authentication: Any one of: HTTP Basic, Negotiate (Kerberos), Bearer token
Responses
200

Dataset UUIDs.

application/jsonuuid-list
401

The request carried no valid credentials.

get/v1/sparkplug-sources/{uuid}/metrics
List the metrics of a device that a metrics dataset can select.

Requires Build datasets from device on the device. Lists every metric in the device's origin map that is recorded to the historian, since nothing else can be read back. A device with no origin map gives an empty list.

Authentication: Any one of: HTTP Basic, Negotiate (Kerberos), Bearer token
Parameters
NameInRequiredTypeDescription
uuidpathYesuuid

The device UUID.

Responses
200

The device's selectable metrics.

application/jsonarray of device-metric
  • instancerequireduuid

    The Instance_UUID of the metric's nearest enclosing object, or the device UUID if it has none.

    Fields
  • metricrequiredstring

    The path from that object to the metric.

  • pathrequiredstring

    The full Sparkplug metric name. It can be sent back as a { "path" } entry or a download selector.

  • typestring

    The Sparkplug type.

  • unitstring

    The Eng_Unit string

  • documentationstring
401

The request carried no valid credentials.

403

The caller does not hold the permission the route needs. Plain-text body.

410

A UUID in the path is not a well-formed UUID. No resource can ever exist at that path, so the answer is 410 rather than 404. Plain-text body.

get/v1/delete/{uuid}
Delete a dataset.

This route deletes with a GET request. Requires Delete dataset. The delete is refused while any other dataset still refers to this one, and nothing is written when it is refused. Otherwise the service removes the class relationships the dataset owns and deletes the dataset object, and answers with the deleted UUID as a JSON string.

Authentication: Any one of: HTTP Basic, Negotiate (Kerberos), Bearer token
Parameters
NameInRequiredTypeDescription
uuidpathYesuuid

The dataset UUID.

Responses
200

The deleted dataset's UUID.

application/jsonuuid
401

The request carried no valid credentials.

403

The caller does not hold the permission the route needs. Plain-text body.

409

default_dataset (a default dataset cannot be deleted) or dataset_in_use (other datasets refer to this one, and referrers lists them).

application/jsonrefusal | in-use
410

A UUID in the path is not a well-formed UUID. No resource can ever exist at that path, so the answer is 410 rather than 404. Plain-text body.

Esc