{"_id":"59e5777285e644001a77724c","project":"568bdc1483d2061900d86cdc","version":{"_id":"59a72290d61777001b6c42c3","project":"568bdc1483d2061900d86cdc","__v":21,"createdAt":"2017-08-30T20:39:44.453Z","releaseDate":"2017-08-30T20:39:44.453Z","categories":["59a7236e3fe4d90025117c10","59a72eb6cb0db3001b84cfe2","59a734eb757d030019b85af8","59c0243b1b2d07001a9d2b76","59c035e42126e10028effb12","59c06c40df5b3c0010584a13","59c1a5852cabe5002641a3e7","59c2fb00b2b45c0010b7a3d7","59c32ceb9aea850010ac4130","59c32e6e190c90003cb0d12f","59c33affb2b45c0010b7aa23","59c7dfa457bd8200105444dc","59c7e975c50cf30010d712a0","59cffdef0cd4dd0010294d54","59d0622ca91a810032c8f60c","59d06733c1aec60026253065","59d174d44ac471001a07b123","59d5a5e323e6e800103defb2","59ecf1d8ed507c001c52b255","59f76fef8581dc0010593e6f","5a0c003680a35b0012c35db0"],"is_deprecated":false,"is_hidden":false,"is_beta":true,"is_stable":true,"codename":"","version_clean":"0.0.0","version":"0"},"category":{"_id":"59d0622ca91a810032c8f60c","project":"568bdc1483d2061900d86cdc","version":"59a72290d61777001b6c42c3","__v":0,"sync":{"url":"","isSync":false},"reference":false,"createdAt":"2017-10-01T03:34:04.474Z","from_sync":false,"order":4,"slug":"edge-server-plugins","title":"Edge Server"},"user":"568bdbc4fe6fcc0d006dc970","__v":0,"parentDoc":null,"updates":[],"next":{"pages":[],"description":""},"createdAt":"2017-10-17T03:22:26.184Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":9,"body":"# Edge Provisioning REST API\n[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Provisiong services in the edge is only supported on OpenWRT\",\n  \"body\": \"Please contact Droplit support to get access to the provisioning services.\"\n}\n[/block]\n## Enable the Edge Provisioning Service\nThe provisioning service on the Edge hub is disabled by default. To enable the provisioning service, set the `provisioningServiceEnabled` property under `config` in the `localsettings.json` file to `true`.\n* Disabled\n```\n...\n\"config\": {\n    \"provisioningServiceEnabled\": false,\n    ...\n}\n```\n* Enabled\n```\n...\n\"config\": {\n    \"provisioningServiceEnabled\": true,\n    ...\n}\n```\n\n## Configure Edge Provisioning Service Port\nThe provisioning service on the Edge hub, when enabled, is configured to port `81` by default. To change the port, set the `provisioningServicePort` property under `config` in the `localsettings.json` file to a valid port number.\n* Default Port Number\n```\n...\n\"config\": {\n    \"provisioningServiceEnabled\": true,\n    \"provisioningServicePort\": 83,\n    ...\n}\n```\n## Auth Suite\nConnect to a specific network with a specified Auth Suite encryption and password. Supported Auth Suites include:\n* `wep+open`\n* `wep+shared`\n* `wep+mixed`\n* `psk2+tkip+ccmp`\n* `psk2+tkip+aes`\n* `psk2+tkip`\n* `psk2+ccmp`\n* `psk2+aes`\n* `psk2`\n* `psk+tkip+ccmp`\n* `psk+tkip+aes`\n* `psk+tkip`\n* `psk+ccmp`\n* `psk+aes`\n* `psk`\n* `psk-mixed+tkip+ccmp`\n* `psk-mixed+tkip+aes`\n* `psk-mixed+tkip`\n* `psk-mixed+ccmp`\n* `psk-mixed+aes`\n* `psk-mixed`\n\nFor more information see: https://wiki.openwrt.org/doc/uci/wireless#wpa_modes\n\n## Endpoints\n\n### Returns the Edge ID\n* Definition \n    * ```GET: http://192.168.1.1:81/droplit-edge```\n* Result Format\n    * 200 OK \n    * ``` \n        {\n            \"edgeId\" : \"00-00-5E-00-53-EB\"\n        } \n         ```\n    * 400 Bad request - no content\n\n### Returns the list of WiFi networks scanned by the Edge Hub\n\n### Network Details\n* `essid` - service set identifier for wireless network\n* `uci` - encryption parameter that should be used as the value for `AUTH_SUITE`\n* `encryption` - User readable description of the encryption type\n* `mode` - connection type for access point \n* `channel` - channel the network is using\n* `signal` - signal strength in dB\n* `quality` - quality of the connection to the network\n\n* Definition\n    * ```GET: http://192.168.1.1:81/droplit-edge/config/wifi```\n* Result Format \n    * 200 OK\n    * ```\n{\n    \"items\": [\n        {\n            \"address\": \"B0:77:AC:37:96:C0\",\n            \"essid\": \"MySuperFastNetwork\",\n            \"mode\": \"Master\",\n            \"channel\": 1,\n            \"signal\": -38,\n            \"quality\": \"64/70\",\n            \"encryption\": \"mixed WPA/WPA2 PSK (TKIP, CCMP)\",\n            \"uci\": \"psk-mixed+tkip+ccmp\"\n        },\n        {\n            \"address\": \"02:1A:11:F5:B4:7A\",\n            \"essid\": \"MySuperFastGuestNetwork\",\n            \"mode\": \"Master\",\n            \"channel\": 5,\n            \"signal\": -39,\n            \"quality\": \"70/70\",\n            \"encryption\": \"mixed WPA/WPA2 PSK (TKIP, CCMP)\",\n            \"uci\": \"psk-mixed+tkip+ccmp\"\n        }\n    ]\n}\n```\n    * 400 Bad request - no content\n\n### Connect to a specified network\n* Definition (Note: You will lose connection to the Edge hub after sending this request  since the Edge \nhub will switch from provisioning mode to attempting to establish and connection to the specified network)\n    * ```PUT: http://192.168.1.1:81/droplit-edge/config/wifi ```\n* Parameters: \n    * ```\n        {\n            \"SSID\" : \"MySuperSafeNetwork\",\n            \"PASS\": \"MySuperSafePasswordThatIChangeFrequenly\",\n            \"AUTH_SUITE\": \"psk-mixed\"\n        }\n      ```\n* Result Format \n    * Status: 200 OK - no content (check to see if Edge hub is connected to internet)\n    * 400 Bad request - no content","excerpt":"","slug":"edge-provisioning-api","type":"basic","title":"Edge Provisioning API"}

Edge Provisioning API


# Edge Provisioning REST API [block:callout] { "type": "info", "title": "Provisiong services in the edge is only supported on OpenWRT", "body": "Please contact Droplit support to get access to the provisioning services." } [/block] ## Enable the Edge Provisioning Service The provisioning service on the Edge hub is disabled by default. To enable the provisioning service, set the `provisioningServiceEnabled` property under `config` in the `localsettings.json` file to `true`. * Disabled ``` ... "config": { "provisioningServiceEnabled": false, ... } ``` * Enabled ``` ... "config": { "provisioningServiceEnabled": true, ... } ``` ## Configure Edge Provisioning Service Port The provisioning service on the Edge hub, when enabled, is configured to port `81` by default. To change the port, set the `provisioningServicePort` property under `config` in the `localsettings.json` file to a valid port number. * Default Port Number ``` ... "config": { "provisioningServiceEnabled": true, "provisioningServicePort": 83, ... } ``` ## Auth Suite Connect to a specific network with a specified Auth Suite encryption and password. Supported Auth Suites include: * `wep+open` * `wep+shared` * `wep+mixed` * `psk2+tkip+ccmp` * `psk2+tkip+aes` * `psk2+tkip` * `psk2+ccmp` * `psk2+aes` * `psk2` * `psk+tkip+ccmp` * `psk+tkip+aes` * `psk+tkip` * `psk+ccmp` * `psk+aes` * `psk` * `psk-mixed+tkip+ccmp` * `psk-mixed+tkip+aes` * `psk-mixed+tkip` * `psk-mixed+ccmp` * `psk-mixed+aes` * `psk-mixed` For more information see: https://wiki.openwrt.org/doc/uci/wireless#wpa_modes ## Endpoints ### Returns the Edge ID * Definition * ```GET: http://192.168.1.1:81/droplit-edge``` * Result Format * 200 OK * ``` { "edgeId" : "00-00-5E-00-53-EB" } ``` * 400 Bad request - no content ### Returns the list of WiFi networks scanned by the Edge Hub ### Network Details * `essid` - service set identifier for wireless network * `uci` - encryption parameter that should be used as the value for `AUTH_SUITE` * `encryption` - User readable description of the encryption type * `mode` - connection type for access point * `channel` - channel the network is using * `signal` - signal strength in dB * `quality` - quality of the connection to the network * Definition * ```GET: http://192.168.1.1:81/droplit-edge/config/wifi``` * Result Format * 200 OK * ``` { "items": [ { "address": "B0:77:AC:37:96:C0", "essid": "MySuperFastNetwork", "mode": "Master", "channel": 1, "signal": -38, "quality": "64/70", "encryption": "mixed WPA/WPA2 PSK (TKIP, CCMP)", "uci": "psk-mixed+tkip+ccmp" }, { "address": "02:1A:11:F5:B4:7A", "essid": "MySuperFastGuestNetwork", "mode": "Master", "channel": 5, "signal": -39, "quality": "70/70", "encryption": "mixed WPA/WPA2 PSK (TKIP, CCMP)", "uci": "psk-mixed+tkip+ccmp" } ] } ``` * 400 Bad request - no content ### Connect to a specified network * Definition (Note: You will lose connection to the Edge hub after sending this request since the Edge hub will switch from provisioning mode to attempting to establish and connection to the specified network) * ```PUT: http://192.168.1.1:81/droplit-edge/config/wifi ``` * Parameters: * ``` { "SSID" : "MySuperSafeNetwork", "PASS": "MySuperSafePasswordThatIChangeFrequenly", "AUTH_SUITE": "psk-mixed" } ``` * Result Format * Status: 200 OK - no content (check to see if Edge hub is connected to internet) * 400 Bad request - no content