Camera mode API

{ "swagger": "2.0", "info": { "version": "2.2.0", "title": "Cameramanager API", "description": "RESTful API for the Cameramanager platform." }, "host": "rest.cameramanager.com", "schemes": [ "http", "https" ], "basePath": "/rest/v2.2", "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" ] }, "mode": { "type": "string", "description": "Mode type: Types of modes:\n * `armed` - armed mode\n * `silent` - silent mode\n * `disarmed` - disarmed mode\n * `private` - private mode\n * `custom` - custom mode", "enum": [ "armed", "silent", "disarmed", "private", "custom" ] }, "recordingMode": { "type": "string", "description": "Recording Mode type: Types of recording modes:\n * `continuous` - continuous recording mode\n * `eventBased` - eventBased recording mode", "enum": [ "continuous", "eventBased" ] }, "CameraMode": { "type": "object", "properties": { "cameraId": { "type": "integer", "description": "The id of the camera" }, "mode": { "type": "string", "enum": [ "armed", "silent", "disarmed", "private", "custom" ] }, "previousMode": { "type": "string", "enum": [ "armed", "silent", "disarmed", "private", "custom" ] }, "recordingMode": { "type": "string", "enum": [ "continuous", "eventBased" ] } }, "required": [ "mode", "previousMode", "recordingMode", "cameraId" ] }, "CameraModeUpdate": { "type": "object", "properties": { "mode": { "type": "string", "description": "Indicates the mode of the camera.", "enum": [ "armed", "silent", "disarmed", "private", "custom" ] }, "recordingMode": { "type": "string", "description": "Indicates the recording mode of the camera.", "enum": [ "continuous", "eventBased" ] } } } }, "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" } } }, "parameters": { "cameraId": { "name": "cameraId", "in": "path", "description": "ID of the camera.", "required": true, "type": "integer" }, "cameraIds": { "name": "cameraIds", "in": "query", "description": "list of cameras", "required": true, "type": "array", "items": { "type": "integer" } } }, "paths": { "/cameras/{cameraId}/mode": { "patch": { "summary": "Update the camera mode.", "description": "Change the mode of the camera and the recording mode based on the camera ID.", "operationId": "updateCameraMode", "parameters": [ { "$ref": "#/parameters/cameraId" }, { "name": "targetMode", "in": "body", "required": true, "schema": { "$ref": "#/definitions/CameraModeUpdate" } } ], "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": [ "Camera" ] }, "get": { "summary": "Get the camera mode per camera ID.", "description": "Retrieves the mode of the camera based on the camera ID provided.", "operationId": "getCameraMode", "parameters": [ { "$ref": "#/parameters/cameraId" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/CameraMode" } }, "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": [ "Camera" ] } }, "/cameras/all/mode": { "get": { "summary": "Get the camera mode for all cameras.", "description": "Retrieves the list of all cameras with modes the requesting user has access to. They are returned as a list of CameraMode objects.", "operationId": "getCameraModes", "responses": { "200": { "description": "OK", "schema": { "title": "CameraModes", "type": "array", "items": { "$ref": "#/definitions/CameraMode" } } }, "400": { "$ref": "#/responses/validationError" }, "401": { "$ref": "#/responses/unauthorized" }, "406": { "$ref": "#/responses/notAcceptableError" }, "500": { "$ref": "#/responses/internalServerError" } }, "tags": [ "Camera" ] } } } }

swagger-camera-mode.json