Camera detections configuration API

{ "swagger": "2.0", "info": { "version": "2.0.0", "title": "Eagle Eye CameraManager API", "description": "RESTful API for the Eagle Eye CameraManager platform." }, "host": "rest.cameramanager.com", "schemes": [ "http", "https" ], "basePath": "/rest/v2.0", "produces": [ "application/json" ], "definitions": { "Error": { "type": "object", "description": "Generic error response, modelled after RFC 7807.", "properties": { "code": { "type": "integer", "description": "Error code within the system." }, "title": { "type": "string", "description": "This title is not meant to be shown to users and is not guaranteed to stay the same. Please use the code to parse the error." }, "detail": { "type": "string", "description": "Error details, to help developers detect what went wrong." } }, "required": [ "code", "title" ] }, "OAuth2Error": { "type": "object", "description": "Generic OAuth2 error response when there is something wrong with the OAuth2 authentication. Defined at RFC 6749.", "properties": { "error": { "type": "string", "description": "A single ASCII error code conforming the pattern." }, "error_description": { "type": "string", "description": "Human-readable ASCII text providing additional information, used to assist the client developer in understanding the error that occurred." } }, "required": [ "error" ] }, "CameraDetectionCapabilities": { "type": "object", "description": "All detection capabilities of a camera.", "properties": { "audio": { "type": "boolean", "description": "Whether the camera has audio detection capability." }, "videoMotion": { "type": "boolean", "description": "Whether the camera has video motion detection capability." }, "pir": { "type": "boolean", "description": "Whether the camera has PIR detection capability." }, "doorbell": { "type": "boolean", "description": "Whether the camera has a doorbell detection capability." }, "analyticsObjectArea": { "type": "boolean", "description": "Whether the camera has object area detection capability." }, "analyticsObjectTripWire": { "type": "boolean", "description": "Whether the camera has object tripwire detection capability." }, "analyticsPersonArea": { "type": "boolean", "description": "Whether the camera has person area detection capability." }, "analyticsPersonTripWire": { "type": "boolean", "description": "Whether the camera has person tripwire detection capability." } } }, "AudioDetection": { "allOf": [ { "$ref": "#/definitions/DetectionEnabled" } ] }, "VideoMotionDetection": { "allOf": [ { "$ref": "#/definitions/DetectionEnabled" } ] }, "PIRDetection": { "allOf": [ { "$ref": "#/definitions/DetectionEnabled" } ] }, "DoorbellDetection": { "allOf": [ { "$ref": "#/definitions/DetectionEnabled" } ] }, "AnalyticsAreaType": { "type": "string", "description": "Types of Areas", "enum": [ "ObjectInArea", "TripWire" ] }, "Coordinate": { "type": "object", "description": "These are the vertex points of a polygon, equal to the number of edges. The coorindate points are mapped to the image as per below (in order) - top-left - x = 0.0, y = 0.0 ( 0.0, 0.0 ) | bottom-left - x = 0.0, y = 1.0 ( 0.0, 1.0 ) | bottom-right - x = 1.0, y = 1.0 ( 1.0, 1.0 ) | top-right - x = 1.0, y = 0.0 ( 1.0, 0.0 )", "properties": { "x": { "type": "number", "format": "double", "description": "The x-coordinate of the point. This needs to be a value between 0 and 1.", "minimum": 0, "maximum": 1 }, "y": { "type": "number", "format": "double", "description": "The y-coordinate of the point. This needs to be a value between 0 and 1.", "minimum": 0, "maximum": 1 } } }, "Color": { "type": "object", "properties": { "red": { "type": "number", "format": "integer", "description": "The red component of the color.", "minimum": 0, "maximum": 255 }, "green": { "type": "number", "format": "integer", "description": "The green component of the color.", "minimum": 0, "maximum": 255 }, "blue": { "type": "number", "format": "integer", "description": "The blue component of the color.", "minimum": 0, "maximum": 255 } } }, "AreaPartialUpdate": { "type": "object", "properties": { "name": { "type": "string", "description": "Name of the area.", "pattern": "^[a-zA-Z0-9]+$", "minLength": 1, "maxLength": 32 }, "color": { "$ref": "#/definitions/Color" }, "exclude": { "type": "boolean", "description": "If exclude is false, the area specified has to be analysed. If it is true, the area has to be excluded for analysis and rest of the area has to be analysed. This is only applicable for an 'object in area' area and not applicable for a tripwire area" }, "coordinates": { "type": "array", "description": "Set of x and y coordinates of the area.", "items": { "$ref": "#/definitions/Coordinate" } } } }, "AreaUpdate": { "allOf": [ { "$ref": "#/definitions/AreaPartialUpdate" }, { "type": "object", "properties": { "areaType": { "$ref": "#/definitions/AnalyticsAreaType" } } } ] }, "AreaMinimal": { "allOf": [ { "$ref": "#/definitions/AreaUpdate" }, { "type": "object", "properties": { "areaId": { "type": "integer", "description": "ID of the area." } } } ], "required": [ "areaId", "areaType", "coordinates", "color" ] }, "AreaCreate": { "allOf": [ { "$ref": "#/definitions/AreaUpdate" } ], "required": [ "areaType", "coordinates", "color" ] }, "AreaReplace": { "allOf": [ { "$ref": "#/definitions/AreaUpdate" } ], "required": [ "areaType", "coordinates", "color" ] }, "DetectionEnabled": { "type": "object", "properties": { "enabled": { "type": "boolean", "default": false } }, "required": [ "enabled" ] }, "PersonDetectionOnly": { "type": "object", "properties": { "personDetectionOnly": { "type": "boolean", "description": "When enabled, only persons on the area or tripwire will be detected. When disabled, all objects will be detected but not classified.", "default": false } }, "required": [ "personDetectionOnly" ] }, "AnalyticsConfigUpdate": { "type": "object", "description": "Analytics Detection Configuration", "allOf": [ { "$ref": "#/definitions/DetectionEnabled" }, { "$ref": "#/definitions/PersonDetectionOnly" } ] }, "AnalyticsConfig": { "allOf": [ { "$ref": "#/definitions/DetectionEnabled" }, { "$ref": "#/definitions/PersonDetectionOnly" }, { "type": "object", "description": "Analytics Detection Configuration", "properties": { "areas": { "type": "array", "description": "Areas defined for the camera.", "items": { "$ref": "#/definitions/AreaMinimal" } } } } ] } }, "responses": { "resourceNotFound": { "description": "Referenced resource could not be found.", "schema": { "$ref": "#/definitions/Error" } }, "unauthorized": { "description": "You are not authenticated. Please authenticate and try again.", "schema": { "$ref": "#/definitions/OAuth2Error" } }, "forbidden": { "description": "You have no permission to access the specified resource.", "schema": { "$ref": "#/definitions/Error" } }, "validationError": { "description": "The supplied object is invalid. Error detail will contain the validation error.", "schema": { "$ref": "#/definitions/Error" } }, "notAcceptableError": { "description": "The requested resource is capable of generating only content not acceptable according to the Accept headers sent in the request.", "schema": { "$ref": "#/definitions/Error" } }, "internalServerError": { "description": "Something went wrong in the server. Please try again.", "schema": { "$ref": "#/definitions/Error" } }, "unsupportedMediaType": { "description": "The requested resource does not understand the media type sent in the request.", "schema": { "$ref": "#/definitions/Error" } }, "conflict": { "description": "There was a conflict while trying to perform your request. See error details for more information.", "schema": { "$ref": "#/definitions/Error" } } }, "parameters": { "cameraId": { "name": "cameraId", "in": "path", "description": "ID of the camera.", "required": true, "type": "integer" }, "areaId": { "name": "areaId", "in": "path", "description": "ID of the area.", "required": true, "type": "integer" }, "enable": { "name": "enable", "in": "query", "required": true, "type": "boolean" } }, "paths": { "/cameras/{cameraId}/detectors/capabilities": { "get": { "summary": "Get whether the different detection capabilities of a camera are available.", "description": "Get whether the different detection capabilities of a camera are available.", "operationId": "getCameraDetectionCapabilities", "parameters": [ { "$ref": "#/parameters/cameraId" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/CameraDetectionCapabilities" } }, "400": { "$ref": "#/responses/validationError" }, "401": { "$ref": "#/responses/unauthorized" }, "403": { "$ref": "#/responses/forbidden" }, "404": { "$ref": "#/responses/resourceNotFound" }, "406": { "$ref": "#/responses/notAcceptableError" }, "500": { "$ref": "#/responses/internalServerError" } }, "tags": [ "CameraDetectionCapabilities" ] } }, "/cameras/{cameraId}/detectors/audio": { "get": { "summary": "Get audio detection enabled camera attribute.", "description": "Get audio detection enabled camera attribute.", "operationId": "getAudioDetectionEnabled", "parameters": [ { "$ref": "#/parameters/cameraId" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/AudioDetection" } }, "400": { "$ref": "#/responses/validationError" }, "401": { "$ref": "#/responses/unauthorized" }, "403": { "$ref": "#/responses/forbidden" }, "404": { "$ref": "#/responses/resourceNotFound" }, "406": { "$ref": "#/responses/notAcceptableError" }, "500": { "$ref": "#/responses/internalServerError" } }, "tags": [ "AudioDetection" ] }, "put": { "summary": "Set audio detection enabled camera attribute.", "description": "Set audio detection enabled camera attribute.", "operationId": "setAudioDetectionEnabled", "parameters": [ { "$ref": "#/parameters/cameraId" }, { "name": "audio detection", "in": "body", "schema": { "$ref": "#/definitions/AudioDetection" } } ], "responses": { "204": { "description": "No Content" }, "400": { "$ref": "#/responses/validationError" }, "401": { "$ref": "#/responses/unauthorized" }, "403": { "$ref": "#/responses/forbidden" }, "404": { "$ref": "#/responses/resourceNotFound" }, "406": { "$ref": "#/responses/notAcceptableError" }, "409": { "$ref": "#/responses/conflict" }, "415": { "$ref": "#/responses/unsupportedMediaType" }, "500": { "$ref": "#/responses/internalServerError" } }, "tags": [ "AudioDetection" ] } }, "/cameras/{cameraId}/detectors/video": { "get": { "summary": "Get video detection enabled camera attribute.", "description": "Get video detection enabled camera attribute.", "operationId": "getVideoMotionDetectionEnabled", "parameters": [ { "$ref": "#/parameters/cameraId" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/VideoMotionDetection" } }, "400": { "$ref": "#/responses/validationError" }, "401": { "$ref": "#/responses/unauthorized" }, "403": { "$ref": "#/responses/forbidden" }, "404": { "$ref": "#/responses/resourceNotFound" }, "406": { "$ref": "#/responses/notAcceptableError" }, "500": { "$ref": "#/responses/internalServerError" } }, "tags": [ "VideoMotionDetection" ] }, "put": { "summary": "Set video motion detection enabled camera attribute.", "description": "Set video motion detection enabled camera attribute.", "operationId": "setVideoMotionDetectionEnabled", "parameters": [ { "$ref": "#/parameters/cameraId" }, { "name": "video motion detection", "in": "body", "schema": { "$ref": "#/definitions/VideoMotionDetection" } } ], "responses": { "204": { "description": "No Content" }, "400": { "$ref": "#/responses/validationError" }, "401": { "$ref": "#/responses/unauthorized" }, "403": { "$ref": "#/responses/forbidden" }, "404": { "$ref": "#/responses/resourceNotFound" }, "406": { "$ref": "#/responses/notAcceptableError" }, "409": { "$ref": "#/responses/conflict" }, "415": { "$ref": "#/responses/unsupportedMediaType" }, "500": { "$ref": "#/responses/internalServerError" } }, "tags": [ "VideoMotionDetection" ] } }, "/cameras/{cameraId}/detectors/pir": { "get": { "summary": "Get PIR detection enabled camera attribute.", "description": "Get PIR detection enabled camera attribute.", "operationId": "getPIRDetectionEnabled", "parameters": [ { "$ref": "#/parameters/cameraId" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/PIRDetection" } }, "400": { "$ref": "#/responses/validationError" }, "401": { "$ref": "#/responses/unauthorized" }, "403": { "$ref": "#/responses/forbidden" }, "404": { "$ref": "#/responses/resourceNotFound" }, "406": { "$ref": "#/responses/notAcceptableError" }, "500": { "$ref": "#/responses/internalServerError" } }, "tags": [ "PIRDetection" ] }, "put": { "summary": "Set PIR detection enabled camera attribute.", "description": "Set PIR detection enabled camera attribute.", "operationId": "setPIRDetectionEnabled", "parameters": [ { "$ref": "#/parameters/cameraId" }, { "name": "pir detection", "in": "body", "schema": { "$ref": "#/definitions/PIRDetection" } } ], "responses": { "204": { "description": "No Content" }, "400": { "$ref": "#/responses/validationError" }, "401": { "$ref": "#/responses/unauthorized" }, "403": { "$ref": "#/responses/forbidden" }, "404": { "$ref": "#/responses/resourceNotFound" }, "406": { "$ref": "#/responses/notAcceptableError" }, "409": { "$ref": "#/responses/conflict" }, "415": { "$ref": "#/responses/unsupportedMediaType" }, "500": { "$ref": "#/responses/internalServerError" } }, "tags": [ "PIRDetection" ] } }, "/cameras/{cameraId}/detectors/doorbell": { "get": { "summary": "Get doorbell detection enabled camera attribute.", "description": "Get doorbell detection enabled camera attribute.", "operationId": "getDoorbellDetectionEnabled", "parameters": [ { "$ref": "#/parameters/cameraId" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/DoorbellDetection" } }, "400": { "$ref": "#/responses/validationError" }, "401": { "$ref": "#/responses/unauthorized" }, "403": { "$ref": "#/responses/forbidden" }, "404": { "$ref": "#/responses/resourceNotFound" }, "406": { "$ref": "#/responses/notAcceptableError" }, "500": { "$ref": "#/responses/internalServerError" } }, "tags": [ "Doorbell" ] }, "put": { "summary": "Set doorbell detection enabled camera attribute.", "description": "Set doorbell detection enabled camera attribute.", "operationId": "setDoorbellDetectionEnabled", "parameters": [ { "$ref": "#/parameters/cameraId" }, { "name": "doorbell detection", "in": "body", "schema": { "$ref": "#/definitions/DoorbellDetection" } } ], "responses": { "204": { "description": "No Content" }, "400": { "$ref": "#/responses/validationError" }, "401": { "$ref": "#/responses/unauthorized" }, "403": { "$ref": "#/responses/forbidden" }, "404": { "$ref": "#/responses/resourceNotFound" }, "406": { "$ref": "#/responses/notAcceptableError" }, "409": { "$ref": "#/responses/conflict" }, "415": { "$ref": "#/responses/unsupportedMediaType" }, "500": { "$ref": "#/responses/internalServerError" } }, "tags": [ "Doorbell" ] } }, "/cameras/{cameraId}/detectors/analytics": { "get": { "summary": "Get video analytics settings for the camera.", "description": "Get video analytics settings for the camera. These include both the area and non-area settings.", "operationId": "getVideoAnalyticsSettings", "parameters": [ { "$ref": "#/parameters/cameraId" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/AnalyticsConfig" } }, "400": { "$ref": "#/responses/validationError" }, "401": { "$ref": "#/responses/unauthorized" }, "403": { "$ref": "#/responses/forbidden" }, "404": { "$ref": "#/responses/resourceNotFound" }, "406": { "$ref": "#/responses/notAcceptableError" }, "500": { "$ref": "#/responses/internalServerError" } }, "tags": [ "VideoAnalytics" ] }, "put": { "summary": "Update video analytics settings of the camera.", "description": "Update video analytics settings of the camera. Only the non-area settings can be updated using this method.", "operationId": "setVideoAnalyticsSettings", "parameters": [ { "$ref": "#/parameters/cameraId" }, { "name": "analyticsDetectionUpdate", "in": "body", "schema": { "$ref": "#/definitions/AnalyticsConfigUpdate" } } ], "responses": { "204": { "description": "No Content" }, "400": { "$ref": "#/responses/validationError" }, "401": { "$ref": "#/responses/unauthorized" }, "403": { "$ref": "#/responses/forbidden" }, "404": { "$ref": "#/responses/resourceNotFound" }, "406": { "$ref": "#/responses/notAcceptableError" }, "415": { "$ref": "#/responses/unsupportedMediaType" }, "500": { "$ref": "#/responses/internalServerError" } }, "tags": [ "VideoAnalytics" ] } }, "/cameras/{cameraId}/detectors/analytics/areas": { "post": { "summary": "Add a new area for the camera", "description": "Add a new object in area \\ tripwire area for the camera. For an onject in area area, we need to provide atleast 3 coordinate points. For a trip-wire area, we need to provide atleast 2 coordinate points. A maximum of 10 areas can be created.", "operationId": "addVideoAnalyticsArea", "parameters": [ { "$ref": "#/parameters/cameraId" }, { "name": "AreaCreate", "in": "body", "required": true, "schema": { "$ref": "#/definitions/AreaCreate" } } ], "consumes": [ "application/json" ], "responses": { "201": { "description": "Created", "schema": { "$ref": "#/definitions/AreaMinimal" } }, "400": { "$ref": "#/responses/validationError" }, "401": { "$ref": "#/responses/unauthorized" }, "403": { "$ref": "#/responses/forbidden" }, "404": { "$ref": "#/responses/resourceNotFound" }, "406": { "$ref": "#/responses/notAcceptableError" }, "409": { "$ref": "#/responses/conflict" }, "415": { "$ref": "#/responses/unsupportedMediaType" }, "500": { "$ref": "#/responses/internalServerError" } }, "tags": [ "VideoAnalytics" ] } }, "/cameras/{cameraId}/detectors/analytics/areas/{areaId}": { "put": { "summary": "Update an area for the camera", "description": "Update an area for the camera defined by the area id", "operationId": "updateVideoAnalyticsArea", "parameters": [ { "$ref": "#/parameters/cameraId" }, { "$ref": "#/parameters/areaId" }, { "name": "AreaReplace", "in": "body", "schema": { "$ref": "#/definitions/AreaReplace" } } ], "responses": { "204": { "description": "No Content" }, "400": { "$ref": "#/responses/validationError" }, "401": { "$ref": "#/responses/unauthorized" }, "403": { "$ref": "#/responses/forbidden" }, "404": { "$ref": "#/responses/resourceNotFound" }, "406": { "$ref": "#/responses/notAcceptableError" }, "415": { "$ref": "#/responses/unsupportedMediaType" }, "500": { "$ref": "#/responses/internalServerError" } }, "tags": [ "VideoAnalytics" ] }, "patch": { "summary": "Partially update an area for the camera", "description": "Partially update an area for the camera defined by the area id=", "operationId": "partialUpdateVideoAnalyticsArea", "parameters": [ { "$ref": "#/parameters/cameraId" }, { "$ref": "#/parameters/areaId" }, { "name": "AreaPartialUpdate", "in": "body", "schema": { "$ref": "#/definitions/AreaPartialUpdate" } } ], "responses": { "204": { "description": "No Content" }, "400": { "$ref": "#/responses/validationError" }, "401": { "$ref": "#/responses/unauthorized" }, "403": { "$ref": "#/responses/forbidden" }, "404": { "$ref": "#/responses/resourceNotFound" }, "406": { "$ref": "#/responses/notAcceptableError" }, "415": { "$ref": "#/responses/unsupportedMediaType" }, "500": { "$ref": "#/responses/internalServerError" } }, "tags": [ "VideoAnalytics" ] }, "delete": { "summary": "Delete an area for the camera", "description": "Delete an area defined by the area id. At least one area must be defined for a camera, which cannot be deleted.", "operationId": "deleteVideoAnalyticsArea", "parameters": [ { "$ref": "#/parameters/cameraId" }, { "$ref": "#/parameters/areaId" } ], "responses": { "204": { "description": "No Content" }, "400": { "$ref": "#/responses/validationError" }, "401": { "$ref": "#/responses/unauthorized" }, "403": { "$ref": "#/responses/forbidden" }, "404": { "$ref": "#/responses/resourceNotFound" }, "406": { "$ref": "#/responses/notAcceptableError" }, "409": { "$ref": "#/responses/conflict" }, "415": { "$ref": "#/responses/unsupportedMediaType" }, "500": { "$ref": "#/responses/internalServerError" } }, "tags": [ "VideoAnalytics" ] } } } }

swagger-camera-detectors.yaml