From 908ae4e9f0583a854413793f4131715ab3997dca Mon Sep 17 00:00:00 2001 From: Mark Trayer Date: Fri, 17 Dec 2021 11:20:00 -0600 Subject: [PATCH] Preserving the location data modeling, currently associated with CR 1781 which is in backup --- ContainerContributor.swagger.json | 155 ++++++++++++++ ContainerEntityURI.swagger.json | 120 +++++++++++ ContainerResURI.swagger.json | 160 ++++++++++++++ DistanceContributor.swagger.json | 169 +++++++++++++++ DistanceEntityURI.swagger.json | 173 +++++++++++++++ EntityResURI.swagger.json | 250 ++++++++++++++++++++++ GeofenceContributor.swagger.json | 157 ++++++++++++++ GeofenceEntityURI.swagger.json | 216 +++++++++++++++++++ LocationCollectionResURI.swagger.json | 295 ++++++++++++++++++++++++++ PositionContributor.swagger.json | 157 ++++++++++++++ PositionEntityURI.swagger.json | 233 ++++++++++++++++++++ PresenceContributor.swagger.json | 153 +++++++++++++ PresenceEntityURI.swagger.json | 153 +++++++++++++ 13 files changed, 2391 insertions(+) create mode 100644 ContainerContributor.swagger.json create mode 100644 ContainerEntityURI.swagger.json create mode 100644 ContainerResURI.swagger.json create mode 100644 DistanceContributor.swagger.json create mode 100644 DistanceEntityURI.swagger.json create mode 100644 EntityResURI.swagger.json create mode 100644 GeofenceContributor.swagger.json create mode 100644 GeofenceEntityURI.swagger.json create mode 100644 LocationCollectionResURI.swagger.json create mode 100644 PositionContributor.swagger.json create mode 100644 PositionEntityURI.swagger.json create mode 100644 PresenceContributor.swagger.json create mode 100644 PresenceEntityURI.swagger.json diff --git a/ContainerContributor.swagger.json b/ContainerContributor.swagger.json new file mode 100644 index 0000000..480ef45 --- /dev/null +++ b/ContainerContributor.swagger.json @@ -0,0 +1,155 @@ +{ + "swagger": "2.0", + "info": { + "title": "Container Contributor", + "version": "2021-12-17", + "license": { + "name": "OCF Data Model License", + "url": "https://github.com/openconnectivityfoundation/core/blob/e28a9e0a92e17042ba3e83661e4c0fbce8bdc4ba/LICENSE.md", + "x-copyright": "copyright 2021 Open Connectivity Foundation, Inc. All rights reserved." + }, + "termsOfService": "https://openconnectivityfoundation.github.io/core/DISCLAIMER.md" + }, + "schemes": [ + "http" + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "paths": { + "/ContainerContributorResURI": { + "get": { + "description": "This resource provides the last presence entity contributed to the location service.\n", + "parameters": [ + {"$ref": "#/parameters/interface"} + ], + "responses": { + "200": { + "description": "Success path response for the Resource", + "x-example": { + "rt": ["oic.r.location.container.contributor"], + "contributingEntity": {"entitydid": "aa:bb:cc:dd","entitydescription": "kitchen sensor"}, + "containerEntity": { + "entityid":"00:11:22:33", + "entitydescription":"mom", + "isincontainer":true, + "confidence":100, + "label": "Kitchen", + "timestamp":"2015-11-05T14:30:00Z" + } + }, + "schema": {"$ref": "#/definitions/ContainerContributor"} + } + } + }, + "post": { + "description": "The presence entity submitted to location services\n", + "parameters": [ + {"$ref": "#/parameters/interface"}, + { + "name": "body", + "in": "body", + "required": true, + "schema": {"$ref": "#/definitions/ContainerContributor"}, + "x-example": { + "contributingEntity": {"entitydid": "aa:bb:cc:dd","entitydescription": "kitchen sensor"}, + "containerEntity": { + "entityid":"00:11:22:33", + "entitydescription":"00:00:00:00:00:00", + "isincontainer":true, + "containerId": "kitchen", + "confidence":100, + "timestamp":"2015-11-05T14:30:00Z" + } + } + } + ], + "responses": { + "200": { + "description": "Success path", + "x-example": { + "contributingEntity": {"entitydid": "aa:bb:cc:dd","entitydescription": "kitchen sensor"}, + "containerEntity": { + "entityid":"00:11:22:33", + "entitydescription":"Mom", + "isincontainer":true, + "confidence":100, + "timestamp":"2015-11-05T14:30:00Z" + } + }, + "schema": {"$ref": "#/definitions/ContainerContributor"} + } + } + } + } + }, + "parameters": { + "interface": { + "in": "query", + "name": "if", + "type": "string", + "enum": [ + "oic.if.rw", + "oic.r.baseline" + ] + } + }, + "definitions": { + "ContainerContributor": { + "type": "object", + "properties": { + "rt": { + "description": "Resource Type", + "items": { + "maxLength": 64, + "type": "string", + "enum": ["oic.r.location.container.contributor"] + }, + "minItems": 1, + "readOnly": true, + "type": "array" + }, + "if": { + "description": "The OCF Interface set supported by this Resource", + "items": { + "enum": [ + "oic.if.baseline", + "oic.if.s" + ], + "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" + }, + "containerentity": { + "$ref": "https://openconnectivityfoundation.github.io/IoTDataModels/ContainerEntityResURI.swagger.json#/definitions/ContainerEntity" + }, + "contributingentity": { + "description": "The entity contributing the presence entity", + "type": "object", + "properties": { + "entitydescription": { + "$ref": "https://openconnectivityfoundation.github.io/IoTDataModels/EntityResURI.swagger.json#/definitions/entity-description" + }, + "entityid": { + "$ref": "https://openconnectivityfoundation.github.io/IoTDataModels/EntityResURI.swagger.json#/definitions/entity-id" + } + } + } + }, + "required": ["containerentity"] + } + } +} diff --git a/ContainerEntityURI.swagger.json b/ContainerEntityURI.swagger.json new file mode 100644 index 0000000..60be2ee --- /dev/null +++ b/ContainerEntityURI.swagger.json @@ -0,0 +1,120 @@ +{ + "swagger": "2.0", + "info": { + "title": "Container Entity", + "version": "2021-12-17", + "license": { + "name": "OCF Data Model License", + "url": "https://github.com/openconnectivityfoundation/core/blob/e28a9e0a92e17042ba3e83661e4c0fbce8bdc4ba/LICENSE.md", + "x-copyright": "copyright 2021 Open Connectivity Foundation, Inc. All rights reserved." + }, + "termsOfService": "https://openconnectivityfoundation.github.io/core/DISCLAIMER.md" + }, + "schemes": ["http"], + "consumes": ["application/json"], + "produces": ["application/json"], + "paths": { + "/ContainerEntityURI" : { + "get": { + "description": "A Container Entity is an location services entity that contains container information.\nContainer information is a boolean on whether an entity is inside or outside a container.", + "parameters": [ + {"$ref": "#/parameters/interface-all"} + ], + "responses": { + "200": { + "description" : "", + "x-example": { + "rt": ["oic.r.location.entity.container"], + "entity": {"entityid":"00:11:22:33","entitydescription":"Mom"}, + "containerid": "MyContainer", + "confidence": 80, + "incontainer": true, + "timestamp": "2015-11-05T14:30:15Z" + }, + "schema": { "$ref": "#/definitions/ContainerEntity" } + } + } + } + } + }, + "parameters": { + "interface-all" : { + "in" : "query", + "name" : "if", + "type" : "string", + "enum" : ["oic.if.r","oic.if.baseline"] + } + }, + "definitions": { + "ContainerEntity" : { + "properties": { + "rt" : { + "description": "Resource Type", + "items": { + "enum": ["oic.r.entity.container"], + "type": "string", + "maxLength": 64 + }, + "minItems": 1, + "readOnly": true, + "uniqueItems": true, + "type": "array" + }, + "containerid" : { + "description": "The current container", + "readOnly": true, + "type": "string" + }, + "confidence" : { + "description": "The confidence level of the reading being correct (0 - 100)", + "minimum": 0, + "readOnly": true, + "type": "number" + }, + "entity" : { + "properties": { + "entitydescription": { + "$ref": "https://openconnectivityfoundation.github.io/IoTDataModels/EntityResURI.swagger.json#/definitions/entity-description" + }, + "entityid": { + "$ref": "https://openconnectivityfoundation.github.io/IoTDataModels/EntityResURI.swagger.json#/definitions/entity-id" + } + }, + "type": "object" + }, + "incontainer" : { + "description": "Indicates whether an entity is inside the container", + "readOnly": true, + "type": "boolean" + }, + "timestamp" : { + "description": "An RFC3339 formated time indicating when the data was observed (e.g.: 2016-02-15T09:19Z)", + "format": "date-time", + "readOnly": true, + "type": "string" + }, + "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 interface set supported by this resource", + "items": { + "enum": [ + "oic.if.baseline", + "oic.if.r" + ], + "type": "string", + "maxLength": 64 + }, + "minItems": 1, + "readOnly": true, + "type": "array" + } + }, + "type" : "object" + } + } +} diff --git a/ContainerResURI.swagger.json b/ContainerResURI.swagger.json new file mode 100644 index 0000000..23d94aa --- /dev/null +++ b/ContainerResURI.swagger.json @@ -0,0 +1,160 @@ +{ + "swagger": "2.0", + "info": { + "title": "Container", + "version": "2021-12-17", + "license": { + "name": "OCF Data Model License", + "url": "https://github.com/openconnectivityfoundation/core/blob/e28a9e0a92e17042ba3e83661e4c0fbce8bdc4ba/LICENSE.md", + "x-copyright": "copyright 2021 Open Connectivity Foundation, Inc. All rights reserved." + }, + "termsOfService": "https://openconnectivityfoundation.github.io/core/DISCLAIMER.md" + }, + "schemes": ["http"], + "consumes": ["application/json"], + "produces": ["application/json"], + "paths": { + "/ContainerResURI" : { + "get": { + "description": "This Resource describes the properties associated with a location service containerr.\nSee also oic.r.location.entity.container.\nincontainer is a boolean that indicates whether something is in or outside of this container.\nconfidence is the confidence in the accuracy of the value of incontainer.\n", + "parameters": [ + {"$ref": "#/parameters/interface"} + ], + "responses": { + "200": { + "description" : "", + "x-example": { + "rt": ["oic.r.sensor.container"], + "containerid": "MyContainer", + "incontainer": true, + "accuracy": 5.0, + "measurementmethod": "gps", + "ContainerElements" : [ + { + "first" : { "origin": "home", "x": 12,"y": 15,"z":0 }, + "second" : { "origin": "home", "x": 20,"y": 15,"z":0 } + }, + { + "first" : { "origin": "home", "x": 12,"y": 23,"z":0 }, + "second" : { "origin": "home", "x": 20,"y": 23,"z":0 } + }, + { + "first" : { "origin": "home", "x": 0,"y": 15,"z":0 }, + "second" : { "origin": "home", "x": 20,"y": 15,"z":0 } + }, + { + "first" : { "origin": "home", "x": 0,"y": 23,"z":0 }, + "second" : { "origin": "home", "x": 20,"y": 23,"z":0 } + }, + { + "first" : { "origin": "home", "x": 12,"y": 15,"z":10 }, + "second" : { "origin": "home", "x": 20,"y": 15,"z":10 } + }, + { + "first" : { "origin": "home", "x": 12,"y": 23,"z":10}, + "second" : { "origin": "home", "x": 20,"y": 23,"z":10 } + }, + { + "first" : { "origin": "home", "x": 0,"y": 15,"z":10 }, + "second" : { "origin": "home", "x": 20,"y": 15,"z":10 } + }, + { + "first" : { "origin": "home", "x": 0,"y": 23,"z":10 }, + "second" : { "origin": "home", "x": 20,"y": 23,"z":10 } + } + ] + } + }, + "schema": { "$ref": "#/definitions/Geofence" } + } + } + } + }, + "parameters": { + "interface" : { + "in" : "query", + "name" : "if", + "type" : "string", + "enum" : ["oic.if.s", "oic.if.baseline"] + } + }, + "definitions": { + "Container" : { + "properties": { + "rt" : { + "description": "Resource Type", + "items": { + "enum": ["oic.r.sensor.container"], + "type": "string", + "maxLength": 64 + }, + "minItems": 1, + "readOnly": 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" + }, + "confidence" : { + "description": "The confidence that the information is accurate", + "minimum": 0, + "readOnly": true, + "type": "number" + }, + "measurementmethod" : { + "description": "Method by which position of an entity in the container was determined if known. See Device Specification for valid values.", + "type": "string" + }, + "containerid": { + "description": "The ID of the container Must locally unique", + "type":"string", + "maxLength": 64 + }, + "ContainerElements" :{ + "properties": { + "first": { + "anyOf": [ + { + "$ref": "https://openconnectivityfoundation.github.io/IoTDataModels/PositionResURI.swagger.json#/definitions/Position" + }, + { + "$ref": "https://openconnectivityfoundation.github.io/IoTDataModels/GeolocationResURI.swagger.json#/definitions/Geolocation" + } + ] + }, + "second" : { + "anyOf": [ + { + "$ref": "https://openconnectivityfoundation.github.io/IoTDataModels/PositionResURI.swagger.json#/definitions/Position" + }, + { + "$ref": "https://openconnectivityfoundation.github.io/IoTDataModels/GeolocationResURI.swagger.json#/definitions/Geolocation" + } + ] + } + } + }, + "if" : { + "description": "The OCF Interface set supported by this Resource", + "items": { + "enum": [ + "oic.if.baseline", + "oic.if.s" + ], + "type": "string", + "maxLength": 64 + }, + "minItems": 1, + "readOnly": true, + "uniqueItems": true, + "type": "array" + } + }, + "type" : "object", + "required": ["incontainer"] + } + } +} diff --git a/DistanceContributor.swagger.json b/DistanceContributor.swagger.json new file mode 100644 index 0000000..6ee2371 --- /dev/null +++ b/DistanceContributor.swagger.json @@ -0,0 +1,169 @@ +{ + "swagger": "2.0", + "info": { + "title": "Distance Contributor", + "version": "2021-12-17", + "license": { + "name": "OCF Data Model License", + "url": "https://github.com/openconnectivityfoundation/core/blob/e28a9e0a92e17042ba3e83661e4c0fbce8bdc4ba/LICENSE.md", + "x-copyright": "copyright 2021 Open Connectivity Foundation, Inc. All rights reserved." + }, + "termsOfService": "https://openconnectivityfoundation.github.io/core/DISCLAIMER.md" + }, + "schemes": [ + "http" + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "paths": { + "/DistanceContributorResURI": { + "get": { + "description": "This Resource provides the last Distance entity contributed to the location service.\n", + "parameters": [ + {"$ref": "#/parameters/interface"} + ], + "responses": { + "200": { + "description": "Success path response for the Resource", + "x-example": { + "rt": ["oic.r.location.distance.contributor"], + "contributingentity": {"entitydid": "aa:bb:cc:dd","entitydescription": "kitchen sensor"}, + "referenceentity": {"entitydid": "aa:bb:cc:dd","entitydescription": "kitchen sensor"}, + "distanceentity": { + "entityid":"00:11:22:33", + "entitydescription":"Mom", + "distance":5.0, + "accuracy":30.0, + "timestamp":"2015-11-05T14:30:00Z" + } + }, + "schema": {"$ref": "#/definitions/DistanceContributor"} + } + } + }, + "post": { + "description": "The distance entity submitted to location services\n", + "parameters": [ + {"$ref": "#/parameters/interface"}, + { + "name": "body", + "in": "body", + "required": true, + "schema": {"$ref": "#/definitions/DistanceContributor"}, + "x-example": { + "contributingentity": {"entitydid": "aa:bb:cc:dd","entitydescription": "00:00:00:00:00:00"}, + "referenceentity": {"entitydid": "aa:bb:cc:dd","entitydescription": "00:00:00:00:00:00"}, + "distanceentity": { + "entityid":"00:11:22:33", + "entitydescription":"00:00:00:00:00:00", + "distance":5.0, + "accuracy":30.0, + "timestamp":"2015-11-05T14:30:00Z" + } + } + } + ], + "responses": { + "200": { + "description": "Success path", + "x-example": { + "contributingentity": {"entitydid": "aa:bb:cc:dd","entitydescription": "00:00:00:00:00:00"}, + "referenceentity": {"entitydid": "aa:bb:cc:dd","entitydescription": "00:00:00:00:00:00"}, + "distanceentity": { + "entityid":"00:11:22:33", + "entitydescription":"00:00:00:00:00:00", + "distance":5.0, + "accuracy":30.0, + "timestamp":"2015-11-05T14:30:00Z" + } + }, + "schema": {"$ref": "#/definitions/DistanceContributor"} + } + } + } + } + }, + "parameters": { + "interface": { + "in": "query", + "name": "if", + "type": "string", + "enum": [ + "oic.if.rw", + "oic.r.baseline" + ] + } + }, + "definitions": { + "DistanceContributor": { + "type": "object", + "properties": { + "rt": { + "description": "Resource Type", + "items": { + "maxLength": 64, + "type": "string", + "enum": ["oic.r.location.distance.contributor"] + }, + "minItems": 1, + "readOnly": true, + "uniqueItems": true, + "type": "array" + }, + "if": { + "description": "The OCF Interface set supported by this Resource", + "items": { + "enum": [ + "oic.if.baseline", + "oic.if.rw" + ], + "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" + }, + "referenceentity": { + "description": "The entity at one endpoint of the distance", + "type": "object", + "properties": { + "entitydescription": { + "$ref": "https://openconnectivityfoundation.github.io/IoTDataModels/EntityResURI.swagger.json#/definitions/entity-description" + }, + "entityid": { + "$ref": "https://openconnectivityfoundation.github.io/IoTDataModels/EntityResURI.swagger.json#/definitions/entity-id" + } + } + }, + "distanceentity": { + "$ref": "https://openconnectivityfoundation.github.io/IoTDataModels/DistanceEntityResURI.swagger.json#/definitions/DistanceEntity" + }, + "contributingentity": { + "description": "The entity contributing the distance entity", + "type": "object", + "properties": { + "entitydescription": { + "$ref": "https://openconnectivityfoundation.github.io/IoTDataModels/EntityResURI.swagger.json#/definitions/entity-description" + }, + "entityid": { + "$ref": "https://openconnectivityfoundation.github.io/IoTDataModels/EntityResURI.swagger.json#/definitions/entity-id" + } + } + } + }, + "required": ["referenceentity","distanceentity"] + } + } +} diff --git a/DistanceEntityURI.swagger.json b/DistanceEntityURI.swagger.json new file mode 100644 index 0000000..c3d2581 --- /dev/null +++ b/DistanceEntityURI.swagger.json @@ -0,0 +1,173 @@ +{ + "swagger": "2.0", + "info": { + "title": "Distance Entity", + "description" : "Location Services distance information entity.", + "version": "2021-12-17", + "license": { + "name": "OCF Data Model License", + "url": "https://github.com/openconnectivityfoundation/core/blob/e28a9e0a92e17042ba3e83661e4c0fbce8bdc4ba/LICENSE.md", + "x-copyright": "copyright 2021 Open Connectivity Foundation, Inc. All rights reserved." + }, + "termsOfService": "https://openconnectivityfoundation.github.io/core/DISCLAIMER.md" + }, + "schemes": ["http"], + "consumes": ["application/json"], + "produces": ["application/json"], + "paths": { + "/DistanceEntityURI": { + "post": { + "description": "Contribute entity distance information.", + "parameters": [ + {"$ref": "https://openconnectivityfoundation.github.io/IoTDataModels/EntityResURI.swagger.json#/parameters/interface-contributor"}, + { + "name": "body", + "in": "body", + "required": true, + "schema": {"$ref": "#/definitions/schema-contribute"}, + "x-example": { + "eguid1": "99:98:97:96:95:94", + "eguid2": "00:11:22:33:44:55", + "distance": 10.2, + "accuracy": 0.5, + "confidence": 68 + } + } + ], + "responses": { + "200": { + "description": "Success path.", + "x-example": { + "id": "1", + "rt": ["oic.r.location.contributor.distance"], + "if": ["oic.if.baseline","oic.if.a"], + "eguid1": "99:98:97:96:95:94", + "eguid2": "00:11:22:33:44:55", + "distance": 10.2, + "accuracy": 0.5, + "confidence": 68 + }, + "schema": {"$ref": "#/definitions/schema-contribute"} + } + } + } + }, + "/DistanceEntityURI/{id}" : { + "get": { + "description": "Get a specific instance of distance information.", + "parameters": [ + {"$ref": "https://openconnectivityfoundation.github.io/IoTDataModels/EntityResURI.swagger.json#/parameters/path-id"}, + {"$ref": "https://openconnectivityfoundation.github.io/IoTDataModels/EntityResURI.swagger.json#/parameters/interface-entity"} + ], + "responses": { + "200": { + "description" : "Success path.", + "x-example": { + "rt": ["oic.r.location.entity.distance"], + "if": ["oic.if.baseline","oic.if.s"], + "entity1": { + "eguid": "99:98:97:96:95:94", + "ttl": 0, + "aliases": ["Kitchen Sensor"] + }, + "entity2": { + "eguid": "00:11:22:33:44:55", + "ttl": 0, + "aliases": ["Mother", "Mom"] + }, + "distance": 10.2, + "accuracy": 0.5, + "confidence": 68, + "timestamp" : "2019-08-22T09:19Z" + }, + "schema": {"$ref": "#/definitions/schema-get"} + } + } + } + } + }, + "definitions": { + "entity-distance": { + "description": "The current distance (meters) between 2 entities.", + "minimum": 0, + "type": "number" + }, + "entity-accuracy": { + "description": "The accuracy delta (EG: The distance is +/- 2 meters).", + "minimum": 0, + "type": "number" + }, + "entity-confidence": { + "description": "Percentage of certainty that the reported distance is within the specified accuracy.", + "type":"number", + "minimum":0, + "maximum":100 + }, + "schema-get": { + "properties": { + "entity1": {"$ref": "https://openconnectivityfoundation.github.io/IoTDataModels/EntityResURI.swagger.json#/definitions/entity-representation"}, + "entity2": {"$ref": "https://openconnectivityfoundation.github.io/IoTDataModels/EntityResURI.swagger.json#/definitions/entity-representation"}, + "distance": {"$ref": "#/definitions/entity-distance"}, + "accuracy": {"$ref": "#/definitions/entity-accuracy"}, + "confidence": {"$ref": "#/definitions/entity-confidence"}, + "rt": { + "description": "Resource type", + "items": { + "enum": ["oic.r.location.entity.distance"], + "type": "string" + }, + "minItems": 1, + "readOnly": true, + "uniqueItems": true, + "type": "array" + }, + "if": { + "description": "The interface set supported by this resource", + "items": { + "enum": ["oic.if.baseline", "oic.if.s"], + "type": "string" + }, + "minItems": 1, + "readOnly": true, + "type": "array" + }, + "timestamp": {"$ref": "https://openconnectivityfoundation.github.io/IoTDataModels/EntityResURI.swagger.json#/definitions/entity-timestamp"} + }, + "type": "object" + }, + "schema-contribute": { + "properties": { + "eguid1": {"$ref": "https://openconnectivityfoundation.github.io/IoTDataModels/EntityResURI.swagger.json#/definitions/entity-guid"}, + "eguid2": {"$ref": "https://openconnectivityfoundation.github.io/IoTDataModels/EntityResURI.swagger.json#/definitions/entity-guid"}, + "distance": {"$ref": "#/definitions/entity-distance"}, + "accuracy": {"$ref": "#/definitions/entity-accuracy"}, + "confidence": {"$ref": "#/definitions/entity-confidence"}, + "rt": { + "description": "Resource type.", + "items": { + "enum": ["oic.r.location.contributor.distance"], + "type": "string" + }, + "minItems": 1, + "readOnly": true, + "uniqueItems": true, + "type": "array" + }, + "if": { + "description": "The OCF interface set supported by this resource.", + "items": { + "enum": ["oic.if.baseline","oic.if.a"], + "type": "string" + }, + "minItems": 1, + "readOnly": true, + "uniqueItems": true, + "type": "array" + }, + "id": {"$ref": "https://openconnectivityfoundation.github.io/core/schemas/oic.common.properties.core-schema.json#/definitions/id"} + }, + "type": "object", + "required": ["id", "eguid1", "eguid2"] + } + } +} diff --git a/EntityResURI.swagger.json b/EntityResURI.swagger.json new file mode 100644 index 0000000..68f9c98 --- /dev/null +++ b/EntityResURI.swagger.json @@ -0,0 +1,250 @@ +{ + "swagger": "2.0", + "info": { + "title": "Entity", + "version": "2021-12-17", + "license": { + "name": "OCF Data Model License", + "url": "https://github.com/openconnectivityfoundation/core/blob/e28a9e0a92e17042ba3e83661e4c0fbce8bdc4ba/LICENSE.md", + "x-copyright": "copyright 2021 Open Connectivity Foundation, Inc. All rights reserved." + }, + "termsOfService": "https://openconnectivityfoundation.github.io/core/DISCLAIMER.md" + }, + "schemes": ["http"], + "consumes": ["application/json"], + "produces": ["application/json"], + "paths": { + "/EntityResURI": { + "post": { + "description": "Contribute entity provisioning information.", + "parameters":[ + {"$ref": "#/parameters/interface-contributor"}, + { + "name": "body", + "in": "body", + "required": true, + "schema": {"$ref": "#/definitions/schema-contribute"}, + "x-example": { + "eguid": "00:11:22:33:44:55", + "ttl": 3600, + "aliases": ["Mother", "Mom"], + "rules": [ + {"policy": 3, "uuid": "484b8a51-cb23-46c0-a5f1-b4aebef50ebe", "summary": "Admin provisioning policy"}, + {"policy": 12, "uuid": "e61c3e6b-9c54-4b81-8ce5-f9039c1d04d9", "summary": "Presence contributor policy"}, + {"policy": 5, "uuid": "00000000-0000-0000-0000-000000000000", "summary": "Default to presence viewing + feature provisioning"} + ] + } + } + ], + "responses": { + "200": { + "description": "Success path.", + "x-example": { + "eguid": "00:11:22:33:44:55", + "id": "1", + "rt": ["oic.r.location.contributor"], + "if": ["oic.if.baseline","oic.if.a"], + "ttl": 3600, + "aliases": ["Mother", "Mom"], + "rules": [ + {"policy": 3, "uuid": "484b8a51-cb23-46c0-a5f1-b4aebef50ebe", "summary": "Admin provisioning policy"}, + {"policy": 12, "uuid": "e61c3e6b-9c54-4b81-8ce5-f9039c1d04d9", "summary": "Presence contributor policy"}, + {"policy": 5, "uuid": "00000000-0000-0000-0000-000000000000", "summary": "Default to presence viewing + feature provisioning"} + ] + }, + "schema": {"$ref": "#/definitions/schema-contribute"} + } + } + } + }, + "/EntityResURI/{id}": { + "get": { + "description": "Get a specific instance of provisioning information.", + "parameters": [ + {"$ref": "#/parameters/path-id"}, + {"$ref": "#/parameters/interface-entity"} + ], + "responses": { + "200": { + "description": "Success path.", + "x-example": { + "rt": ["oic.r.location.entity"], + "if": ["oic.if.baseline","oic.if.s"], + "entity": { + "eguid": "00:11:22:33:44:55", + "ttl": 0, + "aliases": ["Mother", "Mom"] + }, + "rules": [ + {"policy": 3, "uuid": "484b8a51-cb23-46c0-a5f1-b4aebef50ebe", "summary": "Admin provisioning policy"}, + {"policy": 0, "uuid": "00000000-0000-0000-0000-000000000000", "summary": "Default to no action allowed"} + ], + "timestamp": "2019-08-22T09:19Z" + }, + "schema": {"$ref": "#/definitions/schema-get"} + } + } + } + } + }, + "parameters": { + "path-id": { + "description": "Resource instance id.", + "in": "path", + "name": "id", + "type": "string", + "required": true + }, + "interface-entity": { + "in": "query", + "name": "if", + "type": "string", + "enum": ["oic.if.baseline", "oic.if.s"] + }, + "interface-contributor": { + "in": "query", + "name": "if", + "type": "string", + "enum": ["oic.if.baseline", "oic.if.a"] + } + }, + "definitions": { + "entity-guid" : { + "description": "Globally unique identifier for an entity.", + "maxLength": 128, + "type": "string" + }, + "entity-ttl": { + "description": "The time-to-live (in seconds) without refreshed information; a value of 0 specifies forever.", + "minimum": 0, + "type": "integer" + }, + "entity-aliases": { + "description": "Human readable alternative identities/descriptions (non-unique).", + "items": { + "maxLength": 128, + "type": "string" + }, + "type": "array" + }, + "entity-representation": { + "description": "Entity representation (guid + provisioned operational features).", + "properties": { + "eguid": {"$ref": "#/definitions/entity-guid"}, + "ttl": {"$ref": "#/definitions/entity-ttl"}, + "aliases": {"$ref": "#/definitions/entity-aliases"} + }, + "type": "object", + "required": ["eguid"] + }, + "entity-rules": { + "description": "Ordered set of policy rules for entity information access.", + "items": { + "properties": { + "policy": { + "description": "Bitmask encoding of entity information actions.", + "x-detail-desc": [ + "0 - No information access", + "1 - Allow feature provisioning", + "2 - Allow policy provisioning", + "4 - Allow presence viewing", + "8 - Allow presence contributions", + "16 - Allow distance viewing", + "32 - Allow distance contributions", + "64 - Allow geofence viewing", + "128 - Allow geofence contributions", + "256 - Allow position viewing", + "512 - Allow position contributions" + ], + "type": "integer", + "minimum": 0, + "maximum": 1023 + }, + "uuid": { + "description": "Device UUID of locationservices client.", + "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}$", + "maxLength": 36, + "type": "string" + }, + "summary": { + "description": "Descriptive summary of policy.", + "maxLength": 128, + "type": "string" + } + }, + "type": "object", + "required": ["policy", "uuid"] + }, + "type": "array" + }, + "entity-timestamp": { + "description": "An RFC3339 formated time indicating when the data was observed (e.g.: 2019-08-22T09:19Z).", + "format": "date-time", + "readOnly": true, + "type": "string" + }, + "schema-get": { + "properties": { + "entity": {"$ref": "#/definitions/entity-representation"}, + "rules": {"$ref": "#/definitions/entity-rules"}, + "rt": { + "description": "Resource type.", + "items": { + "enum": ["oic.r.location.entity"], + "type": "string" + }, + "minItems": 1, + "readOnly": true, + "uniqueItems": true, + "type": "array" + }, + "if": { + "description": "The OCF interface set supported by this resource.", + "items": { + "enum": ["oic.if.baseline","oic.if.s"], + "type": "string" + }, + "minItems": 1, + "readOnly": true, + "uniqueItems": true, + "type": "array" + }, + "timestamp": {"$ref": "#/definitions/entity-timestamp"} + }, + "type" : "object" + }, + "schema-contribute": { + "properties": { + "eguid": {"$ref": "#/definitions/entity-guid"}, + "ttl": {"$ref": "#/definitions/entity-ttl"}, + "aliases": {"$ref": "#/definitions/entity-aliases"}, + "rules": {"$ref" : "#/definitions/entity-rules"}, + "rt": { + "description": "Resource type.", + "items": { + "enum": ["oic.r.location.contributor"], + "type": "string" + }, + "minItems": 1, + "readOnly": true, + "uniqueItems": true, + "type": "array" + }, + "if": { + "description": "The OCF interface set supported by this resource.", + "items": { + "enum": ["oic.if.baseline","oic.if.a"], + "type": "string" + }, + "minItems": 1, + "readOnly": true, + "uniqueItems": true, + "type": "array" + }, + "id": {"$ref": "https://openconnectivityfoundation.github.io/core/schemas/oic.common.properties.core-schema.json#/definitions/id"} + }, + "type" : "object", + "required": ["id", "eguid"] + } + } +} diff --git a/GeofenceContributor.swagger.json b/GeofenceContributor.swagger.json new file mode 100644 index 0000000..506b46b --- /dev/null +++ b/GeofenceContributor.swagger.json @@ -0,0 +1,157 @@ +{ + "swagger": "2.0", + "info": { + "title": "Geofence Contributor", + "version": "2021-12-17", + "license": { + "name": "OCF Data Model License", + "url": "https://github.com/openconnectivityfoundation/core/blob/e28a9e0a92e17042ba3e83661e4c0fbce8bdc4ba/LICENSE.md", + "x-copyright": "copyright 2021 Open Connectivity Foundation, Inc. All rights reserved." + }, + "termsOfService": "https://openconnectivityfoundation.github.io/core/DISCLAIMER.md" + }, + "schemes": [ + "http" + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "paths": { + "/GeofenceContributorResURI": { + "get": { + "description": "This Resource provides the last Geofence entity contributed to the location service.\n", + "parameters": [ + {"$ref": "#/parameters/interface"} + ], + "responses": { + "200": { + "description": "Success path response for the Resource", + "x-example": { + "rt": ["oic.r.location.geofence.contributor"], + "contributingentity": {"entitydid": "aa:bb:cc:dd","entitydescription": "kitchen sensor"}, + "referenceentity": {"entitydid": "aa:bb:cc:dd","entitydescription": "kitchen sensor"}, + "geofenceEntity": { + "referenceentity": {"entityid":"00:11:22:33","entitydescription":"Mom"}, + "geofenceradius": 5 + }, + "schema": {"$ref": "#/definitions/GeofenceContributor"} + } + } + } + }, + "post": { + "description": "The geofence entity submitted to location services\n", + "parameters": [ + {"$ref": "#/parameters/interface"}, + { + "name": "body", + "in": "body", + "required": true, + "schema": {"$ref": "#/definitions/GeofenceContributor"}, + "x-example": { + "contributingentity": {"entitydid": "aa:bb:cc:dd","entitydescription": "kitchen sensor"}, + "referenceentity": {"entitydid": "aa:bb:cc:dd","entitydescription": "kitchen sensor"}, + "geofenceEntity": { + "referenceentity": {"entityid":"00:11:22:33","entitydescription":"Mom"}, + "geofenceradius": 5 + } + } + } + ], + "responses": { + "200": { + "description": "Success path", + "x-example": { + "contributingentity": {"entitydid": "aa:bb:cc:dd","entitydescription": "kitchen sensor"}, + "referenceentity": { + "entitydid": "aa:bb:cc:dd", + "entitydescription": "kitchen sensor", + "geofenceradius": 5 + }, + "geofenceentity": { + "entity": {"entityid":"66:77:88:99:00","entitydescription":"Uncle Jack"}, + "ingeofence": false, + "accuracy": 0.5, + "timestamp": "2018-05-05T13:13:13Z" + } + }, + "schema": {"$ref": "#/definitions/GeofenceContributor"} + } + } + } + } + }, + "parameters": { + "interface": { + "in": "query", + "name": "if", + "type": "string", + "enum": [ + "oic.if.rw", + "oic.r.baseline" + ] + } + }, + "definitions": { + "GeofenceContributor": { + "type": "object", + "properties": { + "rt": { + "description": "Resource Type", + "items": { + "maxLength": 64, + "type": "string", + "enum": ["oic.r.location.geofence.contributor"] + }, + "minItems": 1, + "readOnly": true, + "uniqueItems": true, + "type": "array" + }, + "if": { + "description": "The OCF Interface set supported by this Resource", + "items": { + "enum": [ + "oic.if.baseline", + "oic.if.rw" + ], + "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" + }, + "referenceentity": { + "$ref": "https://openconnectivityfoundation.github.io/IoTDataModels/GeofenceEntityResURI.swagger.json#/definitions/GeofenceEntity" + }, + "geofenceentity": { + "$ref": "https://openconnectivityfoundation.github.io/IoTDataModels/GeofenceEntityReportResURI.swagger.json#/definitions/GeofenceEntityReport" + }, + "contributingentity": { + "description": "The entity contributing the geofence entity", + "type": "object", + "properties": { + "entitydescription": { + "$ref": "https://openconnectivityfoundation.github.io/IoTDataModels/EntityResURI.swagger.json#/definitions/entity-description" + }, + "entityid": { + "$ref": "https://openconnectivityfoundation.github.io/IoTDataModels/EntityResURI.swagger.json#/definitions/entity-id" + } + } + } + }, + "required": ["referenceentity","geofenceentity"] + } + } +} diff --git a/GeofenceEntityURI.swagger.json b/GeofenceEntityURI.swagger.json new file mode 100644 index 0000000..6c501db --- /dev/null +++ b/GeofenceEntityURI.swagger.json @@ -0,0 +1,216 @@ +{ + "swagger": "2.0", + "info": { + "title": "Geofence Entity", + "version": "2021-12-17", + "license": { + "name": "OCF Data Model License", + "url": "https://github.com/openconnectivityfoundation/core/blob/e28a9e0a92e17042ba3e83661e4c0fbce8bdc4ba/LICENSE.md", + "x-copyright": "copyright 2021 Open Connectivity Foundation, Inc. All rights reserved." + }, + "termsOfService": "https://openconnectivityfoundation.github.io/core/DISCLAIMER.md" + }, + "schemes": ["http"], + "consumes": ["application/json"], + "produces": ["application/json"], + "paths": { + "/GeofenceEntityURI": { + "post": { + "description": "Contribute entity geofence information.", + "parameters": [ + {"$ref": "https://openconnectivityfoundation.github.io/IoTDataModels/EntityResURI.swagger.json#/parameters/interface-contributor"}, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/schema-contribute" + }, + "x-example": { + "eguid1": "99:98:97:96:95:94", + "eguid2": "00:11:22:33:44:55", + "iswithin": true, + "radius": 1.5, + "accuracy": 0.5, + "confidence": 68 + } + } + ], + "responses": { + "200": { + "description": "Success path.", + "x-example": { + "id": "1", + "rt": ["oic.r.location.contributor.geofence"], + "if": ["oic.if.baseline", "oic.if.a"], + "eguid1": "99:98:97:96:95:94", + "eguid2": "00:11:22:33:44:55", + "iswithin": true, + "radius": 1.5, + "accuracy": 0.5, + "confidence": 68 + + }, + "schema": { + "$ref": "#/definitions/schema-contribute" + } + } + } + } + }, + "/GeofenceEntityURI/{id}": { + "get": { + "description": "Get a specific instance of geofence information.", + "parameters": [ + {"$ref": "https://openconnectivityfoundation.github.io/IoTDataModels/EntityResURI.swagger.json#/parameters/path-id"}, + {"$ref": "https://openconnectivityfoundation.github.io/IoTDataModels/EntityResURI.swagger.json#/parameters/interface-entity"} + ], + "responses": { + "200": { + "description": "Success path.", + "x-example": { + "rt": ["oic.r.location.entity.geofence"], + "if": ["oic.if.baseline", "oic.if.s"], + "entity1": { + "eguid": "99:98:97:96:95:94", + "ttl": 0, + "aliases": ["Kitchen Sensor"] + }, + "entity2": { + "eguid": "00:11:22:33:44:55", + "ttl": 0, + "aliases": ["Mother", "Mom"] + }, + "iswithin": true, + "radius": 1.5, + "accuracy": 0.5, + "confidence": 68, + "timestamp": "2019-08-22T09:19Z" + }, + "schema": { + "$ref": "#/definitions/schema-get" + } + } + } + } + } + }, + "definitions": { + "entity-iswithin": { + "description": "Indicates if one entity is within a fenceline of a given radius around another entity.", + "type": "boolean" + }, + "entity-radius": { + "description": "The radius of the fenceline (meters).", + "minimum": 0, + "type": "number" + }, + "entity-accuracy": { + "description": "The accuracy delta (EG: The fenceline is +/- 2 meters).", + "minimum": 0, + "type": "number" + }, + "entity-confidence": { + "description": "Percentage of certainty that the reported fencing is within the specified accuracy.", + "type": "number", + "minimum": 0, + "maximum": 100 + }, + "schema-get": { + "properties": { + "entity1": { + "$ref": "https://openconnectivityfoundation.github.io/IoTDataModels/EntityResURI.swagger.json#/definitions/entity-representation" + }, + "entity2": { + "$ref": "https://openconnectivityfoundation.github.io/IoTDataModels/EntityResURI.swagger.json#/definitions/entity-representation" + }, + "iswithin": { + "$ref": "#/definitions/entity-iswithin" + }, + "radius": { + "$ref": "#/definitions/entity-radius" + }, + "accuracy": { + "$ref": "#/definitions/entity-accuracy" + }, + "confidence": { + "$ref": "#/definitions/entity-confidence" + }, + "rt": { + "description": "Resource type.", + "items": { + "enum": ["oic.r.location.entity.geofence"], + "type": "string" + }, + "minItems": 1, + "readOnly": true, + "uniqueItems": true, + "type": "array" + }, + "if": { + "description": "The interface set supported by this resource.", + "items": { + "enum": ["oic.if.baseline", "oic.if.s"], + "type": "string" + }, + "minItems": 1, + "readOnly": true, + "type": "array" + }, + "timestamp": { + "$ref": "https://openconnectivityfoundation.github.io/IoTDataModels/EntityResURI.swagger.json#/definitions/entity-timestamp" + } + }, + "type": "object" + }, + "schema-contribute": { + "properties": { + "eguid1": { + "$ref": "https://openconnectivityfoundation.github.io/IoTDataModels/EntityResURI.swagger.json#/definitions/entity-guid" + }, + "eguid2": { + "$ref": "https://openconnectivityfoundation.github.io/IoTDataModels/EntityResURI.swagger.json#/definitions/entity-guid" + }, + "iswithin": { + "$ref": "#/definitions/entity-iswithin" + }, + "radius": { + "$ref": "#/definitions/entity-radius" + }, + "accuracy": { + "$ref": "#/definitions/entity-accuracy" + }, + "confidence": { + "$ref": "#/definitions/entity-confidence" + }, + "rt": { + "description": "Resource type.", + "items": { + "enum": ["oic.r.location.contributor.geofence"], + "type": "string" + }, + "minItems": 1, + "readOnly": true, + "uniqueItems": true, + "type": "array" + }, + "if": { + "description": "The OCF interface set supported by this resource.", + "items": { + "enum": ["oic.if.baseline", "oic.if.a"], + "type": "string" + }, + "minItems": 1, + "readOnly": true, + "uniqueItems": true, + "type": "array" + }, + "id": { + "$ref": "https://openconnectivityfoundation.github.io/core/schemas/oic.common.properties.core-schema.json#/definitions/id" + } + }, + "type": "object", + "required": ["id", "eguid1", "eguid2"] + } + } +} diff --git a/LocationCollectionResURI.swagger.json b/LocationCollectionResURI.swagger.json new file mode 100644 index 0000000..7cfed3c --- /dev/null +++ b/LocationCollectionResURI.swagger.json @@ -0,0 +1,295 @@ +{ + "swagger": "2.0", + "info": { + "title": "Location Collection", + "version": "2021-12-17", + "license": { + "name": "OCF Data Model License", + "url": "https://github.com/openconnectivityfoundation/core/blob/e28a9e0a92e17042ba3e83661e4c0fbce8bdc4ba/LICENSE.md", + "x-copyright": "copyright 2021 Open Connectivity Foundation, Inc. All rights reserved." + }, + "termsOfService": "https://openconnectivityfoundation.github.io/core/DISCLAIMER.md" + }, + "schemes": ["http"], + "consumes": ["application/json"], + "produces": ["application/json"], + "paths": { + "/LocationCollectionResURI": { + "post": { + "description": "Generate new filtered collection (tracker) of location services entities.", + "parameters": [ + {"$ref": "#/parameters/interface-builder"}, + { + "name": "body", + "in": "body", + "required": true, + "schema": {"$ref": "#/definitions/schema-builder"}, + "x-example": { + "eguidfilter": ["00:11:22:33:*"], + "aliasfilter": ["Mom", "Dad"], + "rtsfilter": ["oic.r.location.entity", + "oic.r.location.entity.presence", + "oic.r.location.entity.distance", + "oic.r.location.entity.geofence", + "oic.r.location.entity.position" + ] + } + } + ], + "responses": { + "200": { + "description": "Success path.", + "x-example": { + "id": "collection-15", + "supportedlocationservices": ["entitycatalog", "presence", "distance", "geofence", "position"], + "rt": ["oic.r.locationcollection.builder"], + "if": ["oic.if.baseline", "oic.if.rw", "oic.if.create"], + "eguidfilter": ["00:11:22:33:*"], + "aliasfilter": ["Mom", "Dad"], + "rtsfilter": ["oic.r.location.entity", + "oic.r.location.entity.presence", + "oic.r.location.entity.distance", + "oic.r.location.entity.geofence", + "oic.r.location.entity.position" + ] + }, + "schema": {"$ref": "#/definitions/schema-builder"} + } + } + }, + "get": { + "description": "Get default configuration for dynamic trackers.", + "parameters": [ + {"$ref": "#/parameters/interface-builder"} + ], + "responses": { + "200": { + "description": "Success response for get request with if=oic.if.baseline query", + "x-example": { + "id": "", + "supportedlocationservices": ["entitycatalog", "presence", "distance", "geofence", "position"], + "rt": ["oic.r.locationcollection.builder"], + "if": ["oic.if.baseline", "oic.if.rw", "oic.if.create"], + "eguidfilter": ["*"], + "aliasfilter": ["*"], + "rtsfilter": ["oic.r.location.entity", + "oic.r.location.entity.presence", + "oic.r.location.entity.distance", + "oic.r.location.entity.geofence", + "oic.r.location.entity.position" + ] + }, + "schema": {"$ref": "#/definitions/schema-builder"} + } + } + } + }, + "/LocationCollectionResURI/{id}": { + "get": { + "description": "Get entity information from filtered collection.", + "parameters": [ + {"$ref": "#/parameters/path-id"}, + {"$ref": "#/parameters/interface-tracker"} + ], + "responses": { + "200": { + "description": "Success response for get request with if=oic.if.baseline query", + "x-example": { + "rt": ["oic.r.locationcollection"], + "if": ["oic.if.baseline", "oic.if.ll", "oic.if.b", "oic.if.delete"], + "rts": ["oic.r.location.presence", "oic.r.position"], + "links": [ + { + "href": "/{EntityPath1}", + "rt": ["oic.r.location.presence"], + "if": ["oic.if.s", "oic.if.baseline"] + }, + { + "href": "/{EntityPath2}", + "rt": ["oic.r.location.position"], + "if": ["oic.if.s", "oic.if.baseline"] + } + ] + }, + "schema": {"$ref": "#/definitions/schema-tracker"} + } + } + } + } + }, + "parameters": { + "path-id": { + "in": "path", + "name": "id", + "type": "string", + "description": "Unique collection identifier for filtered collection (tracker).", + "required": true + }, + "interface-builder": { + "in": "query", + "name": "if", + "type": "string", + "enum": ["oic.if.baseline", "oic.if.rw","oic.if.create"] + }, + "interface-tracker": { + "in": "query", + "name": "if", + "type": "string", + "enum": ["oic.if.baseline", "oic.if.ll", "oic.if.b", "oic.if.delete"] + } + }, + "definitions": { + "link-types": { + "description": "Collection link resource types.", + "enum": ["oic.r.location.entity", + "oic.r.location.entity.distance", + "oic.r.location.entity.geofence", + "oic.r.location.entity.position", + "oic.r.location.entity.presence" + ], + "type": "string" + }, + "collection-link": { + "properties": { + "if": { + "description": "The interface set supported by the linked resource.", + "items": { + "enum": ["oic.if.baseline", "oic.if.s"], + "type": "string" + }, + "minItems": 2, + "uniqueItems": true, + "readOnly": true, + "type": "array" + }, + "rt": { + "description": "Resource type of the linked resource.", + "items": { + "$ref": "#/definitions/link-types" + }, + "minItems": 1, + "maxItems": 1, + "uniqueItems": true, + "readOnly": true, + "type": "array" + }, + "href": {"$ref": "https://openconnectivityfoundation.github.io/core/schemas/oic.links.properties.core-schema.json#/definitions/href"}, + "anchor": {"$ref": "https://openconnectivityfoundation.github.io/core/schemas/oic.links.properties.core-schema.json#/definitions/anchor"}, + "di": {"$ref": "https://openconnectivityfoundation.github.io/core/schemas/oic.links.properties.core-schema.json#/definitions/di"}, + "eps": {"$ref": "https://openconnectivityfoundation.github.io/core/schemas/oic.links.properties.core-schema.json#/definitions/eps"}, + "ins": {"$ref": "https://openconnectivityfoundation.github.io/core/schemas/oic.links.properties.core-schema.json#/definitions/ins"}, + "p": {"$ref": "https://openconnectivityfoundation.github.io/core/schemas/oic.links.properties.core-schema.json#/definitions/p"}, + "rel": {"$ref": "https://openconnectivityfoundation.github.io/core/schemas/oic.links.properties.core-schema.json#/definitions/rel_array"}, + "title": {"$ref": "https://openconnectivityfoundation.github.io/core/schemas/oic.links.properties.core-schema.json#/definitions/title"}, + "type": {"$ref": "https://openconnectivityfoundation.github.io/core/schemas/oic.links.properties.core-schema.json#/definitions/type"} + }, + "type": "object", + "required": ["href", "rt", "if"] + }, + "schema-builder": { + "properties": { + "eguidfilter": { + "description": "Regular expressions to match against entity globally unique id for collection filtering.", + "items": { + "maxLength": 128, + "type": "string" + }, + "type": "array" + }, + "aliasfilter": { + "description": "Regular expressions to match against aliases for collection filtering.", + "items": { + "maxLength": 128, + "type": "string" + }, + "type": "array" + }, + "rtsfilter": { + "description": "Resource types allowed.", + "items": { + "$ref": "#/definitions/link-types" + }, + "minItems": 1, + "type": "array", + "uniqueItems": true + }, + "rt": { + "description": "OCF collection resource type.", + "items": { + "enum": ["oic.r.locationcollection.builder"], + "type": "string" + }, + "minItems": 1, + "readOnly": true, + "uniqueItems": true, + "type": "array" + }, + "if": { + "description": "OCF resource types supported.", + "items": { + "enum": ["oic.if.baseline", "oic.if.rw"], + "type": "string" + }, + "minItems": 1, + "readOnly": true, + "uniqueItems": true, + "type": "array" + }, + "supportedlocationservice": { + "description": "Array of possible entities the device supports.", + "items": { + "enum": ["entitycatalog", "presence", "distance", "geofence", "position"], + "type": "string" + }, + "type": "array", + "minItems": 1, + "readOnly": true + }, + "id": {"$ref": "https://openconnectivityfoundation.github.io/core/schemas/oic.common.properties.core-schema.json#/definitions/id"} + }, + "type": "object", + "required": ["id"] + }, + "schema-tracker": { + "properties": { + "links": { + "type": "array", + "items": { + "$ref": "#/definitions/collection-link" + } + }, + "rts": { + "items": { + "$ref": "#/definitions/link-types" + }, + "minItems": 1, + "type": "array", + "uniqueItems": true + }, + "rt": { + "description": "OCF collection resource type.", + "items": { + "enum": ["oic.r.locationcollection.tracker"], + "type": "string" + }, + "minItems": 1, + "readOnly": true, + "uniqueItems": true, + "type": "array" + }, + "if": { + "description": "OCF resource types supported..", + "items": { + "enum": ["oic.if.baseline", "oic.if.ll", "oic.if.b"], + "type": "string" + }, + "minItems": 1, + "readOnly": true, + "uniqueItems": true, + "type": "array" + } + }, + "type": "object" + } + } +} diff --git a/PositionContributor.swagger.json b/PositionContributor.swagger.json new file mode 100644 index 0000000..c6899f9 --- /dev/null +++ b/PositionContributor.swagger.json @@ -0,0 +1,157 @@ +{ + "swagger": "2.0", + "info": { + "title": "Position Contributor", + "version": "2021-12-17", + "license": { + "name": "OCF Data Model License", + "url": "https://github.com/openconnectivityfoundation/core/blob/e28a9e0a92e17042ba3e83661e4c0fbce8bdc4ba/LICENSE.md", + "x-copyright": "copyright 2021 Open Connectivity Foundation, Inc. All rights reserved." + }, + "termsOfService": "https://openconnectivityfoundation.github.io/core/DISCLAIMER.md" + }, + "schemes": [ + "http" + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "paths": { + "/PositionContributorResURI": { + "get": { + "description": "This Resource provides the last Position entity contributed to the location service.\n", + "parameters": [ + {"$ref": "#/parameters/interface"} + ], + "responses": { + "200": { + "description": "Success path response for the Resource", + "x-example": { + "rt": ["oic.r.location.position.contributor"], + "contributingentity": {"entitydid": "aa:bb:cc:dd","entitydescription": "kitchen sensor"}, + "positionentity": {"entityid":"00:11:22:33","entitydescription":"Mom"}, + "origin": "Home", + "x": 4.23, + "y": 2.72, + "z": 12.07, + "accuracy": 0.20, + "altitudeAccuracy": 1.0, + "timestamp": "2015-11-05T14:30:00Z" + }, + "schema": {"$ref": "#/definitions/PositionContributor"} + } + } + }, + "post": { + "description": "The position entity submitted to location services\n", + "parameters": [ + {"$ref": "#/parameters/interface"}, + { + "name": "body", + "in": "body", + "required": true, + "schema": {"$ref": "#/definitions/PositionContributor"}, + "x-example": { + "contributingentity": {"entitydid": "aa:bb:cc:dd","entitydescription": "kitchen sensor"}, + "positionentity": {"entityid":"00:11:22:33","entitydescription":"Mom"}, + "origin": "Home", + "x": 4.23, + "y": 2.72, + "z": 12.07, + "accuracy": 0.20, + "altitudeAccuracy": 1.0, + "timestamp": "2015-11-05T14:30:00Z" + } + } + ], + "responses": { + "200": { + "description": "Success path", + "x-example": { + "contributingentity": {"entitydid": "aa:bb:cc:dd","entitydescription": "kitchen sensor"}, + "positionentity": {"entityid":"00:11:22:33","entitydescription":"Mom"}, + "origin": "Home", + "x": 4.23, + "y": 2.72, + "z": 12.07, + "accuracy": 0.20, + "altitudeAccuracy": 1.0, + "timestamp": "2015-11-05T14:30:00Z" + }, + "schema": {"$ref": "#/definitions/PositionContributor"} + } + } + } + } + }, + "parameters": { + "interface": { + "in": "query", + "name": "if", + "type": "string", + "enum": [ + "oic.if.rw", + "oic.r.baseline" + ] + } + }, + "definitions": { + "PositionContributor": { + "type": "object", + "properties": { + "rt": { + "description": "Resource Type", + "items": { + "maxLength": 64, + "type": "string", + "enum": ["oic.r.location.position.contributor"] + }, + "minItems": 1, + "readOnly": true, + "uniqueItems": true, + "type": "array" + }, + "if": { + "description": "The OCF Interface set supported by this Resource", + "items": { + "enum": [ + "oic.if.baseline", + "oic.if.rw" + ], + "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" + }, + "positionentity": { + "$ref": "https://openconnectivityfoundation.github.io/IoTDataModels/PositionEntityResURI.swagger.json#/definitions/PositionEntity" + }, + "contributingentity": { + "description": "The entity contributing the position entity", + "type": "object", + "properties": { + "entitydescription": { + "$ref": "https://openconnectivityfoundation.github.io/IoTDataModels/EntityResURI.swagger.json#/definitions/entity-description" + }, + "entityid": { + "$ref": "https://openconnectivityfoundation.github.io/IoTDataModels/EntityResURI.swagger.json#/definitions/entity-id" + } + } + } + }, + "required": ["positionentity"] + } + } +} diff --git a/PositionEntityURI.swagger.json b/PositionEntityURI.swagger.json new file mode 100644 index 0000000..de1c15a --- /dev/null +++ b/PositionEntityURI.swagger.json @@ -0,0 +1,233 @@ +{ + "swagger": "2.0", + "info": { + "title": "Position Entity", + "version": "2021-12-17", + "license": { + "name": "OCF Data Model License", + "url": "https://github.com/openconnectivityfoundation/core/blob/e28a9e0a92e17042ba3e83661e4c0fbce8bdc4ba/LICENSE.md", + "x-copyright": "copyright 2021 Open Connectivity Foundation, Inc. All rights reserved." + }, + "termsOfService": "https://openconnectivityfoundation.github.io/core/DISCLAIMER.md" + }, + "schemes": ["http"], + "consumes": ["application/json"], + "produces": ["application/json"], + "paths": { + "/PositionEntityURI": { + "post": { + "description": "Contribute entity position information.", + "parameters": [ + {"$ref": "https://openconnectivityfoundation.github.io/IoTDataModels/EntityResURI.swagger.json#/parameters/interface-contributor"}, + { + "name": "body", + "in": "body", + "required": true, + "schema": {"$ref": "#/definitions/schema-contribute"}, + "x-example": { + "eguid": "00:11:22:33:44:55", + "position": { + "origin": { + "x": 0, + "y": 0, + "z": 0 + }, + "coordinates": { + "x": 4.23, + "y": 2.72, + "z": 12.07 + }, + "accuracy": 0.5, + "confidence": 68 + } + } + } + ], + "responses": { + "200": { + "description": "Success path.", + "x-example": { + "id": "1", + "rt": ["oic.r.location.contributor.position"], + "if": ["oic.if.baseline", "oic.if.a"], + "eguid": "00:11:22:33:44:55", + "position": { + "origin": { + "x": 0, + "y": 0, + "z": 0 + }, + "coordinates": { + "x": 4.23, + "y": 2.72, + "z": 12.07 + }, + "accuracy": 0.5, + "confidence": 68 + } + }, + "schema": {"$ref": "#/definitions/schema-contribute"} + } + } + } + }, + "/PositionEntityURI/{id}": { + "get": { + "description": "Get a specific instance of position information.", + "parameters": [ + {"$ref": "https://openconnectivityfoundation.github.io/IoTDataModels/EntityResURI.swagger.json#/parameters/path-id"}, + {"$ref": "https://openconnectivityfoundation.github.io/IoTDataModels/EntityResURI.swagger.json#/parameters/interface-entity"} + ], + "responses": { + "200": { + "description": "Success path.", + "x-example": { + "rt": ["oic.r.location.entity.position"], + "if": ["oic.if.baseline", "oic.if.s"], + "entity": { + "eguid": "00:11:22:33:44:55", + "ttl": 0, + "aliases": ["Mother", "Mom"] + }, + "position": { + "origin": { + "x": 0, + "y": 0, + "z": 0 + }, + "coordinates": { + "x": 4.23, + "y": 2.72, + "z": 12.07 + }, + "accuracy": 0.5, + "confidence": 68 + }, + "timestamp": "2019-08-22T09:19Z" + }, + "schema": {"$ref": "#/definitions/schema-get"} + } + } + } + } + }, + "definitions": { + "entity-coordinates": { + "description": "Cartesian coordinate information.", + "properties": { + "x": { + "type": "number", + "description": "The distance (meters) along the x-axis." + }, + "y": { + "type": "number", + "description": "The distance (meters) along the y-axis." + }, + "z": { + "type": "number", + "description": "The distance (meters) along the z-axis." + } + }, + "type": "object", + "required": ["x", "y", "z"] + }, + "entity-cartesian": { + "properties": { + "origin": { + "$ref": "#/definitions/entity-coordinates" + }, + "coordinates": { + "$ref": "#/definitions/entity-coordinates" + }, + "accuracy": { + "description": "The accuracy delta (EG: The position is +/- 2 meters).", + "minimum": 0, + "type": "number" + }, + "confidence": { + "description": "Percentage of certainty that the reported position is within the specified accuracy.", + "type": "number", + "minimum": 0, + "maximum": 100 + } + }, + "type": "object", + "required": ["origin", "coordinates"] + }, + "entity-geolocation": { + "$ref": "https://openconnectivityfoundation.github.io/IoTDataModels/GeolocationResURI.swagger.json#/definitions/Geolocation" + }, + "schema-get": { + "properties": { + "entity": {"$ref": "https://openconnectivityfoundation.github.io/IoTDataModels/EntityResURI.swagger.json#/definitions/entity-representation"}, + "position": { + "type": "object", + "anyOf": [ + {"$ref": "#/definitions/entity-cartesian"}, + {"$ref": "#/definitions/entity-geolocation"} + ] + }, + "timestamp": {"$ref": "https://openconnectivityfoundation.github.io/IoTDataModels/EntityResURI.swagger.json#/definitions/entity-timestamp"}, + "rt": { + "description": "Resource type.", + "items": { + "enum": ["oic.r.location.entity.position"], + "type": "string" + }, + "minItems": 1, + "readOnly": true, + "type": "array" + }, + "if": { + "description": "The OCF Interface set supported by this resource.", + "items": { + "enum": ["oic.if.baseline", "oic.if.s"], + "type": "string" + }, + "minItems": 1, + "readOnly": true, + "uniqueItems": true, + "type": "array" + } + }, + "type": "object" + }, + "entity-contribute": { + "properties": { + "eguid": {"$ref": "https://openconnectivityfoundation.github.io/IoTDataModels/EntityResURI.swagger.json#/definitions/entity-guid"}, + "position": { + "type": "object", + "anyOf": [ + {"$ref": "#/definitions/entity-cartesian"}, + {"$ref": "#/definitions/entity-geolocation"} + ] + }, + "rt": { + "description": "Resource type.", + "items": { + "enum": ["oic.r.location.contributor.position"], + "type": "string" + }, + "minItems": 1, + "readOnly": true, + "uniqueItems": true, + "type": "array" + }, + "if": { + "description": "The OCF interface set supported by this resource.", + "items": { + "enum": ["oic.if.baseline", "oic.if.a"], + "type": "string" + }, + "minItems": 1, + "readOnly": true, + "uniqueItems": true, + "type": "array" + }, + "id": {"$ref": "https://openconnectivityfoundation.github.io/core/schemas/oic.common.properties.core-schema.json#/definitions/id"}, + "type": "object", + "required": ["id", "eguid"] + } + } + } +} diff --git a/PresenceContributor.swagger.json b/PresenceContributor.swagger.json new file mode 100644 index 0000000..6f0ccf3 --- /dev/null +++ b/PresenceContributor.swagger.json @@ -0,0 +1,153 @@ +{ + "swagger": "2.0", + "info": { + "title": "Presence Contributor", + "version": "2021-12-17", + "license": { + "name": "OCF Data Model License", + "url": "https://github.com/openconnectivityfoundation/core/blob/e28a9e0a92e17042ba3e83661e4c0fbce8bdc4ba/LICENSE.md", + "x-copyright": "copyright 2021 Open Connectivity Foundation, Inc. All rights reserved." + }, + "termsOfService": "https://openconnectivityfoundation.github.io/core/DISCLAIMER.md" + }, + "schemes": [ + "http" + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "paths": { + "/PresenceContributorResURI": { + "get": { + "description": "This resource provides the last presence entity contributed to the location service.\n", + "parameters": [ + {"$ref": "#/parameters/interface"} + ], + "responses": { + "200": { + "description": "Success path response for the Resource", + "x-example": { + "rt": ["oic.r.location.presence.contributor"], + "contributingEntity": {"entitydid": "aa:bb:cc:dd","entitydescription": "kitchen sensor"}, + "presenceEntity": { + "entityid":"00:11:22:33", + "entitydescription":"Mom", + "ispresent":true, + "confidence":100, + "timestamp":"2015-11-05T14:30:00Z" + } + }, + "schema": {"$ref": "#/definitions/PresenceContributor"} + } + } + }, + "post": { + "description": "The presence entity submitted to location services\n", + "parameters": [ + {"$ref": "#/parameters/interface"}, + { + "name": "body", + "in": "body", + "required": true, + "schema": {"$ref": "#/definitions/PresenceContributor"}, + "x-example": { + "contributingEntity": {"entitydid": "aa:bb:cc:dd","entitydescription": "kitchen sensor"}, + "presenceEntity": { + "entityid":"00:11:22:33", + "entitydescription":"Mom", + "ispresent":true, + "confidence":100, + "timestamp":"2015-11-05T14:30:00Z" + } + } + } + ], + "responses": { + "200": { + "description": "Success path", + "x-example": { + "contributingEntity": {"entitydid": "aa:bb:cc:dd","entitydescription": "kitchen sensor"}, + "presenceEntity": { + "entityid":"00:11:22:33", + "entitydescription":"Mom", + "ispresent":true, + "confidence":100, + "timestamp":"2015-11-05T14:30:00Z" + } + }, + "schema": {"$ref": "#/definitions/PresenceContributor"} + } + } + } + } + }, + "parameters": { + "interface": { + "in": "query", + "name": "if", + "type": "string", + "enum": [ + "oic.if.rw", + "oic.r.baseline" + ] + } + }, + "definitions": { + "PresenceContributor": { + "type": "object", + "properties": { + "rt": { + "description": "Resource Type", + "items": { + "maxLength": 64, + "type": "string", + "enum": ["oic.r.location.presence.contributor"] + }, + "minItems": 1, + "readOnly": true, + "type": "array" + }, + "if": { + "description": "The OCF Interface set supported by this Resource", + "items": { + "enum": [ + "oic.if.baseline", + "oic.if.s" + ], + "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" + }, + "presenceentity": { + "$ref": "https://openconnectivityfoundation.github.io/IoTDataModels/PresenceEntityResURI.swagger.json#/definitions/PresenceEntity" + }, + "contributingentity": { + "description": "The entity contributing the presence entity", + "type": "object", + "properties": { + "entitydescription": { + "$ref": "https://openconnectivityfoundation.github.io/IoTDataModels/EntityResURI.swagger.json#/definitions/entity-description" + }, + "entityid": { + "$ref": "https://openconnectivityfoundation.github.io/IoTDataModels/EntityResURI.swagger.json#/definitions/entity-id" + } + } + } + }, + "required": ["presenceentity"] + } + } +} diff --git a/PresenceEntityURI.swagger.json b/PresenceEntityURI.swagger.json new file mode 100644 index 0000000..03b093e --- /dev/null +++ b/PresenceEntityURI.swagger.json @@ -0,0 +1,153 @@ +{ + "swagger": "2.0", + "info": { + "title": "Presence Entity", + "version": "2021-12-17", + "license": { + "name": "OCF Data Model License", + "url": "https://github.com/openconnectivityfoundation/core/blob/e28a9e0a92e17042ba3e83661e4c0fbce8bdc4ba/LICENSE.md", + "x-copyright": "copyright 2021 Open Connectivity Foundation, Inc. All rights reserved." + }, + "termsOfService": "https://openconnectivityfoundation.github.io/core/DISCLAIMER.md" + }, + "schemes": ["http"], + "consumes": ["application/json"], + "produces": ["application/json"], + "paths": { + "/PresenceEntityURI": { + "post": { + "description": "Contribute entity presence information.", + "parameters": [ + {"$ref": "https://openconnectivityfoundation.github.io/IoTDataModels/EntityResURI.swagger.json#/parameters/interface-contributor"}, + { + "name": "body", + "in": "body", + "required": true, + "schema": {"$ref": "#/definitions/schema-contribute"}, + "x-example": { + "eguid": "00:11:22:33:44:55", + "ispresent": true, + "confidence": 100 + } + } + ], + "responses": { + "200": { + "description": "Success path.", + "x-example": { + "id": "1", + "rt": ["oic.r.location.contributor.presence"], + "if": ["oic.if.baseline", "oic.if.a"], + "eguid": "00:11:22:33:44:55", + "ispresent": true, + "confidence": 100 + }, + "schema": {"$ref": "#/definitions/schema-contribute"} + } + } + } + }, + "/PresenceEntityURI/{id}": { + "get": { + "description": "Get a specific instance of presence information.", + "parameters": [ + {"$ref": "https://openconnectivityfoundation.github.io/IoTDataModels/EntityResURI.swagger.json#/parameters/path-id"}, + {"$ref": "https://openconnectivityfoundation.github.io/IoTDataModels/EntityResURI.swagger.json#/parameters/interface-entity"} + ], + "responses": { + "200": { + "description": "Success path.", + "x-example": { + "rt": ["oic.r.location.entity.presence"], + "if": ["oic.if.baseline", "oic.if.s"], + "entity": { + "eguid": "00:11:22:33:44:55", + "ttl": 0, + "aliases": ["Mother", "Mom"] + }, + "ispresent": true, + "confidence": 100, + "timestamp": "2019-08-22T09:19Z" + }, + "schema": {"$ref": "#/definitions/schema-get"} + } + } + } + } + }, + "definitions": { + "entity-ispresent": { + "description": "Indicator of the detection (true) or otherwise (false) of presence.", + "type": "boolean" + }, + "entity-confidence": { + "description": "Percentage of certainty in the reported presence.", + "type": "number", + "minimum": 0, + "maximum": 100 + }, + "schema-get": { + "properties": { + "entity": {"$ref": "https://openconnectivityfoundation.github.io/IoTDataModels/EntityResURI.swagger.json#/definitions/entity-representation"}, + "ispresent": {"$ref": "#/definitions/entity-ispresent"}, + "confidence": {"$ref": "#/definitions/entity-confidence"}, + "timestamp": {"$ref": "https://openconnectivityfoundation.github.io/IoTDataModels/EntityResURI.swagger.json#/definitions/entity-timestamp"}, + "rt": { + "description": "Resource type.", + "items": { + "enum": ["oic.r.location.entity.presence"], + "type": "string" + }, + "minItems": 1, + "readOnly": true, + "uniqueItems": true, + "type": "array" + }, + "if": { + "description": "The OCF Interface set supported by this resource.", + "items": { + "enum": ["oic.if.baseline", "oic.if.s"], + "type": "string" + }, + "minItems": 1, + "readOnly": true, + "uniqueItems": true, + "type": "array" + } + }, + "type": "object" + }, + "schema-contribute": { + "properties": { + "eguid": {"$ref": "https://openconnectivityfoundation.github.io/IoTDataModels/EntityResURI.swagger.json#/definitions/entity-guid"}, + "ispresent": {"$ref": "#/definitions/entity-ispresent"}, + "confidence": {"$ref": "#/definitions/entity-confidence"}, + "rt": { + "description": "Resource type.", + "items": { + "enum": ["oic.r.location.contributor.presence"], + "type": "string" + }, + "minItems": 1, + "readOnly": true, + "uniqueItems": true, + "type": "array" + }, + "if": { + "description": "The OCF interface set supported by this resource.", + "items": { + "enum": ["oic.if.baseline", "oic.if.a"], + "type": "string" + }, + "minItems": 1, + "readOnly": true, + "uniqueItems": true, + "type": "array" + }, + "id": {"$ref": "https://openconnectivityfoundation.github.io/core/schemas/oic.common.properties.core-schema.json#/definitions/id"} + }, + "type": "object", + "required": ["id", "eguid"] + } + } +}