/api/customers/K0002/routers as application/json; charset=UTF-8
with following body:
{
"data": [{
"name": "hostname",
"value": "router.hostname.de"
}, {
"name": "comment",
"value": "router comment"
}]
}
Then I should receive HTTP/1.1 201 Created
with http://localhost:9998/api/customers/K0002/routers/700{
"href": "/api/customers/K0002/routers/700"
}
/api/customers/K0002/routers/700 should return:
{
"href": "/api/customers/K0002/routers/700",
"links": [],
"data": [{
"name": "hostname",
"value": "router.hostname.de"
}, {
"name": "type",
"value": null
}, {
"name": "comment",
"value": "router comment"
}, {
"name": "monitor",
"value": false
}, {
"name": "manageableInPortal",
"value": true
}]
}
/api/customers/K0002/routers as application/json; charset=UTF-8
with following body:
{
"data": [{
"name": "hostname",
"value": "router.hostname.de"
}]
}
Then I should receive HTTP/1.1 400 Bad Request application/api-problem+json {
"title": "Validation error",
"detail": "Could not create or update resource due to constraint violations",
"errors": [{
"message": "Value must be provided",
"path": "comment"
}],
"described_by": "http://api.nfon.net/probs/validation-error"
}
/api/customers/K0002/routers as application/json; charset=UTF-8
with following body:
{
"data": [{
"name": "comment",
"value": "new router"
}]
}
Then I should receive HTTP/1.1 400 Bad Request application/api-problem+json {
"title": "Validation error",
"detail": "Could not create or update resource due to constraint violations",
"errors": [{
"message": "Value must be provided",
"path": "hostname"
}],
"described_by": "http://api.nfon.net/probs/validation-error"
}
/api/customers/K0002/routers as application/json; charset=UTF-8
with following body:
{
"data": [{
"name": "hostname",
"value": "router.hostname.de"
}, {
"name": "comment",
"value": "router comment"
}]
}
Then I should receive HTTP/1.1 400 Bad Request application/api-problem+json {
"title": "Hostname must be unique",
"detail": "There is already a router with name 'router.hostname.de' defined!",
"described_by": "http://api.nfon.net/probs/router-hostname-unique"
}
/api/customers/K0002/routers as application/json; charset=UTF-8
with following body:
{
"data": [{
"name": "hostname",
"value": "router.hostname.de"
}, {
"name": "comment",
"value": "router comment"
}]
}
Then I should receive HTTP/1.1 403 Forbidden application/api-problem+json {
"title": "Access forbidden",
"detail": "Required role is missing",
"described_by": "http://api.nfon.net/probs/invalid-authorization"
}
/api/customers/K404/routers as application/json; charset=UTF-8
with following body:
{
"data": [{
"name": "hostname",
"value": "router.hostname.de"
}, {
"name": "comment",
"value": "router comment"
}]
}
Then I should receive HTTP/1.1 404 Not Found application/api-problem+json {
"title": "Customer not found",
"detail": "Customer with identifier K404 has not been found",
"described_by": "http://api.nfon.net/probs/customer-not-found"
}
/api/customers/K0003/routers as application/json; charset=UTF-8
with following body:
{
"data": [{
"name": "hostname",
"value": "router.hostname.de"
}, {
"name": "comment",
"value": "router comment"
}]
}
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/routers as application/json; charset=UTF-8
with following body:
{
"data": [{
"name": "hostname",
"value": "router.hostname.de"
}, {
"name": "comment",
"value": "router comment"
}]
}
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"
}