/api/customers/K0002/devices/base as application/json; charset=UTF-8
with following body:
{
"data": [{
"name": "mac",
"value": "ABCDEF012345"
}, {
"name": "webguiHttpsonly",
"value": true
}, {
"name": "suppressLineno",
"value": "DEFAULT"
}, {
"name": "note",
"value": "my personal note on post request"
}],
"links": [{
"rel": "deviceType",
"href": "/api/customers/K0002/device-types/Base%20Device"
}]
}
Then I should receive HTTP/1.1 201 Created
{
"href": "/api/customers/K0002/devices/base/ABCDEF012345"
}
/api/customers/K0002/devices/base/ABCDEF012345 should return:
{
"href": "/api/customers/K0002/devices/base/ABCDEF012345",
"data": [{
"name": "mac",
"value": "ABCDEF012345"
}, {
"name": "suppressLineno",
"value": "DEFAULT"
}, {
"name": "webguiHttpsonly",
"value": true
}, {
"name": "note",
"value": "my personal note on post request"
}],
"links": [{
"rel": "deviceType",
"href": "/api/customers/K0002/device-types/Base%20Device"
}]
}
/api/customers/K0002/devices/base as application/json; charset=UTF-8
with following body:
{
"data": [{
"name": "mac",
"value": "ABCDEF012345"
}],
"links": [{
"rel": "deviceType",
"href": "/api/customers/K0002/device-types/ExtendedBaseDevice"
}]
}
Then I should receive HTTP/1.1 201 Created
{
"href": "/api/customers/K0002/devices/base/ABCDEF012345"
}
/api/customers/K0002/devices/base/ABCDEF012345 should return:
{
"href": "/api/customers/K0002/devices/base/ABCDEF012345",
"data": [{
"name": "mac",
"value": "ABCDEF012345"
}],
"links": [{
"rel": "deviceType",
"href": "/api/customers/K0002/device-types/ExtendedBaseDevice"
}]
}
/api/customers/K0002/devices/base as application/json; charset=UTF-8
with following body:
{
"data": [{
"name": "mac",
"value": "ABCDEF012345"
}],
"links": [{
"rel": "deviceType",
"href": "/api/customers/K0002/device-types/Handset"
}]
}
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 create Base Device with type that is not of BASE or EXTENDEDBASE category",
"path": "deviceType",
"value": "/api/customers/K0002/device-types/Handset"
}],
"described_by": "http://api.nfon.net/probs/validation-error"
}
/api/customers/K0002/devices/base as application/json; charset=UTF-8
with following body:
{
"links": [{
"rel": "deviceType",
"href": "/api/customers/K0002/device-types/BaseDevice"
}, {
"rel": "firmware",
"href": "/api/customers/K0002/device-types/BaseDevice/firmwares/150.123"
}, {
"rel": "site",
"href": "/api/customers/K0002/sites/a062000000HbAsd"
}],
"data": [{
"name": "mac",
"value": "ABCDEF012345"
}]
}
Then I should receive HTTP/1.1 201 Created
{
"href": "/api/customers/K0002/devices/base/ABCDEF012345"
}
/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 as application/json; charset=UTF-8
with following body:
{
"links": [{
"rel": "deviceType",
"href": "/api/customers/K0002/device-types/BaseDevice"
}],
"data": [{
"name": "mac",
"value": "ABCDEF012345"
}, {
"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": "1500"
}]
}
Then I should receive HTTP/1.1 201 Created
{
"href": "/api/customers/K0002/devices/base/ABCDEF012345"
}
/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": "1500"
}]
}
/api/customers/K0002/devices/base as application/json; charset=UTF-8
with following body:
{
"links": [{
"rel": "deviceType",
"href": "/api/customers/K0002/device-types/BaseDevice"
}],
"data": [{
"name": "mac",
"value": "ABCDEF012345"
}, {
"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 as application/json; charset=UTF-8
with following body:
{
"links": [{
"rel": "deviceType",
"href": "/api/customers/K0002/device-types/BaseDevice"
}],
"data": [{
"name": "mac",
"value": "ABCDEF012345"
}, {
"name": "dhcpEnabled",
"value": false
}]
}
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": "The following fields are required if dhcpEnabled is not false: ipAddress, netmask, gateway, mtu"
}],
"described_by": "http://api.nfon.net/probs/validation-error"
}
/api/customers/K0002/devices/base as application/json; charset=UTF-8
with following body:
{
"links": [{
"rel": "deviceType",
"href": "/api/customers/K0002/device-types/BaseDevice"
}],
"data": [{
"name": "mac",
"value": "ABCDEF012345"
}, {
"name": "dhcpEnabled",
"value": false
}, {
"name": "ipAddress",
"value": "192.168.64.1.what?"
}, {
"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
{
"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 as application/json; charset=UTF-8
with following body:
{
"links": [{
"rel": "deviceType",
"href": "/api/customers/K0002/device-types/BaseDevice"
}],
"data": [{
"name": "mac",
"value": "ABCDEF012345"
}, {
"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": "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\"]",
"path": "mtu",
"value": "123"
}],
"described_by": "http://api.nfon.net/probs/validation-error"
}
/api/customers/K0002/devices/base as application/json; charset=UTF-8
with following body:
{
"links": [{
"rel": "deviceType",
"href": "/api/customers/K0002/device-types/BaseDevice"
}],
"data": [{
"name": "mac",
"value": "ABCDEF012345"
}]
}
Then I should receive HTTP/1.1 201 Created
{
"href": "/api/customers/K0002/devices/base/ABCDEF012345"
}
/api/customers/K0002/devices/base/ABCDEF012345 should return:
{
"href": "/api/customers/K0002/devices/base/ABCDEF012345",
"links": [{
"rel": "site",
"href": "/api/customers/K0002/sites/1"
}]
}
/api/customers/K0002/devices/base as application/json; charset=UTF-8
with following body:
{
"links": [{
"rel": "deviceType",
"href": "/api/customers/K0002/device-types/BaseDevice"
}],
"data": [{
"name": "mac",
"value": "ABCDEF012345"
}]
}
Then I should receive HTTP/1.1 201 Created
{
"href": "/api/customers/K0002/devices/base/ABCDEF012345"
}
/api/customers/K0002/devices/base/ABCDEF012345 should return:
{
"href": "/api/customers/K0002/devices/base/ABCDEF012345",
"links": [{
"rel": "firmware",
"href": "/api/customers/K0002/device-types/BaseDevice/firmwares/1.2.13"
}]
}
/api/customers/K0002/devices/base as application/json; charset=UTF-8
with following body:
{
"links": [{
"rel": "deviceType",
"href": "/api/customers/K0002/device-types/BaseDevice"
}],
"data": [{
"name": "mac",
"value": "ABCDEF012345"
}, {
"name": "bitrate",
"value": "7200"
}]
}
Then I should receive HTTP/1.1 201 Created
{
"href": "/api/customers/K0002/devices/base/ABCDEF012345"
}
/api/customers/K0002/devices/base/ABCDEF012345 should return:
{
"href": "/api/customers/K0002/devices/base/ABCDEF012345",
"data": [{
"name": "bitrate",
"value": "7200"
}]
}
/api/customers/K0002/devices/base as application/json; charset=UTF-8
with following body:
{
"links": [{
"rel": "deviceType",
"href": "/api/customers/K0002/device-types/BaseDevice"
}],
"data": [{
"name": "mac",
"value": "ABCDEF012345"
}, {
"name": "bitrate",
"value": "abc"
}]
}
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": "bitrate must be one of: [\"-\", \"2400\", \"4800\", \"7200\", \"9600\", \"12000\", \"14400\"]",
"path": "bitrate",
"value": "abc"
}],
"described_by": "http://api.nfon.net/probs/validation-error"
}
/api/customers/K0002/devices/base as application/json; charset=UTF-8
with following body:
{
"links": [{
"rel": "deviceType",
"href": "/api/customers/K0002/device-types/BaseDevice"
}],
"data": [{
"name": "mac",
"value": "ABCDEF012345"
}, {
"name": "bitrate",
"value": "7200"
}]
}
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": "bitrate is only available for Patton bases",
"path": "bitrate"
}],
"described_by": "http://api.nfon.net/probs/validation-error"
}
/api/customers/K0002/devices/base as application/json; charset=UTF-8
with following body:
{
"links": [{
"rel": "deviceType",
"href": "/api/customers/K0002/device-types/BaseDevice"
}],
"data": [{
"name": "mac",
"value": ""
}]
}
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": "MAC number not defined",
"path": "uniqueIdentifier"
}],
"described_by": "http://api.nfon.net/probs/validation-error"
}
/api/customers/K0002/devices/base as application/json; charset=UTF-8
with following body:
{
"links": [{
"rel": "deviceType",
"href": "/api/customers/K0002/device-types/BaseDevice"
}],
"data": [{
"name": "mac",
"value": "acbdefghijkl"
}]
}
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": "MAC number not valid",
"path": "uniqueIdentifier"
}],
"described_by": "http://api.nfon.net/probs/validation-error"
}
/api/customers/K0002/devices/base as application/json; charset=UTF-8
with following body:
{
"links": [{
"rel": "deviceType",
"href": "/api/customers/K0002/device-types/BaseDevice"
}],
"data": [{
"name": "mac",
"value": "ABCDEF012345"
}]
}
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": "MAC number not unique",
"path": "uniqueIdentifier"
}],
"described_by": "http://api.nfon.net/probs/validation-error"
}
/api/customers/K0003/devices/base as application/json; charset=UTF-8
with following body:
{
"data": [{
"name": "mac",
"value": "ABCDEF012345"
}],
"links": [{
"rel": "deviceType",
"href": "/api/customers/K0003/device-types/BaseDevice"
}]
}
Then I should receive HTTP/1.1 400 Bad Request
with following body:
{
"errors": [{
"message": "Customer contract type does not allow to add more Devices"
}]
}
/api/customers/K0002/devices/base with application/json; charset=UTF-8 {
"links": [{
"rel": "deviceType",
"href": "/api/customers/K0002/device-types/not-existing"
}],
"data": [{
"name": "mac",
"value": "ABCDEF012345"
}]
}
Then I should receive HTTP/1.1 404 Not Found {
"title": "Device Type not found",
"detail": "Device Type with name not-existing not found",
"described_by": "http://api.nfon.net/probs/device-type-not-found"
}
/api/customers/K0404/devices/base
with application/json; charset=UTF-8 {
"links": [{
"rel": "deviceType",
"href": "/api/customers/K0002/device-types/not-existing"
}],
"data": [{
"name": "mac",
"value": "ABCDEF012345"
}]
}
Then I should receive HTTP/1.1 404 Not Found {
"title": "Customer not found",
"detail": "Customer with identifier K0404 has not been found",
"described_by": "http://api.nfon.net/probs/customer-not-found"
}
/api/customers/K0002/devices/base with application/json; charset=UTF-8 {
"links": [{
"rel": "deviceType",
"href": "/api/customers/K0002/device-types/not-existing"
}],
"data": [{
"name": "mac",
"value": "ABCDEF012345"
}]
}
Then I should get HTTP/1.1 403 Forbidden {
"title": "Access forbidden",
"detail": "Access denied to [Customer] with id [K0002]",
"described_by": "http://api.nfon.net/probs/invalid-authorization"
}
/api/customers/K0003/devices/base with application/json; charset=UTF-8 {
"links": [{
"rel": "deviceType",
"href": "/api/customers/K0003/device-types/type01"
}],
"data": [{
"name": "mac",
"value": "ABCDEF012345"
}]
}
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 with application/json; charset=UTF-8 {
"links": [{
"rel": "deviceType",
"href": "/api/customers/K0003/device-types/type01"
}],
"data": [{
"name": "mac",
"value": "ABCDEF012345"
}]
}
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"
}