Streaming session service#
OpenAPI file: StreamingSessionService.json
Endpoints#
Resolve#
POST /ingest/v1/internal/streaming-session/dataset/{datasetRid}/resolve
Path parameters
datasetRidstring (RID) required
Body
sourceStreamingSessionSourceThe source attribution for this streaming session. Each unique source gets its own in-progress session per dataset. If absent, the session is unattributed.
Set
typeto"mesh".meshMeshStreamingSessionSource
Fields of
MeshStreamingSessionSourcesourceDatasetRidstring (RID) required
sourceOrgRidstring (RID) required
originStreamingSessionSourcestring required
Set
typeto"dataConnector".dataConnectorDataConnectorStreamingSessionSource
Fields of
DataConnectorStreamingSessionSourcedataConnectorRidstring (RID) required
Set
typeto"custom".customCustomStreamingSessionSource
Fields of
CustomStreamingSessionSourcesourceNamestring required
Response
sessionRidstring (RID)
datasetRidstring (RID)
statusStreamingSessionStatus
Values of
StreamingSessionStatusIN_PROGRESS
COMPLETED
sourceStreamingSessionSource
Set
typeto"mesh".meshMeshStreamingSessionSource
Fields of
MeshStreamingSessionSourcesourceDatasetRidstring (RID)
sourceOrgRidstring (RID)
originStreamingSessionSourcestring
Set
typeto"dataConnector".dataConnectorDataConnectorStreamingSessionSource
Fields of
DataConnectorStreamingSessionSourcedataConnectorRidstring (RID)
Set
typeto"custom".customCustomStreamingSessionSource
Fields of
CustomStreamingSessionSourcesourceNamestring
boundsRange
pointsCountinteger (int64)
createdAtTimestamp
Request
curl -X POST "https://api.gov.nominal.io/api/ingest/v1/internal/streaming-session/dataset/<dataset rid>/resolve" \
-H "Authorization: Bearer <api key>" \
-H "Content-Type: application/json" \
--data '{
"source": {
"type": "mesh",
"mesh": {
"sourceDatasetRid": "<dataset rid>",
"sourceOrgRid": "<org rid>",
"originStreamingSessionSource": "<origin streaming session source>"
}
}
}'
import requests
response = requests.post(
"https://api.gov.nominal.io/api/ingest/v1/internal/streaming-session/dataset/<dataset rid>/resolve",
headers={"Authorization": "Bearer <api key>"},
json={
"source": {
"type": "mesh",
"mesh": {
"sourceDatasetRid": "<dataset rid>",
"sourceOrgRid": "<org rid>",
"originStreamingSessionSource": "<origin streaming session source>",
},
},
},
)
response.raise_for_status()
print(response.json())
import httpx
response = httpx.post(
"https://api.gov.nominal.io/api/ingest/v1/internal/streaming-session/dataset/<dataset rid>/resolve",
headers={"Authorization": "Bearer <api key>"},
json={
"source": {
"type": "mesh",
"mesh": {
"sourceDatasetRid": "<dataset rid>",
"sourceOrgRid": "<org rid>",
"originStreamingSessionSource": "<origin streaming session source>",
},
},
},
)
response.raise_for_status()
print(response.json())
import asyncio
import aiohttp
async def main() -> None:
async with aiohttp.ClientSession() as session:
async with session.post(
"https://api.gov.nominal.io/api/ingest/v1/internal/streaming-session/dataset/<dataset rid>/resolve",
headers={"Authorization": "Bearer <api key>"},
json={
"source": {
"type": "mesh",
"mesh": {
"sourceDatasetRid": "<dataset rid>",
"sourceOrgRid": "<org rid>",
"originStreamingSessionSource": "<origin streaming session source>",
},
},
},
) as response:
response.raise_for_status()
print(await response.json())
asyncio.run(main())
Response: 200
{
"sessionRid": "<streaming session rid>",
"datasetRid": "<dataset rid>",
"status": "IN_PROGRESS",
"source": {
"type": "mesh",
"mesh": {
"sourceDatasetRid": "<dataset rid>",
"sourceOrgRid": "<org rid>",
"originStreamingSessionSource": "<origin streaming session source>"
}
},
"bounds": {
"start": {
"seconds": 1,
"nanos": 1
},
"end": {
"seconds": 1,
"nanos": 1
}
},
"pointsCount": 1,
"createdAt": {
"seconds": 1,
"nanos": 1
}
}
Heartbeat#
PUT /ingest/v1/internal/streaming-session/{sessionRid}/heartbeat
Path parameters
sessionRidstring (RID) required
Body
boundsRangerequiredThe time range of data points ingested since the last heartbeat. The server atomically merges this with the session’s existing bounds using LEAST/GREATEST to track the full time range.
pointsCountinteger requiredNumber of data points ingested since the last heartbeat. The server atomically adds this to the session’s running total.
Response
No content (HTTP 204).
Request
curl -X PUT "https://api.gov.nominal.io/api/ingest/v1/internal/streaming-session/<session rid>/heartbeat" \
-H "Authorization: Bearer <api key>" \
-H "Content-Type: application/json" \
--data '{
"bounds": {
"start": {
"seconds": 1,
"nanos": 1
},
"end": {
"seconds": 1,
"nanos": 1
}
},
"pointsCount": 1
}'
import requests
response = requests.put(
"https://api.gov.nominal.io/api/ingest/v1/internal/streaming-session/<session rid>/heartbeat",
headers={"Authorization": "Bearer <api key>"},
json={
"bounds": {
"start": {"seconds": 1, "nanos": 1},
"end": {"seconds": 1, "nanos": 1},
},
"pointsCount": 1,
},
)
response.raise_for_status()
import httpx
response = httpx.put(
"https://api.gov.nominal.io/api/ingest/v1/internal/streaming-session/<session rid>/heartbeat",
headers={"Authorization": "Bearer <api key>"},
json={
"bounds": {
"start": {"seconds": 1, "nanos": 1},
"end": {"seconds": 1, "nanos": 1},
},
"pointsCount": 1,
},
)
response.raise_for_status()
import asyncio
import aiohttp
async def main() -> None:
async with aiohttp.ClientSession() as session:
async with session.put(
"https://api.gov.nominal.io/api/ingest/v1/internal/streaming-session/<session rid>/heartbeat",
headers={"Authorization": "Bearer <api key>"},
json={
"bounds": {
"start": {"seconds": 1, "nanos": 1},
"end": {"seconds": 1, "nanos": 1},
},
"pointsCount": 1,
},
) as response:
response.raise_for_status()
asyncio.run(main())
Response: 204
No content.
Search streaming sessions#
POST /ingest/v1/streaming-sessions/search
Returns a paginated list of streaming sessions, optionally filtered by dataset.
Body
pageSizeintegerDefaults to 100. Clamped to 1_000 if larger, and to 1 if non-positive.
nextPageTokenstring
filterStreamingSessionSearchFilter
Set
typeto"datasetRids".datasetRidsarray of string (RID)
Set
typeto"source".sourceStreamingSourceFilter
Fields of
StreamingSourceFilterdatasetRidstring (RID) required
sourceStreamingSessionSource
Set
typeto"mesh".meshMeshStreamingSessionSource
Fields of
MeshStreamingSessionSourcesourceDatasetRidstring (RID) required
sourceOrgRidstring (RID) required
originStreamingSessionSourcestring required
Set
typeto"dataConnector".dataConnectorDataConnectorStreamingSessionSource
Fields of
DataConnectorStreamingSessionSourcedataConnectorRidstring (RID) required
Set
typeto"custom".customCustomStreamingSessionSource
Fields of
CustomStreamingSessionSourcesourceNamestring required
Set
typeto"timeRange".timeRangeStreamingSessionTimeRangeFilter
Set
typeto"workspace".workspacestring (RID)Matches sessions whose dataset belongs to the workspace.
Set
typeto"and".andarray ofStreamingSessionSearchFilter
Set
typeto"or".orarray ofStreamingSessionSearchFilter
Set
typeto"not".sortStreamingSessionSortOptionsDefaults to created_at DESC when omitted.
Fields of
StreamingSessionSortOptionsisDescendingboolean required
sortKeyStreamingSessionSortKeyrequired
Values of
StreamingSessionSortKeyCREATED_ATOrders by the time the session was created.
DATA_BOUNDS_STARTOrders by the start of the session’s data bounds. Sessions with no data bounds are excluded from the results.
Response
streamingSessionsarray ofStreamingSession
Fields of
StreamingSessionsessionRidstring (RID)
datasetRidstring (RID)
statusStreamingSessionStatus
Values of
StreamingSessionStatusIN_PROGRESS
COMPLETED
sourceStreamingSessionSource
Set
typeto"mesh".meshMeshStreamingSessionSource
Fields of
MeshStreamingSessionSourcesourceDatasetRidstring (RID)
sourceOrgRidstring (RID)
originStreamingSessionSourcestring
Set
typeto"dataConnector".dataConnectorDataConnectorStreamingSessionSource
Fields of
DataConnectorStreamingSessionSourcedataConnectorRidstring (RID)
Set
typeto"custom".customCustomStreamingSessionSource
Fields of
CustomStreamingSessionSourcesourceNamestring
boundsRange
pointsCountinteger (int64)
createdAtTimestamp
lastSeenAtTimestampTime of the most recent heartbeat for this session.
closedAtTimestampTime the session was completed. Absent while the session is in progress.
nextPageTokenstring
Request
curl -X POST "https://api.gov.nominal.io/api/ingest/v1/streaming-sessions/search" \
-H "Authorization: Bearer <api key>" \
-H "Content-Type: application/json" \
--data '{
"pageSize": 1,
"nextPageToken": "<token>",
"filter": {
"type": "datasetRids",
"datasetRids": [
"<dataset rid>"
]
},
"sort": {
"isDescending": true,
"sortKey": "CREATED_AT"
}
}'
import requests
response = requests.post(
"https://api.gov.nominal.io/api/ingest/v1/streaming-sessions/search",
headers={"Authorization": "Bearer <api key>"},
json={
"pageSize": 1,
"nextPageToken": "<token>",
"filter": {"type": "datasetRids", "datasetRids": ["<dataset rid>"]},
"sort": {"isDescending": True, "sortKey": "CREATED_AT"},
},
)
response.raise_for_status()
print(response.json())
import httpx
response = httpx.post(
"https://api.gov.nominal.io/api/ingest/v1/streaming-sessions/search",
headers={"Authorization": "Bearer <api key>"},
json={
"pageSize": 1,
"nextPageToken": "<token>",
"filter": {"type": "datasetRids", "datasetRids": ["<dataset rid>"]},
"sort": {"isDescending": True, "sortKey": "CREATED_AT"},
},
)
response.raise_for_status()
print(response.json())
import asyncio
import aiohttp
async def main() -> None:
async with aiohttp.ClientSession() as session:
async with session.post(
"https://api.gov.nominal.io/api/ingest/v1/streaming-sessions/search",
headers={"Authorization": "Bearer <api key>"},
json={
"pageSize": 1,
"nextPageToken": "<token>",
"filter": {"type": "datasetRids", "datasetRids": ["<dataset rid>"]},
"sort": {"isDescending": True, "sortKey": "CREATED_AT"},
},
) as response:
response.raise_for_status()
print(await response.json())
asyncio.run(main())
Response: 200
{
"streamingSessions": [
{
"sessionRid": "<streaming session rid>",
"datasetRid": "<dataset rid>",
"status": "IN_PROGRESS",
"source": {
"type": "mesh",
"mesh": {
"sourceDatasetRid": "<dataset rid>",
"sourceOrgRid": "<org rid>",
"originStreamingSessionSource": "<origin streaming session source>"
}
},
"bounds": {
"start": {
"seconds": 1,
"nanos": 1
},
"end": {
"seconds": 1,
"nanos": 1
}
},
"pointsCount": 1,
"createdAt": {
"seconds": 1,
"nanos": 1
},
"lastSeenAt": {
"seconds": 1,
"nanos": 1
},
"closedAt": {
"seconds": 1,
"nanos": 1
}
}
],
"nextPageToken": "<token>"
}
Search streaming sources#
POST /ingest/v1/streaming-sources/search
Returns a paginated list of streaming sessions aggregated by (source, dataset) group, ordered by latest activity descending.
Body
pageSizeintegerDefaults to 100. Clamped to 1_000 if larger, and to 1 if non-positive.
nextPageTokenstring
filterStreamingSourceSearchFilter
Set
typeto"datasetRids".datasetRidsarray of string (RID)
Set
typeto"source".sourceStreamingSourceFilter
Fields of
StreamingSourceFilterdatasetRidstring (RID) required
sourceStreamingSessionSource
Set
typeto"mesh".meshMeshStreamingSessionSource
Fields of
MeshStreamingSessionSourcesourceDatasetRidstring (RID) required
sourceOrgRidstring (RID) required
originStreamingSessionSourcestring required
Set
typeto"dataConnector".dataConnectorDataConnectorStreamingSessionSource
Fields of
DataConnectorStreamingSessionSourcedataConnectorRidstring (RID) required
Set
typeto"custom".customCustomStreamingSessionSource
Fields of
CustomStreamingSessionSourcesourceNamestring required
Set
typeto"workspace".workspacestring (RID)Matches sources whose dataset belongs to the workspace.
Set
typeto"and".andarray ofStreamingSourceSearchFilter
Set
typeto"or".orarray ofStreamingSourceSearchFilter
Set
typeto"not".activityAfterTimestampIf present, only sessions last seen strictly after this instant are aggregated; groups whose sessions were all last seen at or before it are omitted.
Fields of
Timestampsecondsinteger (int64) required
nanosinteger (int64) required
Response
streamingSourcesarray ofStreamingSource
Fields of
StreamingSourcesourceStreamingSessionSourceThe source attribution shared by the aggregated sessions. Absent for unattributed sessions.
Set
typeto"mesh".meshMeshStreamingSessionSource
Fields of
MeshStreamingSessionSourcesourceDatasetRidstring (RID)
sourceOrgRidstring (RID)
originStreamingSessionSourcestring
Set
typeto"dataConnector".dataConnectorDataConnectorStreamingSessionSource
Fields of
DataConnectorStreamingSessionSourcedataConnectorRidstring (RID)
Set
typeto"custom".customCustomStreamingSessionSource
Fields of
CustomStreamingSessionSourcesourceNamestring
datasetRidstring (RID)
sessionCountinteger (int64)Number of sessions aggregated into this group.
totalPointsCountinteger (int64)Sum of the points counts across the aggregated sessions.
earliestCreatedAtTimestampCreation time of the oldest aggregated session.
Fields of
Timestampsecondsinteger (int64)
nanosinteger (int64)
latestLastSeenAtTimestampMost recent heartbeat time across the aggregated sessions.
mergedBoundsRangeUnion of the data bounds across the aggregated sessions, if any session has bounds.
anyInProgressbooleanTrue if at least one aggregated session is in progress.
nextPageTokenstring
Request
curl -X POST "https://api.gov.nominal.io/api/ingest/v1/streaming-sources/search" \
-H "Authorization: Bearer <api key>" \
-H "Content-Type: application/json" \
--data '{
"pageSize": 1,
"nextPageToken": "<token>",
"filter": {
"type": "datasetRids",
"datasetRids": [
"<dataset rid>"
]
},
"activityAfter": {
"seconds": 1,
"nanos": 1
}
}'
import requests
response = requests.post(
"https://api.gov.nominal.io/api/ingest/v1/streaming-sources/search",
headers={"Authorization": "Bearer <api key>"},
json={
"pageSize": 1,
"nextPageToken": "<token>",
"filter": {"type": "datasetRids", "datasetRids": ["<dataset rid>"]},
"activityAfter": {"seconds": 1, "nanos": 1},
},
)
response.raise_for_status()
print(response.json())
import httpx
response = httpx.post(
"https://api.gov.nominal.io/api/ingest/v1/streaming-sources/search",
headers={"Authorization": "Bearer <api key>"},
json={
"pageSize": 1,
"nextPageToken": "<token>",
"filter": {"type": "datasetRids", "datasetRids": ["<dataset rid>"]},
"activityAfter": {"seconds": 1, "nanos": 1},
},
)
response.raise_for_status()
print(response.json())
import asyncio
import aiohttp
async def main() -> None:
async with aiohttp.ClientSession() as session:
async with session.post(
"https://api.gov.nominal.io/api/ingest/v1/streaming-sources/search",
headers={"Authorization": "Bearer <api key>"},
json={
"pageSize": 1,
"nextPageToken": "<token>",
"filter": {"type": "datasetRids", "datasetRids": ["<dataset rid>"]},
"activityAfter": {"seconds": 1, "nanos": 1},
},
) as response:
response.raise_for_status()
print(await response.json())
asyncio.run(main())
Response: 200
{
"streamingSources": [
{
"source": {
"type": "mesh",
"mesh": {
"sourceDatasetRid": "<dataset rid>",
"sourceOrgRid": "<org rid>",
"originStreamingSessionSource": "<origin streaming session source>"
}
},
"datasetRid": "<dataset rid>",
"sessionCount": 1,
"totalPointsCount": 1,
"earliestCreatedAt": {
"seconds": 1,
"nanos": 1
},
"latestLastSeenAt": {
"seconds": 1,
"nanos": 1
},
"mergedBounds": {
"start": {
"seconds": 1,
"nanos": 1
},
"end": {
"seconds": 1,
"nanos": 1
}
},
"anyInProgress": true
}
],
"nextPageToken": "<token>"
}
Types#
CustomStreamingSessionSource#
sourceNamestring required
DataConnectorStreamingSessionSource#
dataConnectorRidstring (RID) required
MeshStreamingSessionSource#
sourceDatasetRidstring (RID) required
sourceOrgRidstring (RID) required
originStreamingSessionSourcestring required
Range#
Deprecated for new APIs. Define an API-owned range with the endpoint semantics it needs instead.
StreamingSession#
Public view of a streaming ingest session.
sessionRidstring (RID) required
datasetRidstring (RID) required
statusStreamingSessionStatusrequired
sourceStreamingSessionSource
boundsRange
pointsCountinteger (int64) required
createdAtTimestamprequired
lastSeenAtTimestamprequiredTime of the most recent heartbeat for this session.
closedAtTimestampTime the session was completed. Absent while the session is in progress.
StreamingSessionSearchFilter#
Filter for streaming-session search. An empty datasetRids list matches all sessions. Filters compose with and/or/not.
Set type to the name of one of the other fields, and set only that field.
datasetRidsarray of string (RID)
sourceStreamingSourceFilter
timeRangeStreamingSessionTimeRangeFilter
workspacestring (RID)Matches sessions whose dataset belongs to the workspace.
andarray ofStreamingSessionSearchFilter
orarray ofStreamingSessionSearchFilter
notStreamingSessionSearchFilter
StreamingSessionSortKey#
CREATED_ATOrders by the time the session was created.
DATA_BOUNDS_STARTOrders by the start of the session’s data bounds. Sessions with no data bounds are excluded from the results.
StreamingSessionSortOptions#
isDescendingboolean required
sortKeyStreamingSessionSortKeyrequired
StreamingSessionSource#
Set type to the name of one of the other fields, and set only that field.
meshMeshStreamingSessionSource
dataConnectorDataConnectorStreamingSessionSource
customCustomStreamingSessionSource
StreamingSessionStatus#
IN_PROGRESS
COMPLETED
StreamingSessionTimeRangeFilter#
Matches sessions whose data bounds overlap this window. Sessions with no data bounds do not match. If both bounds are present, start must not be after end.
StreamingSource#
Aggregate view of the streaming sessions sharing a single (source, dataset) pair.
sourceStreamingSessionSourceThe source attribution shared by the aggregated sessions. Absent for unattributed sessions.
datasetRidstring (RID) required
sessionCountinteger (int64) requiredNumber of sessions aggregated into this group.
totalPointsCountinteger (int64) requiredSum of the points counts across the aggregated sessions.
earliestCreatedAtTimestamprequiredCreation time of the oldest aggregated session.
latestLastSeenAtTimestamprequiredMost recent heartbeat time across the aggregated sessions.
mergedBoundsRangeUnion of the data bounds across the aggregated sessions, if any session has bounds.
anyInProgressboolean requiredTrue if at least one aggregated session is in progress.
StreamingSourceFilter#
Matches the sessions of a single streaming source: the sessions on datasetRid with exactly the given source attribution. An absent source matches unattributed sessions.
datasetRidstring (RID) required
sourceStreamingSessionSource
StreamingSourceSearchFilter#
Filter for streaming-source search. An empty datasetRids list matches all sources. Filters compose with and/or/not.
Set type to the name of one of the other fields, and set only that field.
datasetRidsarray of string (RID)
sourceStreamingSourceFilter
workspacestring (RID)Matches sources whose dataset belongs to the workspace.
andarray ofStreamingSourceSearchFilter
orarray ofStreamingSourceSearchFilter
notStreamingSourceSearchFilter
Timestamp#
Deprecated for new APIs. Use google.protobuf.Timestamp for absolute instants in proto APIs.
This legacy nanosecond precision timestamp type is represented by an epoch time in seconds and a nanosecond offset. The nanosecond offset is from the start of the epoch second, so must be less than 1 billion.
secondsinteger (int64) required
nanosinteger (int64) required
Page design based on Scalar, MIT License.