diff --git a/swagger2.0/oic.r.rule.action.swagger.json b/swagger2.0/oic.r.rule.action.swagger.json new file mode 100644 index 0000000..163b0e9 --- /dev/null +++ b/swagger2.0/oic.r.rule.action.swagger.json @@ -0,0 +1,243 @@ +{ + "swagger": "2.0", + "info": { + "title": "OCF Rule Action", + "version": "20190910", + "license": { + "name": "OCF Data Model License", + "url": "https://github.com/openconnectivityfoundation/core/blob/e28a9e0a92e17042ba3e83661e4c0fbce8bdc4ba/LICENSE.md", + "x-copyright": "copyright 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": { + "/RuleActionResURI": { + "get": { + "description": "Rule Action contains a link to Scene Collection and a value to be set for the \"lastScene\" Property within that Collection.", + "parameters": [ + {"$ref": "#/parameters/interface-r"} + ], + "responses": { + "200": { + "description" : "Retrieves the Rule action.", + "x-example": + { + "rt": ["oic.r.rule.action"], + "if": ["oic.if.rw", "oic.if.baseline"], + "link": {"href": "/myscene","rt":["oic.wk.scenecollection"],"if":["oic.if.a","oic.if.ll","oic.if.baseline"]}, + "scenevalue": "desiredlastscenevalue" + }, + "schema": { "$ref": "#/definitions/ruleaction" } + } + } + }, + "post": { + "description": "", + "parameters": [ + {"$ref": "#/parameters/interface-rw"}, + { + "name": "body", + "in": "body", + "required": true, + "schema": { "$ref": "#/definitions/ruleaction-update" }, + "x-example": + { + "scenevalue": "somedifferentlastscenevalue" + } + } + ], + "responses": { + "200": { + "description" : "", + "x-example": { + "link": {"href": "/myscene","rt":["oic.wk.scenecollection"],"if":["oic.if.a","oic.if.ll","oic.if.baseline"]}, + "scenevalue": "somedifferentlastscenevalue" + }, + "schema": { "$ref": "#/definitions/ruleaction" } + } + } + } + }, + "/RuleActionResURI?if=oic.if.delete": { + "get": { + "description": "Retrieval response using oic.if.delete", + "parameters": [ + {"$ref": "#/parameters/interface-delete"} + ], + "responses": { + "200": { + "description" : "Retrieval on oic.if.create provides an empty payload." + } + } + }, + "delete": { + "description": "", + "parameters": [ + {"$ref": "#/parameters/interface-delete"} + ], + "responses": { + "200": { + "description" : "", + "schema": { "$ref": "#/definitions/resource-delete" } + } + } + } + } + }, + "parameters": { + "interface-r": { + "in": "query", + "name": "if", + "type": "string", + "enum": ["oic.if.rw","oic.if.baseline"] + }, + "interface-rw": { + "in": "query", + "name": "if", + "type": "string", + "enum": ["oic.if.rw"] + } + "interface-delete": { + "in": "query", + "name": "if", + "type": "string", + "enum": ["oic.if.delete"] + }, + "interface-all": { + "in": "query", + "name": "if", + "type": "string", + "enum": ["oic.if.rw","oic.if.baseline","oic.if.delete"] + } + }, + "definitions": { + "oic.oic-link": { + "type": "object", + "properties": { + "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" + }, + "href": { + "$ref": "https://openconnectivityfoundation.github.io/core/schemas/oic.links.properties.core-schema.json#/definitions/href" + }, + "if": { + "description": "The OCF Interfaces supported by the Linked Resource", + "items": { + "enum": [ + "oic.if.baseline", + "oic.if.ll", + "oic.if.a" + ], + "type": "string", + "maxLength": 64 + }, + "minItems": 1, + "uniqueItems": true, + "type": "array" + }, + "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" + }, + "rt": { + "description": "Resource Type of the Linked Resource", + "items": { + "enum": ["oic.wk.scenecollection"], + "maxLength": 64, + "type": "string" + }, + "minItems": 1, + "uniqueItems": true, + "type": "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" + } + }, + "required": [ + "href", + "rt", + "if" + ] + }, + "ruleaction" : { + "properties": { + "rt" : { + "description": "The Resource Type.", + "items": { + "enum": ["oic.r.rule.action"], + "maxLength": 64, + "type": "string" + }, + "minItems": 1, + "uniqueItems": true, + "readOnly": true, + "type": "array" + }, + "link": { + "$ref": "#/definitions/oic.oic-link" + }, + "scenevalue": { + "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 OCF Interface set supported by this Resource.", + "items": { + "enum": [ + "oic.if.rw", + "oic.if.baseline" + ], + "type": "string" + }, + "minItems": 2, + "uniqueItems": true, + "readOnly": true, + "type": "array" + } + }, + "type": "object", + "required": ["link", "scenevalue"] + }, + "ruleaction-update" : { + "properties": { + "scenevalue": { + "type": "string" + } + }, + "type": "object", + "required": ["scenevalue"] + }, + "resource-delete": { + "type": "object", + "properties": { + "href": { + "$ref": "https://openconnectivityfoundation.github.io/core/schemas/oic.links.properties.core-schema.json#/definitions/href" + } + }, + "required": ["href"] + } + } +} diff --git a/swagger2.0/oic.r.rule.actioncollection.swagger.json b/swagger2.0/oic.r.rule.actioncollection.swagger.json new file mode 100644 index 0000000..33acd4f --- /dev/null +++ b/swagger2.0/oic.r.rule.actioncollection.swagger.json @@ -0,0 +1,441 @@ +{ + "swagger": "2.0", + "info": { + "title": "OCF Rule Action Collection", + "version": "20200122", + "license": { + "name": "OCF Data Model License", + "url": "https://github.com/openconnectivityfoundation/core/blob/e28a9e0a92e17042ba3e83661e4c0fbce8bdc4ba/LICENSE.md", + "x-copyright": "copyright 2020 Open Connectivity Foundation, Inc. All rights reserved." + }, + "termsOfService": "https://openconnectivityfoundation.github.io/core/DISCLAIMER.md" + }, + "schemes": ["http"], + "consumes": ["application/json"], + "produces": ["application/json"], + "paths": { + "/RuleActionCollectionResURI?if=oic.if.ll": { + "get": { + "description": "A Collection of Links to one or more Rule Actions, which are processed when the Rule Expression evaluates to \"true\".", + "parameters": [ + {"$ref": "#/parameters/interface-all"} + ], + "responses": { + "200": { + "description" : "Retrieves the rule action Links.", + "x-example": + [ + { + "href": "/myruleaction", + "rt": ["oic.r.rule.action"], + "if": ["oic.if.rw","oic.if.baseline"], + "p": {"bm": 3}, + "eps": [ + {"ep": "coaps://[fe80::b1d6]:1111"} + ] + } + ], + "schema": { "$ref": "#/definitions/slinklist" } + } + } + } + }, + "/RuleActionCollectionResURI?if=oic.if.baseline": { + "get": { + "description": "A Collection of Links to one or more Rule Actions, which are processed when the Rule Expression evaluates to \"true\".", + "parameters": [ + {"$ref": "#/parameters/interface-all"} + ], + "responses": { + "200": { + "description" : "Retrieves the rule action Links.", + "x-example": + { + "rt": ["oic.r.rule.actioncollection"], + "if": ["oic.if.ll","oic.if.baseline","oic.if.create","oic.if.linkadd","oic.if.linkremove"], + "rts": ["oic.r.rule.action"], + "n": "My collection of Rule Actions", + "links": [ + { + "href": "/myruleaction", + "rt": ["oic.r.rule.action"], + "if": ["oic.if.rw","oic.if.baseline"], + "p": {"bm": 3}, + "eps": [ + {"ep": "coaps://[fe80::b1d6]:1111"} + ] + } + ] + }, + "schema": { "$ref": "#/definitions/sbaseline" } + } + } + } + }, + "/RuleActionCollectionResURI?if=oic.if.create": { + "get": { + "description": "Retrieval response for an instance of oic.r.rule.actioncollection using oic.if.create", + "parameters": [ + {"$ref": "#/parameters/interface-all"} + ], + "responses": { + "200": { + "description" : "Retrival on oic.if.create provides an empty payload.", + "x-example": + {} + } + } + }, + "post": { + "description": "", + "parameters": [ + {"$ref": "#/parameters/interface-create"}, + { + "name": "body", + "in": "body", + "required": true, + "schema": { "$ref": "#/definitions/ruleaction-create" }, + "x-example": + { + "rt": ["oic.r.rule.action"], + "if": ["oic.if.rw","oic.if.baseline"], + "p": {"bm": 3}, + "rep": { + "link": [{"href": "/myscene","rt":["oic.wk.scenecollection"],"if":["oic.if.a","oic.if.ll","oic.if.baseline"]}], + "scenevalue": "desiredlastscenevalue" + } + } + } + ], + "responses": { + "200": { + "description" : "", + "x-example": { + "href": "/newURIforResource", + "ins": 39724818, + "rt": ["oic.r.rule.action"], + "if": ["oic.if.rw","oic.if.baseline"], + "p": {"bm": 3}, + "rep": { + "link": [{"href": "/myscene","rt":["oic.wk.scenecollection"],"if":["oic.if.a","oic.if.ll","oic.if.baseline"]}], + "scenevalue": "desiredlastscenevalue" + } + }, + "schema": { "$ref": "#/definitions/ruleaction-create" } + } + } + } + }, + "/RuleActionCollectionResURI?if=oic.if.linkadd" : { + "get": { + "description": "Retrieval response using oic.if.linkadd", + "parameters": [ + {"$ref": "#/parameters/interface-linkadd"} + ], + "responses": { + "200": { + "description" : "Retrieval on oic.if.linkadd provides an empty payload." + } + } + }, + "post": { + "description": "", + "parameters": [ + {"$ref": "#/parameters/interface-linkadd"}, + { + "name": "body", + "in": "body", + "required": true, + "schema": { "$ref": "#/definitions/oic.oic-link" } + } + ], + "responses": { + "200": { + "description" : "", + "schema": { "$ref": "#/definitions/oic.oic-link" } + } + } + } + }, + "/RuleActionCollectionResURI?if=oic.if.linkremove&ins={linkparameter-ins}" : { + "get": { + "description": "Retrieval response using oic.if.linkremove", + "parameters": [ + {"$ref": "#/parameters/interface-linkremove"}, + {"$ref": "#/parameters/linkparameter-ins"} + ], + "responses": { + "200": { + "description" : "Retrieval on oic.if.linkremove provides an empty payload." + } + } + }, + "post": { + "description": "", + "parameters": [ + {"$ref": "#/parameters/interface-linkremove"}, + {"$ref": "#/parameters/linkparameter-ins"} + ], + "responses": { + "200": { + "description" : "", + "schema": { "$ref": "#/definitions/oic.oic-link" } + } + } + } + }, + "/RuleActionCollectionResURI?if=oic.if.delete": { + "get": { + "description": "Retrieval response using oic.if.delete", + "parameters": [ + {"$ref": "#/parameters/interface-delete"} + ], + "responses": { + "200": { + "description" : "Retrieval on oic.if.create provides an empty payload." + } + } + }, + "delete": { + "description": "", + "parameters": [ + {"$ref": "#/parameters/interface-delete"} + ], + "responses": { + "200": { + "description" : "", + "schema": { "$ref": "#/definitions/resource-delete" } + } + } + } + } + }, + "parameters": { + "interface-all": { + "in": "query", + "name": "if", + "type": "string", + "enum": ["oic.if.ll","oic.if.baseline","oic.if.create","oic.if.delete","oic.if.linkadd","oic.if.linkremove"] + }, + "interface-create": { + "in": "query", + "name": "if", + "type": "string", + "enum": ["oic.if.create"] + }, + "interface-delete": { + "in": "query", + "name": "if", + "type": "string", + "enum": ["oic.if.delete"] + }, + "interface-linkadd" : { + "in" : "query", + "name" : "if", + "type" : "string", + "enum" : ["oic.if.linkadd"] + }, + "interface-linkremove" : { + "in" : "query", + "name" : "if", + "type" : "string", + "enum" : ["oic.if.linkremove"] + }, + "linkparameter-ins" : { + "name" : "linkparameter-ins", + "in" : "path", + "type" : "integer", + "required": true + } + }, + "definitions": { + "ruleaction-create": { + "type": "object", + "properties": { + "href": { + "$ref": "https://openconnectivityfoundation.github.io/core/schemas/oic.links.properties.core-schema.json#/definitions/href" + }, + "if": { + "description": "The OCF Interfaces supported by the created Resource", + "items": { + "enum": [ + "oic.if.baseline", + "oic.if.rw" + ], + "type": "string", + "maxLength": 64 + }, + "minItems": 1, + "uniqueItems": true, + "type": "array" + }, + "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" + }, + "rt": { + "description": "Resource Type of the created Resource", + "items": { + "maxLength": 64, + "type": "string", + "enum": ["oic.r.rule.action"] + }, + "minItems": 1, + "uniqueItems": true, + "type": "array" + }, + "rep": { + "type": "object" + } + } + }, + "resource-delete": { + "type": "object", + "properties": { + "href": { + "$ref": "https://openconnectivityfoundation.github.io/core/schemas/oic.links.properties.core-schema.json#/definitions/href" + } + }, + "required": ["href"] + }, + "oic.oic-link": { + "type": "object", + "properties": { + "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" + }, + "href": { + "$ref": "https://openconnectivityfoundation.github.io/core/schemas/oic.links.properties.core-schema.json#/definitions/href" + }, + "if": { + "description": "The OCF Interfaces supported by the Linked Resource", + "items": { + "enum": [ + "oic.if.baseline", + "oic.if.rw" + ], + "type": "string", + "maxLength": 64 + }, + "minItems": 1, + "uniqueItems": true, + "type": "array" + }, + "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" + }, + "rt": { + "description": "Resource Type of the Linked Resource", + "items": { + "maxLength": 64, + "type": "string", + "enum": ["oic.r.rule.action"] + }, + "minItems": 1, + "uniqueItems": true, + "type": "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" + } + }, + "required": [ + "href", + "rt", + "if" + ] + }, + "slinklist": { + "type" : "array", + "readOnly": true, + "items": { + "$ref": "#/definitions/oic.oic-link" + } + }, + "sbaseline" : { + "properties": { + "links" : { + "description": "A set of simple or individual Links.", + "items": { + "$ref": "#/definitions/oic.oic-link" + }, + "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" + }, + "rt": { + "description": "The Resource Type.", + "items": { + "enum": ["oic.r.rule.actioncollection"], + "maxLength": 64, + "type": "string" + }, + "minItems": 1, + "uniqueItems": true, + "readOnly": true, + "type": "array" + }, + "rts": { + "description": "The Resource Types contained within the Collection.", + "items": { + "enum": ["oic.r.rule.action"], + "maxLength": 64, + "type": "string" + }, + "minItems": 1, + "uniqueItems": true, + "readOnly": true, + "type": "array" + }, + "if": { + "description": "The OCF Interfaces supported by this Resource", + "items": { + "enum": [ + "oic.if.ll", + "oic.if.baseline", + "oic.if.create", + "oic.if.linkadd", + "oic.if.linkremove", + "oic.if.delete" + ], + "type": "string", + "maxLength": 64 + }, + "minItems": 2, + "uniqueItems": true, + "readOnly": true, + "type": "array" + } + }, + "additionalProperties": true, + "type" : "object", + "required": [ + "rt", + "if", + "links", + "rts" + ] + } + } +} diff --git a/swagger2.0/oic.r.rule.expression.swagger.json b/swagger2.0/oic.r.rule.expression.swagger.json new file mode 100644 index 0000000..bd02818 --- /dev/null +++ b/swagger2.0/oic.r.rule.expression.swagger.json @@ -0,0 +1,196 @@ +{ + "swagger": "2.0", + "info": { + "title": "OCF Rule Expression", + "version": "20200114", + "license": { + "name": "OCF Data Model License", + "url": "https://github.com/openconnectivityfoundation/core/blob/e28a9e0a92e17042ba3e83661e4c0fbce8bdc4ba/LICENSE.md", + "x-copyright": "copyright 2020 Open Connectivity Foundation, Inc. All rights reserved." + }, + "termsOfService": "https://openconnectivityfoundation.github.io/core/DISCLAIMER.md" + }, + "schemes": ["http"], + "consumes": ["application/json"], + "produces": ["application/json"], + "paths": { + "/RuleExpressionResURI": { + "get": { + "description": "Expression for the Rule that defines the Rule logic in terms of the defined Rule Inputs, and which evaluates to a boolean value, for which \"true\" means that the Rule has been triggered.", + "parameters": [ + {"$ref": "#/parameters/interface-all"} + ], + "responses": { + "200": { + "description" : "Retrieves the Rule expression.", + "x-example": + { + "rt": ["oic.r.rule.expression"], + "if": ["oic.if.rw", "oic.if.baseline"], + "rule": "(mytemperature:temperature >= \"25\")", + "ruleresult": false, + "ruleenable": true, + "actionenable": true + }, + "schema": { "$ref": "#/definitions/ruleexpression" } + } + } + }, + "post": { + "description": "", + "parameters": [ + {"$ref": "#/parameters/interface-rw"}, + { + "name": "body", + "in": "body", + "required": true, + "schema": { "$ref": "#/definitions/ruleexpression-update" }, + "x-example": + { + "ruleenable": true, + "actionenable": false, + "ruleresult": false + } + } + ], + "responses": { + "200": { + "description" : "", + "x-example": { + "rule": "(mytemperature:temperature >= 25)", + "ruleresult": false, + "ruleenable": true, + "actionenable": false + }, + "schema": { "$ref": "#/definitions/ruleexpression" } + } + } + } + }, + "/RuleExpressionResURI?if=oic.if.delete": { + "get": { + "description": "Retrieval response using oic.if.delete", + "parameters": [ + {"$ref": "#/parameters/interface-delete"} + ], + "responses": { + "200": { + "description" : "Retrieval on oic.if.create provides an empty payload." + } + } + }, + "delete": { + "description": "", + "parameters": [ + {"$ref": "#/parameters/interface-delete"} + ], + "responses": { + "200": { + "description" : "", + "schema": { "$ref": "#/definitions/resource-delete" } + } + } + } + } + }, + "parameters": { + "interface-rw": { + "in": "query", + "name": "if", + "type": "string", + "enum": ["oic.if.rw"] + }, + "interface-delete": { + "in": "query", + "name": "if", + "type": "string", + "enum": ["oic.if.delete"] + }, + "interface-all": { + "in": "query", + "name": "if", + "type": "string", + "enum": ["oic.if.rw","oic.if.baseline","oic.if.delete"] + } + }, + "definitions": { + "ruleexpression" : { + "properties": { + "rt": { + "description": "The Resource Type.", + "items": { + "enum": ["oic.r.rule.expression"], + "maxLength": 64, + "type": "string" + }, + "minItems": 1, + "uniqueItems": true, + "readOnly": true, + "type": "array" + }, + "rule": { + "description": "The logical expression to be evaluated, see BNF", + "type": "string" + }, + "ruleresult": { + "type": "boolean" + }, + "ruleenable": { + "type": "boolean" + }, + "actionenable": { + "type": "boolean" + }, + "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.rw", + "oic.if.baseline" + ], + "type": "string" + }, + "minItems": 2, + "uniqueItems": true, + "readOnly": true, + "type": "array" + } + }, + "type": "object", + "required": ["rule","ruleresult","actionenable","ruleenable"] + }, + "ruleexpression-update" : { + "properties": { + "rule": { + "description": "The logical expression to be evaluated, see BNF", + "type": "string" + }, + "ruleenable": { + "type": "boolean" + }, + "actionenable": { + "type": "boolean" + }, + "ruleresult": { + "type": "boolean" + } + }, + "type": "object" + }, + "resource-delete": { + "type": "object", + "properties": { + "href": { + "$ref": "https://openconnectivityfoundation.github.io/core/schemas/oic.links.properties.core-schema.json#/definitions/href" + } + }, + "required": ["href"] + } + } +} diff --git a/swagger2.0/oic.r.rule.inputcollection.swagger.json b/swagger2.0/oic.r.rule.inputcollection.swagger.json new file mode 100644 index 0000000..a99fc0a --- /dev/null +++ b/swagger2.0/oic.r.rule.inputcollection.swagger.json @@ -0,0 +1,347 @@ +{ + "swagger": "2.0", + "info": { + "title": "OCF Rule Input Collection", + "version": "20200114", + "license": { + "name": "OCF Data Model License", + "url": "https://github.com/openconnectivityfoundation/core/blob/e28a9e0a92e17042ba3e83661e4c0fbce8bdc4ba/LICENSE.md", + "x-copyright": "copyright 2020 Open Connectivity Foundation, Inc. All rights reserved." + }, + "termsOfService": "https://openconnectivityfoundation.github.io/core/DISCLAIMER.md" + }, + "schemes": ["http"], + "consumes": ["application/json"], + "produces": ["application/json"], + "paths": { + "/RuleInputCollectionResURI?if=oic.if.ll": { + "get": { + "description": "Collection of Links to the Resources (i.e., Rule Inputs) that contain the Properties whose values are evaluated as part of the Rule Expression.", + "parameters": [ + {"$ref": "#/parameters/interface-all"} + ], + "responses": { + "200": { + "description" : "Retrieves the Rule Input Links.", + "x-example": + [ + { + "anchor": "mytemperature", + "href": "/mylocaltemperaturesensor", + "rel": ["ruleinput"], + "rt": ["oic.r.temperature"], + "if": ["oic.if.s"], + "p": {"bm": 3}, + "eps": [ + {"ep": "coaps://[fe80::b1d6]:1111"} + ] + } + ], + "schema": { "$ref": "#/definitions/slinklist" } + } + } + } + }, + "/RuleInputCollectionResURI?if=oic.if.baseline": { + "get": { + "description": "Collection of Links to the Resources (i.e., Rule Inputs) that contain the Properties whose values are evaluated as part of the Rule Expression.", + "parameters": [ + {"$ref": "#/parameters/interface-all"} + ], + "responses": { + "200": { + "description" : "Retrieves the rule input Links.", + "x-example": + { + "rt": ["oic.r.rule.inputcollection"], + "if": ["oic.if.ll","oic.if.baseline","oic.if.linkadd","oic.if.linkremove"], + "rts": ["oic.r.temperature"], + "n": "My Rule Inputs", + "links": [ + { + "anchor": "mytemperature", + "href": "/mylocaltemperaturesensor", + "rel": ["ruleinput"], + "rt": ["oic.r.temperature"], + "if": ["oic.if.s"], + "p": {"bm": 3}, + "eps": [ + {"ep": "coaps://[fe80::b1d6]:1111"} + ] + } + ] + }, + "schema": { "$ref": "#/definitions/sbaseline" } + } + } + } + }, + "/RuleInputCollectionResURI?if=oic.if.linkadd" : { + "get": { + "description": "Retrieval response using oic.if.linkadd", + "parameters": [ + {"$ref": "#/parameters/interface-linkadd"} + ], + "responses": { + "200": { + "description" : "Retrieval on oic.if.linkadd provides an empty payload." + } + } + }, + "post": { + "description": "", + "parameters": [ + {"$ref": "#/parameters/interface-linkadd"}, + { + "name": "body", + "in": "body", + "required": true, + "schema": { "$ref": "#/definitions/oic.oic-link" } + } + ], + "responses": { + "200": { + "description" : "", + "schema": { "$ref": "#/definitions/oic.oic-link" } + } + } + } + }, + "/RuleInputCollectionResURI?if=oic.if.linkremove&ins={linkparameter-ins}" : { + "get": { + "description": "Retrieval response using oic.if.linkremove", + "parameters": [ + {"$ref": "#/parameters/interface-linkremove"}, + {"$ref": "#/parameters/linkparameter-ins"} + ], + "responses": { + "200": { + "description" : "Retrieval on oic.if.linkremove provides an empty payload." + } + } + }, + "post": { + "description": "", + "parameters": [ + {"$ref": "#/parameters/interface-linkremove"}, + {"$ref": "#/parameters/linkparameter-ins"} + ], + "responses": { + "200": { + "description" : "", + "schema": { "$ref": "#/definitions/oic.oic-link" } + } + } + } + }, + "/RuleInputCollectionResURI?if=oic.if.delete": { + "get": { + "description": "Retrieval response using oic.if.delete", + "parameters": [ + {"$ref": "#/parameters/interface-delete"} + ], + "responses": { + "200": { + "description" : "Retrieval on oic.if.create provides an empty payload." + } + } + }, + "delete": { + "description": "", + "parameters": [ + {"$ref": "#/parameters/interface-delete"} + ], + "responses": { + "200": { + "description" : "", + "schema": { "$ref": "#/definitions/resource-delete" } + } + } + } + } + }, + "parameters": { + "interface-all": { + "in": "query", + "name": "if", + "type": "string", + "enum": ["oic.if.ll","oic.if.linkadd","oic.if.linkremove","oic.if.baseline","oic.if.delete"] + }, + "interface-delete": { + "in": "query", + "name": "if", + "type": "string", + "enum": ["oic.if.delete"] + }, + "interface-linkadd" : { + "in" : "query", + "name" : "if", + "type" : "string", + "enum" : ["oic.if.linkadd"] + }, + "interface-linkremove" : { + "in" : "query", + "name" : "if", + "type" : "string", + "enum" : ["oic.if.linkremove"] + }, + "linkparameter-ins" : { + "name" : "linkparameter-ins", + "in" : "path", + "type" : "integer", + "required": true + } + }, + "definitions": { + "oic.oic-link": { + "type": "object", + "properties": { + "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" + }, + "href": { + "$ref": "https://openconnectivityfoundation.github.io/core/schemas/oic.links.properties.core-schema.json#/definitions/href" + }, + "if": { + "description": "The OCF Interfaces supported by the Linked 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", + "maxLength": 64 + }, + "minItems": 1, + "maxItems": 1, + "uniqueItems": true, + "type": "array" + }, + "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" + }, + "rt": { + "description": "Resource Type of the Linked Resource", + "items": { + "maxLength": 64, + "type": "string" + }, + "minItems": 1, + "uniqueItems": true, + "type": "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" + } + }, + "required": [ + "href", + "rt", + "if", + "rel" + ] + }, + "resource-delete": { + "type": "object", + "properties": { + "href": { + "$ref": "https://openconnectivityfoundation.github.io/core/schemas/oic.links.properties.core-schema.json#/definitions/href" + } + }, + "required": ["href"] + }, + "slinklist": { + "type" : "array", + "readOnly": true, + "items": { + "$ref": "#/definitions/oic.oic-link" + } + }, + "sbaseline" : { + "properties": { + "links" : { + "description": "A set of simple or individual Links.", + "items": { + "$ref": "#/definitions/oic.oic-link" + }, + "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" + }, + "rt": { + "description": "The Resource Type.", + "items": { + "enum": ["oic.r.rule.inputcollection"], + "maxLength": 64, + "type": "string" + }, + "minItems": 1, + "uniqueItems": true, + "readOnly": true, + "type": "array" + }, + "rts": { + "description": "The Resource Types that can be in the Collection.", + "items": { + "maxLength": 64, + "type": "string" + }, + "minItems": 1, + "uniqueItems": true, + "readOnly": true, + "type": "array" + }, + "if": { + "description": "The OCF Interfaces supported by this Resource", + "items": { + "enum": [ + "oic.if.ll", + "oic.if.baseline", + "oic.if.linkadd", + "oic.if.linkremove", + "oic.if.delete" + ], + "type": "string", + "maxLength": 64 + }, + "minItems": 2, + "uniqueItems": true, + "readOnly": true, + "type": "array" + } + }, + "additionalProperties": true, + "type" : "object", + "required": [ + "rt", + "if", + "links", + "rts" + ] + } + } +} diff --git a/swagger2.0/oic.r.rule.swagger.json b/swagger2.0/oic.r.rule.swagger.json new file mode 100644 index 0000000..f207d9e --- /dev/null +++ b/swagger2.0/oic.r.rule.swagger.json @@ -0,0 +1,376 @@ +{ + "swagger": "2.0", + "info": { + "title": "OCF Rule", + "version": "20190910", + "license": { + "name": "OCF Data Model License", + "url": "https://github.com/openconnectivityfoundation/core/blob/e28a9e0a92e17042ba3e83661e4c0fbce8bdc4ba/LICENSE.md", + "x-copyright": "copyright 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": { + "/RuleResURI?if=oic.if.ll": { + "get": { + "description": "A Rule is a Collection made up of 3 Links. \n A Link to an instance of a Collection of Rule Inputs. \n A Link to a Rule Expression (the logic of the Rule). \n A Link to a Collection of Rule Actions.", + "parameters": [ + {"$ref": "#/parameters/interface-all"} + ], + "responses": { + "200": { + "description" : "Retrieves the rule as Links List.", + "x-example": + [ + { + "href": "/ruleinputcollection", + "rt": ["oic.r.rule.inputcollection"], + "if": ["oic.if.ll","oic.if.linkadd","oic.if.linkremove","oic.if.baseline"], + "p": {"bm": 3}, + "eps": [ + {"ep": "coaps://[fe80::b1d6]:1111"} + ] + }, + { + "href": "/ruleexpression", + "rt": ["oic.r.rule.expression"], + "if": ["oic.if.rw","oic.if.baseline"], + "p": {"bm": 3}, + "eps": [ + {"ep": "coaps://[fe80::b1d6]:1111"} + ] + }, + { + "href": "/ruleactioncollection", + "rt": ["oic.r.rule.actioncollection"], + "if": ["oic.if.ll","oic.if.create","oic.if.baseline"], + "p": {"bm": 3}, + "eps": [ + {"ep": "coap://[fe80::b1d6]:1111"} + ] + } + ], + "schema": { "$ref": "#/definitions/slinklist" } + } + } + } + }, + "/RuleResURI?if=oic.if.baseline": { + "get": { + "description": "A Rule is a Collection made up of 3 Links: \n- A Link to an instance of a Collection of Rule Inputs. \n- A Link to a Rule Expression (the logic of the Rule). \n- A Link to a Collection of Rule Actions.", + "parameters": [ + {"$ref": "#/parameters/interface-all"} + ], + "responses": { + "200": { + "description" : "Retrieves the baseline response for the rule.", + "x-example": + { + "rt": ["oic.r.rule"], + "if": ["oic.if.ll","oic.if.baseline","oic.if.create"], + "rts": ["oic.r.rule.inputcollection","oic.r.rule.expression","oic.r.rule.actioncollection"], + "links": [ + { + "href": "/ruleinputcollection", + "rt": ["oic.r.rule.inputcollection"], + "if": ["oic.if.ll","oic.if.linkadd","oic.if.linkremove","oic.if.baseline"], + "p": {"bm": 3}, + "eps": [ + {"ep": "coaps://[fe80::b1d6]:1111"} + ] + }, + { + "href": "/ruleexpression", + "rt": ["oic.r.rule.expression"], + "if": ["oic.if.rw","oic.if.baseline"], + "p": {"bm": 3}, + "eps": [ + {"ep": "coaps://[fe80::b1d6]:1111"} + ] + }, + { + "href": "/ruleactioncollection", + "rt": ["oic.r.rule.actioncollection"], + "if": ["oic.if.ll","oic.if.create","oic.if.baseline"], + "p": {"bm": 3}, + "eps": [ + {"ep": "coap://[fe80::b1d6]:1111"} + ] + } + ] + }, + "schema": { "$ref": "#/definitions/sbaseline" } + } + } + } + }, + "/RuleResURI?if=oic.if.create": { + "get": { + "description": "Retrieval response for an instance of oic.r.rule using oic.if.create", + "parameters": [ + {"$ref": "#/parameters/interface-all"} + ], + "responses": { + "200": { + "description" : "Retrival on oic.if.create provides an empty payload.", + "x-example": + {} + } + } + }, + "post": { + "description": "", + "parameters": [ + {"$ref": "#/parameters/interface-create"}, + { + "name": "body", + "in": "body", + "required": true, + "schema": { "$ref": "#/definitions/rule-create" }, + "x-example": + { + "rt": ["oic.r.rule.expression"], + "if": ["oic.if.rw","oic.if.baseline"], + "p": {"bm": 3}, + "rep": { + "rule": "(mytemperature:temperature >= \"25\")", + "ruleresult": false, + "ruleenable": false, + "actionenable": false + } + } + } + ], + "responses": { + "200": { + "description" : "", + "x-example": { + "href": "/newURIforResource", + "ins": 39724818, + "rt": ["oic.r.rule.expression"], + "if": ["oic.if.rw","oic.if.baseline"], + "p": {"bm": 3}, + "rep": { + "rule": "(mytemperature:temperature >= 25)", + "ruleresult": false, + "ruleenable": false, + "actionenable": false + } + }, + "schema": { "$ref": "#/definitions/rule-create" } + } + } + } + } + }, + "parameters": { + "interface-all": { + "in": "query", + "name": "if", + "type": "string", + "enum": ["oic.if.ll","oic.if.baseline","oic.if.create"] + }, + "interface-create": { + "in": "query", + "name": "if", + "type": "string", + "enum": ["oic.if.create"] + } + }, + "definitions": { + "rule-create": { + "type": "object", + "properties": { + "href": { + "$ref": "https://openconnectivityfoundation.github.io/core/schemas/oic.links.properties.core-schema.json#/definitions/href" + }, + "if": { + "description": "The OCF Interfaces supported by the created Resource", + "items": { + "enum": [ + "oic.if.baseline", + "oic.if.ll", + "oic.if.create", + "oic.if.linkadd", + "oic.if.linkremove", + "oic.if.rw" + ], + "type": "string", + "maxLength": 64 + }, + "minItems": 1, + "uniqueItems": true, + "type": "array" + }, + "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" + }, + "rt": { + "description": "Resource Type of the created Resource", + "items": { + "maxLength": 64, + "type": "string", + "enum": ["oic.r.rule.inputcollection","oic.r.rule.expression","oic.r.rule.actioncollection"] + }, + "minItems": 1, + "uniqueItems": true, + "type": "array" + }, + "rep": { + "type": "object" + } + } + }, + "oic.oic-link": { + "type": "object", + "properties": { + "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" + }, + "href": { + "$ref": "https://openconnectivityfoundation.github.io/core/schemas/oic.links.properties.core-schema.json#/definitions/href" + }, + "if": { + "description": "The OCF Interfaces supported by the Linked Resource", + "items": { + "enum": [ + "oic.if.baseline", + "oic.if.ll", + "oic.if.create", + "oic.if.linkadd", + "oic.if.linkremove", + "oic.if.rw" + ], + "type": "string", + "maxLength": 64 + }, + "minItems": 1, + "uniqueItems": true, + "type": "array" + }, + "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" + }, + "rt": { + "description": "Resource Type of the Linked Resource", + "items": { + "maxLength": 64, + "type": "string", + "enum": ["oic.r.rule.inputcollection","oic.r.rule.expression","oic.r.rule.actioncollection"] + }, + "minItems": 1, + "uniqueItems": true, + "type": "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" + } + }, + "required": [ + "href", + "rt", + "if" + ] + }, + "slinklist": { + "type" : "array", + "readOnly": true, + "items": { + "$ref": "#/definitions/oic.oic-link" + }, + "minItems": 3, + "maxItems": 3 + }, + "sbaseline" : { + "properties": { + "links" : { + "description": "A set of simple or individual Links.", + "items": { + "$ref": "#/definitions/oic.oic-link" + }, + "type": "array", + "minItems": 3, + "maxItems": 3 + }, + "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" + }, + "rt": { + "description": "The Resource Type.", + "items": { + "enum": ["oic.r.rule"], + "maxLength": 64, + "type": "string" + }, + "minItems": 1, + "uniqueItems": true, + "readOnly": true, + "type": "array" + }, + "rts": { + "description": "The Linked Resource Types.", + "items": { + "enum": ["oic.r.rule.inputcollection", + "oic.r.rule.expression", + "oic.r.rule.actioncollection"], + "maxLength": 64, + "type": "string" + }, + "minItems": 3, + "maxItems": 3, + "uniqueItems": true, + "readOnly": true, + "type": "array" + }, + "if": { + "description": "The OCF Interfaces supported by this Resource", + "items": { + "enum": [ + "oic.if.ll", + "oic.if.baseline", + "oic.if.create" + ], + "type": "string", + "maxLength": 64 + }, + "minItems": 2, + "uniqueItems": true, + "readOnly": true, + "type": "array" + } + }, + "additionalProperties": true, + "type" : "object", + "required": [ + "rt", + "if", + "links", + "rts" + ] + } + } +}