diff --git a/DISCLAIMER.md b/DISCLAIMER.md new file mode 100644 index 0000000..4e81410 --- /dev/null +++ b/DISCLAIMER.md @@ -0,0 +1 @@ +THIS SOFTWARE IS PROVIDED BY THE OPEN CONNECTIVITY FOUNDATION, INC. "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE OR WARRANTIES OF NON-INFRINGEMENT, ARE DISCLAIMED. IN NO EVENT SHALL THE OPEN CONNECTIVITY FOUNDATION, INC. OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/LICENSE.md b/LICENSE.md new file mode 100644 index 0000000..0e4811b --- /dev/null +++ b/LICENSE.md @@ -0,0 +1,3 @@ +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: +1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. diff --git a/icon.raml b/icon.raml new file mode 100644 index 0000000..0cb0e92 --- /dev/null +++ b/icon.raml @@ -0,0 +1,43 @@ +#%RAML 0.8 +title: OICIcon +version: v1.1.0-20161107 +documentation: + - title: OCF Copyright + content: Copyright (c) 2016, 2017 Open Connectivity Foundation, Inc. All rights reserved. + - title: OCF License + content: !include LICENSE.md + - title: OCF Disclaimer + content: !include DISCLAIMER.md +schemas: + - Icon: !include schemas/oic.r.icon-schema.json + +traits: + - interface: + queryParameters: + if: + enum: ["oic.if.r","oic.if.baseline"] + +/IconResURI: + description: | + This resource describes the attributes associated with an Icon. + + displayName: Icon + is: [ interface ] # valid for all methods + + get: + description: | + Retrieves the current icon properties. + responses: + 200: + body: + application/json: + schema: Icon + example: | + { + "rt": ["oic.r.icon"], + "id": "unique_example_id", + "mimetype": "image/png", + "width": 256, + "height": 256, + "media": "http://findbetter.ru/public/uploads/1481662800/2043.png" + } diff --git a/introspection-resource.raml b/introspection-resource.raml new file mode 100644 index 0000000..30d2b47 --- /dev/null +++ b/introspection-resource.raml @@ -0,0 +1,290 @@ +#%RAML 0.8 +title: OICIntrospection +version: v1.0.0-20160707 +documentation: + - title: Copyright (c) 2016 Open Connectivity Foundation, Inc. All rights reserved. + content: | + Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE OPEN INTERCONNECT CONSORTIUM, INC. "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE OR WARRANTIES OF NON-INFRINGEMENT, ARE DISCLAIMED. IN NO EVENT SHALL THE OPEN INTERCONNECT CONSORTIUM, INC. OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +traits: + - interface: + queryParameters: + if: + enum: [ "oic.if.r", "oic.if.baseline"] + +schemas: + - oic.wk.introspectionInfo: !include schemas/oic.wk.introspectionInfo.json + +/IntrospectionResURI: + description: | + This resource provides the means to get the device introspection data specifiying all the endpoints of the device. + The url hosted by this resource is either a local or an external url. + + displayName: Introspection Resource + is: [ interface ] # valid for all methods + + get: + responses: + 200: + body: + application/json: + schema: oic.wk.introspectionInfo + example: | + { + "rt" : ["oic.wk.introspection"], + "urlInfo" : [ + { + "content-type" : "application/cbor", + "protocol" : "coap", + "url" : "/IntrospectionExampleURI" + } + ] + } + + +/IntrospectionExampleURL: + description: | + The example is an actual Swagger 2.0 file that would be hosted by the endpoint. + + displayName: Introspection URL Example Swagger 2.0 File + + get: + responses: + 200: + body: + application/json: + example: | + { + "swagger": "2.0", + "info": { + "title": "my_example_device", + "version": "my device version" + }, + "schemes": [ + "http" + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "paths": { + "/switch": { + "get": { + "parameters": [ + { + "name": "if", + "in": "query", + "description": "", + "enum": [ "oic.if.a","oic.if.baseline" ], + "type": "string" + } + ], + "responses": { + "200" : { + "description" : "", + "schema" : { + "$ref": "#/definitions/BinarySwitch" + } + } + } + }, + "post": { + "parameters": [ + { + "name": "if", + "in": "query", + "description": "", + "enum": [ "oic.if.a","oic.if.baseline" ], + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": false, + "schema" : { + "$ref": "#/definitions/BinarySwitch" + } + } + ], + "responses": { + "200" : { + "description" : "", + "schema" : { + "$ref": "#/definitions/BinarySwitch" + } + } + } + } + }, + "/brightness": { + "get": { + "parameters": [ + { + "name": "if", + "in": "query", + "description": "", + "enum": [ "oic.if.a","oic.if.baseline" ], + "type": "string" + } + ], + "responses": { + "200" : { + "description" : "", + "schema" : { + "$ref": "#/definitions/Brightness" + } + } + } + }, + "post": { + "parameters": [ + { + "name": "if", + "in": "query", + "description": "", + "enum": [ "oic.if.a","oic.if.baseline" ], + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": false, + "schema" : { + "$ref": "#/definitions/Brightness" + } + } + ], + "responses": { + "200" : { + "description" : "", + "schema" : { + "$ref": "#/definitions/Brightness" + } + } + } + } + } + }, + "definitions": { + "BinarySwitch": { + "type": "object", + "required": ["id"], + "properties": { + "value": { + "type": "boolean", + "description": "Status of the switch" + }, + "rt": { + "type": "array", + "items" : [ + { + "type" : "string", + "maxLength": 64 + } + ], + "minItems" : 1, + "description": "Resource Type", + "readOnly" : true, + "default" : [ "oic.r.switch.binary" ] + }, + "if": { + "type": "array", + "description": "The interface set supported by this resource", + "readOnly" : true, + "items": { + "type": "string", + "enum": ["oic.if.baseline","oic.if.a"] + } + }, + "p": { + "type": "integer", + "description": "Bitmap indicating observable and discoverable", + "readOnly" : true + }, + "n": { + "type": "string", + "description": "Friendly name of the resource", + "readOnly" : true + }, + "id": { + "type": "string", + "description": "Instance ID of this specific resource", + "readOnly" : true + }, + "range": { + "type": "array", + "description": "The valid range for the value Property", + "readOnly" : true, + "minItems": 2, + "maxItems": 2, + "items": { + "type": "number" + } + } + } + }, + "Brightness": { + "type": "object", + "required": ["id"], + "properties": { + "brighness": { + "type": "integer", + "description": "Current sensed or set value for Brightness" + }, + "rt": { + "type": "array", + "items" : [ + { + "type" : "string", + "maxLength": 64 + } + ], + "minItems" : 1, + "description": "Resource Type", + "readOnly" : true, + "default" : [ "oic.r.light.brightness" ] + }, + "if": { + "type": "array", + "description": "The interface set supported by this resource", + "readOnly" : true, + "items": { + "type": "string", + "enum": ["oic.if.baseline","oic.if.a"] + } + }, + "p": { + "type": "integer", + "description": "Bitmap indicating observable and discoverable", + "readOnly" : true + }, + "n": { + "type": "string", + "description": "Friendly name of the resource", + "readOnly" : true + }, + "id": { + "type": "string", + "description": "Instance ID of this specific resource", + "readOnly" : true + }, + "range": { + "type": "array", + "description": "The valid range for the value Property", + "readOnly" : true, + "minItems": 2, + "maxItems": 2, + "items": { + "type": "number" + } + } + } + } + } + } diff --git a/oic.wk.col.raml b/oic.wk.col.raml new file mode 100644 index 0000000..147f7aa --- /dev/null +++ b/oic.wk.col.raml @@ -0,0 +1,293 @@ +#%RAML 0.8 +#RAML for OIC Collections. +# This is an initial version; has to be converted to a RAML resource type so that it can be used when defining resource that +# are collections. Also needs to use traits to have the same query parameters recognized for all the methods. +title: Collections +version: 1.0 +documentation: + + - title: OCF Copyright + content: Copyright (c) 2016, 2017 Open Connectivity Foundation, Inc. All rights reserved. + - title: OCF License + content: !include LICENSE.md + - title: OCF Disclaimer + content: !include DISCLAIMER.md + - title: OIC Collections + content: | + Collection is an extensions of OIC Resource concept. + In addition to properties, collections also have an + array of OIC web links. + + - title: Introduction + content: | + Collections can be used to group sets of resources, + build structures like topologies, to define a + dependency relationship etc + + - title: Resource Design + content: | + The collection resource is specified as three Base URIs, one + for each interface which is supported by the collection, in addition + to the resource interfaces e.g. oic.if.s, oic.if.rw + + THese three URIs are typically the same URI path, only distinguished + by the different query parameter traits + +schemas: + - sbaseline: !include schemas/oic.collection-schema.json + - sbatch-retrieve: !include schemas/oic.collection.batch-retrieve-schema.json + - sbatch-update: !include schemas/oic.collection.batch-update-schema.json + - slinks: !include schemas/oic.collection.linkslist-schema.json + +traits: + - interface-baseline: + queryParameters: + if: + enum: ["oic.if.baseline"] + + - interface-b: + queryParameters: + if: + enum: ["oic.if.b"] + + - interface-ll: + queryParameters: + if: + enum: ["oic.if.ll"] + + +/CollectionBaselineInterfaceURI: + description: | + OCF Collection Resource Type contains properties and links. + The oic.if.baseline interface exposes a representation of + the links and the properties of the collection resource itself + + + displayName: OCF Collection + is: [ interface-baseline ] + + get: + description: | + Retrieve on Baseline Interface + + responses: + 200: + body: + application/json: + schema: sbaseline + example: | + { + "rt": ["oic.wk.col"], + "id": "unique_example_id", + "rts": [ "oic.r.switch.binary", "oic.r.airflow" ], + "links": [ + { + "href": "switch", + "rt": ["oic.r.switch.binary"], + "if": ["oic.if.a", "oic.if.baseline"], + "eps": [ + {"ep": "coap://[fe80::b1d6]:1111", "pri": 2}, + {"ep": "coaps://[fe80::b1d6]:1122"}, + {"ep": "coap+tcp://[2001:db8:a::123]:2222", "pri": 3} + ] + }, + { + "href": "airFlow", + "rt": ["oic.r.airflow"], + "if": ["oic.if.a", "oic.if.baseline"], + "eps": [ + {"ep": "coap://[fe80::b1d6]:1111", "pri": 2}, + {"ep": "coaps://[fe80::b1d6]:1122"}, + {"ep": "coap+tcp://[2001:db8:a::123]:2222", "pri": 3} + ] + } + ] + } + + + post: + description: | + Update on Baseline Interface + + body: + application/json: + schema: sbaseline + + responses: + 200: + body: + application/json: + schema: sbaseline + + +/CollectionBatchInterfaceURI: + description: | + OCF Collection Resource Type contains properties and links. + The oic.if.b interfacce exposes a composite representation of the + resources pointed to by the links + + displayName: Batch Representation of an OCF COllection + is: [ interface-b ] + + get: + description: | + Retrieve on Batch Interface + + responses: + 200: + description: "All targets returned OK status (HTTP 200 or CoAP 2.05 Content)" + body: + application/json: + schema: sbatch-retrieve + example: | + [ + { + "href": "switch", + "rep": + { + "value": true + } + }, + { + "href": "airFlow", + "rep": + { + "direction": "floor", + "speed": 3 + } + } + ] + 404: + description: "One or more targets did not return an OK status, return a representation containing returned properties from the targets that returned OK" + body: + application/json: + schema: sbatch-retrieve + example: | + [ + { + "href": "switch", + "rep": + { + "value": true + } + } + ] + + post: + description: | + Update on Batch Interface + + body: + application/json: + schema: sbatch-update + example: | + [ + { + "href": "switch", + "rep": + { + "value": true + } + }, + { + "href": "airFlow", + "rep": + { + "direction": "floor", + "speed": 3 + } + } + ] + + responses: + 200: + description: "all targets returned OK status (HTTP 200 or CoAP 2.04 Changed) return a representation of the current state of all targets" + body: + application/json: + schema: sbatch-retrieve + example: | + [ + { + "href": "switch", + "rep": + { + "value": true + } + }, + { + "href": "airFlow", + "rep": + { + "direction": "demist", + "speed": 5 + } + } + ] + + 403: + description: "one or more targets did not return OK status; return a retrieve representation of the current state of all targets in the batch" + body: + application/json: + schema: sbatch-retrieve + example: | + [ + { + "href": "switch", + "rep": + { + "value": true + } + }, + { + "href": "airFlow", + "rep": + { + "direction": "floor", + "speed": 3 + } + } + ] + +/CollectionLinkListInterfaceURI: + description: | + OCF Collection Resource Type contains properties and links. + The oic.if.ll interface exposes a representation of the links + + displayName: Batch Representation of an OCF Collection + is: [ interface-ll ] + + get: + description: | + Retrieve on Link List Interface + + responses: + 200: + body: + application/json: + schema: slinks + example: | + { + "links": + [ + { + "href": "switch", + "rt": ["oic.r.switch.binary"], + "if": ["oic.if.a", "oic.if.baseline"], + "eps": [ + {"ep": "coap://[fe80::b1d6]:1111", "pri": 2}, + {"ep": "coaps://[fe80::b1d6]:1122"}, + {"ep": "coap+tcp://[2001:db8:a::123]:2222", "pri": 3} + ] + }, + { + "href": "airFlow", + "rt": ["oic.r.airflow"], + "if": ["oic.if.a", "oic.if.baseline"], + "eps": [ + {"ep": "coap://[fe80::b1d6]:1111", "pri": 2}, + {"ep": "coaps://[fe80::b1d6]:1122"}, + {"ep": "coap+tcp://[2001:db8:a::123]:2222", "pri": 3} + ] + } + ] + } diff --git a/oic.wk.con.raml b/oic.wk.con.raml new file mode 100755 index 0000000..c9217fa --- /dev/null +++ b/oic.wk.con.raml @@ -0,0 +1,123 @@ +#%RAML 0.8 +title: OIC Configuration +version: v1-20160622 +documentation: + + - title: OCF Copyright + content: Copyright (c) 2016, 2017 Open Connectivity Foundation, Inc. All rights reserved. + - title: OCF License + content: !include LICENSE.md + - title: OCF Disclaimer + content: !include DISCLAIMER.md + + +schemas: + - Configuration: !include schemas/oic.wk.con-schema.json + - Conf_Platform: !include schemas/oic.wk.con.p-schema.json + - Update: !include schemas/oic.wk.con-Update-schema.json + - Update_Platform: !include schemas/oic.wk.con.p-Update-schema.json + +traits: + - interface-all: + queryParameters: + if: + enum: ["oic.if.rw", "oic.if.baseline"] + - interface-rw: + queryParameters: + if: + enum: ["oic.if.rw"] + +/example/oic/con: + displayName: OIC Device Configuration + description: | + Resource that allows for Device specific information to be configured. + + get: + is: ["interface-all"] + description: | + Retrieves the current Device configuration settings + responses: + 200: + body: + application/json: + schema: Configuration + example: | + { + "n": "My Friendly Device Name", + "rt": ["oic.wk.con"], + "loc": [32.777,-96.797], + "locn": "My Location Name", + "c": "USD", + "r": "MyRegion", + "dl": "en" + } + + post: + is: ["interface-rw"] + description: | + Update the information about the Device + body: + application/json: + schema: Update + example: | + { + "n": "Nuevo Nombre Amistoso", + "r": "MyNewRegion", + "ln": [ { "language": "es", "value": "Nuevo Nombre Amistoso" } ], + "dl": "es" + } + responses: + 200: + body: + application/json: + schema: Update + example: | + { + "n": "Nuevo Nombre Amistoso", + "r": "MyNewRegion", + "ln": [ { "language": "es", "value": "Nuevo Nombre Amistoso" } ], + "dl": "es" + } + +/example/oic/con/p: + displayName: OIC Platform Configuration + description: | + Resource that allows for platform specific information to be configured. + + get: + is: ["interface-all"] + description: | + Retrieves the current platform configuration settings + responses: + 200: + body: + application/json: + schema: Conf_Platform + example: | + { + "rt": ["oic.wk.con.p"], + "mnpn": [ { "language": "en", "value": "My Friendly Device Name" } ] + } + + post: + is: ["interface-rw"] + description: | + Update the information about the platform + body: + application/json: + schema: Update_Platform + example: | + { + "n": "Nuevo nombre", + "mnpn": [ { "language": "es", "value": "Nuevo nombre de Plataforma Amigable" } ] + } + responses: + 200: + body: + application/json: + schema: Update_Platform + example: | + { + "n": "Nuevo nombre", + "mnpn": [ { "language": "es", "value": "Nuevo nombre de Plataforma Amigable" } ] + } diff --git a/oic.wk.d.raml b/oic.wk.d.raml new file mode 100755 index 0000000..917b07c --- /dev/null +++ b/oic.wk.d.raml @@ -0,0 +1,44 @@ +#%RAML 0.8 +title: OIC Root Device +version: v1-20160622 +documentation: + + - title: OCF Copyright + content: Copyright (c) 2016 Open Connectivity Foundation, Inc. All rights reserved. + - title: OCF License + content: !include LICENSE.md + - title: OCF Disclaimer + content: !include DISCLAIMER.md + + +schemas: + - Device: !include schemas/oic.wk.d-schema.json +traits: + - interface: + queryParameters: + if: + enum: ["oic.if.r", "oic.if.baseline"] + +/oic/d: + displayName: Device + is: [ interface ] + description: | + Known resource that is hosted by every Server. + Allows for logical device specific information to be discovered. + get: + description: | + Retrieve the information about the Device + responses: + 200: + body: + application/json: + schema: Device + example: | + { + "n": "Device 1", + "rt": ["oic.wk.d"], + "di": "54919CA5-4101-4AE4-595B-353C51AA983C", + "icv": "ocf.1.0.0", + "dmv": "ocf.res.1.0.0, ocf.sh.1.0.0", + "piid": "6F0AAC04-2BB0-468D-B57C-16570A26AE48" + } diff --git a/oic.wk.mnt.raml b/oic.wk.mnt.raml new file mode 100755 index 0000000..45bae8a --- /dev/null +++ b/oic.wk.mnt.raml @@ -0,0 +1,74 @@ +#%RAML 0.8 +title: Maintenance +version: v1-20160622 +documentation: + + - title: OCF Copyright + content: Copyright (c) 2016, 2017 Open Connectivity Foundation, Inc. All rights reserved. + - title: OCF License + content: !include LICENSE.md + - title: OCF Disclaimer + content: !include DISCLAIMER.md + + +schemas: + - MNT: !include schemas/oic.wk.mnt-schema.json +traits: + - interface: + queryParameters: + if: + enum: ["oic.if.rw","oic.if.r","oic.if.baseline"] + +/oic/mnt: + displayName: Maintenance + is: [ interface ] + description: | + The resource through which a Device is maintained and can be used for diagnostic purposes. + fr (Factory Reset) is a boolean. + The value 0 means No action (Default), the value 1 means Start Factory Reset + After factory reset, this value shall be changed back to the default value + rb (Reboot) is a boolean. + The value 0 means No action (Default), the value 1 means Start Reboot + After Reboot, this value shall be changed back to the default value + + get: + description: Retrieve the maintenance action status + queryParameters: + if: + enum: ["oic.if.rw","oic.if.r","oic.if.baseline"] + responses: + 200: + body: + application/json: + schema: MNT + example: | + { + "rt": ["oic.wk.mnt"], + "fr": false, + "rb": false + } + + post: + description: | + Set the maintenance action(s) + queryParameters: + if: + enum: ["oic.if.rw","oic.if.baseline"] + body: + application/json: + schema: MNT + example: | + { + "fr": false, + "rb": false + } + responses: + 200: + body: + application/json: + schema: MNT + example: | + { + "fr": false, + "rb": false + } diff --git a/oic.wk.p.raml b/oic.wk.p.raml new file mode 100755 index 0000000..7b1f09a --- /dev/null +++ b/oic.wk.p.raml @@ -0,0 +1,42 @@ +#%RAML 0.8 +title: Platform +version: v1-20160622 +documentation: + + - title: OCF Copyright + content: Copyright (c) 2016 Open Connectivity Foundation, Inc. All rights reserved. + - title: OCF License + content: !include LICENSE.md + - title: OCF Disclaimer + content: !include DISCLAIMER.md + + +schemas: + - Platform: !include schemas/oic.wk.p-schema.json +traits: + - interface: + queryParameters: + if: + enum: ["oic.if.r", "oic.if.baseline"] + +/oic/p: + displayName: Platform + is: [ interface ] + description: | + Known resource that is defines the platform on which an Server is hosted. + Allows for platform specific information to be discovered. + get: + description: | + Retrieve the information about the Platform + + responses: + 200: + body: + application/json: + schema: Platform + example: | + { + "pi": "54919CA5-4101-4AE4-595B-353C51AA983C", + "rt": ["oic.wk.p"], + "mnmn": "Acme, Inc" + } diff --git a/oic.wk.ping.raml b/oic.wk.ping.raml new file mode 100755 index 0000000..4f63b6b --- /dev/null +++ b/oic.wk.ping.raml @@ -0,0 +1,52 @@ +#%RAML 0.8 +title: Ping +version: v1-20160622 +documentation: + + - title: OCF Copyright + content: Copyright (c) 2016, 2017 Open Connectivity Foundation, Inc. All rights reserved. + - title: OCF License + content: !include LICENSE.md + - title: OCF Disclaimer + content: !include DISCLAIMER.md + + +schemas: + - PING: !include schemas/oic.wk.ping-schema.json +traits: + - interface: + queryParameters: + if: + enum: ["oic.if.rw", "oic.if.baseline"] + +/oic/ping: + displayName: Ping + is: [ interface ] + description: | + The resource using which an Client keeps its Connection with an Server active. + get: + description: Retrieve the ping information + responses: + 200: + body: + application/json: + schema: PING + example: | + { + "rt": ["oic.wk.ping"], + "n": "Ping Information", + "in": 16 + } + post: + description: Update or reset the alive interval + body: + application/json: + schema: PING + example: | + { + "in": 16 + } + + responses: + 203: + description: Successfully updated & restarted alive interval timer. diff --git a/oic.wk.res.raml b/oic.wk.res.raml new file mode 100755 index 0000000..f4abed9 --- /dev/null +++ b/oic.wk.res.raml @@ -0,0 +1,111 @@ +#%RAML 0.8 +title: Discoverable Resources +version: v1-20160622 +documentation: + + - title: OCF Copyright + content: Copyright (c) 2016, 2017 Open Connectivity Foundation, Inc. All rights reserved. + - title: OCF License + content: !include LICENSE.md + - title: OCF Disclaimer + content: !include DISCLAIMER.md + + +schemas: + - sbaseline: !include schemas/oic.wk.res-schema.json + - slinklist: !include schemas/oic.wk.res-schema-ll.json + +traits: + - interface-baseline: + queryParameters: + if: + enum: ["oic.if.baseline"] + + - interface-ll: + queryParameters: + if: + enum: ["oic.if.ll"] + + +/oic-res-baseline-URI: + displayName: Discoverable Resources, baseline interface + is: [ interface-baseline ] + description: | + Baseline representation of /oic/res; list of discoverable resources + get: + description: | + Retrieve the discoverable resource set, baseline interface + + responses: + 200: + body: + application/json: + schema: sbaseline + example: | + [ + { + "rt": ["oic.wk.res"], + "if": ["oic.if.baseline", "oic.if.ll" ], + "links": + [ + { + "href": "/humidity", + "rt": ["oic.r.humidity"], + "if": ["oic.if.s"], + "p": {"bm": 3}, + "eps": [ + {"ep": "coap://[fe80::b1d6]:1111", "pri": 2}, + {"ep": "coaps://[fe80::b1d6]:1122"}, + {"ep": "coap+tcp://[2001:db8:a::123]:2222", "pri": 3} + ] + }, + { + "href": "/temperature", + "rt": ["oic.r.temperature"], + "if": ["oic.if.s"], + "p": {"bm": 3}, + "eps": [ + {"ep": "coap://[[2001:db8:a::123]:2222"} + ] + } + ] + } + ] + +/oic-res-ll-URI: + displayName: Discoverable Resources, link list interface + is: [ interface-ll] + description: | + Link list representation of /oic/res; list of discoverable resources + get: + description: | + Retrieve the discoverable resource set, link list interface + + responses: + 200: + body: + application/json: + schema: slinklist + example: | + [ + { + "href": "/humidity", + "rt": ["oic.r.humidity"], + "if": ["oic.if.s"], + "p": {"bm": 3}, + "eps": [ + {"ep": "coap://[fe80::b1d6]:1111", "pri": 2}, + {"ep": "coaps://[fe80::b1d6]:1122"}, + {"ep": "coap+tcp://[2001:db8:a::123]:2222", "pri": 3} + ] + }, + { + "href": "/temperature", + "rt": ["oic.r.temperature"], + "if": ["oic.if.s"], + "p": {"bm": 3}, + "eps": [ + {"ep": "coap://[[2001:db8:a::123]:2222"} + ] + } + ] diff --git a/rdpublish.raml b/rdpublish.raml new file mode 100755 index 0000000..a84ac04 --- /dev/null +++ b/rdpublish.raml @@ -0,0 +1,157 @@ +#%RAML 0.8 +#RAML for Resource Directory +title: Resource Directory +version: v1-20160622 +documentation: + + - title: OCF Copyright + content: Copyright (c) 2016, 2017 Open Connectivity Foundation, Inc. All rights reserved. + - title: OCF License + content: !include LICENSE.md + - title: OCF Disclaimer + content: !include DISCLAIMER.md + + - title: Resource Directory + content: | + A Resoure Directory is an Device that helps other Devices to be discovered. + - title: Introduction + content: | + For resource in other Devices to be discovered using the Resource Directory, these other devices have to publish the resource links they would otherwise have advertised through /oic/res to the Resource Directory. Once the information has been published then the Devices may stop responding to discovery queries and may also go to sleep. + + The Resource Directory will respond to all discovery queries with resources that it directly advertises and also the resource information that has been published to it. + - title: Resource Directory discovery + content: | + Before a Device publishes its resource information, it must first discover available Resource Directories and then select one of those to publish the information to. + + This doscovery is done with a multicast query to /oic/rd. The information returned is either a bais factor or a list of attributes that help the discovering Device to select one of the RDs. This RD will be used till the RD does not respond or another RD is selected. + - title: Resource Directory publish + content: | + Once the RD has been discovery and selected, the Device can publish its resoure information. The resource information are published to the /oic/rd resource using the "publish" interface. The information that needs to tbe available in /oic/res is then populated by the Resource Directory. + + Periodically based on the TTL set by the publishing Device, the information that is published has to be refreshed with a new TTL or the TTL can be updated if there is no change in the information. It is the responsibility of the publishing Device to ensure that the information or TTL is updated before the previous TTL expires; failing this the RD will garbage collect all the information related to the publishing Device. + - title: Resource discovery + content: | + The discovery of resources is done in the same manner as for any Server. A query to /oic/res either over multicast or uincast is required. + +schemas: + # Each schema represents an OIC Resource Type. The baseline interface operates on the entire representation +- rdPublish: !include schemas/oic.rd.publish-schema.json +- rdSelection: !include schemas/oic.rd.selection-schema.json + # rdDelLink: !include schemas/oic.rd.del-link-schema.json + +traits: +- rddefinterface: + queryParameters: + if: + description: | + Interface is optional since there is only one interface supported for the Resource Type + Both for RD selectin and for publish + type: string + enum: [ "oic.if.baseline" ] + default: "oic.if.baseline" + required: false + example: | + GET /oic/rd?if=oic.if.baseline + +/oic/rd: + displayName: Resource directory resource + description: | + Resource to be exposed by any Device that can act as a Resource Directory + get: + description: | + Get the attributes of the Resource Directory for selection purposes. + queryParameters: + rt: + description: | + Only one Resource Type is used for GET; RT is optional + type: string + enum: [ "oic.wk.rd" ] + default: "oic.wk.rd" + required: false + example: | + GET /oic/rd?rt=oic.wk.rd + is: [ rddefinterface ] + responses: + 200: + description: | + Respond with the selector criteria - either the set of attributes or the bias factor + body: + application/json: + schema: rdSelection + example: | + { + "rt": "oic.wk.rd", + "sel": 50 + } + post: + description: | + Publish the resource information. Appropriates parts of the information posted will be discovered through /oic/res + body: + application/json: + schema: rdPublish + # Maybe the entire published information should be treated as a new resource - as if created using the link-batch interface. + queryParameters: + rt: + description: | + Only one Resource Type is used for GET; RT is optional + type: string + enum: [ "oic.wk.rdpub" ] + default: "oic.wk.rdpub" + required: false + example: | + GET /oic/rd?rt=oic.wk.rdpub + is: [ rddefinterface ] + responses: + 200: + description: | + Respond with the same schema as publish but with the links have the "ins" parameter set to the appropriate instance value. + This value is used by the receiver to manage that OIC Link instance. + body: + application/json: + schema: rdPublish + example: | + { + "links": [ + { + "href": "coap://someAuthority:1000/somePath", + "rt": "oic.r.someResource", + "if": "oic.if.a", + "ins": 12345 + }, + { + "href": "coap://someAuthority:1000/somePath", + "rt": "oic.r.someOtherResource", + "if": "oic.if.baseline", + "ins": 54321 + } + ], + "ttl": 600 + } + + delete: + description: | + Delete a particular OIC Link - the link may be a simple link or a link in a tagged set. + queryParameters: + di: + displayName: ID of the device making request + description: | + This is used to determine which set of links to operata on. (Need authentication to ensure that there is no spoofing). If instance is ommitted then the entire set of links from this device ID is deleted + type: string + required: true + example: | + DELETE /oic/rd?di="0685B960-736F-46F7-BEC0-9E6CBD671ADC1" + ins: + displayName: Link instance for deletion + description: | + Instance of the link to delete + Value of parameter is a string where instance to be deleted are comma separated + type: string + required: false + example: | + DELETE /oic/rd?di="0685B960-736F-46F7-BEC0-9E6CBD671ADC1";ins="20" + responses: + 200: + description: The delete succeeded + +# The discovery through the /oic/res of the resource directory is the same as the standard resource discovery +# Need to include the RAML for /oic/res based resource discovery diff --git a/scene.raml b/scene.raml new file mode 100755 index 0000000..b04dd67 --- /dev/null +++ b/scene.raml @@ -0,0 +1,158 @@ +#%RAML 0.8 +title: Scene +version: v1-20160622 +documentation: + + - title: OCF Copyright + content: Copyright (c) 2016, 2017 Open Connectivity Foundation, Inc. All rights reserved. + - title: OCF License + content: !include LICENSE.md + - title: OCF Disclaimer + content: !include DISCLAIMER.md + + +schemas: + - Collection: !include schemas/oic.collection-schema.json + - SceneCollection: !include schemas/oic.sceneCollection-schema.json + - SceneCollectionUpdate: !include schemas/oic.sceneCollection-Update-schema.json + - SceneMember: !include schemas/oic.sceneMember-schema.json + +traits: + - interface: + queryParameters: + if: + enum: ["oic.if.a", "oic.if.ll", "oic.if.baseline"] + + +/SceneListResURI: + description: | + Toplevel Scene resource. + This resource is a generic collection resource. + The rts value shall contain oic.wk.scenecollection resource types. + displayName: Scenes (Top level) + + get: + description: | + Provides the current list of web links pointing to scenes + responses: + 200: + body: + application/json: + schema: Collection + example: | + { + "rt": ["oic.wk.scenelist"], + "n": "list of scene Collections", + "rts": ["oic.wk.scenecollection"], + "links": [ + ] + } + + + +/SceneCollectionResURI: + description: | + Collection that models a set of Scenes. + This resource is a generic collection resource with additional parameters. + The rts value shall contain oic.sceneMember resource types. + The additional parameters are + lastScene, this is the scene value last set by any OIC Client + sceneValueList, this is the list of available scenes + lastScene shall be listed in sceneValueList. + displayName: Scene Collections + + get: + description: | + Provides the current list of web links pointing to scenes + responses: + 200: + body: + application/json: + schema: SceneCollection + example: | + { + "lastScene": "off", + "sceneValues": "off,Reading,TVWatching", + "rt": ["oic.wk.scenecollection"], + "n": "My Scenes for my living room", + "id": "0685B960-736F-46F7-BEC0-9E6CBD671ADC1", + "rts": ["oic.wk.scenemember"], + "links": [ + ] + } + + put: + description: | + Provides the action to change the last settted scene selection. + Calling this method shall update of all sceneMembers to the prescribed membervalue. + When this method is called with the same value as the current lastScene value + then all sceneMembers shall be updated. + + body: + application/json: + schema: SceneCollectionUpdate + example: | + { + "lastScene": "Reading" + } + + responses: + 200: + description: | + Indicates that the value is changed. + The changed properties are provided in the response. + body: + application/json: + schema: SceneCollectionUpdate + example: | + { + "lastScene": "Reading" + } + + +/SceneMemberResURI: + description: | + Collection that models a scene member. + displayName: Scene Member + + get: + description: | + Provides the scene member + responses: + 200: + body: + application/json: + schema: SceneMember + example: | + { + "rt": ["oic.wk.scenemember"], + "id": "0685B960-FFFF-46F7-BEC0-9E6234671ADC1", + "n": "my binary switch (for light bulb) mappings", + "link": { + "href": "binarySwitch", + "rt": ["oic.r.switch.binary"], + "if": ["oic.if.a", "oic.if.baseline"], + "eps": [ + {"ep": "coap://[fe80::b1d6]:1111", "pri": 2}, + {"ep": "coaps://[fe80::b1d6]:1122"}, + {"ep": "coap+tcp://[2001:db8:a::123]:2222", "pri": 3} + ] + }, + "sceneMappings": [ + { + "scene": "off", + "memberProperty": "value", + "memberValue": true + }, + { + "scene": "Reading", + "memberProperty": "value", + "memberValue": false + }, + { + "scene": "TVWatching", + "memberProperty": "value", + "memberValue": true + } + ] + } diff --git a/schemas/DISCLAIMER.md b/schemas/DISCLAIMER.md new file mode 100644 index 0000000..4e81410 --- /dev/null +++ b/schemas/DISCLAIMER.md @@ -0,0 +1 @@ +THIS SOFTWARE IS PROVIDED BY THE OPEN CONNECTIVITY FOUNDATION, INC. "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE OR WARRANTIES OF NON-INFRINGEMENT, ARE DISCLAIMED. IN NO EVENT SHALL THE OPEN CONNECTIVITY FOUNDATION, INC. OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/schemas/LICENSE.md b/schemas/LICENSE.md new file mode 100644 index 0000000..0e4811b --- /dev/null +++ b/schemas/LICENSE.md @@ -0,0 +1,3 @@ +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: +1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. diff --git a/schemas/oic.collection-schema.json b/schemas/oic.collection-schema.json new file mode 100755 index 0000000..b8c2be3 --- /dev/null +++ b/schemas/oic.collection-schema.json @@ -0,0 +1,65 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "description" : "Copyright (c) 2016 Open Connectivity Foundation, Inc. All rights reserved.", + "id": "https://www.openconnectivity.org/ocf-apis/core/schemas/oic.collection-schema.json#", + "title": "Collection", + "definitions": { + "oic.collection.setoflinks": { + "description": "A set (array) of simple or individual OIC Links. In addition to properties required for an OIC Link, the identifier for that link in this set is also required", + "type": "array", + "items": { + "$ref": "oic.oic-link-schema.json#/definitions/oic.oic-link" + } + }, + "oic.collection.alllinks": { + "description": "All forms of links in a collection", + "oneOf": [ + { + "$ref": "#/definitions/oic.collection.setoflinks" + } + ] + }, + "oic.collection": { + "type": "object", + "description": "A collection is a set (array) of tagged-link or set (array) of simple links along with additional properties to describe the collection itself", + "properties": { + "id": { + "anyOf": [ + { + "type": "integer", + "description": "A number that is unique to that collection; like an ordinal number that is not repeated" + }, + { + "type": "string", + "description": "A unique string that could be a hash or similarly unique" + }, + { + "$ref": "oic.types-schema.json#/definitions/uuid", + "description": "A unique string that could be a UUIDv4" + } + ], + "description": "ID for the collection. Can be an value that is unique to the use context or a UUIDv4" + }, + "di": { + "$ref": "oic.types-schema.json#/definitions/uuid", + "description": "The device ID which is an UUIDv4 string; used for backward compatibility with Spec A definition of /oic/res" + }, + "rts": { + "$ref": "oic.core-schema.json#/definitions/oic.core/properties/rt", + "description": "Defines the list of allowable resource types (for Target and anchors) in links included in the collection; new links being created can only be from this list" }, + "drel": { + "type": "string", + "description": "When specified this is the default relationship to use when an OIC Link does not specify an explicit relationship with *rel* parameter" + }, + "links": { + "$ref": "#/definitions/oic.collection.alllinks" + } + } + } + }, + "type": "object", + "allOf": [ + {"$ref": "oic.core-schema.json#/definitions/oic.core"}, + {"$ref": "#/definitions/oic.collection"} + ] +} diff --git a/schemas/oic.collection.batch-retrieve-schema.json b/schemas/oic.collection.batch-retrieve-schema.json new file mode 100644 index 0000000..20d4c1c --- /dev/null +++ b/schemas/oic.collection.batch-retrieve-schema.json @@ -0,0 +1,38 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "description" : "Copyright (c) 2016 Open Connectivity Foundation, Inc. All rights reserved.", + "id": "https://www.openconnectivity.org/ocf-apis/core/schemas/oic.collection.batch-retrieve-schema.json#", + "title": "Collection Batch Retrieve Format", + "definitions": { + "oic.wk.col-batch-retrieve": { + "type": "array", + "minItems": 1, + "items": { + "type": "object", + "properties": { + "href": { + "type": "string", + "description": "URI of the target resource relative assuming the collection URI as anchor" + }, + "rep": { + "oneOf": [ + { + "type": "object", + "description": "The response payload from a single resource" + }, + { + "type": "array", + "description": " The response payload from a collection (batch) resource" + } + ] + } + }, + "additionalProperties": true, + "required": ["href","rep"] + } + } + }, + "allOf": [ + {"$ref": "#/definitions/oic.wk.col-batch-retrieve"} + ] +} diff --git a/schemas/oic.collection.batch-update-schema.json b/schemas/oic.collection.batch-update-schema.json new file mode 100644 index 0000000..067219f --- /dev/null +++ b/schemas/oic.collection.batch-update-schema.json @@ -0,0 +1,39 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "description" : "Copyright (c) 2016 Open Connectivity Foundation, Inc. All rights reserved.", + "id": "https://www.openconnectivity.org/ocf-apis/core/schemas/oic.collection.batch-update-schema.json#", + "title": "Collection Batch Update Format", + "definitions": { + "oic.wk.col-batch-update": { + "description": "array of resource representations to apply to the batch collection, using href to indicate which resource(s) in the batch to update. If the href property is empty, effectively making the URI reference to the collection itself, the representation is to be applied to all resources in the batch", + "type": "array", + "minItems": 1, + "items": { + "type": "object", + "properties": { + "href": { + "type": "string", + "description": "URI of the target resource relative assuming the collection URI as anchor" + }, + "rep": { + "oneOf": [ + { + "type": "object", + "description": "The response payload from a single resource" + }, + { + "type": "array", + "description": " The response payload from a collection (batch) resource" + } + ] + } + }, + "additionalProperties": true, + "required": ["href","rep"] + } + } + }, + "allOf": [ + {"$ref": "#/definitions/oic.wk.col-batch-update"} + ] +} diff --git a/schemas/oic.collection.linkslist-schema.json b/schemas/oic.collection.linkslist-schema.json new file mode 100644 index 0000000..4ce6655 --- /dev/null +++ b/schemas/oic.collection.linkslist-schema.json @@ -0,0 +1,16 @@ +{ + "$schema": "http://json-schema.org/draft-v4/schema#", + "description" : "Copyright (c) 2016 Open Connectivity Foundation, Inc. All rights reserved.", + "id": "https://www.openconnectivity.org/ocf-apis/core/schemas/oic.collection.linkslist-schema.json#", + "definitions": { + "oic.collection.alllinks": { + "$ref": "oic.collection-schema.json#/definitions/oic.collection.alllinks" + } + }, + "type": "object", + "properties": { + "links": { + "$ref": "#/definitions/oic.collection.alllinks" + } + } +} diff --git a/schemas/oic.core-schema.json b/schemas/oic.core-schema.json new file mode 100755 index 0000000..62c7127 --- /dev/null +++ b/schemas/oic.core-schema.json @@ -0,0 +1,49 @@ +{ + "id": "https://www.openconnectivity.org/ocf-apis/core/schemas/oic.core-schema.json#", + "$schema": "http://json-schema.org/draft-04/schema#", + "description" : "Copyright (c) 2016, 2017 Open Connectivity Foundation, Inc. All rights reserved.", + "title": "Core", + "definitions": { + "oic.core": { + "type": "object", + "properties": { + "rt": { + "type": "array", + "items" : { + "type" : "string", + "maxLength": 64 + }, + "minItems" : 1, + "readOnly": true, + "description": "Resource Type" + }, + "if": { + "type": "array", + "items": { + "type" : "string", + "enum" : ["oic.if.baseline", "oic.if.ll", "oic.if.b", "oic.if.lb", "oic.if.rw", "oic.if.r", "oic.if.a", "oic.if.s" ] + }, + "minItems": 1, + "readOnly": true, + "description": "The interface set supported by this resource" + }, + "n": { + "type": "string", + "maxLength": 64, + "readOnly": true, + "description": "Friendly name of the resource" + }, + "id": { + "type": "string", + "maxLength": 64, + "readOnly": true, + "description": "Instance ID of this specific resource" + } + } + } + }, + "type": "object", + "allOf": [ + { "$ref": "#/definitions/oic.core"} + ] +} diff --git a/schemas/oic.core-schema.rw.json b/schemas/oic.core-schema.rw.json new file mode 100644 index 0000000..f624ed0 --- /dev/null +++ b/schemas/oic.core-schema.rw.json @@ -0,0 +1,48 @@ +{ + "id": "https://www.openconnectivity.org/ocf-apis/core/schemas/oic.core-schema.baseline.json#", + "$schema": "http://json-schema.org/draft-04/schema#", + "description" : "Copyright (c) 2017 Open Connectivity Foundation, Inc. All rights reserved.", + "title": "Core", + "definitions": { + "oic.core": { + "type": "object", + "properties": { + "rt": { + "type": "array", + "items" : { + "type" : "string", + "maxLength": 64 + }, + "minItems" : 1, + "readOnly": true, + "description": "Resource Type" + }, + "if": { + "type": "array", + "items": { + "type" : "string", + "enum" : ["oic.if.baseline", "oic.if.ll", "oic.if.b", "oic.if.lb", "oic.if.rw", "oic.if.r", "oic.if.a", "oic.if.s" ] + }, + "minItems": 1, + "readOnly": true, + "description": "The interface set supported by this resource" + }, + "n": { + "type": "string", + "maxLength": 64, + "description": "Friendly name of the resource" + }, + "id": { + "type": "string", + "maxLength": 64, + "readOnly": true, + "description": "Instance ID of this specific resource" + } + } + } + }, + "type": "object", + "allOf": [ + { "$ref": "#/definitions/oic.core"} + ] +} diff --git a/schemas/oic.oic-link-schema.json b/schemas/oic.oic-link-schema.json new file mode 100755 index 0000000..9eead77 --- /dev/null +++ b/schemas/oic.oic-link-schema.json @@ -0,0 +1,134 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "description" : "Copyright (c) 2016, 2017 Open Connectivity Foundation, Inc. All rights reserved.", + "id": "https://www.openconnectivity.org/ocf-apis/core/schemas/oic.oic-link-schema.json#", + "definitions": { + "oic.oic-link": { + "type": "object", + "properties": { + "href": { + "type": "string", + "maxLength": 256, + "description": "This is the target URI, it can be specified as a Relative Reference or fully-qualified URI. Relative Reference should be used along with the di parameter to make it unique.", + "format": "uri" + }, + "rel": { + "oneOf":[ + { + "type": "array", + "items": { + "type": "string", + "maxLength": 64 + }, + "minItems": 1, + "default": ["hosts"] + }, + { + "type": "string", + "maxLength": 64, + "default": "hosts" + } + ], + "description": "The relation of the target URI referenced by the link to the context URI" + }, + "rt": { + "type": "array", + "items" : { + "type" : "string", + "maxLength": 64 + }, + "minItems" : 1, + "description": "Resource Type" + }, + "if": { + "type": "array", + "items": { + "type" : "string", + "enum" : ["oic.if.baseline", "oic.if.ll", "oic.if.b", "oic.if.rw", "oic.if.r", "oic.if.a", "oic.if.s" ] + }, + "minItems": 1, + "description": "The interface set supported by this resource" + }, + "di": { + "$ref": "oic.types-schema.json#/definitions/uuid", + "description": "Unique identifier for device (UUID)" + }, + "p": { + "description": "Specifies the framework policies on the Resource referenced by the target URI", + "type": "object", + "properties": { + "bm": { + "description": "Specifies the framework policies on the Resource referenced by the target URI for e.g. observable and discoverable", + "type": "integer" + } + }, + "required" : ["bm"] + }, + "title": { + "type": "string", + "maxLength": 64, + "description": "A title for the link relation. Can be used by the UI to provide a context" + }, + "anchor": { + "type": "string", + "maxLength": 256, + "description": "This is used to override the context URI e.g. override the URI of the containing collection", + "format": "uri" + }, + "ins": { + "oneOf": [ + { + "type": "integer", + "description": "An ordinal number that is not repeated - must be unique in the collection context" + }, + { + "type": "string", + "maxLength": 256, + "format" : "uri", + "description": "Any unique string including a URI" + }, + { + "$ref": "oic.types-schema.json#/definitions/uuid", + "description": "Unique identifier (UUID)" + } + ], + "description": "The instance identifier for this web link in an array of web links - used in collections" + }, + "type": { + "type": "array", + "description": "A hint at the representation of the resource referenced by the target URI. This represents the media types that are used for both accepting and emitting", + "items" : { + "type": "string", + "maxLength": 64 + }, + "minItems": 1, + "default": "application/cbor" + }, + "eps": { + "type": "array", + "description": "the Endpoint information of the target Resource", + "items": { + "type": "object", + "properties": { + "ep": { + "type": "string", + "format": "uri", + "description": "URI with Transport Protocol Suites + Endpoint Locator as specified in 10.2.1" + }, + "pri": { + "type": "integer", + "minimum": 1, + "description": "The priority among multiple Endpoints as specified in 10.2.3" + } + } + } + } + }, + "required": [ "href", "rt", "if", "eps" ] + } + }, + "type": "object", + "allOf": [ + { "$ref": "#/definitions/oic.oic-link" } + ] +} diff --git a/schemas/oic.r.icon-schema.json b/schemas/oic.r.icon-schema.json new file mode 100644 index 0000000..8623ed3 --- /dev/null +++ b/schemas/oic.r.icon-schema.json @@ -0,0 +1,43 @@ +{ + "id": "https://www.openconnectivity.org/ocf-apis/core/schemas/oic.r.icon.json#", + "$schema": "http://json-schema.org/draft-04/schema#", + "description" : "Copyright (c) 2017 Open Connectivity Foundation, Inc. All rights reserved.", + "title": "Icon", + "definitions": { + "oic.r.icon": { + "properties": { + "mimetype": { + "type": "string", + "maxLength": 64, + "readOnly": true, + "description": "Specifies the format of the MIME Type" + }, + "width": { + "type": "integer", + "minimum": 1, + "readOnly": true, + "description": "Specifies the width in pixels" + }, + "height": { + "type": "integer", + "minimum": 1, + "readOnly": true, + "description": "Specifies the height in pixels" + }, + "media": { + "type": "string", + "maxLength": 256, + "format" : "uri", + "readOnly": true, + "description": "Specifies the media URL to icon" + } + } + } + }, + "type": "object", + "allOf": [ + { "$ref": "oic.core-schema.json#/definitions/oic.core"}, + { "$ref": "#/definitions/oic.r.icon"} + ], + "required": ["mimetype","width","height","media"] +} diff --git a/schemas/oic.rd.publish-schema.json b/schemas/oic.rd.publish-schema.json new file mode 100755 index 0000000..a9d9644 --- /dev/null +++ b/schemas/oic.rd.publish-schema.json @@ -0,0 +1,26 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "description" : "Copyright (c) 2016,2017 Open Connectivity Foundation, Inc. All rights reserved.", + "id": "https://www.openconnectivity.org/ocf-apis/core/schemas/oic.rd.publish-schema.json#", + "title": "RD Publish & Update", + "definitions": { + "oic.rd.publish": { + "description": "Publishes resources as OIC Links into the resource directory", + "properties": { + "linkSet": { + "$ref": "oic.collection-schema.json#/definitions/oic.collection.setoflinks" + }, + "ttl": { + "type": "integer", + "description": "Time to indicate a RD, how long to keep this published item. After this time (in seconds) elapses, the RD invalidates the links. To keep link alive the publishing device updates the ttl using the update schema" + } + } + } + }, + "type": "object", + "allOf": [{ "$ref": "#/definitions/oic.rd.publish" }], + "required": [ "links" ], + "dependencies": { + "links": [ "ttl" ] + } +} diff --git a/schemas/oic.rd.selection-schema.json b/schemas/oic.rd.selection-schema.json new file mode 100755 index 0000000..c535853 --- /dev/null +++ b/schemas/oic.rd.selection-schema.json @@ -0,0 +1,69 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "description" : "Copyright (c) 2016, 2017 Open Connectivity Foundation, Inc. All rights reserved.", + "id": "https://www.openconnectivity.org/ocf-apis/core/schemas/oic.rd.selection-schema.json#", + "title" : "RD Selection", + "definitions": { + "oic.rd.attributes": { + "type": "object", + "properties": { + "n": { + "type": "string", + "description": "A human friendly name for the Resource Directory" + }, + "di": { + "$ref": "oic.types-schema.json#/definitions/uuid", + "description": "A unique identifier for the Resource Directory - the same as the device ID of the RD" + + }, + "sel": { + "description": "Selection criteria that a device wanting to publish to any RD can use to choose this Resource Directory over others that are discovered", + "oneOf": [ + { + "type": "object", + "properties": { + "pwr": { + "type": "string", + "enum": [ "ac", "batt", "safe" ], + "description": "A hint about how the RD is powered. If AC then this is stronger than battery powered. If source is reliable (safe) then appropriate mechanism for managing power failure exists" + }, + "conn": { + "type": "string", + "enum": [ "wrd", "wrls" ], + "description": "A hint about the networking connectivity of the RD. *wrd* if wired connected and *wrls* if wireless connected." + }, + "bw": { + "type": "string", + "description": "Qualitative bandwidth of the connection", + "enum": [ "high", "low", "lossy" ] + }, + "mf": { + "type": "integer", + "description": "Memory factor - Ratio of available memory to total memory expressed as a percentage" + }, + "load": { + "type": "array", + "items": { + "type": "number" + }, + "minitems": 3, + "maxitems": 3, + "description": "Current load capacity of the RD. Expressed as a load factor 3-tuple (upto two decimal points each). Load factor is based on request processed in a 1 minute, 5 minute window and 15 minute window" + } + } + }, + { + "type": "integer", + "minimum": 0, + "maximum": 100, + "description": "A bias factor calculated by the Resource directory - the value is in the range of 0 to 100 - 0 implies that RD is not to be selected. Client chooses RD with highest bias factor or randomly between RDs that have same bias factor" + } + ] + } + } + } + }, + "type": "object", + "allOf": [ {"$ref": "#/definitions/oic.rd.attributes"}], + "required": ["sel"] +} diff --git a/schemas/oic.sceneCollection-Update-schema.json b/schemas/oic.sceneCollection-Update-schema.json new file mode 100755 index 0000000..05c3242 --- /dev/null +++ b/schemas/oic.sceneCollection-Update-schema.json @@ -0,0 +1,51 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "description" : "Copyright (c) 2016, 2017 Open Connectivity Foundation, Inc. All rights reserved.", + "id": "https://www.openconnectivity.org/ocf-apis/core/schemas/oic.sceneCollection-schema.json#", + "title" : "Scene Collection", + "definitions": { + "oic.sceneCollection": { + "type": "object", + "properties": { + "lastScene": { + "type": "string", + "description": "Last selected Scene, shall be part of sceneValues" + }, + "sceneValues": { + "type": "string", + "readOnly": true, + "description": "All available scene values" + }, + "n": { + "type": "string", + "description": "Used to name the Scene collection" + }, + "id": { + "type": "string", + "description" : "A unique string that could be a hash or similarly unique" + }, + "rts": { + "$ref": "oic.core-schema.json#/definitions/oic.core/properties/rt", + "description": "Defines the list of allowable resource types in links included in the collection; new links being created can only be from this list" + }, + "links": { + "type": "array", + "description": "Array of OIC web links that are reference from this collection", + "items" : { + "allOf": [ + { "$ref": "oic.oic-link-schema.json#/definitions/oic.oic-link" }, + { "required" : [ "ins" ] } + ] + } + } + }, + "required": [ "lastScene" ] + } + }, + + "type": "object", + "allOf" : [ + { "$ref": "oic.core-schema.json#/definitions/oic.core" }, + { "$ref": "#/definitions/oic.sceneCollection" } + ] +} diff --git a/schemas/oic.sceneCollection-schema.json b/schemas/oic.sceneCollection-schema.json new file mode 100755 index 0000000..4097bc7 --- /dev/null +++ b/schemas/oic.sceneCollection-schema.json @@ -0,0 +1,51 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "description" : "Copyright (c) 2016, 2017 Open Connectivity Foundation, Inc. All rights reserved.", + "id": "https://www.openconnectivity.org/ocf-apis/core/schemas/oic.sceneCollection-schema.json#", + "title" : "Scene Collection", + "definitions": { + "oic.sceneCollection": { + "type": "object", + "properties": { + "lastScene": { + "type": "string", + "description": "Last selected Scene, shall be part of sceneValues" + }, + "sceneValues": { + "type": "string", + "readOnly": true, + "description": "All available scene values" + }, + "n": { + "type": "string", + "description": "Used to name the Scene collection" + }, + "id": { + "type": "string", + "description" : "A unique string that could be a hash or similarly unique" + }, + "rts": { + "$ref": "oic.core-schema.json#/definitions/oic.core/properties/rt", + "description": "Defines the list of allowable resource types in links included in the collection; new links being created can only be from this list" + }, + "links": { + "type": "array", + "description": "Array of OIC web links that are reference from this collection", + "items" : { + "allOf": [ + { "$ref": "oic.oic-link-schema.json#/definitions/oic.oic-link" }, + { "required" : [ "ins" ] } + ] + } + } + }, + "required": [ "lastScene","sceneValues","rts","id" ] + } + }, + + "type": "object", + "allOf" : [ + { "$ref": "oic.core-schema.json#/definitions/oic.core" }, + { "$ref": "#/definitions/oic.sceneCollection" } + ] +} diff --git a/schemas/oic.sceneMember-schema.json b/schemas/oic.sceneMember-schema.json new file mode 100755 index 0000000..3ef0f27 --- /dev/null +++ b/schemas/oic.sceneMember-schema.json @@ -0,0 +1,58 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "description" : "Copyright (c) 2016, 2017 Open Connectivity Foundation, Inc. All rights reserved.", + "id": "https://www.openconnectivity.org/ocf-apis/core/schemas/oic.sceneMember-schema.json#", + "title" : "Scene Member", + "definitions": { + "oic.sceneMember": { + "type": "object", + "properties": { + "n": { + "type": "string", + "description": "Used to name the Scene collection" + }, + "id": { + "type": "string", + "description": "Can be an value that is unique to the use context or a UUIDv4" + }, + "SceneMappings" : { + "type": "array", + "description": "array of mappings per scene, can be 1", + "items": { + "type": "object", + "properties": { + "scene": { + "type": "string", + "description": "Specifies a scene value that will acted upon" + }, + "memberProperty": { + "type": "string", + "readOnly": true, + "description": "property name that will be mapped" + }, + "memberValue": { + "type": "string", + "readOnly": true, + "description": "value of the Member Property" + } + }, + "required": [ "scene", "memberProperty", "memberValue" ] + } + }, + + "link": { + "type": "string", + "description": "web link that points at a resource", + "$ref": "oic.oic-link-schema.json#/definitions/oic.oic-link" + } + }, + "required": [ "link" ] + } + }, + + "type": "object", + "allOf" : [ + { "$ref": "oic.core-schema.json#/definitions/oic.core" }, + { "$ref": "#/definitions/oic.sceneMember" } + ] +} diff --git a/schemas/oic.types-schema.json b/schemas/oic.types-schema.json new file mode 100644 index 0000000..8f52aff --- /dev/null +++ b/schemas/oic.types-schema.json @@ -0,0 +1,32 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "description" : "Copyright (c) 2016, 2017 Open Connectivity Foundation, Inc. All rights reserved.", + "id": "https://www.openconnectivity.org/ocf-apis/core/schemas/oic.types-schema.json#", + "definitions" : { + "uuid": { + "description": "An identifier formatted according to IETF RFC 4122.", + "type": "string", + "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" + }, + "date": { + "description": "As defined in ISO 8601. The format is [yyyy]-[mm]-[dd].", + "type": "string", + "pattern": "^([0-9]{4})-(1[0-2]|0[1-9])-(3[0-1]|2[0-9]|1[0-9]|0[1-9])$" + }, + "language-tag": { + "description": "An identifier formatted according to IETF RFC 5646 (langusge tag).", + "type": "string", + "pattern": "^[A-Za-z]{1,8}(-[A-Za-z0-9]{1-8})*$" + }, + "int64": { + "description": "A string instance is valid against this attribute if it contains an integer in the range [-(2**63), (2**63)-1]", + "type": "string", + "pattern": "^0|(-?[1-9][0-9]{0,18)}$" + }, + "uint64": { + "description": "A string instance is valid against this attribute if it contains an integer in the range [0, (2**64)-1]", + "type": "string", + "pattern": "^0|([1-9][0-9]{0,19})$" + } + } +} diff --git a/schemas/oic.wk.con-Update-schema.json b/schemas/oic.wk.con-Update-schema.json new file mode 100644 index 0000000..bc85df7 --- /dev/null +++ b/schemas/oic.wk.con-Update-schema.json @@ -0,0 +1,66 @@ +{ + "id": "https://www.openconnectivity.org/ocf-apis/core/schemas/oic.wk.con-Update-schema.json#", + "$schema": "http://json-schema.org/draft-04/schema#", + "description" : "Copyright (c) 2016 Open Connectivity Foundation, Inc. All rights reserved.", + "definitions": { + "oic.wk.con": { + "type": "object", + "properties": { + "loc": { + "type": "array", + "description": "Location information", + "items": { + "type": "number" + }, + "minItems": 2, + "maxItems": 2 + }, + "locn": { + "type": "string", + "maxLength": 64, + "description": "Human Friendly Name for location" + }, + "c": { + "type": "string", + "maxLength": 64, + "description": "Currency" + }, + "r": { + "type": "string", + "maxLength": 64, + "description": "Region" + }, + "ln": { + "type": "array", + "items" : + { + "type": "object", + "properties": { + "language": { + "$ref": "oic.types-schema.json#/definitions/language-tag", + "description": "An RFC 5646 language tag." + }, + "value": { + "type": "string", + "maxLength": 64, + "description": "Device description in the indicated language." + } + } + }, + "minItems" : 1, + "description": "Localized names" + }, + "dl": { + "$ref": "oic.types-schema.json#/definitions/language-tag", + "description": "Default Language" + } + } + } + }, + "type": "object", + "allOf": [ + { "$ref": "oic.core-schema.rw.json#/definitions/oic.core"}, + { "$ref": "#/definitions/oic.wk.con" } + ], + "required": ["n"] +} diff --git a/schemas/oic.wk.con-schema.json b/schemas/oic.wk.con-schema.json new file mode 100755 index 0000000..bc1d69e --- /dev/null +++ b/schemas/oic.wk.con-schema.json @@ -0,0 +1,66 @@ +{ + "id": "https://www.openconnectivity.org/ocf-apis/core/schemas/oic.wk.con-schema.json#", + "$schema": "http://json-schema.org/draft-04/schema#", + "description" : "Copyright (c) 2016, 2017 Open Connectivity Foundation, Inc. All rights reserved.", + "definitions": { + "oic.wk.con": { + "type": "object", + "properties": { + "loc": { + "type": "array", + "description": "Location information", + "items": { + "type": "number" + }, + "minItems": 2, + "maxItems": 2 + }, + "locn": { + "type": "string", + "maxLength": 64, + "description": "Human Friendly Name for location" + }, + "c": { + "type": "string", + "maxLength": 64, + "description": "Currency" + }, + "r": { + "type": "string", + "maxLength": 64, + "description": "Region" + }, + "ln": { + "type": "array", + "items" : + { + "type": "object", + "properties": { + "language": { + "$ref": "oic.types-schema.json#/definitions/language-tag", + "description": "An RFC 5646 language tag." + }, + "value": { + "type": "string", + "maxLength": 64, + "description": "Device description in the indicated language." + } + } + }, + "minItems" : 1, + "description": "Localized names" + }, + "dl": { + "$ref": "oic.types-schema.json#/definitions/language-tag", + "description": "Default Language" + } + } + } + }, + "type": "object", + "allOf": [ + { "$ref": "oic.core-schema.json#/definitions/oic.core"}, + { "$ref": "#/definitions/oic.wk.con" } + ], + "required": ["n"] +} diff --git a/schemas/oic.wk.con.p-Update-schema.json b/schemas/oic.wk.con.p-Update-schema.json new file mode 100644 index 0000000..aca5578 --- /dev/null +++ b/schemas/oic.wk.con.p-Update-schema.json @@ -0,0 +1,38 @@ +{ + "id": "https://www.openconnectivity.org/ocf-apis/core/schemas/oic.wk.con.p-Update-schema.json#", + "$schema": "http://json-schema.org/draft-04/schema#", + "description" : "Copyright (c) 2017 Open Connectivity Foundation, Inc. All rights reserved.", + "definitions": { + "oic.wk.con.p": { + "type": "object", + "properties": { + "mnpn": { + "type": "array", + "items" : + { + "type": "object", + "properties": { + "language": { + "$ref": "oic.types-schema.json#/definitions/language-tag", + "description": "An RFC 5646 language tag." + }, + "value": { + "type": "string", + "maxLength": 64, + "description": "Platform description in the indicated language." + } + } + }, + "minItems" : 1, + "description": "Platform names" + } + } + } + }, + "type": "object", + "allOf": [ + { "$ref": "oic.core-schema.rw.json#/definitions/oic.core"}, + { "$ref": "#/definitions/oic.wk.con.p" } + ], + "required": ["mnpn"] +} diff --git a/schemas/oic.wk.con.p-schema.json b/schemas/oic.wk.con.p-schema.json new file mode 100644 index 0000000..af11b78 --- /dev/null +++ b/schemas/oic.wk.con.p-schema.json @@ -0,0 +1,37 @@ +{ + "id": "https://www.openconnectivity.org/ocf-apis/core/schemas/oic.wk.con.p-schema.json#", + "$schema": "http://json-schema.org/draft-04/schema#", + "description" : "Copyright (c) 2017 Open Connectivity Foundation, Inc. All rights reserved.", + "definitions": { + "oic.wk.con.p": { + "type": "object", + "properties": { + "mnpn": { + "type": "array", + "items" : + { + "type": "object", + "properties": { + "language": { + "$ref": "oic.types-schema.json#/definitions/language-tag", + "description": "An RFC 5646 language tag." + }, + "value": { + "type": "string", + "maxLength": 64, + "description": "Platform description in the indicated language." + } + } + }, + "minItems" : 1, + "description": "Platform names" + } + } + } + }, + "type": "object", + "allOf": [ + { "$ref": "oic.core-schema.json#/definitions/oic.core"}, + { "$ref": "#/definitions/oic.wk.con.p" } + ] +} diff --git a/schemas/oic.wk.d-schema.json b/schemas/oic.wk.d-schema.json new file mode 100755 index 0000000..53285dc --- /dev/null +++ b/schemas/oic.wk.d-schema.json @@ -0,0 +1,98 @@ +{ + "$schema": "http://json-schemas.org/draft-04/schema#", + "description" : "Copyright (c) 2016, 2017 Open Connectivity Foundation, Inc. All rights reserved.", + "id": "https://www.openconnectivity.org/ocf-apis/core/schemas/oic.wk.d-schema.json#", + "definitions": { + "oic.wk.d": { + "type": "object", + "properties": { + "di": { + "$ref": "oic.types-schema.json#/definitions/uuid", + "readOnly": true, + "description": "Unique identifier for device (UUID)" + }, + "icv": { + "type": "string", + "maxLength": 64, + "readOnly": true, + "description": "The version of the OIC Server" + }, + "dmv": { + "type": "string", + "maxLength": 256, + "readOnly": true, + "description": "Spec versions of the Resource and Device Specifications to which this device data model is implemented" + }, + "ld": { + "type": "array", + "items" : + { + "type": "object", + "properties": { + "language": { + "$ref": "oic.types-schema.json#/definitions/language-tag", + "readOnly": true, + "description": "An RFC 5646 language tag." + }, + "value": { + "type": "string", + "maxLength": 64, + "readOnly": true, + "description": "Device description in the indicated language." + } + } + }, + "minItems" : 1, + "readOnly": true, + "description": "Localized Description." + }, + "sv": { + "type": "string", + "maxLength": 64, + "readOnly": true, + "description": "Software version." + }, + "dmn": { + "type": "array", + "items" : + { + "type": "object", + "properties": { + "language": { + "$ref": "oic.types-schema.json#/definitions/language-tag", + "readOnly": true, + "description": "An RFC 5646 language tag." + }, + "value": { + "type": "string", + "maxLength": 64, + "readOnly": true, + "description": "Manufacturer name in the indicated language." + } + } + }, + "minItems" : 1, + "readOnly": true, + "description": "Manufacturer Name." + }, + "dmno": { + "type": "string", + "maxLength": 64, + "readOnly": true, + "description": "Model number as designated by manufacturer." + }, + "piid": { + "$ref": "oic.types-schema.json#/definitions/uuid", + "readOnly": true, + "description": "Protocol independent unique identifier for device (UUID) that is immutable." + } + } + } + }, + "type": "object", + "allOf": [ + { "$ref": "oic.core-schema.json#/definitions/oic.core"}, + { "$ref": "#/definitions/oic.wk.d" } + ], + "required": [ "n", "di", "icv", "dmv", "piid" ] +} diff --git a/schemas/oic.wk.introspectionInfo.json b/schemas/oic.wk.introspectionInfo.json new file mode 100644 index 0000000..56b7eaf --- /dev/null +++ b/schemas/oic.wk.introspectionInfo.json @@ -0,0 +1,53 @@ +{ + "id": "http://www.openconnectivity.org/ocf-apis/core/schemas/oic.wk.introspectionInfo.json#", + "$schema": "http://json-schema.org/draft-04/schema#", + "description" : "Copyright (c) 2017 Open Interconnect Consortium, Inc. All rights reserved.", + "title": "introspection resource", + "definitions": { + "oic.wk.introspectionInfo": { + "type": "object", + "properties": { + "urlInfo": { + "type": "array", + "description": "The valid range for the value Property", + "readOnly": true, + "minItems": 1, + "items": { + "type" : "object", + "properties": { + "url": { + "type": "string", + "format": "uri", + "description" : "url to download the description" + }, + "protocol": { + "type": "string", + "enum": [ "coap", "coaps", "http", "https", "coap+tcp", "coaps+tcp" ], + "description" : "protocol to be used to download the introspection" + }, + "content-type": { + "type": "string", + "enum": [ "application/json", "application/cbor" ], + "default" : "application/cbor", + "description" : "content-type of the introspection data" + }, + "version": { + "type": "integer", + "enum": [ 1 ], + "default" : 1, + "description" : "version the introspection data that can be downloaded" + } + }, + "required" : [ "url","protocol"] + } + } + }, + "required" : ["urlInfo"] + } + }, + "type": "object", + "allOf": [ + {"$ref": "#/definitions/oic.wk.introspectionInfo"}, + {"$ref": "oic.core-schema.json#/definitions/oic.core"} + ] +} diff --git a/schemas/oic.wk.mnt-schema.json b/schemas/oic.wk.mnt-schema.json new file mode 100755 index 0000000..e044bf1 --- /dev/null +++ b/schemas/oic.wk.mnt-schema.json @@ -0,0 +1,29 @@ +{ + "$schema": "http://json-schemas.org/draft-04/schema#", + "description" : "Copyright (c) 2016, 2017 Open Connectivity Foundation, Inc. All rights reserved.", + "id": "https://www.openconnectivity.org/ocf-apis/core/schemas/oic.wk.mnt-schema.json#", + "definitions": { + "oic.wk.mnt": { + "type": "object", + "anyOf": [ + {"required": ["fr"]}, + {"required": ["rb"]} + ], + "properties": { + "fr":{ + "type": "boolean", + "description": "Factory Reset" + }, + "rb": { + "type": "boolean", + "description": "Reboot Action" + } + } + } + }, + "type": "object", + "allOf": [ + { "$ref": "oic.core-schema.json#/definitions/oic.core"}, + { "$ref": "#/definitions/oic.wk.mnt" } + ] +} diff --git a/schemas/oic.wk.p-schema.json b/schemas/oic.wk.p-schema.json new file mode 100755 index 0000000..a288fd4 --- /dev/null +++ b/schemas/oic.wk.p-schema.json @@ -0,0 +1,90 @@ +{ + "$schema": "http://json-schemas.org/draft-04/schema#", + "description" : "Copyright (c) 2016, 2017 Open Connectivity Foundation, Inc. All rights reserved.", + "id": "https://www.openconnectivity.org/ocf-apis/core/schemas/oic.wk.p-schema.json#", + "definitions": { + "oic.wk.p": { + "type": "object", + "properties": { + "pi": { + "$ref": "oic.types-schema.json#/definitions/uuid", + "readOnly": true, + "description": "Platform Identifier as a UUID" + }, + "mnmn": { + "type": "string", + "readOnly": true, + "description": "Manufacturer Name", + "maxLength": 64 + }, + "mnml": { + "type": "string", + "readOnly": true, + "description": "Manufacturer's URL", + "maxLength": 256, + "format": "uri" + }, + "mnmo": { + "type": "string", + "maxLength": 64, + "readOnly": true, + "description": "Model number as designated by manufacturer" + }, + "mndt": { + "$ref": "oic.types-schema.json#/definitions/date", + "readOnly": true, + "description": "Manufacturing Date." + }, + "mnpv": { + "type": "string", + "maxLength": 64, + "readOnly": true, + "description": "Platform Version" + }, + "mnos": { + "type": "string", + "maxLength": 64, + "readOnly": true, + "description": "Platform Resident OS Version" + }, + "mnhw": { + "type": "string", + "maxLength": 64, + "readOnly": true, + "description": "Platform Hardware Version" + }, + "mnfv": { + "type": "string", + "maxLength": 64, + "readOnly": true, + "description": "Manufacturer's firmware version" + }, + "mnsl": { + "type": "string", + "readOnly": true, + "description": "Manufacturer's Support Information URL", + "maxLength": 256, + "format": "uri" + }, + "st": { + "type": "string", + "readOnly": true, + "description": "Reference time for the device as defined in ISO 8601, where concatenation of 'date' and 'time' with the 'T' as a delimiter between 'date' and 'time'.", + "format": "date-time" + }, + "vid": { + "type": "string", + "maxLength": 64, + "readOnly": true, + "description": "Manufacturer's defined string for the platform. The string is freeform and up to the manufacturer on what text to populate it" + } + } + } + }, + "type": "object", + "allOf": [ + { "$ref": "oic.core-schema.json#/definitions/oic.core"}, + { "$ref": "#/definitions/oic.wk.p" } + ], + "required": [ "pi", "mnmn" ] +} diff --git a/schemas/oic.wk.ping-schema.json b/schemas/oic.wk.ping-schema.json new file mode 100755 index 0000000..1aac213 --- /dev/null +++ b/schemas/oic.wk.ping-schema.json @@ -0,0 +1,25 @@ +{ + "$schema": "http://json-schemas.org/draft-04/schema#", + "description" : "Copyright (c) 2016, 2017 Open Connectivity Foundation, Inc. All rights reserved.", + "id": "https://www.openconnectivity.org/ocf-apis/core/schemas/oic.wk.ping-schema.json#", + "definitions": { + "oic.wk.ping": { + "type": "object", + "properties": { + "in": { + "type": "integer", + "readOnly": false, + "description": "Indicates the interval for which connection shall be kept alive" + } + } + } + }, + "type": "object", + "allOf": [ + { "$ref": "oic.core-schema.json#/definitions/oic.core"}, + { "$ref": "#/definitions/oic.wk.ping"} + ], + "required": [ + "in" + ] +} diff --git a/schemas/oic.wk.res-schema-ll.json b/schemas/oic.wk.res-schema-ll.json new file mode 100644 index 0000000..ba6509b --- /dev/null +++ b/schemas/oic.wk.res-schema-ll.json @@ -0,0 +1,10 @@ +{ + "$schema": "http://json-schema.org/draft-v4/schema#", + "description" : "Copyright (c) 2016, 2017 Open Connectivity Foundation, Inc. All rights reserved.", + "id": "https://www.openconnectivity.org/ocf-apis/core/schemas/oic.wk.res-schema-ll.json#", + "description": "The list of resources expressed as OCF links without di", + "type": "array", + "items": { + "$ref": "oic.oic-link-schema.json#/definitions/oic.oic-link" + } +} diff --git a/schemas/oic.wk.res-schema.json b/schemas/oic.wk.res-schema.json new file mode 100755 index 0000000..30bbd8c --- /dev/null +++ b/schemas/oic.wk.res-schema.json @@ -0,0 +1,56 @@ +{ + "$schema": "http://json-schema.org/draft-v4/schema#", + "description" : "Copyright (c) 2016, 2017 Open Connectivity Foundation, Inc. All rights reserved.", + "id": "https://www.openconnectivity.org/ocf-apis/core/schemas/oic.wk.res-schema.json#", + "definitions": { + "oic.res-baseline": { + "type": "object", + "properties": { + "rt": { + "type": "array", + "items" : { + "type" : "string", + "maxLength": 64 + }, + "minItems" : 1, + "readOnly": true, + "description": "Resource Type" + }, + "if": { + "type": "array", + "items": { + "type" : "string", + "enum" : ["oic.if.baseline", "oic.if.ll"] + }, + "minItems": 1, + "readOnly": true, + "description": "The interface set supported by this resource" + }, + "n": { + "type": "string", + "maxLength": 64, + "readOnly": true, + "description": "Human friendly name" + }, + "mpro": { + "readOnly": true, + "description": "Supported messaging protocols", + "type": "string", + "maxLength": 64 + }, + "links": { + "type": "array", + "items": { + "$ref": "oic.oic-link-schema.json#/definitions/oic.oic-link" + } + } + }, + "required": ["rt", "if", "links"] + } + }, + "description": "The list of resources expressed as OIC links", + "type": "array", + "items": { + "$ref": "#/definitions/oic.res-baseline" + } +}