DeviceTypes API

{ "swagger": "2.0", "info": { "version": "2.0.0", "title": "Cameramanager API", "description": "RESTful API for the 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" ] }, "DeviceModelInfo": { "type": "object", "properties": { "brand": { "type": "string", "minLength": 1, "maxLength": 32, "description": "Brand of a specific device." }, "model": { "type": "string", "minLength": 1, "maxLength": 32, "description": "Model of a specific device." } }, "required": [ "brand", "model" ] }, "ApiFamily": { "type": "object", "properties": { "apiFamilyId": { "type": "string", "minLength": 1, "maxLength": 32, "description": "Unique ID of the API family type." } }, "required": [ "apiFamilyId" ] }, "Capabilities": { "type": "object", "description": "Capabilities of a device", "properties": { "microphone": { "type": "boolean", "description": "Supports microphone" }, "speaker": { "type": "boolean", "description": "Supports speaker" }, "wifi": { "type": "boolean", "description": "Supports wifi" }, "disableWifi": { "type": "boolean", "description": "Supports disabling WiFi" }, "forgetWifi": { "type": "boolean", "description": "Supports forget WiFi network" }, "saveMultipleWifi": { "type": "boolean", "description": "Supports storing multiple WiFi networks" }, "panTilt": { "type": "boolean", "description": "Supports pan tilt" }, "zoom": { "type": "boolean", "description": "Supports zoom" }, "provideFirmwareVersion": { "type": "boolean", "description": "Supports providing firmware version" }, "firmwareUpgrade": { "type": "boolean", "description": "Supports firmware upgrade" } }, "required": [ "microphone", "speaker", "wifi", "disableWifi", "forgetWifi", "saveMultipleWifi", "panTilt", "zoom", "provideFirmwareVersion", "firmwareUpgrade" ] }, "DeviceType": { "type": "object", "properties": { "deviceTypeId": { "type": "integer", "description": "Id of the device type in the system." }, "display": { "description": "Brand and model of the device.", "$ref": "#/definitions/DeviceModelInfo" }, "sniffer": { "description": "Brand and model as announced by the device. Only needed for the sniffer. This field is not intended to be shown to the user as the device can announce itself with a very different name from expected and lead the user to a misunderstanding.", "$ref": "#/definitions/DeviceModelInfo" }, "localConnection": { "$ref": "#/definitions/ApiFamily", "description": "General API type to use with the device. That means that with this property our system understands how to communicate with that family of devices." }, "capabilities": { "description": "Capabilities supported by the device.", "$ref": "#/definitions/Capabilities" } }, "required": [ "deviceTypeId", "display" ] } }, "responses": { "unauthorized": { "description": "You are not authenticated. Please authenticate and try again.", "schema": { "$ref": "#/definitions/OAuth2Error" } }, "validationError": { "description": "The supplied object is invalid. Error detail will contain the validation error.", "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" } }, "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" } } }, "parameters": { "includeSniffer": { "name": "includeSniffer", "in": "query", "description": "Include device type information that is relevant to sniffer.", "required": false, "type": "boolean", "default": false }, "includeLocalConnection": { "name": "includeLocalConnection", "in": "query", "description": "Include information that is relevant to perform HTTP requests directly to the device.", "required": false, "type": "boolean", "default": false }, "includeCapabilities": { "name": "includeCapabilities", "in": "query", "description": "Include the capabilities supported by the device type.", "required": false, "type": "boolean", "default": false } }, "paths": { "/deviceTypes": { "get": { "summary": "Get the list of all supported device types.", "description": "Retrieves the list of all supported devices.", "operationId": "getDeviceTypes", "parameters": [ { "$ref": "#/parameters/includeSniffer" }, { "$ref": "#/parameters/includeLocalConnection" }, { "$ref": "#/parameters/includeCapabilities" } ], "responses": { "200": { "description": "OK", "schema": { "title": "DeviceTypes", "type": "array", "items": { "$ref": "#/definitions/DeviceType" } } }, "400": { "$ref": "#/responses/validationError" }, "401": { "$ref": "#/responses/unauthorized" }, "406": { "$ref": "#/responses/notAcceptableError" }, "409": { "$ref": "#/responses/conflict" }, "500": { "$ref": "#/responses/internalServerError" } }, "tags": [ "DeviceType" ] } } } }

swagger-deviceTypes.yaml