/api/customers/K0002/routers/700 as application/json; charset=UTF-8
with following body:
{
"data": [{
"name": "hostname",
"value": "changed.router.hostname.de"
}, {
"name": "comment",
"value": "changed router comment"
}, {
"name": "monitor",
"value": true
}, {
"name": "type",
"value": "changed type"
}]
}
Then I should receive HTTP/1.1 204 No Content /api/customers/K0002/routers/700 should return:
{
"href": "/api/customers/K0002/routers/700",
"data": [{
"name": "hostname",
"value": "changed.router.hostname.de"
}, {
"name": "type",
"value": "changed type"
}, {
"name": "comment",
"value": "changed router comment"
}, {
"name": "monitor",
"value": true
}, {
"name": "manageableInPortal",
"value": true
}]
}
/api/customers/K0002/routers/700 as application/json; charset=UTF-8
with following body:
{
"data": [{
"name": "comment",
"value": ""
}]
}
Then I should receive HTTP/1.1 400 Bad Request application/api-problem+json {
"title": "Comment is required",
"detail": "Comment cannot be blank",
"described_by": "http://api.nfon.net/probs/router-comment-required"
}
/api/customers/K0002/routers/700 as application/json; charset=UTF-8
with following body:
{
"data": [{
"name": "hostname",
"value": ""
}]
}
Then I should receive HTTP/1.1 400 Bad Request application/api-problem+json {
"title": "Hostname is required",
"detail": "Hostname cannot be blank",
"described_by": "http://api.nfon.net/probs/router-hostname-required"
}
/api/customers/K0002/routers/700 as application/json; charset=UTF-8
with following body:
{
"data": [{
"name": "hostname",
"value": "another.hostname.de"
}]
}
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 'another.hostname.de' defined!",
"described_by": "http://api.nfon.net/probs/router-hostname-unique"
}
/api/customers/K0002/routers/700 as application/json; charset=UTF-8
with following body:
{
"data": [{
"name": "comment",
"value": "new 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/K0002/routers/700 as application/json; charset=UTF-8
with following body:
{
"data": [{
"name": "hostname",
"value": "router.hostname.de"
}, {
"name": "comment",
"value": "new router comment"
}]
}
Then I should receive HTTP/1.1 403 Forbidden application/api-problem+json {
"title": "Managed routers cannot be changed",
"detail": "Router with ID 700 is managed, therefore cannot be changed via API call",
"described_by": "http://api.nfon.net/probs/cannot-delete-non-managed-router"
}
/api/customers/K404/routers/700 as application/json; charset=UTF-8
with following body:
{
"data": [{
"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/700 as application/json; charset=UTF-8
with following body:
{
"data": [{
"name": "comment",
"value": "new router comment"
}]
}
Then I should receive HTTP/1.1 400 Bad Request application/api-problem+json {
"title": "Wrong customer",
"detail": "Router with ID 700 belongs to another customer",
"described_by": "http://api.nfon.net/probs/wrong-customer"
}
/api/customers/K0002/routers/404 as application/json; charset=UTF-8
with following body:
{
"data": [{
"name": "comment",
"value": "router comment"
}]
}
Then I should receive HTTP/1.1 404 Not Found application/api-problem+json {
"title": "Router not found",
"detail": "Router with ID 404 has not been found",
"described_by": "http://api.nfon.net/probs/router-not-found"
}
/api/customers/K0003/routers/700 as application/json; charset=UTF-8
with following body:
{
"data": [{
"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/700 as application/json; charset=UTF-8
with following body:
{
"data": [{
"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"
}