Auto-merge for PR #467 via VersionBot

Replace edge device type with generic-amd64
This commit is contained in:
resin-io-versionbot[bot] 2017-07-07 18:37:25 +00:00 committed by GitHub
commit c84a269947
4 changed files with 23 additions and 14 deletions

View File

@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file
automatically by Versionist. DO NOT EDIT THIS FILE MANUALLY!
This project adheres to [Semantic Versioning](http://semver.org/).
## v6.0.0 - 2017-07-07
* Deprecate edge device type [Joe Roberts]
## v5.1.1 - 2017-07-04
* Fix semver comparison for OS version when determining if the device has deviceApiKey support [Pablo Carranza Velez]

View File

@ -57,14 +57,12 @@ curl -X GET $RESIN_SUPERVISOR_ADDRESS/v1/dependent-apps?apikey=$RESIN_SUPERVISOR
[
{
"id": 13015,
"device_type": "edge",
"name": "edgeApp1",
"commit": "d43bea5e16658e653088ce4b9a91b6606c3c2a0d",
"config": {}
},
{
"id": 13016,
"device_type": "edge",
"name": "edgeApp2",
"commit": "d0f6624d6410fa079159fa3ebe0d3af46753d75d",
"config": {}
@ -110,7 +108,7 @@ curl -X GET $RESIN_SUPERVISOR_ADDRESS/v1/devices?apikey=$RESIN_SUPERVISOR_API_KE
"id": 1,
"uuid": "5ae8cf6e062c033ea38435498ad9b487bcc714e9eab0fed0404ee56e397790",
"appId": 13015,
"device_type": "edge",
"device_type": "generic-amd64",
"logs_channel": "69f961abffaad1ff66031b29f712be4fb19e1bfabf1fee7a9ebfb5fa75a1fbdb",
"deviceId": "47270",
"is_online": null,
@ -128,7 +126,7 @@ curl -X GET $RESIN_SUPERVISOR_ADDRESS/v1/devices?apikey=$RESIN_SUPERVISOR_API_KE
"id": 3,
"uuid": "8dc608765fd32665d49d218a7eb4657bc2ab8a56db06d2c57ef7c7e9a115da",
"appId": 13015,
"device_type": "edge",
"device_type": "generic-amd64",
"logs_channel": "d0244a90e8cd6e9a1ab410d3d599dea7f15110a6fe37b2a8fd69bb6ee0bce043",
"deviceId": "47318",
"is_online": null,
@ -148,10 +146,15 @@ curl -X GET $RESIN_SUPERVISOR_ADDRESS/v1/devices?apikey=$RESIN_SUPERVISOR_API_KE
### POST /v1/devices
Dependent Device Provision
The `device_type` parameter is optional, defaulting to `generic-amd64`. You
should only set this if you need to provision a dependent device to an
application with the deprecated `edge` device type.
**Example**
```bash
curl -H "Content-Type: application/json" -X POST --data '{"appId": <appId>}' /
curl -H "Content-Type: application/json" -X POST --data '{"appId": <appId>,
"device_type": "edge"}' /
$RESIN_SUPERVISOR_ADDRESS/v1/devices?apikey=$RESIN_SUPERVISOR_API_KEY
```
@ -162,10 +165,10 @@ $RESIN_SUPERVISOR_ADDRESS/v1/devices?apikey=$RESIN_SUPERVISOR_API_KEY
```javascript
{
"id": 47318,
"uuid": "8dc608765fd32665d49a268a7eb4657bc2ab8a56db06d2c57ef7c7e9a115da",
"name": "wild-paper",
"uuid": "8dc608765fd32665d49a268a7eb4657bc2ab8a56db06d2c57ef7c7e9a115da",
"name": "wild-paper",
"note": null,
"device_type": "edge",
"device_type": "edge"
}
```
@ -186,7 +189,7 @@ curl -X GET $RESIN_SUPERVISOR_ADDRESS/v1/devices/<uuid>?apikey=$RESIN_SUPERVISOR
"id": 1,
"uuid": "5ae8cf6e062c033ea57837498ad9b487bfc714e9eab0fed0404ee56e397790",
"appId": 13015,
"device_type": "edge",
"device_type": "generic-amd64",
"logs_channel": "69f961abffaad2ff00031b29f718be4fb19e1bfabf1fee7a9ebfb5fa75a1fbdb",
"deviceId": "47270",
"is_online": null,
@ -219,7 +222,7 @@ $RESIN_SUPERVISOR_ADDRESS/v1/devices/<uuid>?apikey=$RESIN_SUPERVISOR_API_KEY
"id": 1,
"uuid": "5ae8cf6e062c033ea38437498ad9b482bcc714e9eab0fed0404ee56e397790",
"appId": 13015,
"device_type": "edge",
"device_type": "generic-amd64",
"logs_channel": "69f961abffaad2ff66031b29f712be4fb19e1bfabf1fee7a9ebfb5fa05a1fbdb",
"deviceId": "47270",
"is_online": true,

View File

@ -1,7 +1,7 @@
{
"name": "resin-supervisor",
"description": "This is resin.io's Supervisor, a program that runs on IoT devices and has the task of running user Apps (which are Docker containers), and updating them as Resin's API informs it to.",
"version": "5.1.1",
"version": "6.0.0",
"license": "Apache-2.0",
"repository": {
"type": "git",

View File

@ -42,10 +42,13 @@ router.get '/v1/devices', (req, res) ->
res.status(503).send(err?.message or err or 'Unknown error')
router.post '/v1/devices', (req, res) ->
appId = req.body.appId
{ appId, device_type } = req.body
if !appId? or _.isNaN(parseInt(appId)) or parseInt(appId) <= 0
res.status(400).send('appId must be a positive integer')
return
device_type = 'generic-amd64' if !device_type?
Promise.join(
utils.getConfig('apiKey')
utils.getConfig('userId')
@ -57,7 +60,7 @@ router.post '/v1/devices', (req, res) ->
user: userId
application: req.body.appId
uuid: uuid
device_type: 'edge'
device_type: device_type
device: deviceId
registered_at: Math.floor(Date.now() / 1000)
logs_channel: logsChannel
@ -203,7 +206,6 @@ router.get '/v1/dependent-apps', (req, res) ->
return {
id: parseInt(app.appId)
commit: app.commit
device_type: 'edge'
name: app.name
config: JSON.parse(app.config ? '{}')
}