Skip to content

CR3533-Archiving the Trim Level Resource proposal #14

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
157 changes: 157 additions & 0 deletions trimlevel.swagger.json
Original file line number Diff line number Diff line change
@@ -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"
]
}
}
}