Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

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