Device Management

List devices

GET /api/v1/devices

Returns a list of devices.

Example response:

[
    {
        "deviceID": "T5ZNYVY-VDRQ2HH-FP26UHC-FO6NOJ3-YQWK7AV-...",
        "apiKey": "uRT9cSDVnaKe6F3GEN2YycEwiqZHtNjv",
        "apiPort": 8384,
        "apiAddress": "localhost",
        "label": "s1",
        "createdAt": "2017-10-28T10:06:48.087317052+02:00",
        "updatedAt": "2017-10-28T10:06:48.087317052+02:00"
    }
]

Get device

GET /api/v1/devices/(string: deviceID)

Example response:

{
    "deviceID": "T5ZNYVY-VDRQ2HH-FP26UHC-FO6NOJ3-YQWK7AV-...",
    "apiKey": "uRT9cSDVnaKe6F3GEN2YycEwiqZHtNjv",
    "apiPort": 8384,
    "apiAddress": "localhost",
    "label": "s1",
    "createdAt": "2017-10-28T10:06:48.087317052+02:00",
    "updatedAt": "2017-10-28T10:06:48.087317052+02:00"
}

Set Device

PUT /api/v1/devices/(string: deviceID)

Example request:

{
    "deviceID": "T5ZNYVY-VDRQ2HH-FP26UHC-FO6NOJ3-YQWK7AV-...",
    "apiKey": "uRT9cSDVnaKe6F3GEN2YycEwiqZHtNjv",
    "apiPort": 8384,
    "apiAddress": "localhost",
    "label": "s1"
}

The apiAddress attribute is optional - when blank or missing, Arigi will instead use dynamic discovery to find the device address. The deviceID attribute is optional but must then match the device ID in the URL if set.

Delete Device

DELETE /api/v1/devices/(string: deviceID)

The response is 204 No Content on successfull delete.

Get Device Status

GET /api/v1/devices/(string: deviceID)/status

This endpoint mirrors Syncthing’s API call to get device status.

Example response:

{
    "myID": "T5ZNYVY-VDRQ2HH-FP26UHC-FO6NOJ3-YQWK7AV-...",
    "alloc": 15395616,
    "cpuPercent": 0.019787337440146772,
    "discoveryEnabled": true,
    "discoveryMethods": 8,
    "goRoutines": 65,
    "pathSeparator": "/",
    "sys": 33286392,
    "tilde": "/Users/jb",
    "uptime": 71,
    "createdAt": "2017-10-28T10:14:43.721492134+02:00",
    "updatedAt": "2017-10-28T10:14:43.721492134+02:00"
}

Get Device Version

GET /api/v1/devices/(string: deviceID)/version

This endpoint mirrors Syncthing’s API call to get the device version.

Example response:

{
    "device": "T5ZNYVY-VDRQ2HH-FP26UHC-FO6NOJ3-YQWK7AV-...",
    "arch": "amd64",
    "codename": "Dysprosium Dragonfly",
    "longVersion": "syncthing v0.14.40-rc.3+5-gf8015c9a ...",
    "os": "darwin",
    "version": "v0.14.40-rc.3+5-gf8015c9a",
    "createdAt": "2017-10-28T10:14:43.721879991+02:00",
    "updatedAt": "2017-10-28T10:14:43.721879991+02:00"
}

List Device Tags

GET /api/v1/devices/(string: deviceID)/tags

Returns the current set of tags for the device.

Example response:

[
    "s1"
]

Tag a Device

PUT /api/v1/devices/(string: deviceID)/tags/(string: tag)

Set a tag on a given device. No request body is necessary. The response contains the resulting set of tags for the device, same format as the list tags call.

Untag a Device

DELETE /api/v1/devices/(string: deviceID)/tags/(string: tag)

The response contains the resulting set of tags for the device, same format as the list tags call. This is possibly the empty list.