diff --git a/BinarySwitchCollectionResURI.swagger.json b/BinarySwitchCollectionResURI.swagger.json new file mode 100644 index 0000000..86e1b27 --- /dev/null +++ b/BinarySwitchCollectionResURI.swagger.json @@ -0,0 +1,268 @@ +{ + "swagger": "2.0", + "info": { + "title": "Binary Switch Collection", + "version": "2021-12-20", + "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": { + "/BinarySwitchCollectionResURI?if=oic.if.ll" : { + "get": { + "description": "This Resource describes a collection of binary switches (on/off).\nThe Property \"value\" is a boolean.\nA value of 'true' means that the switch is on.\nA value of 'false' means that the switch is off.\n", + "parameters": [ + {"$ref": "#/parameters/interface-all"} + ], + "responses": { + "200": { + "description" : "", + "x-example": [ + {"href": "/switch1ResURI", "rt": ["oic.r.switch.binary"], "if": ["oic.if.a","oic.if.baseline"], "eps": [{"ep": "coaps://[fe80::b1d6]:1122"}]}, + {"href": "/switch2ResURI", "rt": ["oic.r.switch.binary"], "if": ["oic.if.a","oic.if.baseline"], "eps": [{"ep": "coaps://[fe80::b1d6]:1122"}]}, + {"href": "/switch3ResURI", "rt": ["oic.r.switch.binary"], "if": ["oic.if.a","oic.if.baseline"], "eps": [{"ep": "coaps://[fe80::b1d6]:1122"}]}, + {"href": "/switch4ResURI", "rt": ["oic.r.switch.binary"], "if": ["oic.if.a","oic.if.baseline"], "eps": [{"ep": "coaps://[fe80::b1d6]:1122"}]} + ], + "schema": { "$ref": "#/definitions/BinarySwitch-ll" } + } + } + } + }, + "/BinarySwitchCollectionResURI?if=oic.if.b": { + "get": { + "description": "This Resource describes a collection of binary switches (on/off).\nThe Property \"value\" is a boolean.\nA value of 'true' means that the switch is on.\nA value of 'false' means that the switch is off.\n", + "parameters": [ + {"$ref": "#/parameters/interface-all"} + ], + "responses": { + "200": { + "description" : "", + "x-example": [ + { + "href": "/Switch1ResURI", + "rep": { + "value": true + } + }, + { + "href": "/Switch2ResURI", + "rep": { + "value": false + } + } + ], + "schema": { "$ref": "#/definitions/BinarySwitchBatch-Retrieve" } + } + } + } + }, + "/BinarySwitchCollectionResURI?if=oic.if.baseline" : { + "get": { + "description": "This Resource describes a collection of binary switches (on/off).\nThe Property \"value\" is a boolean.\nA value of 'true' means that the switch is on.\nA value of 'false' means that the switch is off.\n", + "parameters": [ + {"$ref": "#/parameters/interface-all"} + ], + "responses": { + "200": { + "description" : "", + "x-example": { + "rt": ["oic.r.switch.binary,collection","oic.wk.col"], + "if": ["oic.if.ll","oic.if.b","oic.if.baseline"], + "rts": ["oic.r.binary.switch"], + "links": [ + {"href": "/Switch1ResURI", "rt": ["oic.r.switch.binary"], "if": ["oic.if.a","oic.if.baseline"], "eps": [{"ep": "coaps://[fe80::b1d6]:1122"}]}, + {"href": "/Switch2ResURI", "rt": ["oic.r.switch.binary"], "if": ["oic.if.a","oic.if.baseline"], "eps": [{"ep": "coaps://[fe80::b1d6]:1122"}]}, + {"href": "/Switch3ResURI", "rt": ["oic.r.switch.binary"], "if": ["oic.if.a","oic.if.baseline"], "eps": [{"ep": "coaps://[fe80::b1d6]:1122"}]}, + {"href": "/Switch4ResURI", "rt": ["oic.r.switch.binary"], "if": ["oic.if.a","oic.if.baseline"], "eps": [{"ep": "coaps://[fe80::b1d6]:1122"}]} + ] + }, + "schema": { "$ref": "#/definitions/BinarySwitch-Retrieve" } + } + } + } + } + }, + "parameters": { + "interface-all" : { + "in" : "query", + "name" : "if", + "type" : "string", + "enum" : ["oic.if.ll", "oic.if.b", "oic.if.baseline"] + } + }, + "definitions": { + "BinarySwitch-ll" : { + "items": { + "$ref": "#/definitions/oic.oic-link" + }, + "type": "array", + "minItems": 1, + "uniqueItems": true, + "readOnly": true + }, + "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" + }, + "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" + }, + "if": { + "description": "The OCF Interfaces supported by the target Resource", + "items": { + "enum": [ + "oic.if.a", + "oic.if.baseline" + ], + "type": "string", + "maxLength": 64 + }, + "minItems": 2, + "uniqueItems": true, + "type": "array", + "readOnly": true + }, + "rt": { + "description": "Resource Type of the target Resource", + "items": { + "maxLength": 64, + "type": "string", + "enum": ["oic.r.switch.binary"] + }, + "minItems": 1, + "type": "array", + "uniqueItems": true, + "readOnly": true + } + }, + "required": [ + "href", + "rt", + "if" + ] + }, + "BinarySwitch-Retrieve" : { + "properties": { + "rt": { + "description": "The Resource Type.", + "items": { + "enum": ["oic.r.switch.binary"], + "maxLength": 64, + "type": "string" + }, + "minItems": 1, + "uniqueItems": true, + "readOnly": true, + "type": "array" + }, + "links": { + "items": { + "$ref": "#/definitions/oic.oic-link" + }, + "type": "array", + "minItems": 1, + "uniqueItems": true, + "readOnly": true + }, + "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" + }, + "rts": { + "items": { + "anyOf": [ + { + "enum": [ + "oic.r.switch.binary", + "oic.r.value.conditional" + ], + "type": "string", + "maxLength": 64 + }, + { + "enum": [ + "oic.r.switch.binary" + ], + "type": "string", + "maxLength": 64 + } + ] + }, + "minItems": 1, + "type": "array", + "readOnly": true, + "uniqueItems": true + }, + "if": { + "description": "The OCF Interfaces supported by this Resource", + "items": { + "enum": [ + "oic.if.ll", + "oic.if.b", + "oic.if.baseline" + ], + "type": "string", + "maxLength": 64 + }, + "minItems": 1, + "readOnly": true, + "uniqueItems": true, + "type": "array" + } + }, + "type" : "object" + }, + "BinarySwitchBatch-Retrieve" : { + "type": "array", + "minItems": 1, + "uniqueItems": true, + "items": { + "type": "object", + "additionalProperties": true, + "properties": { + "href": { + "$ref": "https://openconnectivityfoundation.github.io/core/schemas/oic.links.properties.core-schema.json#/definitions/href" + }, + "rep": { + "$ref": "https://openconnectivityfoundation.github.io/IoTDataModels/HeatingZoneResURI.swagger.json#/definitions/BinarySwitch" + } + }, + "required": [ + "href", + "rep" + ] + } + } + } +} diff --git a/DHCPResURI.swagger.json b/DHCPResURI.swagger.json new file mode 100644 index 0000000..007314f --- /dev/null +++ b/DHCPResURI.swagger.json @@ -0,0 +1,142 @@ +{ + "swagger": "2.0", + "info": { + "title": "DHCP", + "version": "2021-12-20", + "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": { + "/DHCPResURI" : { + "get": { + "description": "This Resource describes a DHCP service.", + "parameters": [ + {"$ref": "#/parameters/interface"} + ], + "responses": { + "200": { + "description" : "", + "x-example": { + "rt": ["oic.r.network.dhcp"], + "if": ["oic.if.a", "oic.if.baseline"], + "startAddress": "192.168.1.15", + "endAddress": "192.168.1.30", + "numAddresses" : 15, + "leaseTime": 86400 + }, + "schema": { "$ref": "#/definitions/DHCP" } + } + } + }, + "post": { + "description": "", + "parameters": [ + {"$ref": "#/parameters/interface"}, + { + "name": "body", + "in": "body", + "required": true, + "schema": { "$ref": "#/definitions/DHCP" }, + "x-example": { + "startAddress": "192.168.1.15", + "endAddress": "192.168.1.30", + "numAddresses" : 15, + "leaseTime": 86400 + } + } + ], + "responses": { + "200": { + "description" : "", + "x-example": { + "startAddress": "192.168.1.15", + "endAddress": "192.168.1.30", + "numAddresses" : 15, + "leaseTime": 86400 + }, + "schema": { "$ref": "#/definitions/DHCP" } + } + } + } + } + }, + "parameters": { + "interface" : { + "in": "query", + "name": "if", + "type": "string", + "enum": ["oic.if.a", "oic.if.baseline"] + } + }, + "definitions": { + "DHCP" : { + "properties": { + "rt": { + "description": "The Resource Type.", + "items": { + "enum": ["oic.r.network.dhcp"], + "maxLength": 64, + "type": "string" + }, + "minItems": 1, + "uniqueItems": true, + "readOnly": true, + "type": "array" + }, + "startAddress": { + "description": "The first address in the DHCP range.", + "type": "string" + }, + "endAddress" : { + "description" : "The last address in the DHCP range.", + "type" : "string" + }, + "numAddresses": { + "description" : "The number of addresses in the DHCP range.", + "type": "integer" + }, + "leaseTime": { + "description" : "THe amount of time the lease is valid in seconds.", + "type": "integer" + }, + "staticLeases" : { + "type":"array", + "items": { + "$ref": "https://openconnectivityfoundation.github.io/IoTDataModels/dhcpLeaseResURI.swagger.json#/definitions/DHCPLease" + }, + "minimum": 0, + "type":"object" + }, + "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.a", + "oic.if.baseline" + ], + "type": "string" + }, + "minItems": 2, + "uniqueItems": true, + "readOnly": true, + "type": "array" + } + }, + "type": "object", + "required": ["startAddress","endAddress","leaseTime"] + } + } +} diff --git a/RouterUPnPResURI.swagger.json b/RouterUPnPResURI.swagger.json new file mode 100644 index 0000000..54dfe45 --- /dev/null +++ b/RouterUPnPResURI.swagger.json @@ -0,0 +1,113 @@ +{ + "swagger": "2.0", + "info": { + "title": "Router UPnP Configuration", + "version": "2021-12-20", + "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": { + "/UPnPConfigResURI" : { + "get": { + "description": "This Resource describes a UPNP configureation in a router or other network device\n", + "parameters": [ + {"$ref": "#/parameters/interface"} + ], + "responses": { + "200": { + "description" : "", + "x-example": { + "rt": ["oic.r.network.upnp"], + "if": ["oic.if.a", "oic.if.baseline"], + "enabled": false + }, + "schema": { "$ref": "#/definitions/UPnPConfig" } + } + } + }, + "post": { + "description": "", + "parameters": [ + {"$ref": "#/parameters/interface"}, + { + "name": "body", + "in": "body", + "required": true, + "schema": { "$ref": "#/definitions/UPnPConfig" }, + "x-example": { + "enabled": true + } + } + ], + "responses": { + "200": { + "description" : "", + "x-example": { + "enabled": true + }, + "schema": { "$ref": "#/definitions/UPnPConfig" } + } + } + } + } + }, + "parameters": { + "interface" : { + "in": "query", + "name": "if", + "type": "string", + "enum": ["oic.if.a", "oic.if.baseline"] + } + }, + "definitions": { + "UPnPConfig" : { + "properties": { + "rt": { + "description": "The Resource Type.", + "items": { + "enum": ["oic.r.network.upnp"], + "maxLength": 64, + "type": "string" + }, + "minItems": 1, + "uniqueItems": true, + "readOnly": true, + "type": "array" + }, + "enabled": { + "description": "True if UPNP is enabled false otherwise", + "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.a", + "oic.if.baseline" + ], + "type": "string" + }, + "minItems": 2, + "uniqueItems": true, + "readOnly": true, + "type": "array" + } + }, + "type": "object", + "required": ["enabled"] + } + } +} diff --git a/VPNResURI.swagger.json b/VPNResURI.swagger.json new file mode 100644 index 0000000..4ce793d --- /dev/null +++ b/VPNResURI.swagger.json @@ -0,0 +1,168 @@ +{ + "swagger": "2.0", + "info": { + "title": "Virtual Private Network", + "version": "2021-12-20", + "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": { + "/VPNResURI" : { + "get": { + "description": "This Resource describes a VPN.\n", + "parameters": [ + {"$ref": "#/parameters/interface"} + ], + "responses": { + "200": { + "description" : "", + "x-example": { + "rt": ["oic.r.network.vpn"], + "if": ["oic.if.a", "oic.if.baseline"], + "enabled": false, + "isDefaultGateway": true, + "vpnMode": "main", + "presharedKey": "This1sAPreSharedKey", + "startAddress": "192.168.12.5", + "endAddress": "192.168.12.250", + "dhcpServer": "192.168.12.2" + }, + "schema": { "$ref": "#/definitions/VPN" } + } + } + }, + "post": { + "description": "", + "parameters": [ + {"$ref": "#/parameters/interface"}, + { + "name": "body", + "in": "body", + "required": true, + "schema": { "$ref": "#/definitions/VPN" }, + "x-example": { + "isDefaultGateway": true, + "vpnMode": "main", + "presharedKey": "This1sAPreSharedKey", + "startAddress": "192.168.12.5", + "endAddress": "192.168.12.250", + "dhcpServer": "192.168.12.2" + } + } + ], + "responses": { + "200": { + "description" : "", + "x-example": { + "isDefaultGateway": true, + "vpnMode": "main", + "presharedKey": "This1sAPreSharedKey", + "startAddress": "192.168.12.5", + "endAddress": "192.168.12.250", + "dhcpServer": "192.168.12.2" + }, + "schema": { "$ref": "#/definitions/VPN" } + } + } + } + } + }, + "parameters": { + "interface" : { + "in": "query", + "name": "if", + "type": "string", + "enum": ["oic.if.a", "oic.if.baseline"] + } + }, + "definitions": { + "VPN" : { + "properties": { + "rt": { + "description": "The Resource Type.", + "items": { + "enum": ["oic.r.network.vpn"], + "maxLength": 64, + "type": "string" + }, + "minItems": 1, + "uniqueItems": true, + "readOnly": true, + "type": "array" + }, + "enabled": { + "description": "True if the VPN is enabled.", + "type": "boolean" + }, + "isDefaultGateway": { + "description" : "True if default gateway.", + "type" : "boolean" + }, + "vpnMode": { + "description" : "The mode for initiating the VPN", + "enum" : [ + "main", + "aggressive", + "quick" + ], + "type": "string" + }, + "presharedKey": { + "description" : "The pre-shared key for the VPN", + "type" : "string" + }, + "startAddress": { + "description" : "The starting address for VPNs", + "type": "string" + }, + "endAddress" : { + "description": "The ending address for VPNs", + "type":"string" + }, + "dhcpServer": { + "description" : "The address of the dhcpserver for this VPN", + "type":"string" + }, + "users": { + "description": "The list of authorized users", + "items" : { + "type": "string" + }, + "minItems": 2, + "uniqueItems": true, + "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" + }, + "if": { + "description": "The OCF Interface set supported by this Resource.", + "items": { + "enum": [ + "oic.if.a", + "oic.if.baseline" + ], + "type": "string" + }, + "minItems": 2, + "uniqueItems": true, + "readOnly": true, + "type": "array" + } + }, + "type": "object", + "required": ["enabled"] + } + } +} diff --git a/dhcpLeaseResURI.swagger.json b/dhcpLeaseResURI.swagger.json new file mode 100644 index 0000000..cf295cf --- /dev/null +++ b/dhcpLeaseResURI.swagger.json @@ -0,0 +1,131 @@ +{ + "swagger": "2.0", + "info": { + "title": "DHCP Lease", + "version": "2021-12-20", + "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": { + "/DHCPLeasehResURI" : { + "get": { + "description": "This Resource describes a DHCP Lease.\n", + "parameters": [ + {"$ref": "#/parameters/interface"} + ], + "responses": { + "200": { + "description" : "", + "x-example": + { + "rt": ["oic.r.netowrk.dhcp.lease"], + "if": ["oic.if.a", "oic.if.baseline"], + "value": false + }, + "schema": { "$ref": "#/definitions/DHCPLease" } + } + } + }, + "post": { + "description": "", + "parameters": [ + {"$ref": "#/parameters/interface"}, + { + "name": "body", + "in": "body", + "required": true, + "schema": { "$ref": "#/definitions/DHCPLease" }, + "x-example": + { + "value": true + } + } + ], + "responses": { + "200": { + "description" : "", + "x-example": + { + "value": true + }, + "schema": { "$ref": "#/definitions/DHCPLease" } + } + } + } + } + }, + "parameters": { + "interface" : { + "in": "query", + "name": "if", + "type": "string", + "enum": ["oic.if.a", "oic.if.baseline"] + } + }, + "definitions": { + "DHCPLease" : { + "properties": { + "rt": { + "description": "The Resource Type.", + "items": { + "enum": ["oic.r.network.dhcp.lease"], + "maxLength": 64, + "type": "string" + }, + "minItems": 1, + "uniqueItems": true, + "readOnly": true, + "type": "array" + }, + "IPAddress": { + "description": "The IP Address of the Lease.", + "type": "string", + "maxLength": 64 + }, + "LeaseTime": { + "description": "The duration of the lease in seconds.", + "type": "integer", + "maximum":4294967295, + "minimum": 1 + }, + "MACAddress": { + "$ref":"https://openconnectivityfoundation.github.io/IoTDataModels/MacAddressResURI.swagger.json#/definitions/macaddress" + + }, + "ExpireTime" : { + "description": "The time that his lease expires.", + "$ref": "https://openconnectivityfoundation.github.io/IoTDataModels/TimeStampResURI.swagger.json#/definitions/TimeStamp" + }, + "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.a", + "oic.if.baseline" + ], + "type": "string" + }, + "minItems": 2, + "uniqueItems": true, + "readOnly": true, + "type": "array" + } + }, + "type": "object", + "required": ["IPAddress", "ExpireTime"] + } + } +} diff --git a/ipnetworkResURI.swagger.json b/ipnetworkResURI.swagger.json new file mode 100644 index 0000000..3745817 --- /dev/null +++ b/ipnetworkResURI.swagger.json @@ -0,0 +1,161 @@ +{ + "swagger": "2.0", + "info": { + "title": "IP Network", + "version": "2021-12-20", + "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": { + "/ipnetworkResURI" : { + "get": { + "description": "This Resource specifies an IP network.", + "parameters": [ + {"$ref": "#/parameters/interface"} + ], + "responses": { + "200": { + "description" : "", + "x-example": + { + "rt": ["oic.r.network.ip"], + "if": ["oic.if.a", "oic.if.baseline"], + "connectionType": "static", + "ipAddress": "192.168.0.2", + "netmask": "255.255.255.0", + "gateway": "192.168.0.1", + "macAddress": "01:02:03:04:05:06", + "mtu": 1500 + }, + "schema": { "$ref": "#/definitions/IPNetwork" } + } + } + }, + "post": { + "description": "Sets the current IP Network attributes\n", + "parameters": [ + {"$ref": "#/parameters/interface"}, + { + "name": "body", + "in": "body", + "required": true, + "schema": { "$ref": "#/definitions/IPAddress" }, + "x-example": + { + "ipAddress": "192.168.0.1", + "netmask": "255.255.255.0" + } + } + ], + "responses": { + "200": { + "description" : "", + "x-example": + { + "ipAddress": "192.168.0.1", + "netmask": "255.255.255.0" + }, + "schema": { "$ref": "#/definitions/IPAddress" } + } + } + } + } + }, + "parameters": { + "interface" : { + "in": "query", + "name": "if", + "type": "string", + "enum": ["oic.if.a", "oic.if.baseline"] + } + }, + "definitions": { + "IPNetwork" : { + "properties": { + "rt": { + "description": "The Resource Type.", + "items": { + "enum": ["oic.r.network.ip"], + "maxLength": 64, + "type": "string" + }, + "minItems": 1, + "uniqueItems": true, + "readOnly": true, + "type": "array" + }, + "networkType": { + "description" : "If the network is a WAN netowkr or a LAN network", + "enum" : [ + "WAN", + "LAN" + ] + }, + "connectionType" : { + "description" : "The type of connection i.e. DHCP, static. PPPOE", + "enum" : [ + "DHCP", + "static", + "PPPOE" + ], + "type" : "string" + }, + "ipAddress": { + "description": "The IPV4 or IPv6 address e.g 192.168.0.1", + "type": "string", + "maxlength" : 64 + }, + "netmask": { + "description": "The the subnet mask for the address", + "type":"string", + "maxlength": 64 + }, + "gateway" : { + "description": "The ip address of the gateway for the ipAddress", + "type" : "string", + "maxlength": 64 + }, + "macAddress" : { + "$ref":"https://openconnectivityfoundation.github.io/IoTDataModels/MacAddressResURI.swagger.json#/definitions/macaddress" + }, + "mtu": { + "description": "Maximum transmission Unit", + "type": "integer" + }, + "portState": { + "description": "The state of the port, link, rate", + "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.a", + "oic.if.baseline" + ], + "type": "string" + }, + "minItems": 2, + "uniqueItems": true, + "readOnly": true, + "type": "array" + } + }, + "type": "object", + "required": ["ipaddress"] + } + } +} diff --git a/macaddress.swagger.json b/macaddress.swagger.json new file mode 100644 index 0000000..25169d7 --- /dev/null +++ b/macaddress.swagger.json @@ -0,0 +1,18 @@ +{ + "swagger": "2.0", + "info": { + "title": "MAC Address", + "version": "2021-12-20", + "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": { + } +} diff --git a/routerResURI.swagger.json b/routerResURI.swagger.json new file mode 100644 index 0000000..0c3801b --- /dev/null +++ b/routerResURI.swagger.json @@ -0,0 +1,133 @@ +{ + "swagger": "2.0", + "info": { + "title": "Router", + "version": "2021-12-20", + "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": { + "/RouterResURI" : { + "get": { + "description": "This Resource describes the general resources of a router.\n", + "parameters": [ + {"$ref": "#/parameters/interface"} + ], + "responses": { + "200": { + "description" : "", + "x-example": { + "rt": ["oic.r.network.router.general"], + "if": ["oic.if.a", "oic.if.baseline"], + "value": false + }, + "schema": { "$ref": "#/definitions/BinarySwitch" } + } + } + }, + "post": { + "description": "", + "parameters": [ + {"$ref": "#/parameters/interface"}, + { + "name": "body", + "in": "body", + "required": true, + "schema": { "$ref": "#/definitions/BinarySwitch" }, + "x-example": { + "value": true + } + } + ], + "responses": { + "200": { + "description" : "", + "x-example": { + "value": true + }, + "schema": { "$ref": "#/definitions/BinarySwitch" } + } + } + } + } + }, + "parameters": { + "interface" : { + "in": "query", + "name": "if", + "type": "string", + "enum": ["oic.if.a", "oic.if.baseline"] + } + }, + "definitions": { + "router" : { + "properties": { + "rt": { + "description": "The Resource Type.", + "items": { + "enum": ["oic.r.network.interface"], + "maxLength": 64, + "type": "string" + }, + "minItems": 1, + "uniqueItems": true, + "readOnly": true, + "type": "array" + }, + "uptime": { + "description": "The amount of time passed since last boot", + "type":"string", + "maxlength": 64 + }, + "dmzenabled": { + "description": "True if DMZ is enabled, false if not", + "type": "boolean" + }, + "dmzstart": { + "description": "The starting address for DMZ forwarding", + "type":"string", + "maxlength": 64 + }, + "dmzstart": { + "description": "The starting address for DMZ forwarding", + "type":"string", + "maxlength": 64 + }, + "dmzaddress": { + "description" : "The target IP Address for the DMZ", + "type": "string", + "maxlength": 64 + }, + "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.a", + "oic.if.baseline" + ], + "type": "string" + }, + "minItems": 2, + "uniqueItems": true, + "readOnly": true, + "type": "array" + } + }, + "type": "object", + "required": ["uptime"] + } + } +} diff --git a/routesResUri.swagger.json b/routesResUri.swagger.json new file mode 100644 index 0000000..789c609 --- /dev/null +++ b/routesResUri.swagger.json @@ -0,0 +1,134 @@ +{ + "swagger": "2.0", + "info": { + "title": "Router", + "version": "2021-12-20", + "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": { + "/RoutesResURI" : { + "get": { + "description": "This Resource describes a network route.\n", + "parameters": [ + {"$ref": "#/parameters/interface"} + ], + "responses": { + "200": { + "description" : "", + "x-example": + { + "rt": ["oic.r.network.route"], + "if": ["oic.if.a", "oic.if.baseline"], + "value": false + }, + "schema": { "$ref": "#/definitions/NetworkRoute" } + } + } + }, + "post": { + "description": "", + "parameters": [ + {"$ref": "#/parameters/interface"}, + { + "name": "body", + "in": "body", + "required": true, + "schema": { "$ref": "#/definitions/NetworkRoute" }, + "x-example": + { + "value": true + } + } + ], + "responses": { + "200": { + "description" : "", + "x-example": + { + "value": true + }, + "schema": { "$ref": "#/definitions/NetworkRoute" } + } + } + } + } + }, + "parameters": { + "interface" : { + "in": "query", + "name": "if", + "type": "string", + "enum": ["oic.if.a", "oic.if.baseline"] + } + }, + "definitions": { + "NetworkRoute" : { + "properties": { + "rt": { + "description": "The Resource Type.", + "items": { + "enum": ["oic.r.network.route"], + "maxLength": 64, + "type": "string" + }, + "minItems": 1, + "uniqueItems": true, + "readOnly": true, + "type": "array" + }, + "IPAddress": { + "description": "The IP address of the network interface", + "type": "string", + "maxLength": 64 + }, + "Netmask": { + "description" : "The subnet mask of for the IP address", + "type": "string", + "maxLength": 64 + }, + "Gateway": { + "description": "The gateway for this route", + "type": "string", + "maxLength": 64 + }, + "metric": { + "description": "The metric helps the router choose the best route", + "type": "integer" + }, + "interface": { + + }, + "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.a", + "oic.if.baseline" + ], + "type": "string" + }, + "minItems": 2, + "uniqueItems": true, + "readOnly": true, + "type": "array" + } + }, + "type": "object", + "required": ["IPAddress","Netmask","Gateway"] + } + } +} diff --git a/wifiCollectionResURI.swagger.json b/wifiCollectionResURI.swagger.json new file mode 100644 index 0000000..0212d90 --- /dev/null +++ b/wifiCollectionResURI.swagger.json @@ -0,0 +1,286 @@ +{ + "swagger": "2.0", + "info": { + "title": "WiFi Collection", + "version": "2021-12-20", + "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": { + "/wifiCollectionResURI?if=oic.if.ll" : { + "get": { + "description": "This Resource describes a collection of wifi networks.\n", + "parameters": [ + {"$ref": "#/parameters/interface-all"} + ], + "responses": { + "200": { + "description" : "", + "x-example": [ + {"href": "/wifi1ResURI", "rt": ["oic.r.switch.binary"], "if": ["oic.if.a","oic.if.baseline"], "eps": [{"ep": "coaps://[fe80::b1d6]:1122"}]}, + {"href": "/wifi2ResURI", "rt": ["oic.r.switch.binary"], "if": ["oic.if.a","oic.if.baseline"], "eps": [{"ep": "coaps://[fe80::b1d6]:1122"}]}, + {"href": "/wifi3ResURI", "rt": ["oic.r.switch.binary"], "if": ["oic.if.a","oic.if.baseline"], "eps": [{"ep": "coaps://[fe80::b1d6]:1122"}]}, + {"href": "/wifi4ResURI", "rt": ["oic.r.switch.binary"], "if": ["oic.if.a","oic.if.baseline"], "eps": [{"ep": "coaps://[fe80::b1d6]:1122"}]} + ], + "schema": { "$ref": "#/definitions/wifi-ll" } + } + } + } + }, + "/wifiCollectionResURI?if=oic.if.b": { + "get": { + "description": "This Resource describes a collection of wifi networks.\n", + "parameters": [ + {"$ref": "#/parameters/interface-all"} + ], + "responses": { + "200": { + "description" : "", + "x-example": [ + { + "href": "/wifi1ResURI", + "rep": { + "wifiType": "2.4GHZ", + "enabled": true, + "SSID" : "OCF guest", + "securityMode" : "WPA-Auto", + "broadcast": true, + "isolation": true, + "passphrase" : "OCF202Welcome", + "channel": "5", + "MacAddress":"01:02:03:04:05:06", + "channelWidth": "40MHZ" + } + }, + { + "href": "/wifi2ResURI", + "rep": { + "wifiType": "2.4GHZ", + "enabled": true, + "SSID" : "OCF guest", + "securityMode" : "WPA-Auto", + "broadcast": true, + "isolation": true, + "passphrase" : "OCF202Welcome", + "channel": "7", + "MacAddress":"01:02:03:04:05:06", + "channelWidth": "40MHZ" + } + } + ], + "schema": { "$ref": "#/definitions/wifi-Retrieve" } + } + } + } + }, + "/wifiCollectionResURI?if=oic.if.baseline" : { + "get": { + "description": "This Resource describes a collection of wifi networks.\n", + "parameters": [ + {"$ref": "#/parameters/interface-all"} + ], + "responses": { + "200": { + "description" : "", + "x-example": { + "rt": ["oic.r.switch.network.wifi.collection","oic.wk.col"], + "if": ["oic.if.ll","oic.if.b","oic.if.baseline"], + "rts": ["oic.r.nework.wifi"], + "links": [ + {"href": "/wifi1ResURI", "rt": ["oic.r.network.wifi"], "if": ["oic.if.a","oic.if.baseline"], "eps": [{"ep": "coaps://[fe80::b1d6]:1122"}]}, + {"href": "/wifi2ResURI", "rt": ["oic.r.network.wifi"], "if": ["oic.if.a","oic.if .baseline"], "eps": [{"ep": "coaps://[fe80::b1d6]:1122"}]}, + {"href": "/wifi3ResURI", "rt": ["oic.r.network.wifi"], "if": ["oic.if.a","oic.if.baseline"], "eps": [{"ep": "coaps://[fe80::b1d6]:1122"}]}, + {"href": "/wifi4ResURI", "rt": ["oic.r.network.wifi"], "if": ["oic.if.a","oic.if.baseline"], "eps": [{"ep": "coaps://[fe80::b1d6]:1122"}]} + ] + }, + "schema": { "$ref": "#/definitions/wifi-Retrieve" } + } + } + } + } + }, + "parameters": { + "interface-all" : { + "in" : "query", + "name" : "if", + "type" : "string", + "enum" : ["oic.if.ll", "oic.if.b", "oic.if.baseline"] + } + }, + "definitions": { + "wifi-ll" : { + "items": { + "$ref": "#/definitions/oic.oic-link" + }, + "type": "array", + "minItems": 1, + "uniqueItems": true, + "readOnly": true + }, + "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" + }, + "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" + }, + "if": { + "description": "The OCF Interfaces supported by the target Resource", + "items": { + "enum": [ + "oic.if.a", + "oic.if.baseline" + ], + "type": "string", + "maxLength": 64 + }, + "minItems": 2, + "uniqueItems": true, + "type": "array", + "readOnly": true + }, + "rt": { + "description": "Resource Type of the target Resource", + "items": { + "maxLength": 64, + "type": "string", + "enum": ["oic.r.network.wifi"] + }, + "minItems": 1, + "type": "array", + "uniqueItems": true, + "readOnly": true + } + }, + "required": [ + "href", + "rt", + "if" + ] + }, + "wifi-Retrieve" : { + "properties": { + "rt": { + "description": "The Resource Type.", + "items": { + "enum": ["oic.r.network.wifi"], + "maxLength": 64, + "type": "string" + }, + "minItems": 1, + "uniqueItems": true, + "readOnly": true, + "type": "array" + }, + "links": { + "items": { + "$ref": "#/definitions/oic.oic-link" + }, + "type": "array", + "minItems": 1, + "uniqueItems": true, + "readOnly": true + }, + "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" + }, + "rts": { + "items": { + "anyOf": [ + { + "enum": [ + "oic.r.network.wifi", + "oic.r.value.conditional" + ], + "type": "string", + "maxLength": 64 + }, + { + "enum": [ + "oic.r.network.wifi" + ], + "type": "string", + "maxLength": 64 + } + ] + }, + "minItems": 1, + "type": "array", + "readOnly": true, + "uniqueItems": true + }, + "if": { + "description": "The OCF Interfaces supported by this Resource", + "items": { + "enum": [ + "oic.if.ll", + "oic.if.b", + "oic.if.baseline" + ], + "type": "string", + "maxLength": 64 + }, + "minItems": 1, + "readOnly": true, + "uniqueItems": true, + "type": "array" + } + }, + "type" : "object" + }, + "wifiBatch-Retrieve" : { + "type": "array", + "minItems": 1, + "uniqueItems": true, + "items": { + "type": "object", + "additionalProperties": true, + "properties": { + "href": { + "$ref": "https://openconnectivityfoundation.github.io/core/schemas/oic.links.properties.core-schema.json#/definitions/href" + }, + "rep": { + "$ref": "https://openconnectivityfoundation.github.io/IoTDataModels/wifiResURI.swagger.json#/definitions/wifi" + } + }, + "required": [ + "href", + "rep" + ] + } + } + } +} diff --git a/wifiResURI.swagger.json b/wifiResURI.swagger.json new file mode 100644 index 0000000..ba08d26 --- /dev/null +++ b/wifiResURI.swagger.json @@ -0,0 +1,153 @@ +{ + "swagger": "2.0", + "info": { + "title": "Wifi", + "version": "2021-12-20", + "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": { + "/WiFiResURI" : { + "get": { + "description": "This Resource describes a wifi configuration.\nT", + "parameters": [ + {"$ref": "#/parameters/interface"} + ], + "responses": { + "200": { + "description" : "", + "x-example": { + "rt": ["oic.r.network.wifi"], + "if": ["oic.if.a", "oic.if.baseline"], + "swf": ["2.4GHZ"] + }, + "schema": { "$ref": "#/definitions/wifi" } + } + } + }, + "post": { + "description": "", + "parameters": [ + {"$ref": "#/parameters/interface"}, + { + "name": "body", + "in": "body", + "required": true, + "schema": { "$ref": "#/definitions/wifi" }, + "x-example": { + "swf": ["2.4GHZ"] + } + } + ], + "responses": { + "200": { + "description" : "", + "x-example": { + "swf": ["2.4GHZ"] + }, + "schema": { "$ref": "#/definitions/wifi" } + } + } + } + } + }, + "parameters": { + "interface" : { + "in": "query", + "name": "if", + "type": "string", + "enum": ["oic.if.a", "oic.if.baseline"] + } + }, + "definitions": { + "wifi" : { + "properties": { + "rt": { + "description": "The Resource Type.", + "items": { + "enum": ["oic.r.network.wifi"], + "maxLength": 64, + "type": "string" + }, + "minItems": 1, + "uniqueItems": true, + "readOnly": true, + "type": "array" + }, + "enabled": { + "description": "If the service is enabled true, if disabled false", + "type":"boolean" + }, + "wifiConf": { + "$ref": "https://github.com/openconnectivityfoundation/core-extensions/swagger2.0/oic.r.wificonf.swagger.json#/definitions/WiFiConf" + }, + "broadcast" : { + "description" : "If true the SSID is broadcast, if false the SSID is hidden", + "type": "boolean" + }, + "isolation": { + "description" : "If true clients can only communicate with the Intenet, if false, clients can communicate with devices on the local LAN and other wireless devices", + "type": "boolean" + }, + "passphrase": { + "description": "The passphrase for the link encryption", + "type": "string", + "maxLength": 64 + }, + "keyinterval" : { + "description": "The re key interval in seconds", + "type":"integer" + }, + "channel": { + "description": "The channel selected for this Wifi network", + "type": "string", + "maxLength" : 64 + }, + "MacAddress": { + "description": "The MAC address of the interface", + "type": "string", + "maxLength": 64 + }, + "channelWidth": { + "description": "The width of the channel, not 80MHZ is only supported for 5GHZ wifi", + "enum" : [ + "20MHZ", + "40MHZ", + "80MHZ" + ], + "type": "string", + "maxLength": 16 + }, + "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.a", + "oic.if.baseline" + ], + "type": "string" + }, + "minItems": 2, + "uniqueItems": true, + "readOnly": true, + "type": "array" + } + }, + "type": "object", + "required": ["enabled"] + } + } +}