Nimble REST API (v1)

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.

What is a REST API?

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.

The Key Elements of Nimble

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.

Configuration

Nimble is controlled by a Configuration. A Configuration is a collection of Sources, Sinks and Pipeline Elements arranged to execute the desired analytic behaviour.

Fetch the Configuration

Retrieve the Configuration from Nimble.

Responses

Response samples

Content type
application/json
{
  • "sources": [
    ],
  • "sinks": [
    ],
  • "pipelines": [
    ]
}

Deploy a Configuration

Deploy a Configuration to Nimble.

Request Body schema: application/json

The new Configuration in list-based format, see config.yaml.

Array
required
Array of objects non-empty [ items ]
Array of objects[ items ]
Array of strings or objects non-empty [ items ]
string or null

Responses

Request samples

Content type
application/json
Example

Deployment with short-form pipeline elements

[
  • {
    }
]

Source

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.

Fetch all Sources

Retrieve all Sources in the Configuration.

Responses

Response samples

Content type
application/json
[
  • {
    },
  • {
    }
]

Create a Source

Create a Source in the Configuration.

header Parameters
object
Examples:
  • return=minimal - Request minimal response (ID only)
  • return=representation - Request full representational response

The preferred response (minimal or full)

Request Body schema: application/json

The new Source.

type
required
string (type)
Enum: "video" "file" "youtube" "zmqinternal" "zmq" "inf"
required
string or object (address)
rate
number <float> (rate) > 0

Responses

Request samples

Content type
application/json
{
  • "type": "video",
  • "address": "rtsp://localhost:554/axis-media/media.amp",
  • "rate": 25
}

Response samples

Content type
application/json
{
  • "id": 0,
  • "type": "video",
  • "address": "rtsp://localhost:554/axis-media/media.amp",
  • "rate": 25
}

Fetch a Sources information

Retrieve all of the information about a Source (by ID) in the Configuration.

path Parameters
id
required
integer <int32> (id) >= 0

The ID of the Source.

Responses

Response samples

Content type
application/json
{
  • "type": "video",
  • "address": "rtsp://localhost:554/axis-media/media.amp",
  • "rate": 25
}

Update a Source

Update a Source (by ID) in the Configuration.

path Parameters
id
required
integer <int32> (id) >= 0

The ID of the Source.

header Parameters
object
Examples:
  • return=minimal - Request minimal response (ID only)
  • return=representation - Request full representational response

The preferred response (minimal or full)

Request Body schema: application/json

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

Responses

Request samples

Content type
application/json
{
  • "type": "file",
  • "address": "input.mp4",
  • "rate": 30
}

Response samples

Content type
application/json
{
  • "type": "file",
  • "address": "input.mp4",
  • "rate": 30
}

Modify a Source

Modify a Source (by ID) in the Configuration.
JSON merge patch (RFC7386) is used to apply the modifications to the Source's information.

path Parameters
id
required
integer <int32> (id) >= 0

The ID of the Source.

header Parameters
object
Examples:
  • return=minimal - Request minimal response (ID only)
  • return=representation - Request full representational response

The preferred response (minimal or full)

Request Body schema: application/merge-patch+json

The Source's information

type
string (type)
Enum: "video" "file" "youtube" "zmqinternal" "zmq" "inf"
string or object (address)
rate
number <float> (rate) > 0

Responses

Request samples

Content type
application/merge-patch+json
{
  • "type": "file",
  • "address": "input.mp4"
}

Response samples

Content type
application/json
{
  • "type": "file",
  • "address": "input.mp4",
  • "rate": 25
}

Delete a Source

Delete a Source (by ID) in the Configuration.

path Parameters
id
required
integer <int32> (id) >= 0

The ID of the Source.

query Parameters
force
boolean
Default: false

Whether to force deletion of the Source even if it is being referenced by a Pipeline. If true, the Source will be automatically removed from any Pipelines that reference it.

Responses

Response samples

Content type
application/json
{
  • "pipelines": [
    ]
}

Fetch a Sources statistics

Retrieve all the runtime statistics for a Source (by ID) in the Configuration.

path Parameters
id
required
integer <int32> (id) >= 0

The ID of the Source.

Responses

Response samples

Content type
application/json
{
  • "status": "starting",
  • "fps": 0,
  • "latency": 0
}

Sink

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.

Fetch all Sinks

Retrieve all Sinks in the Configuration.

Responses

Response samples

Content type
application/json
[
  • {
    },
  • {
    }
]

Create a Sink

Create a Sink in the Configuration.

header Parameters
object
Examples:
  • return=minimal - Request minimal response (ID only)
  • return=representation - Request full representational response

The preferred response (minimal or full)

Request Body schema: application/json

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.

Responses

Request samples

Content type
application/json
{
  • "type": "video",
  • "address": "output.mp4"
}

Response samples

Content type
application/json
{
  • "id": 0,
  • "type": "video",
  • "address": "output.mp4",
  • "filter": [ ]
}

Fetch a Sinks information

Retrieve all of the information about a Sink (by ID) in the Configuration.

path Parameters
id
required
integer <int32> (sink_id) >= 0

The ID of the Sink.

Responses

Response samples

Content type
application/json
{
  • "type": "zmq",
  • "address": "tcp://*:22952",
  • "filter": [ ]
}

Update a Sink

Update a Sink (by ID) in the Configuration.

path Parameters
id
required
integer <int32> (sink_id) >= 0

The ID of the Sink.

header Parameters
object
Examples:
  • return=minimal - Request minimal response (ID only)
  • return=representation - Request full representational response

The preferred response (minimal or full)

Request Body schema: application/json

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.

Responses

Request samples

Content type
application/json
{
  • "type": "video",
  • "address": "output.mp4",
  • "filter": [
    ]
}

Response samples

Content type
application/json
{
  • "type": "video",
  • "address": "output.mp4",
  • "filter": [
    ]
}

Modify a Sink

Modify a Sink (by ID) in the Configuration.
JSON merge patch (RFC7386) is used to apply the modifications to the Sink's information.

path Parameters
id
required
integer <int32> (sink_id) >= 0

The ID of the Sink.

header Parameters
object
Examples:
  • return=minimal - Request minimal response (ID only)
  • return=representation - Request full representational response

The preferred response (minimal or full)

Request Body schema: application/merge-patch+json

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.

Responses

Request samples

Content type
application/merge-patch+json
{
  • "type": "video",
  • "address": "output.mp4"
}

Response samples

Content type
application/json
{
  • "type": "video",
  • "address": "output.mp4",
  • "filter": [ ]
}

Delete a Sink

Delete a Sink (by ID) in the Configuration.

path Parameters
id
required
integer <int32> (sink_id) >= 0

The ID of the Sink.

query Parameters
force
boolean
Default: false

Whether to force deletion of the Sink even if it is being referenced by a Pipeline. If true, the Sink will be automatically removed from any Pipelines that reference it.

Responses

Response samples

Content type
application/json
{
  • "pipelines": [
    ]
}

Fetch a Sinks statistics

Retrieve all the runtime statistics for a Sink (by ID) in the Configuration.

path Parameters
id
required
integer <int32> (sink_id) >= 0

The ID of the Sink.

Responses

Response samples

Content type
application/json
{
  • "status": "starting",
  • "fps": 0,
  • "latency": 0
}

Pipeline

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.

Fetch all Pipelines

Retrieve all Pipelines in the Configuration.

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Fetch available elements

Retrieve all pipeline elements and models that are available from Nimble.

query Parameters
type
Array of strings
Items Enum: "element" "model"

The element type filter to apply.

Responses

Response samples

Content type
application/json
[
  • {
    },
  • {
    },
  • {
    },
  • {
    },
  • {
    },
  • {
    },
  • {
    },
  • {
    }
]

Create a Pipeline

Create a Pipeline in the Configuration.

header Parameters
object
Examples:
  • return=minimal - Request minimal response (ID only)
  • return=representation - Request full representational response

The preferred response (minimal or full)

Request Body schema: application/json

The Pipeline.

required
Array of strings or objects (elements) non-empty [ items ]

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

Responses

Request samples

Content type
application/json
Example
{
  • "elements": [
    ],
  • "usecase": "physical-distancing",
  • "sources": [
    ],
  • "sinks": [
    ]
}

Response samples

Content type
application/json
Example
{
  • "id": 0,
  • "elements": [
    ],
  • "usecase": "physical-distancing",
  • "sources": [
    ],
  • "sinks": [
    ]
}

Fetch a Pipelines information

Get information about a Pipeline (by ID) in the Configuration.

path Parameters
id
required
integer <int32> (pipeline_id) >= 0

The ID of the Pipeline.

Responses

Response samples

Content type
application/json
{
  • "elements": [
    ],
  • "usecase": "physical-distancing",
  • "sources": [
    ],
  • "sinks": [
    ]
}

Update a Pipeline

Update a Pipeline (by ID) in the Configuration.

path Parameters
id
required
integer <int32> (pipeline_id) >= 0

The ID of the Pipeline.

header Parameters
object
Examples:
  • return=minimal - Request minimal response (ID only)
  • return=representation - Request full representational response

The preferred response (minimal or full)

Request Body schema: application/json

The Pipeline information.

required
Array of strings or objects (elements) non-empty [ items ]

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

Responses

Request samples

Content type
application/json
Example
{
  • "elements": [
    ],
  • "usecase": "physical-distancing",
  • "sources": [
    ],
  • "sinks": [
    ]
}

Response samples

Content type
application/json
Example
{
  • "id": 0,
  • "elements": [
    ],
  • "usecase": "physical-distancing",
  • "sources": [
    ],
  • "sinks": [
    ]
}

Modify a Pipeline

Modify a Pipeline (by ID) in the Configuration.

path Parameters
id
required
integer <int32> (pipeline_id) >= 0

The ID of the Pipeline.

header Parameters
object
Examples:
  • return=minimal - Request minimal response (ID only)
  • return=representation - Request full representational response

The preferred response (minimal or full)

Request Body schema: application/merge-patch+json

The Pipeline information.

Array of strings or objects (elements) non-empty [ items ]

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

Responses

Request samples

Content type
application/merge-patch+json
{
  • "elements": [
    ],
  • "sinks": [
    ]
}

Response samples

Content type
application/json
{
  • "elements": [
    ],
  • "usecase": "tracing",
  • "sources": [
    ],
  • "sinks": [
    ]
}

Delete a pipeline

Delete a Pipeline (by ID) in the Configuration.

path Parameters
id
required
integer <int32> (pipeline_id) >= 0

The ID of the Pipeline.

query Parameters
force
boolean
Default: false

Whether to force deletion of the Pipeline even if it is connected to a Source or Sink. If true, the Pipeline will be automatically disconnected from any Sources or Sinks.

Responses

Response samples

Content type
application/json
{
  • "sources": [
    ],
  • "sinks": [
    ]
}

Fetch a Pipelines statistics

Retrieve all the runtime statistics for a Pipeline (by ID) in the Configuration.

path Parameters
id
required
integer <int32> (pipeline_id) >= 0

The ID of the Pipeline.

Responses

Response samples

Content type
application/json
{
  • "status": "starting",
  • "fps": 0,
  • "latency": 0
}

Add Sources to Pipeline

Connect Sources as input to a Pipeline (by ID) in the Configuration.

path Parameters
id
required
integer <int32> (pipeline_id) >= 0

The ID of the Pipeline.

Request Body schema: application/json

The Sources to connect.

Array (non-empty)
integer <int32> (id) >= 0

Source ID

Responses

Request samples

Content type
application/json
[
  • 0,
  • 1,
  • 2
]

Remove Source from Pipeline

Disconnect Sources from a Pipeline (by ID) in the Configuration.

path Parameters
id
required
integer <int32> (pipeline_id) >= 0

The ID of the Pipeline.

Request Body schema: application/json

The Sources to disconnect.

Array (non-empty)
integer <int32> (id) >= 0

Source ID

Responses

Request samples

Content type
application/json
[
  • 1,
  • 2
]

Add Sinks to a Pipeline

Connect Sinks as output to a Pipeline (by ID) in the Configuration.

path Parameters
id
required
integer <int32> (pipeline_id) >= 0

The ID of the Pipeline.

Request Body schema: application/json

The Sinks to connect.

Array (non-empty)
integer <int32> (sink_id) >= 0

Sink ID

Responses

Request samples

Content type
application/json
[
  • 1,
  • 2
]

Remove Sinks from Pipeline

Disconnect Sinks from a Pipeline (by ID) in the Configuration.

path Parameters
id
required
integer <int32> (pipeline_id) >= 0

The ID of the Pipeline.

Request Body schema: application/json

The Sinks to disconnect.

Array (non-empty)
integer <int32> (sink_id) >= 0

Sink ID

Responses

Request samples

Content type
application/json
[
  • 2
]

Exports

Exports allow you to inspect Channel properties such as its current Configuration, processing rate (FPS), and latency.

Fetch Channels and Streams

Retrieve the Channels and Streams from the Configuration.

Responses

Response samples

Content type
application/json
{
  • "streams": [
    ],
  • "channels": [
    ]
}

Fetch a Channel's information

Retrieve all of the information about a Channel (by ID).

path Parameters
id
required
number <int32> (channel_id) >= 0

The ID of the Channel.

Responses

Response samples

Content type
application/json
{
  • "source": 0,
  • "pipeline": 0,
  • "stream": null
}

Fetch a Channel's static metadata

Retrieve the Channel's static metadata.

path Parameters
id
required
number <int32> (channel_id) >= 0

The ID of the Channel.

query Parameters
format
string (formatterWithPass)
Default: "pass"
Enum: "aws" "megh" "pass"

The formatter to use to output the static metadata.

Responses

Response samples

Content type
application/json
Example
{ }

Fetch a Channel's FPS

Retrieve the estimated processing frame rate of the Channel (measured in frames per second).

path Parameters
id
required
number <int32> (channel_id) >= 0

The ID of the Channel.

Responses

Response samples

Content type
application/json
{
  • "fps": 24.98
}

Fetch a Channel's latency

Retrieve the estimated end-to-end processing latency of the Channel (measured in milliseconds).

path Parameters
id
required
number <int32> (channel_id) >= 0

The ID of the Channel.

Responses

Response samples

Content type
application/json
{
  • "latency": 134.1
}

Fetch all Channel properties

Retrieve the properties of all Channels.

query Parameters
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.

Responses

Response samples

Content type
application/json
{
  • "0": {
    },
  • "1": {
    }
}

Statistics

Statistics allows you to inspect Nimble's system-level details such as current CPU and Memory load.

Fetch all statistics

Retrieve all dynamic statistics of Nimble.

Responses

Response samples

Content type
application/json
{
  • "uptime": 3987.291,
  • "cpu": 7.92,
  • "memory": {
    }
}

Fetch uptime

Retrieve the time since Nimble started (in seconds)

Responses

Response samples

Content type
application/json
{
  • "uptime": 3987.291
}

Fetch CPU usage

Retrieve estimated CPU usage of Nimble over the last minute (measured in virtual cores).

Responses

Response samples

Content type
application/json
{
  • "cpu": 7.92
}

Fetch memory usage

Retrieve estimated memory usage of Nimble (measured in bytes).

Responses

Response samples

Content type
application/json
{
  • "memory": {
    }
}

About

General information about Nimble.

Fetch all information

Retrieve all general information about Nimble.

Responses

Response samples

Content type
application/json
{
  • "version": "0.11",
  • "hostname": "nimble-k8sj1ld",
  • "hash": "c627841eadcb31f12588051183ef996145acfda4fb89d3baaf04242213ce44f3"
}

Fetch version

Fetch the version of Nimble.

Responses

Response samples

Content type
application/json
{
  • "version": "0.11"
}

Fetch hostname

Fetch the hostname of the machine (or container) that Nimble is running on.

Responses

Response samples

Content type
application/json
{
  • "hostname": "nimble-k8sj1ld"
}

Fetch hash

Fetch the randomly-generated hash to uniquely identify the instance of Nimble.

Responses

Response samples

Content type
application/json
{
  • "hash": "c627841eadcb31f12588051183ef996145acfda4fb89d3baaf04242213ce44f3"
}