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.
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
| Structure | UUID | Config | What it contains |
|---|---|---|---|
| UNS device | 0d4ac57f-76b5-45c9-9c2d-4b0812be08ff | { "source": "<device UUID>" } | Every metric of one device in the UNS history |
| UNS device metrics | bd9550fb-ef75-4523-81d6-25dd32c22925 | { "source": "<device UUID>", "metrics": [...] } | Chosen metrics of one device in the UNS history |
| Union components | 1c4ca454-de38-44d9-92fb-aa5218bfa257 | ["<dataset UUID>", ...] | Everything each component dataset contains |
| Session limits | 8754c000-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_UUIDandSchema_UUID) and theDevice Controlmetrics, 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.
instanceis theInstance_UUIDof the metric’s nearest enclosing object. For a metric with no enclosing object, it is the device UUID.metricis the path from that object to the metric, such asPosition/Actual. It never carries a datatype suffix. It can pass through plain folders that have noInstance_UUIDof 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 device55555555-5555-5555-5555-555555555555is575769eb-8e9a-541e-b339-34db16415672.GET /v1/metadata/{uuid}/contentsgoes 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
409with the codeuse_default_datasetand 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
409with the codedefault_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.
| Class | UUID | Meaning |
|---|---|---|
| Published dataset | 414d2d10-6be8-4c27-8e9f-c716ef5432b9 | A dataset that has been released, under the terms in its Release policy entry |
| MES dataset | 586205bf-81c6-4091-9d2c-f3c0465ebdc4 | The superclass of the manufacturing kinds below |
| MES equipment (a kind) | 4c93ddc1-e610-4efe-91e3-a355f9ba1a09 | The data of one piece of equipment |
| Run (a kind) | 3c866b35-66a1-4cb8-8db2-dae284883cf8 | One run of a process or trial |
| MES operation (a kind) | bd0354eb-b8f7-4bd9-8407-0588e545603c | One operation |
| MES product (a kind) | 4a089748-b26b-4f12-8f1a-164bfba97809 | One product |
| MES work order | b416e44c-c57e-4486-9431-64c425f1b2c6 | One 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.
| Application | UUID | Holds |
|---|---|---|
| Dataset tags | c95e372e-2fbe-45b9-9937-3235f94e22a3 | { "tags": [string] } |
| Equipment device labels | dfc3983b-658c-4099-b76a-01ce7c18bde1 | { "labels": { "<dataset UUID>": string } }, a label for each component of an equipment dataset |
| Run metadata | 2b2b4dbc-e0a0-474e-93a8-257bbcbb7f7a | An object describing a run |
| Recording in progress | cf3f6103-0f0e-4839-953a-ad2cedc78c30 | Whether an equipment dataset is recording now |
| Release policy | cb9b2307-3b82-4ffd-9665-0d214379ac21 | The 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).
ec48462e-37eb-4f56-8efa-83d813e85559af06b9e5-456a-43e4-b636-5b17de28fc7f2d666b41-7a0d-4845-ad59-3113f25b469a6f301df8-0ad1-496f-8391-8de92c43ad8e788b049c-2831-11f1-99fd-2b0bf86d6f77c089b9a9-06cd-4211-94fc-9ad52a75998794d51085-af83-4796-8059-fcd578e3f572Build 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.
6abc1879-429d-4c0f-a5e4-00a655a09f26The 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.
| Route | Purpose | Needs |
|---|---|---|
GET /v1/metadata | List datasets, with optional include fields | Nothing (lists what the caller may read) |
GET /v1/metadata/{uuid} | One dataset’s name, window, function, metadata and parts | Read dataset |
GET /v1/metadata/{uuid}/contents | The devices and metrics a download reads | Read dataset |
PUT /v1/metadata/{uuid}/name, /tags, /labels, /kind, /run, PATCH .../run | Change one piece of metadata | Edit dataset |
POST /v1/data/{uuid} | Download the dataset as CSV | Read dataset |
POST /v1/series | Bucketed counts, means and last-data times (OPTIONAL) | Read dataset, or Build datasets from device on each device |
GET /v1/coverage/status | State of a count summary (OPTIONAL) | Nothing for the basic fields |
GET /v1/structure | List datasets whose structure the caller may read | Nothing |
POST /v1/structure | Create a dataset | The source permissions |
GET /v1/structure/{uuid} | Read a structure | Edit dataset |
PUT /v1/structure/{uuid} | Change a structure | Edit dataset and the source permissions |
GET /v1/union-sources, GET /v1/session-sources | List what the caller may combine | Nothing |
GET /v1/sparkplug-sources/{uuid}/metrics | List a device’s selectable metrics | Build datasets from device |
GET /v1/delete/{uuid} | Delete a dataset | Delete 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.
| Column | Content |
|---|---|
device | The Sparkplug device ID the reading came from |
metric | The metric name, with no datatype suffix |
timestamp | ISO 8601 timestamp |
value | The value as stored. 64-bit integers keep every digit |
unit | The metric’s Eng_Unit string, if it has one |
path | The full Sparkplug metric name, such as Axes/X/Position/Actual, or the name alone for a metric at the top of the device |
device_uuid | The device UUID, which is its top-level Instance_UUID |
instance_uuid | The 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_uuid | The Schema_UUID of that object, or the device’s schema |
type | The 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.
- Coded refusals are JSON objects with a stable
errorcode and a human-readablemessage. Some carry more fields. They are used wherever a client can act on the reason. - Download body refusals come from
POST /v1/data/{uuid}. They are JSON objects with anerrorstring only. The string is a sentence saying what to change. - 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
403gives 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.
| Status | error | When |
|---|---|---|
409 | default_dataset | A change to, or delete of, a default dataset. device and dataset name both |
409 | use_default_dataset | A request that would make a second UNS device dataset for a device. dataset is the default dataset and device the device |
409 | dataset_in_use | A delete of a dataset that other datasets refer to. referrers lists them as { "dataset", "structure" } |
422 | structure_retired | A new Sparkplug source or Sub-device dataset. use lists the structures to use instead |
422 | device_required | The source of a UNS structure is not a device. device names it |
422 | placement_required | The device has no ISA-95 placement and is not on the UNS. device names it |
422 | invalid_include | An unknown field in include. unknown and fields list the bad and valid names |
422 | invalid_request | A series request that breaks a rule. limit or every suggest a value where one applies |
413 | too_many_devices, too_many_metrics, too_large | A series request or body over a limit. limit gives the limit |
400 | bad_request | A body that is not valid JSON, or a series body that is not an object |
415 | unsupported_media_type | A body in an encoding or character set the service does not accept |
503 | uns_unavailable | The 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.
| Resource | What 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:
201for a dataset that is new to the principal200for a changed body404for 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
06cee697-29d3-4972-9479-bc392e24946ec31d3cbd-01cd-4833-8014-c4512aef1e5c17e37253-8626-4031-b217-28c6a03e91c186e5b048-e956-4820-939e-3abf3eda4e03eae2d4ae-164d-4dc6-b646-7e0320057bd9e3b9fd2c-9de1-470b-9675-739e2a55b77f696396a0-2831-11f1-9b12-33d63b8c511521892bf2-0d9d-4496-a84e-37ff1829b94cThe 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
/v1/metadataWithout 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.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
include | query | No | string | A comma-separated list of the fields name, from, to, function, metadata and device_deleted. The parameter may be repeated. |
The datasets the caller may read.
application/jsonuuid-list | array of metadata-entryThe request carried no valid credentials.
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/jsonrefusalerrorrequiredstringmessagerequiredstring
/v1/metadata/{uuid}Requires Read dataset on the dataset.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
uuid | path | Yes | uuid | The dataset UUID. |
The dataset's metadata.
application/jsonmetadatauuidrequireduuidnamerequiredstringThe dataset's General Information name, or "UNKNOWN" if it has none.
fromdate-timeThe start of the window inherited from sessions in the structure. Omitted when unbounded.
Fields
todate-timeThe end of that window. Omitted when unbounded.
Fields
functionuuid-listThe functional classes the dataset belongs to, including through subclasses.
Fields
metadataobjectConfig entries keyed by application UUID, for every application in Dataset metadata.
partsrequireduuid-listSubclasses of the dataset, at any depth, that are datasets the caller may read.
Fields
device_deletedtruePresent only on the default dataset of a deleted device.
The request carried no valid credentials.
The caller does not hold the permission the route needs. Plain-text body.
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.
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.
/v1/metadata/{uuid}/contentsRequires 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.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
uuid | path | Yes | uuid | The dataset UUID. |
The dataset's contents.
application/jsoncontentsuuidrequireduuidfromdate-timetodate-timedevicesrequiredarray of objectFields
uuidrequireduuidnamerequiredstring | nullThe device's name, which is its Sparkplug device ID.
storerequired"uns" | "sparkplug"Which history a download reads the device from.
metricsrequiredarray of device-metricFields
instancerequireduuidThe Instance_UUID of the metric's nearest enclosing object, or the device UUID if it has none.
Fields
metricrequiredstringThe path from that object to the metric.
pathrequiredstringThe full Sparkplug metric name. It can be sent back as a
{ "path" }entry or a download selector.typestringThe Sparkplug type.
unitstringThe Eng_Unit string
documentationstring
The request carried no valid credentials.
The caller does not hold the permission the route needs. Plain-text body.
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.
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.
/v1/metadata/{uuid}/nameRequires Edit dataset. The name is trimmed and written to the dataset's General Information entry, keeping its other fields.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
uuid | path | Yes | uuid | The dataset UUID. |
application/jsonobjectnamerequiredstring
The name was written.
The request carried no valid credentials.
The caller does not hold the permission the route needs. Plain-text body.
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.
default_dataset: the dataset is a device's default dataset, which nobody can change. device and dataset name both.
application/jsonrefusalerrorrequiredstringmessagerequiredstring
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.
The body has the wrong shape. Plain-text body.
/v1/metadata/{uuid}/tagsRequires Edit dataset. An empty list removes the entry.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
uuid | path | Yes | uuid | The dataset UUID. |
application/jsonobjecttagsrequiredarray of string
The tags were written.
The request carried no valid credentials.
The caller does not hold the permission the route needs. Plain-text body.
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.
default_dataset: the dataset is a device's default dataset, which nobody can change. device and dataset name both.
application/jsonrefusalerrorrequiredstringmessagerequiredstring
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.
The body has the wrong shape. Plain-text body.
/v1/metadata/{uuid}/labelsRequires Edit dataset. The labels map a component dataset UUID to a label string. An empty object removes the entry.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
uuid | path | Yes | uuid | The dataset UUID. |
application/jsonobjectlabelsrequiredmap of string
The labels were written.
The request carried no valid credentials.
The caller does not hold the permission the route needs. Plain-text body.
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.
default_dataset: the dataset is a device's default dataset, which nobody can change. device and dataset name both.
application/jsonrefusalerrorrequiredstringmessagerequiredstring
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.
The body has the wrong shape. Plain-text body.
/v1/metadata/{uuid}/kindRequires 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).
| Name | In | Required | Type | Description |
|---|---|---|---|---|
uuid | path | Yes | uuid | The dataset UUID. |
application/jsonobjectkindrequired"4c93ddc1-e610-4efe-91e3-a355f9ba1a09" | "3c866b35-66a1-4cb8-8db2-dae284883cf8" | "bd0354eb-b8f7-4bd9-8407-0588e545603c" | "4a089748-b26b-4f12-8f1a-164bfba97809" | null
The kind was written.
The request carried no valid credentials.
The caller does not hold the permission the route needs. Plain-text body.
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.
default_dataset: the dataset is a device's default dataset, which nobody can change. device and dataset name both.
application/jsonrefusalerrorrequiredstringmessagerequiredstring
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.
The body has the wrong shape. Plain-text body.
/v1/metadata/{uuid}/runRequires Edit dataset. The body replaces the Run metadata entry.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
uuid | path | Yes | uuid | The dataset UUID. |
application/jsonobjectThe run details were written.
The request carried no valid credentials.
The caller does not hold the permission the route needs. Plain-text body.
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.
default_dataset: the dataset is a device's default dataset, which nobody can change. device and dataset name both.
application/jsonrefusalerrorrequiredstringmessagerequiredstring
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.
The body has the wrong shape. Plain-text body.
/v1/metadata/{uuid}/runRequires 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.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
uuid | path | Yes | uuid | The dataset UUID. |
application/merge-patch+jsonobjectapplication/jsonobjectThe patch was applied.
The request carried no valid credentials.
The caller does not hold the permission the route needs. Plain-text body.
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.
default_dataset: the dataset is a device's default dataset, which nobody can change. device and dataset name both.
application/jsonrefusalerrorrequiredstringmessagerequiredstring
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.
The body has the wrong shape. Plain-text body.
/v1/data/{uuid}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.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
uuid | path | Yes | uuid | The dataset UUID. |
application/jsondownload-requestfromstringStart of the window, inclusive. ISO 8601.
tostringEnd of the window, exclusive. ISO 8601.
metricsarray of stringExport 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.measurementstringDeprecatedDeprecated. A single stored measurement name, suffix included. Use
metrics.
The dataset's readings.
text/csvstringThe request carried no valid credentials.
The caller does not hold the permission the route needs. Plain-text body.
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.
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.
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-errorerrorrequiredstring
The dataset reads the UNS history and this installation has none (uns_unavailable).
application/jsonrefusalerrorrequiredstringmessagerequiredstring
/v1/seriesThis 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.
application/jsonseries-requestdevicesuuid-listdatasetuuidstore"sparkplug" | "uns"Only with
devices. Which history to read.fromrequireddate-timetorequireddate-timeevery"10s" | "30s" | "1m" | "5m" | "15m" | "30m" | "1h" | "6h" | "1d" | "1w"Bucket size. Without it the server picks the smallest step giving at most
pointsbuckets. Steps up to 6h align to UTC, and 1d and 1w follow the time zone the installation sets.pointsintegercountbooleanReturn per-device point counts. Birth metadata (Schema_UUID and Instance_UUID) does not count.
meanarray of objectFields
devicerequireduuidmetricrequiredstringThe 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 | objectReturn each device's newest data time, within the lookback (default 30d).
The bucketed series.
| Header | Required | Type | Description |
|---|---|---|---|
Cache-Control | No | string |
|
application/jsonseries-responsefromrequireddate-timetorequireddate-timeeveryrequiredstringasOfrequireddate-timeThe 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-timeRanges with no counts yet, as [from, to) pairs. Present only when there are some.
devicesrequiredmap of objectmetricsrequiredarray of objectFields
deviceuuidmetricstringtypestring | nullunitstring | nullpointsarray of array of numberSparse rows of [bucket start in epoch ms, mean, number of points].
deniedrequireduuid-list
The body is not valid JSON, or not a JSON object (bad_request).
application/jsonrefusalerrorrequiredstringmessagerequiredstring
The request carried no valid credentials.
The caller does not hold the permission the route needs. Plain-text body.
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.
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/jsonrefusalerrorrequiredstringmessagerequiredstring
The request is not valid (invalid_request). The message says what to change, and limit or every suggests a value where one applies.
application/jsonrefusalerrorrequiredstringmessagerequiredstring
The history store failed a query part way through.
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).
The request or one of its queries took longer than its time limit.
/v1/coverage/statusThis 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.
The summary's state.
application/jsoncoverage-statusenabledrequiredbooleanreadybooleanstalebooleanerrorstring | nullA code for the last failure, or null.
unsobjectThe UNS history's summary, in the same shape.
The request carried no valid credentials.
/v1/structureThose 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.
Dataset UUIDs.
application/jsonuuid-listThe request carried no valid credentials.
/v1/structureThe 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.
application/jsonstructure-definitionuuiduuidIgnored if sent. The dataset is named by the path on PUT, and made by the service on POST.
Fields
structurerequireduuidconfigrequireddevice-config | device-metrics-config | union-config | session-config | null
The new dataset's UUID.
application/jsonuuidThe request carried no valid credentials.
The caller does not hold the permission the route needs. Plain-text body.
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/jsonrefusalerrorrequiredstringmessagerequiredstring
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/jsonrefusalerrorrequiredstringmessagerequiredstring
uns_unavailable (JSON): this installation has no UNS history, so it cannot make datasets that read it.
application/jsonrefusalerrorrequiredstringmessagerequiredstring
/v1/structure/{uuid}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.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
uuid | path | Yes | uuid | The dataset UUID. |
The structure. The body does not hold the dataset UUID.
application/jsonstructure-definitionuuiduuidIgnored if sent. The dataset is named by the path on PUT, and made by the service on POST.
Fields
structurerequireduuidconfigrequireddevice-config | device-metrics-config | union-config | session-config | null
The request carried no valid credentials.
The caller does not hold the permission the route needs. Plain-text body.
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.
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.
/v1/structure/{uuid}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.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
uuid | path | Yes | uuid | The dataset UUID. |
application/jsonstructure-definitionuuiduuidIgnored if sent. The dataset is named by the path on PUT, and made by the service on POST.
Fields
structurerequireduuidconfigrequireddevice-config | device-metrics-config | union-config | session-config | null
The dataset's UUID.
application/jsonuuidThe request carried no valid credentials.
The caller does not hold the permission the route needs. Plain-text body.
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.
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/jsonrefusalerrorrequiredstringmessagerequiredstring
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.
As for POST /structure. structure_retired applies only when an invalid dataset is rewritten.
application/jsonrefusalerrorrequiredstringmessagerequiredstring
uns_unavailable, as for POST /structure.
application/jsonrefusalerrorrequiredstringmessagerequiredstring
/v1/union-sourcesDatasets the caller holds Include in union on.
Dataset UUIDs.
application/jsonuuid-listThe request carried no valid credentials.
/v1/session-sourcesDatasets the caller holds Use for session on.
Dataset UUIDs.
application/jsonuuid-listThe request carried no valid credentials.
/v1/sparkplug-sources/{uuid}/metricsRequires 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.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
uuid | path | Yes | uuid | The device UUID. |
The device's selectable metrics.
application/jsonarray of device-metricinstancerequireduuidThe Instance_UUID of the metric's nearest enclosing object, or the device UUID if it has none.
Fields
metricrequiredstringThe path from that object to the metric.
pathrequiredstringThe full Sparkplug metric name. It can be sent back as a
{ "path" }entry or a download selector.typestringThe Sparkplug type.
unitstringThe Eng_Unit string
documentationstring
The request carried no valid credentials.
The caller does not hold the permission the route needs. Plain-text body.
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.
/v1/delete/{uuid}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.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
uuid | path | Yes | uuid | The dataset UUID. |
The deleted dataset's UUID.
application/jsonuuidThe request carried no valid credentials.
The caller does not hold the permission the route needs. Plain-text body.
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-useA 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.