diff --git a/ShadowConfigurationResURI.swagger.json b/ShadowConfigurationResURI.swagger.json new file mode 100644 index 0000000..8eeae84 --- /dev/null +++ b/ShadowConfigurationResURI.swagger.json @@ -0,0 +1,378 @@ +{ + "swagger":"2.0", + "info":{ + "title":"ShadowConfiguration", + "version":"20190402", + "license":{ + "name":"OCF Data Model License", + "url":"https://github.com/openconnectivityfoundation/core/blob/e28a9e0a92e17042ba3e83661e4c0fbce8bdc4ba/LICENSE.md", + "x-copyright":"copyright 2016-2017, 2019 Open Connectivity Foundation, Inc. All rights reserved." + }, + "termsOfService":"https://openconnectivityfoundation.github.io/core/DISCLAIMER.md" + }, + "schemes":[ + "http" + ], + "consumes":[ + "application/json" + ], + "produces":[ + "application/json" + ], + "paths":{ + "/ShadowConfigurationResURI":{ + "get":{ + "description":"This Resource resides on the Original Device and holds critical information used in establishing its Shadow Device and synchronizing with it.\nThe property \"ssi\" maintains the identity (UUID) of the Shadow Service which was used to generate a Shadow Device.\nThe property \"sdi\" maintains the identity (UUID) of a Shadow Device.\nThe property \"sde\" is an array in which each item takes the form of an \"ep\" value as extracted from the \"eps\" list of the Shadow Device's /oic/res Link.\nThe property \"issynched\" represents synchronization status indicating whether the Original Device is allowed to synchronize its Resources with its Shadow Device.\nThe property \"ssr\" is an array in which each item is a URI of the Shadow Device's \"oic.wk.shadow.sync\" Resource.\nThe property \"ttl\" specifies the maximum idle lifetime (in seconds) of the Shadow Device during periods of inactivity.\nThe \"synchedresources\" property is an array of Non-Configuration Resources (NCRs) in the Original Device that shall be synchronized with the Shadow Device.", + "parameters":[ + { + "$ref":"#/parameters/interface" + } + ], + "responses":{ + "200":{ + "description":"Retrieves the current state of the Shadow Configuration Resource.", + "x-example":{ + "rt":[ + "oic.wk.shadow.conf" + ], + "if":[ + "oic.if.rw", + "oic.if.baseline" + ], + "ssi":"30590fd0-a11b-4b95-af91-27c69f4a5824", + "sdi":"40590fd0-a11b-4b95-af91-27c69f4a5824", + "sde":[ + "coaps://[fe80::b1d6]:2222" + ], + "ssr":[ + "coaps://[fe80::b1d6]:2222/oic/shadow/sync" + ], + "synchedresources":[ + { + "href":"/temperature", + "p":{ + "bm":1 + }, + "rt":[ + "oic.r.temperature" + ], + "if":[ + "oic.if.a", + "oic.if.s", + "oic.if.baseline" + ] + } + ], + "ttl":600, + "issynched":true + }, + "schema":{ + "$ref":"#/definitions/ShadowConfiguration" + } + } + } + }, + "post":{ + "description":"A Mediator sets the properties of the Shadow Configuration Resource in the process of establishing a Shadow Device and thereby also establishes sufficient context for the Original Device to further synchronize with its Shadow Device.\nThis request may fail if all the mandatory properties are not configured by the time \"issynched\" is set to \"true\".", + "parameters":[ + { + "$ref":"#/parameters/interface" + }, + { + "name":"body", + "in":"body", + "required":true, + "schema":{ + "$ref":"#/definitions/ShadowConfiguration" + }, + "x-example":{ + "ssi":"30590fd0-a11b-4b95-af91-27c69f4a5824", + "sdi":"40590fd0-a11b-4b95-af91-27c69f4a5824", + "sde":[ + "coaps://[fe80::b1d6]:2222" + ], + "ssr":[ + "coaps://[fe80::b1d6]:2222/oic/shadow/sync" + ], + "synchedresources":[ + { + "href":"/temperature", + "p":{ + "bm":1 + }, + "rt":[ + "oic.r.temperature" + ], + "if":[ + "oic.if.a", + "oic.if.s", + "oic.if.baseline" + ] + } + ], + "ttl":600, + "issynched":true + } + } + ], + "responses":{ + "200":{ + "description":"", + "x-example":{ + "rt":[ + "oic.wk.shadow.conf" + ], + "if":[ + "oic.if.rw", + "oic.if.baseline" + ], + "ssi":"30590fd0-a11b-4b95-af91-27c69f4a5824", + "sdi":"40590fd0-a11b-4b95-af91-27c69f4a5824", + "sde":[ + "coaps://[fe80::b1d6]:2222" + ], + "ssr":[ + "coaps://[fe80::b1d6]:2222/oic/shadow/sync" + ], + "synchedresources":[ + { + "href":"/temperature", + "p":{ + "bm":1 + }, + "rt":[ + "oic.r.temperature" + ], + "if":[ + "oic.if.a", + "oic.if.s", + "oic.if.baseline" + ] + } + ], + "ttl":600, + "issynched":true + }, + "schema":{ + "$ref":"#/definitions/ShadowConfiguration" + } + }, + "403":{ + "description":"This response is generated by an OCF Device when the Mediator sends:\n An UPDATE with a read-only property or improperly formatted property.\n An UPDATE that does not include all the required properties in an object of the \"synchedresources\" array.\n An UPDATE that attempts to set \"issynched\" to \"true\" when the values of \"sdi\", \"sde\", \"ssi\", \"ssr\" and \"synchedresources\" are not yet configured.\nThe OCF Device responds with the current Resource representation for \"oic.wk.shadow.conf\".", + "x-example":{ + "rt":[ + "oic.wk.shadow.conf" + ], + "if":[ + "oic.if.rw", + "oic.if.baseline" + ], + "ssi":"30590fd0-a11b-4b95-af91-27c69f4a5824", + "sdi":"40590fd0-a11b-4b95-af91-27c69f4a5824", + "sde":[ + "coaps://[fe80::b1d6]:2222" + ], + "ssr":[ + + ], + "synchedresources":[ + { + "href":"/temperature", + "p":{ + "bm":1 + }, + "rt":[ + "oic.r.temperature" + ], + "if":[ + "oic.if.a", + "oic.if.s", + "oic.if.baseline" + ] + } + ], + "ttl":600, + "issynched":false + }, + "schema":{ + "$ref":"#/definitions/ShadowConfiguration" + } + } + } + } + } + }, + "parameters":{ + "interface":{ + "in":"query", + "name":"if", + "type":"string", + "enum":[ + "oic.if.rw", + "oic.if.baseline" + ] + } + }, + "definitions":{ + "ShadowConfiguration":{ + "properties":{ + "rt":{ + "description":"The Resource Type.", + "items":{ + "maxLength":64, + "type":"string", + "enum":[ + "oic.wk.shadow.conf" + ] + }, + "minItems":1, + "uniqueItems":true, + "readOnly":true, + "type":"array" + }, + "ssi":{ + "description":"The identity of the Shadow Service which was used to generate a Shadow Device.", + "$ref":"#/definitions/uuid" + }, + "sdi":{ + "description":"The identity (UUID) of a Shadow Device.", + "$ref":"#/definitions/uuid" + }, + "sde":{ + "description":"Array of \"ep\" values extracted from the \"eps\" list of the Shadow Device's /oic/res Link.", + "items":{ + "format":"uri", + "type":"string" + }, + "minItems":1, + "uniqueItems":true, + "type":"array" + }, + "issynched":{ + "description":"An indication of whether the Original Device is allowed to synchronize its Resources with its Shadow Device.", + "type":"boolean", + "default":false + }, + "ssr":{ + "description":"Array of URIs of the Shadow Device's \"oic.wk.shadow.sync\" Resource.", + "items":{ + "format":"uri", + "type":"string" + }, + "minItems":1, + "uniqueItems":true, + "type":"array" + }, + "ttl":{ + "description":"The maximum idle lifetime (in seconds) of the Shadow Device during periods of inactivity.", + "default":600, + "type":"integer" + }, + "synchedresources":{ + "description":"The array of Non-Configuration Resources (NCRs) in the Original Device that shall be synchronized with the Shadow Device.", + "items":{ + "properties":{ + "href":{ + "description":"This target URI for a Resource in the Original Device specified as a Relative Reference.", + "format":"uri", + "maxLength":256, + "type":"string" + }, + "rt":{ + "description":"Resource Type of the Resource", + "items":{ + "maxLength":64, + "type":"string" + }, + "minItems":1, + "uniqueItems":true, + "type":"array" + }, + "if":{ + "description":"The interface set supported by this Resource", + "items":{ + "enum":[ + "oic.if.baseline", + "oic.if.ll", + "oic.if.b", + "oic.if.rw", + "oic.if.r", + "oic.if.a", + "oic.if.s" + ], + "type":"string" + }, + "minItems":1, + "uniqueItems":true, + "type":"array" + }, + "p":{ + "description":"Specifies the framework policies on the Resource referenced by the target URI.", + "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" + ], + "type":"object" + }, + "rep":{ + "description":"The current Resource representation.", + "type":"object" + } + }, + "type":"object", + "required":[ + "href", + "rt", + "if", + "p" + ] + }, + "minItems":1, + "uniqueItems":true, + "type":"array" + }, + "n":{ + "$ref":"https://openconnectivityfoundation.github.io/core/schemas/oic.common.properties.core-schema.json#/definitions/n" + }, + "id":{ + "$ref":"https://openconnectivityfoundation.github.io/core/schemas/oic.common.properties.core-schema.json#/definitions/id" + }, + "if":{ + "description":"The OCF Interface set supported by this Resource.", + "items":{ + "enum":[ + "oic.if.baseline", + "oic.if.rw" + ], + "maxLength":64, + "type":"string" + }, + "minItems":2, + "uniqueItems":true, + "readOnly":true, + "type":"array" + } + }, + "type":"object", + "required":[ + "ssi", + "sdi", + "sde", + "issynched", + "ssr", + "ttl", + "synchedresources" + ] + }, + "uuid":{ + "description":"Format pattern according to IETF RFC 4122.", + "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}$", + "type":"string" + } + } +} diff --git a/ShadowGenerationResURI.swagger.json b/ShadowGenerationResURI.swagger.json new file mode 100644 index 0000000..c04d055 --- /dev/null +++ b/ShadowGenerationResURI.swagger.json @@ -0,0 +1,436 @@ +{ + "swagger":"2.0", + "info":{ + "title":"ShadowGeneration", + "version":"20190402", + "license":{ + "name":"OCF Data Model License", + "url":"https://github.com/openconnectivityfoundation/core/blob/e28a9e0a92e17042ba3e83661e4c0fbce8bdc4ba/LICENSE.md", + "x-copyright":"copyright 2016-2017, 2019 Open Connectivity Foundation, Inc. All rights reserved." + }, + "termsOfService":"https://openconnectivityfoundation.github.io/core/DISCLAIMER.md" + }, + "schemes":[ + "http" + ], + "consumes":[ + "application/json" + ], + "produces":[ + "application/json" + ], + "paths":{ + "/ShadowGenerationResURI":{ + "get":{ + "description":"This Resource is hosted in a Shadow Service where it serves as a factory Resource for generating Shadow Devices.\nA Mediator shall be pre-provisioned with the URI and access to this Resource.", + "parameters":[ + { + "$ref":"#/parameters/interface" + } + ], + "responses":{ + "200":{ + "description":"Retrieves the baseline properties of the Shadow Generation Resource.", + "x-example":{ + "rt":[ + "oic.wk.shadow.gen" + ], + "if":[ + "oic.if.rw", + "oic.if.baseline" + ], + "n":"ShadowGen", + "id":"0_ShadowGen" + }, + "schema":{ + "$ref":"#/definitions/baseline" + } + } + } + }, + "post":{ + "description":"To generate a Shadow Device, the Mediator issues a CREATE request with a payload that includes the following properties:\n The property \"di\" contains the identity (UUID) of the Mediator.\n The property \"ode\" is an array in which each item is an \"ep\" value as extracted from the \"eps\" list of the Original Device's /oic/res link.\n The property \"ssr\" is an array in which each item is a URI of the Original Device's \"oic.wk.shadow.sync\" Resource.\n The property \"ttl\" indicates the maximum idle lifetime (in seconds) of the Shadow Device.\n The \"resources\" property is an array of Resources on the Original Device to be copied to and synchronized with the Shadow Device.", + "parameters":[ + { + "$ref":"#/parameters/interface" + }, + { + "name":"body", + "in":"body", + "required":true, + "schema":{ + "$ref":"#/definitions/ShadowGenerationRequest" + }, + "x-example":{ + "di":"50590fd0-a11b-4b95-af91-27c69f4a5824", + "ttl":600, + "ssr":[ + "coaps://[fe80::b1e6]:55555/oic/shadow/sync" + ], + "ode":[ + "coaps://[fe80::b1e6]:55555" + ], + "resources":[ + { + "href":"/temperature", + "p":{ + "bm":1 + }, + "rt":[ + "oic.r.temperature" + ], + "if":[ + "oic.if.a", + "oic.if.s", + "oic.if.baseline" + ] + }, + { + "href":"/oic/d", + "p":{ + "bm":1 + }, + "rt":[ + "oic.wk.d", + "oic.d.sensor" + ], + "if":[ + "oic.if.r", + "oic.if.baseline" + ], + "rep":{ + "rt":[ + "oic.wk.d", + "oic.d.sensor" + ], + "if":[ + "oic.if.r", + "oic.if.baseline" + ], + "di":"20590fd0-a11b-4b95-af91-27c69f4a5824", + "icv":"ocf.2.0.0", + "dmv":"ocf.res.1.0.0", + "dmn":"foo labs", + "dmno":"bar product xxx" + } + } + ] + } + } + ], + "responses":{ + "200":{ + "description":"Upon successful creation of the Shadow Device, this Resource returns a response to the Mediator containing the Links of \"oic.wk.res\" and \"oic.wk.shadow.sync\" Resources in the Shadow Device.", + "x-example":[ + { + "href":"/oic/shadow/sync", + "anchor":"ocf://40590fd0-a11b-4b95-af91-27c69f4a5824", + "rt":[ + "oic.wk.shadow.sync" + ], + "if":[ + "oic.if.rw", + "oic.if.baseline" + ], + "p":{ + "bm":0 + }, + "eps":[ + { + "ep":"coaps://[fe80::b1d6]:2222" + } + ] + }, + { + "href":"/oic/res", + "anchor":"ocf://40590fd0-a11b-4b95-af91-27c69f4a5824", + "rt":[ + "oic.wk.res" + ], + "if":[ + "oic.if.r", + "oic.if.baseline" + ], + "p":{ + "bm":3 + }, + "eps":[ + { + "ep":"coaps://[fe80::b1d6]:2222" + } + ] + } + ], + "schema":{ + "$ref":"#/definitions/ShadowGenerationResponse" + } + }, + "403":{ + "description":"This response is generated by the Shadow Service when:\n The Mediator fails to at a minimum include the following in its CREATE request:\n One or more Non-Configuration Resources (NCRs).\n The Original Device's /oic/d link parameters and representation in the \"resources\" property.\n When the Shadow Service experiences internal errors in constructing and launching a Shadow Device." + } + } + } + } + }, + "parameters":{ + "interface":{ + "in":"query", + "name":"if", + "type":"string", + "enum":[ + "oic.if.rw", + "oic.if.baseline" + ] + } + }, + "definitions":{ + "baseline":{ + "properties":{ + "rt":{ + "description":"The Resource Type.", + "items":{ + "enum":[ + "oic.wk.shadow.gen" + ], + "type":"string", + "maxLength":64 + }, + "minItems":1, + "uniqueItems":true, + "readOnly":true, + "type":"array" + }, + "if":{ + "description":"The OCF Interface set supported by this Resource.", + "items":{ + "enum":[ + "oic.if.rw", + "oic.if.baseline" + ], + "type":"string", + "maxLength":64 + }, + "minItems":2, + "readOnly":true, + "uniqueItems":true, + "type":"array" + }, + "n":{ + "$ref":"https://openconnectivityfoundation.github.io/core/schemas/oic.common.properties.core-schema.json#/definitions/n" + }, + "id":{ + "$ref":"https://openconnectivityfoundation.github.io/core/schemas/oic.common.properties.core-schema.json#/definitions/id" + } + }, + "type":"object", + "required":[ + "rt", + "if" + ] + }, + "ShadowGenerationRequest":{ + "properties":{ + "di":{ + "description":"The identity (UUID) of the Mediator.", + "$ref":"#/definitions/uuid" + }, + "ttl":{ + "description":"The maximum idle lifetime (in seconds) of the Shadow Device during periods of inactivity.", + "default":600, + "type":"integer" + }, + "ode":{ + "description":"Array of \"ep\" values extracted from the \"eps\" list of the Original Device's /oic/res Link.", + "items":{ + "format":"uri", + "type":"string" + }, + "minItems":1, + "uniqueItems":true, + "type":"array" + }, + "ssr":{ + "description":"Array of URIs of the Original Device's \"oic.wk.shadow.sync\" Resource.", + "items":{ + "format":"uri", + "type":"string" + }, + "minItems":1, + "uniqueItems":true, + "type":"array" + }, + "resources":{ + "description":"The array of Resources in the Original Device that shall be synchronized with the Shadow Device.", + "items":{ + "properties":{ + "href":{ + "description":"This target URI for a Resource in the Original Device specified as a Relative Reference.", + "format":"uri", + "maxLength":256, + "type":"string" + }, + "rt":{ + "description":"Resource Type of the Resource", + "items":{ + "maxLength":64, + "type":"string" + }, + "minItems":1, + "uniqueItems":true, + "type":"array" + }, + "if":{ + "description":"The interface set supported by this Resource", + "items":{ + "enum":[ + "oic.if.baseline", + "oic.if.ll", + "oic.if.b", + "oic.if.rw", + "oic.if.r", + "oic.if.a", + "oic.if.s" + ], + "type":"string" + }, + "minItems":1, + "uniqueItems":true, + "type":"array" + }, + "p":{ + "description":"Specifies the framework policies on the Resource referenced by the target URI.", + "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" + ], + "type":"object" + }, + "rep":{ + "description":"The current Resource representation.", + "type":"object" + } + }, + "type":"object", + "required":[ + "href", + "rt", + "if", + "p" + ] + }, + "minItems":2, + "uniqueItems":true, + "type":"array" + } + }, + "type":"object", + "required":[ + "di", + "ttl", + "ode", + "resources" + ] + }, + "ShadowGenerationResponse":{ + "items":{ + "properties":{ + "eps":{ + "description":"the Endpoint information of the target Resource", + "items":{ + "properties":{ + "ep":{ + "description":"Transport Protocol Suite + Endpoint Locator", + "format":"uri", + "type":"string" + }, + "pri":{ + "description":"The priority among multiple Endpoints", + "minimum":1, + "type":"integer" + } + }, + "type":"object" + }, + "type":"array", + "minItems":1 + }, + "anchor":{ + "description":"This is used to override the context URI e.g. override the URI of the containing collection.", + "format":"uri", + "maxLength":256, + "type":"string" + }, + "href":{ + "description":"This target URI for a Resource in the Original Device specified as a Relative Reference.", + "format":"uri", + "maxLength":256, + "type":"string" + }, + "rt":{ + "description":"Resource Type of the Resource", + "items":{ + "maxLength":64, + "type":"string" + }, + "minItems":1, + "uniqueItems":true, + "type":"array" + }, + "if":{ + "description":"The interface set supported by this Resource", + "items":{ + "enum":[ + "oic.if.baseline", + "oic.if.ll", + "oic.if.b", + "oic.if.rw", + "oic.if.r", + "oic.if.a", + "oic.if.s" + ], + "type":"string" + }, + "minItems":1, + "uniqueItems":true, + "type":"array" + }, + "p":{ + "description":"Specifies the framework policies on the Resource referenced by the target URI.", + "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" + ], + "type":"object" + } + }, + "required":[ + "href", + "rt", + "if", + "anchor", + "eps" + ], + "type":"object" + }, + "minItems":0, + "maxItems":2, + "uniqueItems":true, + "type":"array" + }, + "uuid":{ + "description":"Format pattern according to IETF RFC 4122.", + "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}$", + "type":"string" + } + } +} diff --git a/ShadowInformationResURI.swagger.json b/ShadowInformationResURI.swagger.json new file mode 100644 index 0000000..3900d59 --- /dev/null +++ b/ShadowInformationResURI.swagger.json @@ -0,0 +1,249 @@ +{ + "swagger":"2.0", + "info":{ + "title":"ShadowInformation", + "version":"20190402", + "license":{ + "name":"OCF Data Model License", + "url":"https://github.com/openconnectivityfoundation/core/blob/e28a9e0a92e17042ba3e83661e4c0fbce8bdc4ba/LICENSE.md", + "x-copyright":"copyright 2016-2017, 2019 Open Connectivity Foundation, Inc. All rights reserved." + }, + "termsOfService":"https://openconnectivityfoundation.github.io/core/DISCLAIMER.md" + }, + "schemes":[ + "http" + ], + "consumes":[ + "application/json" + ], + "produces":[ + "application/json" + ], + "paths":{ + "/ShadowInformationResURI":{ + "get":{ + "description":"The Shadow information Resource is exposed by a Shadow Device and maintains references to its Original Device.\nThe property \"odi\" stores the identity (UUID) of the Original Device.\nThe property \"ode\" is array in which each item takes the form of an \"ep\" value as extracted from the \"eps\" list of the Original Device's /oic/res Link.\nThe property \"issynched\" represents synchronization status indicating whether the Shadow Device is allowed to synchronize its Resources with its Original Device to handle actuation requests.\nThe optional property \"ssr\" is an array in which each item is a URI of the Original Device's \"oic.wk.shadow.sync\" Resource.", + "parameters":[ + { + "$ref":"#/parameters/interface" + } + ], + "responses":{ + "200":{ + "description":"Retrieves the current state of the Shadow Information Resource.", + "x-example":{ + "rt":[ + "oic.wk.shadow.info" + ], + "if":[ + "oic.if.rw", + "oic.if.baseline" + ], + "odi":"40590fd0-a11b-4b95-af91-27c69f4a5824", + "ssr":[ + "coaps://[fe80::b1e6]:55555/oic/shadow/sync" + ], + "ode":[ + "coaps://[fe80::b1e6]:55555" + ], + "issynched":true + }, + "schema":{ + "$ref":"#/definitions/ShadowInformation" + } + } + } + }, + "post":{ + "description":"A Mediator sets the properties of the Shadow Information Resource on the Shadow Device providing it sufficient context around its Original Device. This enables the Shadow Device to relay actuation requests from its Clients to the Original Device via a request to the Original Device's \"oic.wk.shadow.sync\" Resource.\nThis request may fail if the mandatory properties are not configured by the time \"issynched\" is set to \"true\".", + "parameters":[ + { + "$ref":"#/parameters/interface" + }, + { + "name":"body", + "in":"body", + "required":true, + "schema":{ + "$ref":"#/definitions/ShadowInformation" + }, + "x-example":{ + "odi":"40590fd0-a11b-4b95-af91-27c69f4a5824", + "ssr":[ + "coaps://[fe80::b1e6]:55555/oic/shadow/sync" + ], + "ode":[ + "coaps://[fe80::b1e6]:55555" + ], + "issynched":true + } + } + ], + "responses":{ + "200":{ + "description":"", + "x-example":{ + "rt":[ + "oic.wk.shadow.info" + ], + "if":[ + "oic.if.rw", + "oic.if.baseline" + ], + "odi":"20590fd0-a11b-4b95-af91-27c69f4a5824", + "ssr":[ + "coaps://[fe80::b1e6]:55555/oic/shadow/sync" + ], + "ode":[ + "coaps://[fe80::b1e6]:55555" + ], + "issynched":true + }, + "schema":{ + "$ref":"#/definitions/ShadowInformation" + } + }, + "403":{ + "description":"This response is generated by the Shadow Device when the Mediator sends:\n An UPDATE with a read-only property or improperly formatted property.\n An UPDATE that attempts to set \"issynched\" to \"true\" when the values of \"odi\" and \"ode\" are not yet configured.\nThe OCF Server responds with the current Resource representation for \"oic.wk.shadow.info\".", + "x-example":{ + "rt":[ + "oic.wk.shadow.info" + ], + "if":[ + "oic.if.rw", + "oic.if.baseline" + ], + "odi":"40590fd0-a11b-4b95-af91-27c69f4a5824", + "ssr":[ + "coaps://[fe80::b1e6]:55555/oic/shadow/sync" + ], + "ode":[ + + ], + "issynched":false + }, + "schema":{ + "$ref":"#/definitions/ShadowInformation" + } + } + } + } + } + }, + "parameters":{ + "interface":{ + "in":"query", + "name":"if", + "type":"string", + "enum":[ + "oic.if.rw", + "oic.if.baseline" + ] + } + }, + "definitions":{ + "ShadowInformation":{ + "properties":{ + "rt":{ + "description":"The Resource Type.", + "items":{ + "maxLength":64, + "type":"string", + "enum":[ + "oic.wk.shadow.info" + ] + }, + "minItems":1, + "uniqueItems":true, + "readOnly":true, + "type":"array" + }, + "odi":{ + "description":"The identity (UUID) of the Original Device.", + "$ref":"#/definitions/uuid" + }, + "ode":{ + "description":"Array of \"ep\" values extracted from the \"eps\" list of the Original Device's /oic/res Link.", + "items":{ + "format":"uri", + "type":"string" + }, + "minItems":1, + "uniqueItems":true, + "type":"array" + }, + "issynched":{ + "description":"An indication of whether the Shadow Device is allowed to synchronize its Resources with its Original Device to handle actuation requests.", + "type":"boolean", + "default":false + }, + "ssr":{ + "description":"Array of URIs of the Original Device's \"oic.wk.shadow.sync\" Resource.", + "items":{ + "format":"uri", + "type":"string" + }, + "minItems":1, + "uniqueItems":true, + "type":"array" + }, + "n":{ + "$ref":"https://openconnectivityfoundation.github.io/core/schemas/oic.common.properties.core-schema.json#/definitions/n" + }, + "id":{ + "$ref":"https://openconnectivityfoundation.github.io/core/schemas/oic.common.properties.core-schema.json#/definitions/id" + }, + "if":{ + "description":"The OCF Interface set supported by this Resource.", + "items":{ + "enum":[ + "oic.if.baseline", + "oic.if.rw" + ], + "maxLength":64, + "type":"string" + }, + "minItems":2, + "uniqueItems":true, + "readOnly":true, + "type":"array" + }, + "isasleep":{ + "description":"An indication whether the Original Device is currently in a sleep mode.", + "type":"boolean", + "default":false + }, + "wakeuptime":{ + "description":"An RFC 3339 formatted absolute timestamp when the Original Device will wake up.", + "format":"date-time", + "type":"string" + }, + "wakeonscheme":{ + "description":"A string that signifies a supported wake up mechanism that utilizes a specific Link-layer technology.", + "maxLength":64, + "type":"string" + }, + "wakeoncontext":{ + "description":"An array of strings where each item signifies a deployment defined parameter that is supplied by the Original Device and utilized by the Shadow Device to wake up the Original Device from a sleep mode.", + "items":{ + "maxLength":64, + "type":"string" + }, + "minItems":1, + "type":"array" + } + }, + "type":"object", + "required":[ + "odi", + "ode", + "issynched" + ] + }, + "uuid":{ + "description":"Format pattern according to IETF RFC 4122.", + "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}$", + "type":"string" + } + } +} diff --git a/ShadowSynchronizationResURI.swagger.json b/ShadowSynchronizationResURI.swagger.json new file mode 100644 index 0000000..a69cefd --- /dev/null +++ b/ShadowSynchronizationResURI.swagger.json @@ -0,0 +1,266 @@ +{ + "swagger":"2.0", + "info":{ + "title":"ShadowSynchronization", + "version":"20190402", + "license":{ + "name":"OCF Data Model License", + "url":"https://github.com/openconnectivityfoundation/core/blob/e28a9e0a92e17042ba3e83661e4c0fbce8bdc4ba/LICENSE.md", + "x-copyright":"copyright 2016-2017, 2019 Open Connectivity Foundation, Inc. All rights reserved." + }, + "termsOfService":"https://openconnectivityfoundation.github.io/core/DISCLAIMER.md" + }, + "schemes":[ + "http" + ], + "consumes":[ + "application/json" + ], + "produces":[ + "application/json" + ], + "paths":{ + "/ShadowSynchronizationResURI":{ + "get":{ + "description":"This Resource serves as the receiving end of synchronization requests from the Original Device or the Shadow Device.", + "parameters":[ + { + "$ref":"#/parameters/interface" + } + ], + "responses":{ + "200":{ + "description":"Retrieves the baseline properties of the Shadow Synchronization Resource.", + "x-example":{ + "rt":[ + "oic.wk.shadow.sync" + ], + "if":[ + "oic.if.rw", + "oic.if.baseline" + ], + "n":"ShadowSync", + "id":"0_ShadowSync" + }, + "schema":{ + "$ref":"#/definitions/baseline" + } + } + } + }, + "delete":{ + "description":"The Original Device may issue a DELETE request to this resource on a Shadow Device to signal the Shadow Service to remove and free the Shadow Device.", + "parameters":[ + { + "$ref":"#/parameters/interface" + } + ], + "responses":{ + "200":{ + "description":"This response indicates that the Shadow Device was successfully removed." + } + } + }, + "post":{ + "description":"This resource receives an UPDATE request containing an array of representations of Resources that have recently undergone a change in state and need to be synchronized. It then internally echoes those changes to all corresponding Resources in its Device and returns a response containing an array of changed representations from those Resources.\nThe UPDATE request also includes the identity of the device that issued this request in the \"di\" property.", + "parameters":[ + { + "$ref":"#/parameters/interface" + }, + { + "name":"body", + "in":"body", + "required":true, + "schema":{ + "$ref":"#/definitions/ShadowSynchronizationRequest" + }, + "x-example":{ + "di":"20590fd0-a11b-4b95-af91-27c69f4a5824", + "resources":[ + { + "href":"/temperature", + "rep":{ + "temperature":25, + "units":"C" + } + } + ] + } + } + ], + "responses":{ + "200":{ + "description":"The response payload includes the array of the current (updated) representations of all Resources included in the Request.", + "x-example":[ + { + "href":"/temperature", + "rep":{ + "rt":[ + "oic.r.temperature" + ], + "if":[ + "oic.if.a", + "oic.if.s", + "oic.if.baseline" + ], + "temperature":25, + "units":"C" + } + } + ], + "schema":{ + "$ref":"#/definitions/ShadowSynchronizationResponse" + } + }, + "403":{ + "description":"In the event that one or more Resources could not be synchronized, the response payload includes the unchanged representation for that resource and returns an array of updated or unchanged representations of all Resources included in the Request.", + "x-example":[ + { + "href":"/temperature", + "rep":{ + "rt":[ + "oic.r.temperature" + ], + "if":[ + "oic.if.a", + "oic.if.s", + "oic.if.baseline" + ], + "temperature":20, + "units":"C" + } + } + ], + "schema":{ + "$ref":"#/definitions/ShadowSynchronizationResponse" + } + } + } + } + } + }, + "parameters":{ + "interface":{ + "in":"query", + "name":"if", + "type":"string", + "enum":[ + "oic.if.rw", + "oic.if.baseline" + ] + } + }, + "definitions":{ + "baseline":{ + "properties":{ + "rt":{ + "description":"The Resource Type.", + "items":{ + "enum":[ + "oic.wk.shadow.sync" + ], + "type":"string", + "maxLength":64 + }, + "minItems":1, + "uniqueItems":true, + "readOnly":true, + "type":"array" + }, + "if":{ + "description":"The OCF Interface set supported by this Resource.", + "items":{ + "enum":[ + "oic.if.rw", + "oic.if.baseline" + ], + "type":"string", + "maxLength":64 + }, + "minItems":2, + "readOnly":true, + "uniqueItems":true, + "type":"array" + }, + "n":{ + "$ref":"https://openconnectivityfoundation.github.io/core/schemas/oic.common.properties.core-schema.json#/definitions/n" + }, + "id":{ + "$ref":"https://openconnectivityfoundation.github.io/core/schemas/oic.common.properties.core-schema.json#/definitions/id" + } + }, + "type":"object", + "required":[ + "rt", + "if" + ] + }, + "ShadowSynchronizationRequest":{ + "properties":{ + "di":{ + "description":"The identity (UUID) of the entity issuing a synchronization request.", + "$ref":"#/definitions/uuid" + }, + "resources":{ + "description":"The array of Resources to be synchronized with the Shadow Device.", + "items":{ + "properties":{ + "href":{ + "description":"This target URI for a Resource specified as a Relative Reference.", + "format":"uri", + "maxLength":256, + "type":"string" + }, + "rep":{ + "description":"The current Resource representation.", + "type":"object" + } + }, + "type":"object", + "required":[ + "href", + "rep" + ] + }, + "minItems":1, + "uniqueItems":true, + "type":"array" + } + }, + "type":"object", + "required":[ + "di", + "resources" + ] + }, + "ShadowSynchronizationResponse":{ + "items":{ + "properties":{ + "href":{ + "description":"This target URI for a Resource specified as a Relative Reference.", + "format":"uri", + "maxLength":256, + "type":"string" + }, + "rep":{ + "description":"The current Resource representation.", + "type":"object" + } + }, + "type":"object", + "required":[ + "href", + "rep" + ] + }, + "minItems":1, + "uniqueItems":true, + "type":"array" + }, + "uuid":{ + "description":"Format pattern according to IETF RFC 4122.", + "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}$", + "type":"string" + } + } +}