Download OpenAPI specification:Download
Nimble's REST API (Application Programming Interface) enables users to configure and query analytics workloads executing within Nimble. Behind this API is a software layer that routes data, arbitrates resources and executes Deep Learning and analytics functions to enable enriched business insights at world-class speed.
The latest online documentation can be found here.
API is short for "Application Programming Interface". An API is a set of rules that lets programs talk to each other, exposing data and functionality across the Internet in a consistent format.
REST stands for "Representational State Transfer". This is an architectural pattern that describes how distributed systems can expose a consistent interface. When people use the term "REST API", they are generally referring to an API accessed using the HTTP protocol at a predefined set of URLs.
These URLs represent various resources - any information or content accessed at that location, which can be returned as JSON, HTML, or media files.
Often resources have one or more methods that can be performed on them over HTTP, like GET
, POST
, PUT
, PATCH
, and DELETE
.
The action represented by the first and last of these is clear, but POST
, PUT
, and PATCH
have specific meanings.
How they are defined is confusing, but the general rule is: use POST
to create resources, PUT
to update resources, and PATCH
to modify resources.
Nimble and the REST API have six key elements: Configuration, Source, Sink, Pipeline, Channel, and Stream.
A Configuration is a collection of Sources, Sinks and Pipeline Elements arranged to execute the desired analytic behavior.
A Source brings data into Nimble.
A Sink pushes data out of Nimble.
A Pipeline is made up of processing elements that perform some analytics task.
Since a Source can be shared between multiple Pipelines, a Channel is an abstraction of both a Source and a Pipeline that can be thought of as "the data brought in by this Source is operated on by this Pipeline".
A Stream is a proxied fMP4 video stream from a Source.
Nimble is controlled by a Configuration. A Configuration is a collection of Sources, Sinks and Pipeline Elements arranged to execute the desired analytic behaviour.
{- "sources": [
- {
- "id": 0,
- "type": "file",
- "address": "input.mp4",
- "rate": 30,
- "timeout": 0,
- "proxy": false
}, - {
- "id": 1,
- "type": "video",
- "address": "rtsp://localhost:554/axis-media/media.amp",
- "rate": 25,
- "timeout": -1,
- "proxy": true
}
], - "sinks": [
- {
- "id": 0,
- "type": "video",
- "address": "output.mp4",
- "filter": 1
}, - {
- "id": 1,
- "type": "zmq",
- "address": "tcp://*:22952",
- "filter": "*"
}
], - "pipelines": [
- {
- "id": 0,
- "usecase": "physical-distancing",
- "elements": [
- "person-detection-0200:a:0.3:0.3",
- "social-distancing:0.2"
], - "sources": [
- 0,
- 1
], - "sinks": [
- 0,
- 1
]
}
]
}
Deploy a Configuration to Nimble.
The new Configuration in list-based format, see config.yaml.
required | Array of objects non-empty |
Array of objects | |
Array of strings or objects non-empty | |
string or null | |
Array of objects |
Deployment with short-form pipeline elements
[- {
- "sinks": [
- {
- "type": "zmq",
- "address": "tcp://*:22952",
- "filter": "*"
}
], - "pipeline": [
- "person-detection-0200:a:0.3:0.3",
- "social-distancing:0.2"
], - "usecase": "physical-distancing",
- "configuration": [
- {
- "address": "tcp://*:22951",
- "message": {
- "grid": [
- [
- "0"
]
]
}
}
]
}
]
A Source brings in data and pushes it to one or more Pipelines. Sources are generally URLs to video streams or other media but can also be other Nimble instances or files for offline processing.
[- {
- "id": 0,
- "type": "file",
- "address": "input.mp4",
- "rate": 30,
- "timeout": 0,
- "proxy": false
}, - {
- "id": 1,
- "type": "video",
- "address": "rtsp://localhost:554/axis-media/media.amp",
- "rate": 25,
- "timeout": -1,
- "proxy": true
}
]
Create a Source in the Configuration.
object Examples:
The preferred response (minimal or full) |
The new Source.
type required | string (schemas) Enum: "video" "file" "youtube" "zmqinternal" "zmq" "inf" |
required | string or object (address) |
rate required | number <float> (schemas) [0 .. 0] |
timeout | number <float> (schemas) Default: -1 If source is disconnected, then try to reconnect for the specified number of minutes; -1 is try indefinitely. |
proxy | boolean (schemas) Default: true |
stream | number <int32> (schemas) >= 0 Stream ID |
{- "type": "video",
- "address": "rtsp://localhost:554/axis-media/media.amp",
- "rate": 25,
- "timeout": -1
}
{- "id": 0,
- "type": "video",
- "address": "rtsp://localhost:554/axis-media/media.amp",
- "rate": 25,
- "timeout": -1,
- "proxy": true
}
Retrieve all of the information about a Source (by ID) in the Configuration.
id required | integer <int32> (id) >= 0 The ID of the Source. |
{- "type": "video",
- "address": "rtsp://localhost:554/axis-media/media.amp",
- "rate": 25,
- "timeout": -1,
- "proxy": true
}
Update a Source (by ID) in the Configuration.
id required | integer <int32> (id) >= 0 The ID of the Source. |
object Examples:
The preferred response (minimal or full) |
The Source's information.
type required | string (schemas) Enum: "video" "file" "youtube" "zmqinternal" "zmq" "inf" |
required | string or object (address) |
rate required | number <float> (schemas) [0 .. 0] |
timeout | number <float> (schemas) Default: -1 If source is disconnected, then try to reconnect for the specified number of minutes; -1 is try indefinitely. |
proxy | boolean (schemas) Default: true |
stream | number <int32> (schemas) >= 0 Stream ID |
{- "type": "file",
- "address": "input.mp4",
- "rate": 30,
- "proxy": false
}
{- "type": "file",
- "address": "input.mp4",
- "rate": 30,
- "timeout": -1,
- "proxy": false
}
Modify a Source (by ID) in the Configuration.
JSON merge patch (RFC7386) is used to apply the modifications to the Source's information.
id required | integer <int32> (id) >= 0 The ID of the Source. |
object Examples:
The preferred response (minimal or full) |
The Source's information
type | string (schemas) Enum: "video" "file" "youtube" "zmqinternal" "zmq" "inf" |
string or object (address) | |
rate | number <float> (schemas) [0 .. 0] |
timeout | number <float> (schemas) Default: -1 If source is disconnected, then try to reconnect for the specified number of minutes; -1 is try indefinitely. |
proxy | boolean (schemas) Default: true |
stream | number <int32> (schemas) >= 0 Stream ID |
{- "type": "file",
- "address": "input.mp4"
}
{- "type": "file",
- "address": "input.mp4",
- "rate": 25,
- "timeout": -1,
- "proxy": true
}
Delete a Source (by ID) in the Configuration.
id required | integer <int32> (id) >= 0 The ID of the Source. |
force | boolean Default: false Whether to force deletion of the Source even if it is being referenced by a Pipeline.
If |
{- "pipelines": [
- 0,
- 1
]
}
A Sink takes data from a Pipeline and pushes it out. Apart from the WebSocket API, which is always active and can be found here, other Sinks such has ZMQ sockets or file can be created.
Create a Sink in the Configuration.
object Examples:
The preferred response (minimal or full) |
The Sink.
type required | string (schemas) Enum: "video" "zmq" "zmqinternal" "inf" |
address required | string <url> (schemas) |
"*" (string) or integer or Array of integers (filter) |
{- "type": "video",
- "address": "output.mp4"
}
{- "id": 0,
- "type": "video",
- "address": "output.mp4",
- "filter": "*"
}
Update a Sink (by ID) in the Configuration.
id required | integer <int32> (sink_id) >= 0 The ID of the Sink. |
object Examples:
The preferred response (minimal or full) |
The Sink's information.
type required | string (schemas) Enum: "video" "zmq" "zmqinternal" "inf" |
address required | string <url> (schemas) |
"*" (string) or integer or Array of integers (filter) |
{- "type": "video",
- "address": "output.mp4",
- "filter": 1
}
{- "type": "video",
- "address": "output.mp4",
- "filter": 1
}
Modify a Sink (by ID) in the Configuration.
JSON merge patch (RFC7386) is used to apply the modifications to the Sink's information.
id required | integer <int32> (sink_id) >= 0 The ID of the Sink. |
object Examples:
The preferred response (minimal or full) |
The Sink's information.
type | string (schemas) Enum: "video" "zmq" "zmqinternal" "inf" |
address | string <url> (schemas) |
"*" (string) or integer or Array of integers (filter) |
{- "type": "video",
- "address": "output.mp4"
}
{- "type": "video",
- "address": "output.mp4",
- "filter": "*"
}
Delete a Sink (by ID) in the Configuration.
id required | integer <int32> (sink_id) >= 0 The ID of the Sink. |
force | boolean Default: false Whether to force deletion of the Sink even if it is being referenced by a Pipeline.
If |
{- "pipelines": [
- 0,
- 1
]
}
A Pipeline is a list elements or operations that perform the desired analytics task. Pipelines can be constructed for a number of different elements that execute Deep Learning, Machine Learning, OpenCV-based functions or custom algorithms.
Retrieve all pipeline elements and models that are available from Nimble.
type | Array of strings Items Enum: "element" "model" The element type filter to apply. |
[- {
- "type": "element",
- "name": "BEV"
}, - {
- "type": "element",
- "name": "line-crossing"
}, - {
- "type": "element",
- "name": "social-distancing"
}, - {
- "type": "model",
- "name": "detr",
- "platform": "GPU"
}, - {
- "type": "model",
- "name": "faster_rcnn_inception_v2",
- "platform": "GPU"
}, - {
- "type": "model",
- "name": "person-detection-large",
- "platform": "CPU"
}, - {
- "type": "model",
- "name": "person-detection-nano",
- "platform": "CPU"
}, - {
- "type": "model",
- "name": "S10_yolov3-tiny-int8",
- "platform": "FPGA"
}
]
Create a Pipeline in the Configuration.
object Examples:
The preferred response (minimal or full) |
The Pipeline.
usecase | string (schemas) The high-level description of the analytics performed by the pipeline. |
required | Array of strings or objects (schemas) non-empty Sequence of processing stages |
sources | Array of integers <int32> (schemas) IDs of input sources to the pipeline |
sinks | Array of integers <int32> (schemas) IDs of output sinks from the pipeline |
{- "elements": [
- "person-detection-0200:a:0.3:0.3",
- "social-distancing:0.2"
], - "sources": [
- 0,
- 1
], - "sinks": [
- 0,
- 1
]
}
{- "id": 0,
- "usecase": "physical-distancing",
- "elements": [
- "person-detection-0200:a:0.3:0.3",
- "social-distancing:0.2"
], - "sources": [
- 0,
- 1
], - "sinks": [
- 0,
- 1
]
}
Get information about a Pipeline (by ID) in the Configuration.
id required | integer <int32> (pipeline_id) >= 0 The ID of the Pipeline. |
{- "usecase": "physical-distancing",
- "elements": [
- "person-detection-0200:a:0.3:0.3",
- "social-distancing:0.2"
], - "sources": [
- 0,
- 1
], - "sinks": [
- 0,
- 1
]
}
Update a Pipeline (by ID) in the Configuration.
id required | integer <int32> (pipeline_id) >= 0 The ID of the Pipeline. |
object Examples:
The preferred response (minimal or full) |
The Pipeline information.
usecase | string (schemas) The high-level description of the analytics performed by the pipeline. |
required | Array of strings or objects (schemas) non-empty Sequence of processing stages |
sources | Array of integers <int32> (schemas) IDs of input sources to the pipeline |
sinks | Array of integers <int32> (schemas) IDs of output sinks from the pipeline |
{- "elements": [
- "person-detection-0200:a:0.3:0.3",
- "social-distancing:0.2"
], - "sources": [
- 2
], - "sinks": [
- 0,
- 1
]
}
{- "usecase": "physical-distancing",
- "elements": [
- "person-detection-0200:a:0.3:0.3",
- "social-distancing:0.2"
], - "sources": [
- 2
], - "sinks": [
- 0,
- 1
]
}
Modify a Pipeline (by ID) in the Configuration.
id required | integer <int32> (pipeline_id) >= 0 The ID of the Pipeline. |
object Examples:
The preferred response (minimal or full) |
The Pipeline information.
usecase | string (schemas) The high-level description of the analytics performed by the pipeline. |
Array of strings or objects (schemas) non-empty Sequence of processing stages | |
sources | Array of integers <int32> (schemas) IDs of input sources to the pipeline |
sinks | Array of integers <int32> (schemas) IDs of output sinks from the pipeline |
{- "elements": [
- "person-detection-0200:a:0.3:0.3",
- "people-tracking:5:50:20"
], - "sinks": [
- 2,
- 3
]
}
{- "usecase": "tracing",
- "elements": [
- "person-detection-0200:a:0.3:0.3",
- "people-tracking:5:50:20"
], - "sources": [
- 0,
- 1
], - "sinks": [
- 2,
- 3
]
}
Assign Sources as input to a Pipeline (by ID) in the Configuration.
id required | integer <int32> (pipeline_id) >= 0 The ID of the Pipeline. |
The Sources to add.
Source ID
[- 0,
- 1,
- 2
]
Unassign Sources from a Pipeline (by ID) in the Configuration.
id required | integer <int32> (pipeline_id) >= 0 The ID of the Pipeline. |
The Sources to remove.
Source ID
[- 1,
- 2
]
Assign Sinks as output to a Pipeline (by ID) in the Configuration.
id required | integer <int32> (pipeline_id) >= 0 The ID of the Pipeline. |
The Sinks to add.
Sink ID
[- 1,
- 2
]
Unassign Sinks from a Pipeline (by ID) in the Configuration.
id required | integer <int32> (pipeline_id) >= 0 The ID of the Pipeline. |
The Sinks to remove.
Sink ID
[- 2
]
Exports allow you to inspect Channel properties such as its current Configuration, processing rate (FPS), and latency.
{- "streams": [
- {
- "id": 0,
- "source": 0
}, - {
- "id": 1,
- "source": 1
}
], - "channels": [
- {
- "id": 0,
- "source": 0,
- "pipeline": 0,
- "usecase": "physical-distancing",
- "stream": 0
}, - {
- "id": 1,
- "source": 0,
- "pipeline": 1,
- "usecase": "line-crossing",
- "stream": 0
}, - {
- "id": 2,
- "source": 2,
- "pipeline": 2,
- "usecase": "pose-detection",
- "stream": null
}, - {
- "id": 3,
- "source": 1,
- "pipeline": 3,
- "usecase": null,
- "stream": 1
}
]
}
Retrieve the Channel's static metadata.
id required | number <int32> (channel_id) >= 0 The ID of the Channel. |
format | string (formatter) Default: "megh" Enum: "aws" "megh" The formatter to use to output the static metadata. |
{ }
Retrieve the estimated end-to-end processing latency of the Channel (measured in milliseconds).
id required | number <int32> (channel_id) >= 0 The ID of the Channel. |
{- "latency": 134.1
}
Retrieve the properties of all Channels.
ids | Array of numbers <int32> (channel_id) The Channel IDs to query. |
props | Array of strings Items Enum: "source" "pipeline" "usecase" "fps" "latency" The requested properties for each Channel. |
{- "0": {
- "source": 0,
- "pipeline": 0,
- "usecase": "physical-distancing",
- "fps": 24.52,
- "latency": 89.41
}, - "1": {
- "source": 0,
- "pipeline": 1,
- "usecase": null,
- "fps": 14.9,
- "latency": 56.7
}
}
Statistics allows you to inspect Nimble's system-level details such as current CPU and Memory load.