From 3953850b8cdacc2b8bb11d8a1b8c5227b31e1d48 Mon Sep 17 00:00:00 2001 From: Mark Trayer Date: Mon, 20 Dec 2021 12:22:38 -0600 Subject: [PATCH] Archiving the Trim Level Resource proposal --- trimlevel.swagger.json | 157 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 157 insertions(+) create mode 100644 trimlevel.swagger.json diff --git a/trimlevel.swagger.json b/trimlevel.swagger.json new file mode 100644 index 0000000..257c2ab --- /dev/null +++ b/trimlevel.swagger.json @@ -0,0 +1,157 @@ +{ + "swagger": "2.0", + "info": { + "title": "Trim level", + "description": "This Resource describes the Properties associated with the minimum and maximum values of a Property.\nIf this resource is used, then the values for a Property can not be lower or higher than what's defined by the trim level.\nThis resource is writeable, meaning the client can dynamically change the minimum or maximum value of a property.\nIf a range property is specified, the most restrictive boundaries are used, between trimlevel and range.", + "version": "2021-12-20", + "license": { + "name": "OCF Data Model License", + "url": "https://github.com/openconnectivityfoundation/core/blob/e28a9e0a92e17042ba3e83661e4c0fbce8bdc4ba/LICENSE.md", + "x-copyright": "copyright 2021 Open Connectivity Foundation, Inc. All rights reserved." + }, + "termsOfService": "https://openconnectivityfoundation.github.io/core/DISCLAIMER.md" + }, + "schemes": [ + "http" + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "paths": { + "/Trimlevel": { + "get": { + "description": "Gets the current trim level values.", + "parameters": [ + { + "$ref": "#/parameters/interface" + } + ], + "responses": { + "200": { + "description": "", + "x-example": { + "rt": [ + "oic.r.trimlevel" + ], + "if": [ + "oic.if.rw", + "oic.if.baseline" + ], + "trimlow": 20, + "trimhigh": 80 + }, + "schema": { + "$ref": "#/definitions/Trimlevel" + } + } + } + }, + "post": { + "description": "Sets the desired trim level values.", + "parameters": [ + { + "$ref": "#/parameters/interface" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/Trimlevel" + }, + "x-example": { + "trimlow": 30.0, + "trimhigh": 70.0 + } + } + ], + "responses": { + "200": { + "description": "Indicates that the trim level values were changed.\nThe new trim level values are provided in the response.", + "x-example": { + "rt": [ + "oic.r.trimlevel" + ], + "if": [ + "oic.if.rw", + "oic.if.baseline" + ], + "trimlow": 30.0, + "trimhigh": 70.0 + }, + "schema": { + "$ref": "#/definitions/Trimlevel" + } + } + } + } + } + }, + "parameters": { + "interface": { + "in": "query", + "name": "if", + "type": "string", + "enum": [ + "oic.if.rw", + "oic.if.baseline" + ] + } + }, + "definitions": { + "Trimlevel": { + "properties": { + "trimlow": { + "type": "number", + "description": "Minimum value for the trim level." + }, + "trimhigh": { + "type": "number", + "description": "Maximum value for the trim level." + }, + "trimrange": { + "$ref": "https://openconnectivityfoundation.github.io/IoTDataModels/oic.baseresource.properties-schema.json#/definitions/range_number" + }, + "trimstep": { + "$ref": "https://openconnectivityfoundation.github.io/IoTDataModels/oic.baseresource.properties-schema.json#/definitions/step_number" + }, + "if": { + "description": "The OCF Interface set supported by this Resource", + "type": "array", + "minItems": 2, + "uniqueItems": true, + "readOnly": true, + "items": { + "type": "string", + "maxLength": 64, + "enum": [ + "oic.if.rw", + "oic.if.baseline" + ] + } + }, + "rt": { + "description": "Resource Type.", + "type": "array", + "minItems": 1, + "uniqueItems": true, + "readOnly": true, + "items": { + "type": "string", + "maxLength": 64, + "enum": [ + "oic.r.trimlevel" + ] + } + } + }, + "type": "object", + "required": [ + "trimlow", "trimhigh" + ] + } + } +}