Body
Media type: application/json
Type:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"description": "Register a new resource or update an existing resource",
"title": "Resource registration",
"required": [
"max_update_rate_ms",
"persist",
"resource_path",
"params"
],
"properties": {
"max_update_rate_ms": {
"description": "Rate limiting for messages. Sets the minimum interval between consecutive websocket messages",
"type": "integer",
"default": 100
},
"persist": {
"description": "Whether to destroy the socket when the final client disconnects",
"type": "boolean",
"default": false
},
"resource_path": {
"description": "HTTP resource path in the query API which this subscription relates to",
"type": "string",
"enum": ["/nodes", "/devices", "/sources", "/flows", "/senders", "/receivers"]
},
"params": {
"description": "Object containing attributes to filter the resource on as per the Query Parameters specification. Can be empty.",
"type": "object"
}
}
}
Example:
{
"max_update_rate_ms": 100,
"resource_path": "/nodes",
"params": {
"label": "host1"
},
"persist": false
}
HTTP status code 200
Body
Media type: application/json
Type:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"description": "A single subscription resource registered with a Query API",
"title": "Subscription resource",
"required": [
"id",
"ws_href",
"max_update_rate_ms",
"persist",
"resource_path",
"params"
],
"properties": {
"id": {
"description": "Globally unique identifier for the subscription",
"type": "string",
"pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$"
},
"ws_href": {
"description": "Address to connect to for the websocket subscription",
"type": "string",
"format": "uri"
},
"max_update_rate_ms": {
"description": "Rate limiting for messages. Sets the minimum interval between consecutive websocket messages",
"type": "integer",
"default": 100
},
"persist": {
"description": "Whether to destroy the socket when the final client disconnects",
"type": "boolean",
"default": false
},
"resource_path": {
"description": "HTTP resource path in the query API which this subscription relates to",
"type": "string",
"enum": ["/nodes", "/devices", "/sources", "/flows", "/senders", "/receivers"]
},
"params": {
"description": "Object containing attributes to filter the resource on as per the Query Parameters specification. Can be empty.",
"type": "object"
}
}
}
Example:
{
"max_update_rate_ms": 100,
"resource_path": "/nodes",
"params": {
"label": "host1"
},
"persist": false,
"ws_href": "ws://172.29.80.52:8870/ws/?uid=7c903667-7113-4a8f-8865-1c63f9070a9e",
"id": "7c903667-7113-4a8f-8865-1c63f9070a9e"
}
HTTP status code 201
Body
Media type: application/json
Type:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"description": "A single subscription resource registered with a Query API",
"title": "Subscription resource",
"required": [
"id",
"ws_href",
"max_update_rate_ms",
"persist",
"resource_path",
"params"
],
"properties": {
"id": {
"description": "Globally unique identifier for the subscription",
"type": "string",
"pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$"
},
"ws_href": {
"description": "Address to connect to for the websocket subscription",
"type": "string",
"format": "uri"
},
"max_update_rate_ms": {
"description": "Rate limiting for messages. Sets the minimum interval between consecutive websocket messages",
"type": "integer",
"default": 100
},
"persist": {
"description": "Whether to destroy the socket when the final client disconnects",
"type": "boolean",
"default": false
},
"resource_path": {
"description": "HTTP resource path in the query API which this subscription relates to",
"type": "string",
"enum": ["/nodes", "/devices", "/sources", "/flows", "/senders", "/receivers"]
},
"params": {
"description": "Object containing attributes to filter the resource on as per the Query Parameters specification. Can be empty.",
"type": "object"
}
}
}
Example:
{
"max_update_rate_ms": 100,
"resource_path": "/nodes",
"params": {
"label": "host1"
},
"persist": false,
"ws_href": "ws://172.29.80.52:8870/ws/?uid=7c903667-7113-4a8f-8865-1c63f9070a9e",
"id": "7c903667-7113-4a8f-8865-1c63f9070a9e"
}
HTTP status code 400
Returned when the POST request is incorrectly formatted or missing mandatory attributes
Body
Media type: application/json
Type: json
Content:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"description": "Describes the standard error response which is returned with HTTP codes 400 and above",
"title": "Error response",
"required": [
"code",
"error",
"debug"
],
"properties": {
"code": {
"description": "HTTP error code",
"type": "integer",
"minimum": 400,
"maximum": 599
},
"error": {
"description": "Human readable message which is suitable for user interface display, and helpful to the user",
"type": "string"
},
"debug": {
"description": "Debug information which may assist a programmer working with the API",
"type": ["null", "string"]
}
}
}