Add Camera Status Poll API

{ "swagger": "2.0", "info": { "version": "2.4.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.4", "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" ] }, "AddStatus": { "type": "string", "description": "Status: status of the addition\\validation of camera:\n * `inProgress` - An unidentified camera was added and validation is in progress\n * `validated` - The camera was validated successfully, but is yet to come online.\n * `added` - The camera was added successfully to the platform after having come online.\n * `failure` - The camera has failed validation, it has not been connected or never came online (already deleted)", "enum": [ "inProgress", "validated", "added", "failure" ] }, "AddSubStatus": { "type": "string", "description": "Sub status: sub status of the addition\\validation of camera. Please contact support if the issue still persists after following the corrective steps.\n * `notConnected` - The camera never connected to the system after being added. Please check the network and internet connection of the camera and reboot it\n * `deviceIdentificationFailed` - The device (brand and model) was not identified. Please try again after rebooting the camera, but if the issue persist the camera model or its firmware might not be compatible.\n * `credentialSetupFailed` - Password lookup in database failed. This should be an intermittent cloud, not camera issue. Please try again later.\n * `credentialValidationFailed` - The credential validation failed. Please factory reset the camera to reset any configured non-default credentials and contact support if the issue still persists.\n * `localUrlValidationFailed` - The local url discovery failed. Please factory reset the camera and try again.\n * `unsupportedModel` - The device is not in the supported whitelist of models.\n * `notOnline` - The camera was validated successfully, but did not come online after re-connection.\n * `none` - No sub status, for eg in the case of a successful addition.", "enum": [ "notConnected", "deviceIdentificationFailed", "credentialValidationFailed", "credentialSetupFailed", "localUrlValidationFailed", "unsupportedModel", "notOnline", "none" ] }, "AddCameraStatus": { "type": "object", "properties": { "cameraId": { "type": "integer", "description": "ID of the respective camera." }, "accountId": { "type": "integer", "description": "ID of the account where the camera is registered." }, "macAddress": { "type": "string", "description": "Mac address of the camera." }, "startTime": { "type": "string", "format": "date-time", "description": "Time when the camera was first added to the system, but not yet validated or connected to" }, "endTime": { "type": "string", "format": "date-time", "description": "Time when the camera finished being added, validated and connected." }, "status": { "$ref": "#/definitions/AddStatus" }, "subStatus": { "$ref": "#/definitions/AddSubStatus" } }, "required": [ "cameraId", "accountId", "macAddress", "startTime", "status", "subStatus" ] } }, "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" } }, "timeout": { "description": "Your request has timed out.", "schema": { "$ref": "#/definitions/Error" } } }, "parameters": { "cameraId": { "name": "cameraId", "in": "path", "description": "ID of the camera.", "required": true, "type": "integer" } }, "paths": { "/cameras/{cameraId}/additionStatus/poll": { "get": { "summary": "Wait for camera status to change to a terminal state (added or failure).", "description": "Response to this request will be returned as soon as status is changed to added or failure, or if it times out after the timeout period of 180 seconds.", "operationId": "pollAddCameraStatus", "parameters": [ { "$ref": "#/parameters/cameraId" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/AddCameraStatus" } }, "400": { "$ref": "#/responses/validationError" }, "401": { "$ref": "#/responses/unauthorized" }, "403": { "$ref": "#/responses/forbidden" }, "404": { "$ref": "#/responses/resourceNotFound" }, "406": { "$ref": "#/responses/notAcceptableError" }, "500": { "$ref": "#/responses/internalServerError" }, "504": { "$ref": "#/responses/timeout" } }, "tags": [ "AddCameraStatusPoll" ] } } } }

swagger-addcamera-status-poll.yaml