From ea7a9e27c48cbe0c2e6fe8d2e095ce47aab09ed6 Mon Sep 17 00:00:00 2001 From: Harish Anand Date: Thu, 22 Feb 2018 16:54:16 +0530 Subject: [PATCH] Fix: missing new urls for 1.0.0 release (#41) --- README.rst | 157 +++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 151 insertions(+), 6 deletions(-) diff --git a/README.rst b/README.rst index cd82c92..d72ccdf 100644 --- a/README.rst +++ b/README.rst @@ -31,7 +31,7 @@ smartcity-middleware v1.0.0_ Configuration ============= -middleware.conf_ v0.1.0 +middleware.conf_ v1.0.0 .. _middleware.conf: https://github.com/rbccps-iisc/ideam/blob/master/middleware.conf middleware.conf:: @@ -92,18 +92,163 @@ Comment +----------------------------------------------------------------+----------------------------------------------------------+ | https://smartcity.rbccps.org/api/1.0.0/subscribe?name=testDemo | https://localhost:10443/api/1.0.0/subscribe?name=testDemo| +----------------------------------------------------------------+----------------------------------------------------------+ -| https://smartcity.rbccps.org/api/1.0.0/subscribe/bind | https://localhost:10443/api/1.0.0/subscribe/bind | -+----------------------------------------------------------------+----------------------------------------------------------+ -| https://smartcity.rbccps.org/api/1.0.0/subscribe/unbind | https://localhost:10443/api/1.0.0/subscribe/unbind | +| https://smartcity.rbccps.org/api/1.0.0/follow | https://localhost:10443/api/1.0.0/follow | +----------------------------------------------------------------+----------------------------------------------------------+ | https://smartcity.rbccps.org/api/1.0.0/cat | https://localhost:10443/api/1.0.0/cat | +----------------------------------------------------------------+----------------------------------------------------------+ -| https://smartcity.rbccps.org/api/1.0.0/historicData | https://localhost:10443/api/1.0.0/historicData | +| https://smartcity.rbccps.org/api/1.0.0/db | https://localhost:10443/api/1.0.0/db | +----------------------------------------------------------------+----------------------------------------------------------+ For example, registration of device to local middleware is as follows. -``curl -i -X GET "https://localhost:10443/api/0.1.0/register" -H 'apikey: ' -H 'resourceID: ' -H 'serviceType: publish,subscribe,historicData'`` +command:: + + curl -X POST \ + https://smartcity.rbccps.org/api/1.0.0/register \ + -H 'apikey: guest' \ + -d '{ + "entitySchema": { + "refCatalogueSchema": "generic_iotdevice_schema.json", + "resourceType": "streetlight", + "tags": ["onstreet", "Energy", "still under development!"], + "refCatalogueSchemaRelease": "0.1.0", + "latitude": { + "value": 13.0143335, + "ontologyRef": "http://www.w3.org/2003/01/geo/wgs84_pos#" + }, + "longitude": { + "value": 77.5678424, + "ontologyRef": "http://www.w3.org/2003/01/geo/wgs84_pos#" + }, + "owner": { + "name": "IISC", + "website": "http://www.iisc.ac.in" + }, + "provider": { + "name": "Robert Bosch Centre for Cyber Physical Systems, IISc", + "website": "http://rbccps.org" + }, + "geoLocation": { + "address": "80 ft Road, Bangalore, 560012" + }, + "data_schema": { + "type": "object", + "properties": { + "dataSamplingInstant": { + "type": "number", + "description": "Sampling Time in EPOCH format", + "units": "seconds", + "permissions": "read", + "accessModifier": "public" + }, + "caseTemperature": { + "type": "number", + "description": "Temperature of the device casing", + "units": "degreeCelsius", + "permissions": "read", + "accessModifier": "public" + }, + "powerConsumption": { + "type": "number", + "description": "Power consumption of the device", + "units": "watts", + "permissions": "read", + "accessModifier": "public" + }, + "luxOutput": { + "type": "number", + "description": "lux output of LED measured at LED", + "units": "lux", + "permissions": "read", + "accessModifier": "public" + }, + "ambientLux": { + "type": "number", + "description": "lux value of ambient", + "units": "lux", + "permissions": "read", + "accessModifier": "public" + }, + "targetPowerState": { + "type": "string", + "enum": ["ON", "OFF"], + "units": "dimensionless", + "description": "If set to ON, turns ON the device. If OFF turns OFF the device. Writeable parameter. Writeable only allowed for authorized apps", + "permissions": "read-write", + "accessModifier": "protected" + }, + "targetBrightnessLevel": { + "type": "number", + "description": "Number between 0 to 100 to indicate the percentage brightness level. Writeable only allowed for authorized apps", + "units": "percent", + "permissions": "read-write", + "accessModifier": "protected" + }, + "targetControlPolicy": { + "enum": ["AUTO_TIMER", "AUTO_LUX", "MANUAL"], + "units": "dimensionless", + "permissions": "read-write", + "description": "Indicates which of the behaviours the device should implement. AUTO_TIMER is timer based, AUTO_LUX uses ambient light and MANUAL is controlled by app. Writeable only allowed for authorized apps", + "accessModifier": "protected" + }, + "targetAutoTimerParams": { + "type": "object", + "permissions": "read-write", + "properties": { + "targetOnTime": { + "type": "number", + "description": "Indicates time of day in seconds from 12 midnight when device turns ON in AUTO_TIMER. Writeable only allowed for authorized apps", + "units": "seconds", + "accessModifier": "protected" + }, + "targetOffTime": { + "type": "number", + "description": "Indicates time of day in seconds from 12 midnight when device turns OFF in AUTO_TIMER. Writeable only allowed for authorized apps", + "units": "seconds", + "accessModifier": "protected" + } + } + }, + "targetAutoLuxParams": { + "type": "object", + "permissions": "read-write", + "properties": { + "targetOnLux": { + "type": "number", + "description": "Indicates ambient lux when device turns ON in AUTO_LUX. Writeable only allowed for authorized apps", + "units": "lux", + "accessModifier": "protected" + }, + "targetOffLux": { + "type": "number", + "description": "Indicates ambient lux when device turns OFF in AUTO_LUX. Writeable only allowed for authorized apps", + "units": "lux", + "accessModifier": "protected" + } + } + } + }, + "additionalProperties": false + }, + "serialization_from_device": { + "format": "protocol-buffers", + "schema_ref": { + "type": "proto 2", + "mainMessageName": "sensor_values", + "link": "https://raw.githubusercontent.com/rbccps-iisc/applications-streetlight/master/proto_stm/txmsg/sensed.proto" + } + }, + "serialization_to_device": { + "format": "protocol-buffers", + "schema_ref": { + "type": "proto 2", + "mainMessageName": "targetConfigurations", + "link": "https://raw.githubusercontent.com/rbccps-iisc/applications-streetlight/master/proto_stm/rxmsg/actuated.proto" + } + }, + "id": "streetLight_1A_212" + } + }' NOTE