Cloud Subscription 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" ] }, "ResellerAccountSubscription": { "type": "object", "properties": { "subscriptionPackageId": { "type": "integer", "format": "int32", "description": "Identifier of the ongoing subscription package." }, "startDate": { "type": "string", "description": "Subscription start date. Formatting according to ISO 8601's full-date format: yyyy-mm-dd.", "format": "date" }, "endDate": { "type": "string", "description": "Subscription end date. Formatting according to ISO 8601's full-date format: yyyy-mm-dd.", "format": "date" }, "nextSubscriptionPackageId": { "type": "integer", "format": "int32", "description": "Identifier of the subscription package that will become effective from next billing period. Contains value '-1' if the subscription is scheduled for deactivation." } } }, "ResellerAccountSubscriptionUpdate": { "type": "object", "properties": { "nextSubscriptionPackageId": { "type": "integer", "format": "int32", "description": "A subscription package ID from one of those available to the account's reseller. The change will take effect depending on whether this value belongs to a subscription package that represents an upgrade of the current subscription or a downgrade. Upgrade will be effective immediately. Downgrade will be effective from next billing period. This field is ignored if 'deactivate' is True. " }, "deactivate": { "type": "boolean", "default": false, "description": "If True, the current subscription will be scheduled for deactivation, which will be effective at the end of billing period." }, "effectiveToday": { "type": "boolean", "default": false, "description": "If True, the change will become effective immediately. This field's usage is restricted to a platform admin." } } } }, "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" } } }, "parameters": { "resellerId": { "name": "resellerId", "in": "path", "description": "ID of the reseller.", "required": true, "type": "integer" }, "accountId": { "name": "accountId", "in": "path", "description": "ID of the account.", "required": true, "type": "integer" } }, "paths": { "/resellers/{resellerId}/accounts/{accountId}/subscriptions/current": { "get": { "summary": "Get details of the currently active cloud subscription.", "description": "Retrieves the subscription package ID together with the start and end dates. It also retrieves the next subscription package ID. Next subscription package ID is the same if no downgrade is scheduled. Next subscription package ID is different from subscription ID if downgrade is scheduled. Next subscription package ID is -1 if subscription is scheduled for deactivation.", "operationId": "getResellerAccountSubscription", "parameters": [ { "$ref": "#/parameters/resellerId" }, { "$ref": "#/parameters/accountId" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/ResellerAccountSubscription" } }, "401": { "$ref": "#/responses/unauthorized" }, "403": { "$ref": "#/responses/forbidden" }, "404": { "$ref": "#/responses/resourceNotFound" }, "406": { "$ref": "#/responses/notAcceptableError" }, "500": { "$ref": "#/responses/internalServerError" } }, "tags": [ "ResellerAccountSubscription" ] }, "patch": { "summary": "Update a specific cloud subscription.", "description": "Allows to do one of the following changed to the cloud subscription: - upgrade the currently active cloud subscription - downgrade the currently active cloud subscription - undo scheduling of downgrade", "operationId": "updateResellerAccountSubscription", "parameters": [ { "$ref": "#/parameters/resellerId" }, { "$ref": "#/parameters/accountId" }, { "name": "resellerAccountSubscription", "in": "body", "description": "Changes to apply", "schema": { "$ref": "#/definitions/ResellerAccountSubscriptionUpdate" } } ], "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" }, "500": { "$ref": "#/responses/internalServerError" } }, "tags": [ "ResellerAccountSubscription" ] } } } }
Subscription API YAML Specification
swagger-reseller-account-subscription.yaml