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 seven key elements: Activation, Configuration, Source, Sink, Pipeline, Channel, and Stream.
Nimble must be activated with a valid license before a configuration can be deployed.
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.
Activate Nimble with a valid license.
force | boolean Default: false Whether to force re-activation of Nimble even if Nimble is already activated with a valid license. |
The license JSON data.
version required | integer <int32> Version of the license. Value: 1 |
customer required | string Customer ID. |
subscription required | string License Subscription ID. |
pool required | string License Pool ID. |
{- "version": 1,
- "customer": "ABCDEFGHI",
- "subscription": "JKLMNOPQR",
- "pool": "STUVWXYZ"
}
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
}, - {
- "id": 1,
- "type": "video",
- "address": "rtsp://localhost:554/axis-media/media.amp",
- "rate": 25
}
], - "sinks": [
- {
- "id": 0,
- "type": "video",
- "address": "output.mp4",
- "filter": [
- 1
]
}, - {
- "id": 1,
- "type": "zmq",
- "address": "tcp://*:22952",
- "filter": [ ]
}
], - "pipelines": [
- {
- "id": 0,
- "elements": [
- "person-detection-0200:a:0.3:0.3",
- "social-distancing:0.2"
], - "usecase": "physical-distancing",
- "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 |
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"
}
]
{- "code": "syntax",
- "reason": "string"
}
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.
Create a Source in the Configuration.
object Examples:
The preferred response (minimal or full) |
The new Source.
type required | string (type) Enum: "video" "file" "youtube" "zmqinternal" "zmq" "inf" |
required | string or object (address) |
rate | number <float> (rate) > 0 |
{- "type": "video",
- "address": "rtsp://localhost:554/axis-media/media.amp",
- "rate": 25
}
{- "id": 0,
- "type": "video",
- "address": "rtsp://localhost:554/axis-media/media.amp",
- "rate": 25
}
Retrieve all of the information about a Source (by ID) in the Configuration.
id required | integer <int32> (id) >= 0 The ID of the Source. |
{- "id": 0,
- "type": "video",
- "address": "rtsp://localhost:554/axis-media/media.amp",
- "rate": 25
}
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 (type) Enum: "video" "file" "youtube" "zmqinternal" "zmq" "inf" |
required | string or object (address) |
rate | number <float> (rate) > 0 |
{- "type": "file",
- "address": "input.mp4",
- "rate": 30
}
{- "id": 0,
- "type": "file",
- "address": "input.mp4",
- "rate": 30
}
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 (type) Enum: "video" "file" "youtube" "zmqinternal" "zmq" "inf" |
string or object (address) | |
rate | number <float> (rate) > 0 |
{- "type": "file",
- "address": "input.mp4"
}
{- "id": 0,
- "type": "file",
- "address": "input.mp4",
- "rate": 25
}
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 |
{- "code": "reference",
- "reason": "string",
- "value": {
- "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 (sink_type) Enum: "file" "embedding" "zmq" "zmqinternal" "inf" |
address required | string <url> (sink_address) |
filter | Array of integers <int32> (filter) unique [ items <int32 > >= 0 ] A list of sources to include. An empty list indicates no filtering is enabled. |
{- "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 (sink_type) Enum: "file" "embedding" "zmq" "zmqinternal" "inf" |
address required | string <url> (sink_address) |
filter | Array of integers <int32> (filter) unique [ items <int32 > >= 0 ] A list of sources to include. An empty list indicates no filtering is enabled. |
{- "type": "video",
- "address": "output.mp4",
- "filter": [
- 1
]
}
{- "id": 0,
- "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 (sink_type) Enum: "file" "embedding" "zmq" "zmqinternal" "inf" |
address | string <url> (sink_address) |
filter | Array of integers <int32> (filter) unique [ items <int32 > >= 0 ] A list of sources to include. An empty list indicates no filtering is enabled. |
{- "type": "video",
- "address": "output.mp4"
}
{- "id": 0,
- "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 |
{- "code": "reference",
- "reason": "string",
- "value": {
- "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.
{- "elements": [
- {
- "name": "image-resize",
- "paramsSchema": {
- "oneOf": [
- {
- "type": "object",
- "properties": {
- "width": {
- "description": "The target width of the resized image.",
- "type": "integer",
- "exclusiveMinimum": 0
}, - "height": {
- "description": "The target height of the resized image.",
- "type": "integer",
- "exclusiveMinimum": 0
}
}, - "required": [
- "width",
- "height"
]
}, - {
- "type": "object",
- "properties": {
- "scale": {
- "description": "The scale by which to resize the image.",
- "type": "number",
- "exclusiveMinimum": 0
}
}, - "required": [
- "scale"
]
}
]
}, - "passthrough": true
}
], - "models": [
- {
- "name": "detr",
- "platform": "GPU"
}, - {
- "name": "faster_rcnn_inception_v2",
- "platform": "GPU"
}, - {
- "name": "person-detection-large",
- "platform": "CPU"
}, - {
- "name": "person-detection-nano",
- "platform": "CPU"
}
]
}
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"
}
]
Create a Pipeline in the Configuration.
object Examples:
The preferred response (minimal or full) |
The Pipeline.
required | Array of strings or objects (elements) non-empty Sequence of processing stages |
usecase | string (usecase) The high-level description of the analytics performed by the pipeline. |
sources | Array of integers <int32> (sources) [ items <int32 > >= 0 ] IDs of input sources to the pipeline |
sinks | Array of integers <int32> (sinks) [ items <int32 > >= 0 ] IDs of output sinks from the pipeline |
{- "elements": [
- "person-detection-0200:a:0.3:0.3",
- "social-distancing:0.2"
], - "usecase": "physical-distancing",
- "sources": [
- 0,
- 1
], - "sinks": [
- 0,
- 1
]
}
{- "id": 0,
- "elements": [
- "person-detection-0200:a:0.3:0.3",
- "social-distancing:0.2"
], - "usecase": "physical-distancing",
- "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. |
{- "id": 0,
- "elements": [
- "person-detection-0200:a:0.3:0.3",
- "social-distancing:0.2"
], - "usecase": "physical-distancing",
- "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.
required | Array of strings or objects (elements) non-empty Sequence of processing stages |
usecase | string (usecase) The high-level description of the analytics performed by the pipeline. |
sources | Array of integers <int32> (sources) [ items <int32 > >= 0 ] IDs of input sources to the pipeline |
sinks | Array of integers <int32> (sinks) [ items <int32 > >= 0 ] IDs of output sinks from the pipeline |
{- "elements": [
- "person-detection-0200:a:0.3:0.3",
- "social-distancing:0.2"
], - "usecase": "physical-distancing",
- "sources": [
- 0,
- 1
], - "sinks": [
- 0,
- 1
]
}
{- "id": 0,
- "elements": [
- "person-detection-0200:a:0.3:0.3",
- "social-distancing:0.2"
], - "usecase": "physical-distancing",
- "sources": [
- 0,
- 1
], - "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.
Array of strings or objects (elements) non-empty Sequence of processing stages | |
usecase | string (usecase) The high-level description of the analytics performed by the pipeline. |
sources | Array of integers <int32> (sources) [ items <int32 > >= 0 ] IDs of input sources to the pipeline |
sinks | Array of integers <int32> (sinks) [ items <int32 > >= 0 ] IDs of output sinks from the pipeline |
{- "elements": [
- "person-detection-0200:a:0.3:0.3",
- "object-tracking:5:50:20"
], - "sinks": [
- 2,
- 3
]
}
{- "id": 0,
- "elements": [
- "person-detection-0200:a:0.3:0.3",
- "object-tracking:5:50:20"
], - "usecase": "tracing",
- "sources": [
- 0,
- 1
], - "sinks": [
- 2,
- 3
]
}
Delete a Pipeline (by ID) in the Configuration.
id required | integer <int32> (pipeline_id) >= 0 The ID of the Pipeline. |
force | boolean Default: false Whether to force deletion of the Pipeline even if it is connected to a Source or Sink.
If |
{- "code": "reference",
- "reason": "string",
- "value": {
- "sources": [
- 1,
- 3
], - "sinks": [
- 0,
- 1
]
}
}
Retrieve all the runtime statistics for a Pipeline (by ID) in the Configuration.
id required | integer <int32> (pipeline_id) >= 0 The ID of the Pipeline. |
{- "status": "starting",
- "fps": 0,
- "latency": 0
}
Connect 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 connect.
Source ID
[- 0,
- 1,
- 2
]
{- "code": "id",
- "reason": "string",
- "value": {
- "id": "string",
- "sources": [
- 0
]
}
}
Disconnect Sources from a Pipeline (by ID) in the Configuration.
id required | integer <int32> (pipeline_id) >= 0 The ID of the Pipeline. |
The Sources to disconnect.
Source ID
[- 1,
- 2
]
{- "code": "id",
- "reason": "string",
- "value": {
- "id": "string",
- "sources": [
- 0
]
}
}
Connect 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 connect.
Sink ID
[- 1,
- 2
]
{- "code": "id",
- "reason": "string",
- "value": {
- "id": "string",
- "sinks": [
- 0
]
}
}
Disconnect Sinks from a Pipeline (by ID) in the Configuration.
id required | integer <int32> (pipeline_id) >= 0 The ID of the Pipeline. |
The Sinks to disconnect.
Sink ID
[- 2
]
{- "code": "id",
- "reason": "string",
- "value": {
- "id": "string",
- "sinks": [
- 0
]
}
}
Exports allow you to inspect Channel properties such as its current Configuration, processing rate (FPS), and latency.
{- "streams": [
- {
- "id": 0,
- "sources": [
- 0,
- 3
]
}, - {
- "id": 1,
- "sources": [
- 1
]
}
], - "channels": [
- {
- "id": 0,
- "source": 0,
- "pipeline": 0,
- "stream": 0
}, - {
- "id": 1,
- "source": 3,
- "pipeline": 1,
- "stream": 0
}, - {
- "id": 2,
- "source": 2,
- "pipeline": 2,
- "stream": null
}, - {
- "id": 3,
- "source": 1,
- "pipeline": 3,
- "stream": 1
}
]
}
Retrieve the Channel's static metadata.
id required | number <int32> (channel_id) >= 0 The ID of the Channel. |
format | string (formatterWithPass) Default: "pass" Enum: "aws" "megh" "pass" The formatter to use to output the static metadata. |
{ }
Retrieve the properties of all Channels.
ids | Array of numbers <int32> (channel_id) [ items <int32 > >= 0 ] The Channel IDs to query. |
props | Array of strings Items Enum: "source" "pipeline" "stream" "usecase" "static" "fps" "latency" The requested properties for each Channel. |
format | string (formatterWithPass) Default: "pass" Enum: "aws" "megh" "pass" The formatter to use to output the static metadata. |
{- "0": {
- "source": 0,
- "pipeline": 0,
- "stream": 0,
- "usecase": "physical-distancing",
- "static": { },
- "fps": 24.52,
- "latency": 89.41
}, - "1": {
- "source": 0,
- "pipeline": 1,
- "stream": 0,
- "usecase": "line-crossing",
- "static": {
- "lines": {
- "line1": {
- "Name": "Bathroom",
- "Coords": [
- [
- 0.13,
- 0.56
], - [
- 0.23,
- 0.98
]
]
}, - "line2": {
- "Name": "Exit",
- "Coords": [
- [
- 0.87,
- 0.34
], - [
- 0.19,
- 0.38
]
]
}
}
}, - "fps": 14.9,
- "latency": 56.7
}
}
Statistics allows you to inspect Nimble's system-level details such as current CPU and Memory load.