/api/customers/K0002/devices/base/ABCDEF012345 as application/json; charset=UTF-8
with following body:
{
"links": [{
"rel": "firmware",
"href": "/api/customers/K0002/device-types/BaseDevice/firmwares/150.123"
}, {
"rel": "site",
"href": "/api/customers/K0002/sites/a062000000HbAsd"
}]
}
Then I should receive HTTP/1.1 204 No Content
/api/customers/K0002/devices/base/ABCDEF012345 should return:
{
"links": [{
"rel": "firmware",
"href": "/api/customers/K0002/device-types/BaseDevice/firmwares/150.123"
}, {
"rel": "site",
"href": "/api/customers/K0002/sites/a062000000HbAsd"
}]
}
/api/customers/K0002/devices/base/ABCDEF012345 with application/json; charset=UTF-8 {
"data": [{
"name": "note",
"value": "my personal note for this device"
}]
}
Then I should receive HTTP/1.1 204 No Content
/api/customers/K0002/devices/base/ABCDEF012345 HTTP/1.1 200 OK {
"data": [{
"name": "note",
"value": "my personal note for this device"
}]
}
/api/customers/K0002/devices/base/ABCDEF012345 with application/json; charset=UTF-8 {
"data": [{
"name": "note",
"value": ""
}]
}
Then I should receive HTTP/1.1 204 No Content
/api/customers/K0002/devices/base/ABCDEF012345 HTTP/1.1 200 OK {
"data": [{
"name": "note",
"value": null
}]
}
/api/customers/K0002/devices/base/ABCDEF012345 with application/json; charset=UTF-8 {
"data": [{
"name": "note",
"value": null
}]
}
Then I should receive HTTP/1.1 204 No Content
/api/customers/K0002/devices/base/ABCDEF012345 HTTP/1.1 200 OK {
"data": [{
"name": "note",
"value": null
}]
}
/api/customers/K0002/devices/base/ABCDEF012345 as application/json; charset=UTF-8
with following body:
{
"data": [{
"name": "ipAddress",
"value": "192.168.64.1"
}, {
"name": "netmask",
"value": "192.168.64.2"
}, {
"name": "gateway",
"value": "192.168.64.3"
}, {
"name": "dns1",
"value": "192.168.64.4"
}, {
"name": "dns2",
"value": "192.168.64.5"
}, {
"name": "mtu",
"value": "9000"
}, {
"name": "webguiHttpsonly",
"value": true
}, {
"name": "suppressLineno",
"value": "DEFAULT"
}]
}
Then I should receive HTTP/1.1 204 No Content
/api/customers/K0002/devices/base/ABCDEF012345 should return:
{
"data": [{
"name": "dhcpEnabled",
"value": false
}, {
"name": "ipAddress",
"value": "192.168.64.1"
}, {
"name": "netmask",
"value": "192.168.64.2"
}, {
"name": "gateway",
"value": "192.168.64.3"
}, {
"name": "dns1",
"value": "192.168.64.4"
}, {
"name": "dns2",
"value": "192.168.64.5"
}, {
"name": "mtu",
"value": "9000"
}, {
"name": "suppressLineno",
"value": "DEFAULT"
}]
}
/api/customers/K0002/devices/base/ABCDEF012345 as application/json; charset=UTF-8
with following body:
{
"data": [{
"name": "ipAddress",
"value": "192.168.64.1"
}, {
"name": "netmask",
"value": "192.168.64.2"
}, {
"name": "gateway",
"value": "192.168.64.3"
}, {
"name": "dns1",
"value": "192.168.64.4"
}, {
"name": "dns2",
"value": "192.168.64.5"
}, {
"name": "mtu",
"value": "1500"
}]
}
Then I should receive HTTP/1.1 400 Bad Request
{
"title": "Validation error",
"detail": "Could not create or update resource due to constraint violations",
"errors": [{
"message": "Cannot set DHCP options if dhcpEnabled is not false",
"path": "dhcpEnabled"
}],
"described_by": "http://api.nfon.net/probs/validation-error"
}
/api/customers/K0002/devices/base/ABCDEF012345 as application/json; charset=UTF-8
with following body:
{
"data": [{
"name": "ipAddress",
"value": "192.168.64.1.what?"
}]
}
Then I should receive HTTP/1.1 400 Bad Request
{
"title": "Validation error",
"detail": "Could not create or update resource due to constraint violations",
"errors": [{
"message": "ipAddress is not in IP format",
"value": "192.168.64.1.what?"
}],
"described_by": "http://api.nfon.net/probs/validation-error"
}
/api/customers/K0002/devices/base/ABCDEF012345 as application/json; charset=UTF-8
with following body:
{
"data": [{
"name": "mtu",
"value": "123"
}]
}
Then I should receive HTTP/1.1 400 Bad Request
{
"title": "Validation error",
"detail": "Could not create or update resource due to constraint violations",
"errors": [{
"message": "mtu must be one of: [\"1500\", \"9000\"]"
}],
"described_by": "http://api.nfon.net/probs/validation-error"
}
/api/customers/K0002/devices/base/ABCDEF012345 as application/json; charset=UTF-8
with following body:
{
"data": [{
"name": "dhcpEnabled",
"value": true
}]
}
Then I should receive HTTP/1.1 204 No Content
/api/customers/K0002/devices/base/ABCDEF012345 should return:
{
"data": [{
"name": "dhcpEnabled",
"value": true
}, {
"name": "ipAddress",
"value": null
}, {
"name": "netmask",
"value": null
}, {
"name": "gateway",
"value": null
}, {
"name": "dns1",
"value": null
}, {
"name": "dns2",
"value": null
}, {
"name": "mtu",
"value": null
}]
}
/api/customers/K0002/devices/base/ABCDEF012345 as application/json; charset=UTF-8
with following body:
{
"data": [{
"name": "dhcpEnabled",
"value": true
}, {
"name": "ipAddress",
"value": "192.168.64.1"
}, {
"name": "netmask",
"value": "192.168.64.2"
}, {
"name": "gateway",
"value": "192.168.64.3"
}, {
"name": "mtu",
"value": "1500"
}]
}
Then I should receive HTTP/1.1 400 Bad Request
with following body:
{
"errors": [{
"message": "Cannot set DHCP options if dhcpEnabled is not false",
"path": "dhcpEnabled"
}]
}
/api/customers/K0002/devices/base/ABCDEF012345 as application/json; charset=UTF-8
with following body:
{
"data": [{
"name": "bitrate",
"value": "4800"
}]
}
Then I should receive HTTP/1.1 204 No Content
/api/customers/K0002/devices/base/ABCDEF012345 should return:
{
"data": [{
"name": "bitrate",
"value": "4800"
}]
}
/api/customers/K0002/devices/base/ABCDEF012345 as application/json; charset=UTF-8
with following body:
{
"data": [{
"name": "bitrate",
"value": "4800"
}]
}
Then I should receive HTTP/1.1 400 Bad Request
with following body:
{
"errors": [{
"message": "bitrate is only available for Patton bases",
"path": "bitrate"
}]
}
/api/customers/K0002/devices/base/ABCDEF012345 as application/json; charset=UTF-8
with following body:
{
"links": [{
"rel": "firmware",
"href": "/api/customers/K0002/device-types/OtherBaseDeviceType/firmwares/150.123"
}]
}
Then I should receive HTTP/1.1 400 Bad Request
with following body:
{
"errors": [{
"message": "Firmware is invalid for selected device type",
"detailMessage": "Provided firmware with releaseVersion 150.123 is invalid for device with type BaseDevice",
"path": "firmware"
}]
}
/api/customers/K0002/devices/base/ABCDEF012345 as application/json; charset=UTF-8
with following body:
{
"links": [{
"rel": "site",
"href": "/api/customers/K0003/sites/a062000000K0003"
}]
}
Then I should receive HTTP/1.1 400 Bad Request
with following body:
{
"errors": [{
"message": "Site not allowed",
"detailMessage": "Site [a062000000K0003] is not reachable for customer [K0002]",
"path": "site"
}]
}
/api/customers/K0003/devices/base/ABCDEF012345 as application/json; charset=UTF-8
with following body:
{}
Then I should receive HTTP/1.1 403 Forbidden {
"title": "Access forbidden",
"detail": "Access denied to [Customer] with id [K0003]",
"described_by": "http://api.nfon.net/probs/invalid-authorization"
}
/api/customers/K0003/devices/base/ABCDEF012345 as application/json; charset=UTF-8
with following body:
{}
Then I should receive HTTP/1.1 403 Forbidden {
"title": "Access forbidden",
"detail": "Access denied to [Customer] with id [K0003]",
"described_by": "http://api.nfon.net/probs/invalid-authorization"
}