decentralized-internet
Version:
An NPM library of programs to create decentralized web and distributed computing projects
700 lines • 17.7 kB
JSON
{
"swagger" : "2.0",
"info" : {
"description" : "The API for old ZWave compatibility that you can run untop of a parallel processing mesh network",
"version" : "1.0.0",
"title" : "reg-iot-api",
"termsOfService" : "https://github.com/Lonero-Team/Decentralized-Internet/security/policy",
"contact" : {
"email" : "andrew@etherstone.org"
},
"license" : {
"name" : "MIT",
"url" : "https://github.com/Lonero-Team/Lonero-Beta/blob/master/LICENSE"
}
},
"host" : "virtserver.swaggerhub.com",
"basePath" : "/Lonero/Decentralized-Internet_API/1.0.0",
"schemes" : [ "https" ],
"consumes" : [ "application/json" ],
"produces" : [ "application/json" ],
"paths" : {
"/devices" : {
"get" : {
"tags" : [ "Device" ],
"description" : "returns all registered devices",
"operationId" : "getDevices",
"parameters" : [ {
"name" : "skip",
"in" : "query",
"description" : "number of records to skip",
"required" : false,
"type" : "integer",
"format" : "int32"
}, {
"name" : "limit",
"in" : "query",
"description" : "max number of records to return",
"required" : false,
"type" : "integer",
"format" : "int32"
} ],
"responses" : {
"200" : {
"description" : "All the devices",
"schema" : {
"type" : "array",
"items" : {
"type" : "string",
"format" : "uri",
"example" : "http://10.0.0.225:8080"
}
}
}
}
},
"post" : {
"tags" : [ "Device" ],
"operationId" : "register",
"parameters" : [ {
"in" : "body",
"name" : "device",
"required" : false,
"schema" : {
"$ref" : "#/definitions/DeviceRegistrationInfo"
}
} ],
"responses" : {
"200" : {
"description" : "successfully registered device"
}
}
}
},
"/lighting/dimmers/{deviceId}/{value}" : {
"post" : {
"tags" : [ "Z-Wave" ],
"operationId" : "setDimmer",
"parameters" : [ {
"name" : "deviceId",
"in" : "path",
"required" : true,
"type" : "string"
}, {
"name" : "value",
"in" : "path",
"required" : true,
"type" : "integer",
"maximum" : 100,
"minimum" : 0,
"format" : "int32"
} ],
"responses" : {
"200" : {
"description" : "response",
"schema" : {
"$ref" : "#/definitions/ApiResponse"
}
}
},
"x-swagger-router-controller" : "ZWave"
}
},
"/lighting/dimmers/{deviceId}/{value}/timer/{timeunit}" : {
"post" : {
"tags" : [ "Z-Wave" ],
"description" : "sets a dimmer to a specific value on a timer",
"operationId" : "setDimmerTimer",
"parameters" : [ {
"name" : "deviceId",
"in" : "path",
"required" : true,
"type" : "string"
}, {
"name" : "value",
"in" : "path",
"required" : true,
"type" : "integer",
"format" : "int32"
}, {
"name" : "timeunit",
"in" : "path",
"required" : true,
"type" : "integer",
"format" : "int32"
}, {
"name" : "units",
"in" : "query",
"required" : false,
"type" : "string",
"default" : "milliseconds",
"enum" : [ "seconds", "minutes", "milliseconds" ]
} ],
"responses" : {
"200" : {
"description" : "response",
"schema" : {
"$ref" : "#/definitions/ApiResponse"
}
}
},
"x-swagger-router-controller" : "ZWave"
}
},
"/lighting/switches/{deviceId}" : {
"get" : {
"tags" : [ "Z-Wave" ],
"operationId" : "getSwitchState",
"parameters" : [ {
"name" : "deviceId",
"in" : "path",
"required" : true,
"type" : "string"
} ],
"responses" : {
"200" : {
"description" : "response",
"schema" : {
"$ref" : "#/definitions/DeviceState"
}
}
},
"x-swagger-router-controller" : "ZWave"
}
},
"/lighting/switches/{deviceId}/{value}" : {
"post" : {
"tags" : [ "Z-Wave" ],
"operationId" : "setSwitch",
"parameters" : [ {
"name" : "deviceId",
"in" : "path",
"required" : true,
"type" : "string"
}, {
"name" : "value",
"in" : "path",
"required" : true,
"type" : "string",
"enum" : [ "true", "false" ]
} ],
"responses" : {
"200" : {
"description" : "response",
"schema" : {
"$ref" : "#/definitions/ApiResponse"
}
}
},
"x-swagger-router-controller" : "ZWave"
}
},
"/lighting/switches/{deviceId}/{value}/timer/{minutes}" : {
"post" : {
"tags" : [ "Z-Wave" ],
"description" : "sets a switch to a specific value on a timer",
"operationId" : "setSwitchTimer",
"parameters" : [ {
"name" : "deviceId",
"in" : "path",
"required" : true,
"type" : "string"
}, {
"name" : "value",
"in" : "path",
"required" : true,
"type" : "string",
"enum" : [ "true", "false" ]
}, {
"name" : "minutes",
"in" : "path",
"required" : true,
"type" : "integer",
"format" : "int32"
} ],
"responses" : {
"200" : {
"description" : "response",
"schema" : {
"$ref" : "#/definitions/ApiResponse"
}
}
},
"x-swagger-router-controller" : "ZWave"
}
},
"/lightingSummary" : {
"get" : {
"tags" : [ "Z-Wave" ],
"operationId" : "getLightingSummary",
"parameters" : [ ],
"responses" : {
"200" : {
"description" : "ok",
"schema" : {
"$ref" : "#/definitions/LightingSummary"
}
}
},
"x-swagger-router-controller" : "ZWave"
}
},
"/temperature" : {
"get" : {
"tags" : [ "Environment" ],
"operationId" : "temperatureSummary",
"parameters" : [ ],
"responses" : {
"200" : {
"description" : "ok",
"schema" : {
"$ref" : "#/definitions/TemperatureSummary"
}
}
},
"x-swagger-router-controller" : "Environment"
}
},
"/temperature/forecast/{days}" : {
"get" : {
"tags" : [ "Environment" ],
"operationId" : "getForecast",
"parameters" : [ {
"name" : "days",
"in" : "path",
"required" : true,
"type" : "integer",
"format" : "int32"
} ],
"responses" : {
"200" : {
"description" : "the forecast",
"schema" : {
"$ref" : "#/definitions/ForecastResponse"
}
}
},
"x-swagger-router-controller" : "Environment"
}
},
"/temperature/{zoneId}" : {
"get" : {
"tags" : [ "Environment" ],
"operationId" : "getZoneTemperature",
"parameters" : [ {
"name" : "zoneId",
"in" : "path",
"required" : true,
"type" : "string"
} ],
"responses" : {
"200" : {
"description" : "Zone temperature",
"schema" : {
"$ref" : "#/definitions/TemperatueZoneStatus"
}
}
},
"x-swagger-router-controller" : "Environment"
}
},
"/temperature/{zoneId}/heater" : {
"get" : {
"tags" : [ "Environment" ],
"description" : "gets the state of the heater",
"operationId" : "getHeaterState",
"parameters" : [ {
"name" : "zoneId",
"in" : "path",
"required" : true,
"type" : "string"
} ],
"responses" : {
"200" : {
"description" : "heater state",
"schema" : {
"$ref" : "#/definitions/HeaterState"
}
}
},
"x-swagger-router-controller" : "Environment"
}
},
"/temperature/{zoneId}/heater/{state}" : {
"post" : {
"tags" : [ "Environment" ],
"description" : "turns the heater on or off",
"operationId" : "setHeaterState",
"parameters" : [ {
"name" : "zoneId",
"in" : "path",
"required" : true,
"type" : "string"
}, {
"name" : "state",
"in" : "path",
"required" : true,
"type" : "string",
"enum" : [ "false", "true" ]
} ],
"responses" : {
"200" : {
"description" : "Status of the operation",
"schema" : {
"$ref" : "#/definitions/ApiResponse"
}
}
},
"x-swagger-router-controller" : "Environment"
}
},
"/zones" : {
"get" : {
"tags" : [ "Zones" ],
"operationId" : "getZones",
"parameters" : [ ],
"responses" : {
"200" : {
"description" : "ok",
"schema" : {
"type" : "array",
"items" : {
"type" : "string"
}
}
}
},
"x-swagger-router-controller" : "Zones"
}
},
"/zones/{zoneId}/quiet" : {
"get" : {
"tags" : [ "Zones" ],
"operationId" : "quietZone",
"parameters" : [ {
"name" : "zoneId",
"in" : "path",
"required" : true,
"type" : "string",
"enum" : [ "basement", "first-floor", "second-floor" ]
} ],
"responses" : {
"200" : {
"description" : "ok"
}
},
"x-swagger-router-controller" : "Zones"
}
}
},
"definitions" : {
"LightingSummary" : {
"type" : "object",
"properties" : {
"zones" : {
"type" : "array",
"items" : {
"$ref" : "#/definitions/LightingZone"
}
},
"zoneStatus" : {
"type" : "array",
"items" : {
"$ref" : "#/definitions/LightingZoneStatus"
}
}
},
"description" : "ok"
},
"LightingZone" : {
"type" : "object",
"properties" : {
"id" : {
"type" : "string"
},
"name" : {
"type" : "string"
},
"deviceId" : {
"type" : "integer",
"format" : "int32"
},
"deviceType" : {
"type" : "string",
"enum" : [ "dimmer", "switch" ]
},
"zone" : {
"type" : "string"
}
}
},
"LightingZoneStatus" : {
"type" : "object",
"properties" : {
"id" : {
"type" : "string"
},
"name" : {
"type" : "string"
},
"lastUpdate" : {
"type" : "string",
"format" : "date-time"
},
"level" : {
"type" : "integer",
"format" : "int32"
}
},
"description" : "the status of the lighting zone."
},
"TemperatureSummary" : {
"type" : "object",
"properties" : {
"zones" : {
"type" : "array",
"items" : {
"$ref" : "#/definitions/TemperatureZone"
}
},
"zoneStatus" : {
"type" : "array",
"items" : {
"$ref" : "#/definitions/TemperatueZoneStatus"
}
}
},
"description" : "ok"
},
"TemperatureZone" : {
"type" : "object",
"required" : [ "id", "name" ],
"properties" : {
"id" : {
"type" : "integer",
"format" : "int32",
"description" : "the unique identifier for the zone"
},
"name" : {
"type" : "string"
},
"inputPosition" : {
"type" : "integer",
"format" : "int32"
},
"outputPosition" : {
"type" : "integer",
"format" : "int32"
},
"zone" : {
"type" : "string"
}
},
"description" : "a single temperature zone"
},
"TemperatueZoneStatus" : {
"type" : "object",
"required" : [ "id", "timestamp", "value" ],
"properties" : {
"id" : {
"type" : "string",
"description" : "the unique identifier for the zone"
},
"name" : {
"type" : "string",
"description" : "the name of the zone"
},
"value" : {
"type" : "number",
"format" : "double",
"description" : "the temperature in the zone"
},
"units" : {
"type" : "string",
"description" : "the temperature units",
"default" : "fahrenheit",
"enum" : [ "celsius", "fahrenheit" ]
},
"timestamp" : {
"type" : "string",
"format" : "date-time",
"description" : "the timestamp when the temperature was measured"
}
},
"description" : "status of a single zone"
},
"ApiResponse" : {
"type" : "object",
"properties" : {
"code" : {
"type" : "integer",
"format" : "int32"
},
"message" : {
"type" : "string",
"example" : "everything is ok"
}
}
},
"HeaterState" : {
"type" : "object",
"properties" : {
"id" : {
"type" : "string"
},
"state" : {
"type" : "string"
}
}
},
"DeviceState" : {
"type" : "object",
"properties" : {
"id" : {
"type" : "string"
},
"name" : {
"type" : "string"
},
"lastUpdate" : {
"type" : "string",
"format" : "date-time"
},
"level" : {
"type" : "integer",
"format" : "int32"
}
}
},
"ForecastResponse" : {
"type" : "object",
"properties" : {
"city" : {
"$ref" : "#/definitions/City"
},
"values" : {
"type" : "array",
"items" : {
"$ref" : "#/definitions/Forecast"
}
}
}
},
"Forecast" : {
"type" : "object",
"properties" : {
"date" : {
"type" : "string",
"format" : "date-time"
},
"pressure" : {
"type" : "number",
"format" : "double"
},
"humidity" : {
"type" : "integer",
"format" : "int32"
},
"windSpeed" : {
"type" : "number",
"format" : "double"
},
"clouds" : {
"type" : "integer",
"format" : "int32"
},
"temperature" : {
"$ref" : "#/definitions/ForecastTemperature"
},
"weather" : {
"$ref" : "#/definitions/WeatherForecast"
}
}
},
"City" : {
"type" : "object",
"properties" : {
"id" : {
"type" : "integer",
"format" : "int64"
},
"name" : {
"type" : "string"
},
"lat" : {
"type" : "number",
"format" : "double"
},
"lon" : {
"type" : "number",
"format" : "double"
},
"country" : {
"type" : "string"
}
}
},
"ForecastTemperature" : {
"type" : "object",
"properties" : {
"low" : {
"type" : "number",
"format" : "double"
},
"high" : {
"type" : "number",
"format" : "double"
},
"morning" : {
"type" : "number",
"format" : "double"
},
"day" : {
"type" : "number",
"format" : "double"
},
"evening" : {
"type" : "number",
"format" : "double"
},
"night" : {
"type" : "number",
"format" : "double"
}
}
},
"WeatherForecast" : {
"type" : "object",
"properties" : {
"summary" : {
"type" : "string"
},
"description" : {
"type" : "string"
},
"icon" : {
"type" : "string"
}
}
},
"DeviceRegistrationInfo" : {
"type" : "object",
"properties" : {
"uri" : {
"type" : "string",
"format" : "uri",
"example" : "http://10.0.0.220:8080"
},
"id" : {
"type" : "string",
"format" : "uuid",
"example" : "0729a580-2240-11e6-9eb5-0002a5d5c51b"
}
}
}
},
"externalDocs" : {
"description" : "Documentation",
"url" : "https://lonero.readthedocs.io/en/latest/"
}
}