/api/sip-servers application/json; charset=UTF-8
and following body:
{
"links": [{
"rel": "pbxGroup",
"href": "/api/pbx-groups/Pbx1"
}],
"data": [{
"name": "name",
"value": "sipServerName"
}, {
"name": "externalIp",
"value": "192.168.1.1"
}, {
"name": "internalIp",
"value": "192.168.1.2"
}, {
"name": "maxSubscribers",
"value": 1000
}, {
"name": "subscribersLimit",
"value": 500
}, {
"name": "location",
"value": "Location"
}, {
"name": "partition",
"value": "P01"
}, {
"name": "description",
"value": "4xE5504-2GHZ;4GB"
}]
}
Then I should receive HTTP/1.1 201 Created http://localhost:9998/api/sip-servers/200
and following body:
{
"href": "/api/sip-servers/200"
}
/api/sip-servers/200 HTTP/1.1 200 OK {
"href": "/api/sip-servers/200",
"links": [{
"rel": "pbxGroup",
"href": "/api/pbx-groups/Pbx1"
}, {
"rel": "availablePbxGroup",
"href": "/api/pbx-groups"
}],
"data": [{
"name": "name",
"value": "sipServerName"
}, {
"name": "externalIp",
"value": "192.168.1.1"
}, {
"name": "internalIp",
"value": "192.168.1.2"
}, {
"name": "maxSubscribers",
"value": 1000
}, {
"name": "subscribersLimit",
"value": 500
}, {
"name": "location",
"value": "Location"
}, {
"name": "partition",
"value": "P01"
}, {
"name": "description",
"value": "4xE5504-2GHZ;4GB"
}]
}
/api/sip-servers application/json; charset=UTF-8
and following body:
{
"links": [{
"rel": "pbxGroup",
"href": "/api/pbx-groups/Pbx1"
}],
"data": [{
"name": "name",
"value": "sipServerName"
}, {
"name": "externalIp",
"value": "192.168.1.1"
}, {
"name": "internalIp",
"value": "192.168.1.2"
}, {
"name": "subscribersLimit",
"value": 500
}, {
"name": "partition",
"value": "P01"
}]
}
Then I should receive HTTP/1.1 201 Created http://localhost:9998/api/sip-servers/200
and following body:
{
"href": "/api/sip-servers/200"
}
/api/sip-servers/200 HTTP/1.1 200 OK {
"links": [{
"rel": "pbxGroup",
"href": "/api/pbx-groups/Pbx1"
}],
"data": [{
"name": "name",
"value": "sipServerName"
}, {
"name": "externalIp",
"value": "192.168.1.1"
}, {
"name": "internalIp",
"value": "192.168.1.2"
}, {
"name": "subscribersLimit",
"value": 500
}, {
"name": "partition",
"value": "P01"
}]
}
/api/sip-servers application/json; charset=UTF-8
and following body:
{
"links": [{
"rel": "pbxGroup",
"href": "/api/pbx-groups/Pbx1"
}],
"data": [{
"name": "name",
"value": "sipServerName"
}, {
"name": "externalIp",
"value": "192.168.1.1"
}, {
"name": "internalIp",
"value": "192.168.1.2"
}, {
"name": "maxSubscribers",
"value": -10000000
}, {
"name": "subscribersLimit",
"value": 500
}, {
"name": "partition",
"value": "P01"
}]
}
Then I should receive HTTP/1.1 400 Bad Request {
"errors": [{
"message": "maxSubscribers must be greater than or equal -10000",
"path": "maxSubscribers",
"value": -10000000
}]
}
/api/sip-servers application/json; charset=UTF-8
and following body:
{
"links": [{
"rel": "pbxGroup",
"href": "/api/pbx-groups/Pbx1"
}],
"data": [{
"name": "name",
"value": "sipServerName"
}, {
"name": "externalIp",
"value": "192.168.1.1"
}, {
"name": "internalIp",
"value": "192.168.1.2"
}, {
"name": "subscribersLimit",
"value": 0
}, {
"name": "partition",
"value": "P01"
}]
}
Then I should receive HTTP/1.1 400 Bad Request {
"errors": [{
"message": "subscribersLimit must be greater than 0",
"path": "subscribersLimit",
"value": 0
}]
}
/api/sip-servers application/json; charset=UTF-8
and following body:
{
"links": [{
"rel": "pbxGroup",
"href": "/api/pbx-groups/Pbx1"
}],
"data": [{
"name": "name",
"value": "sipServerName"
}, {
"name": "externalIp",
"value": "192.168.1.1"
}, {
"name": "internalIp",
"value": "192.168.1.2"
}, {
"name": "subscribersLimit",
"value": 500
}, {
"name": "partition",
"value": "P01"
}]
}
Then I should receive HTTP/1.1 400 Bad Request {
"errors": [{
"message": "name is not unique",
"path": "name",
"value": "sipServerName"
}]
}
/api/sip-servers application/json; charset=UTF-8
and following body:
{
"links": [{
"rel": "pbxGroup",
"href": "/api/operators/C0002/pbx-groups/Pbx1"
}],
"data": [{
"name": "name",
"value": "sipServerName"
}, {
"name": "externalIp",
"value": "192.168.1.1"
}, {
"name": "internalIp",
"value": "192.168.1.2"
}, {
"name": "subscribersLimit",
"value": 500
}, {
"name": "partition",
"value": "P01"
}]
}
Then I should receive HTTP/1.1 400 Bad Request {
"detail": "Resource at /api/operators/C0002/pbx-groups/Pbx1 is of incorrect type",
"title": "Invalid resource type",
"described_by": "http://api.nfon.net/probs/invalid-resource-type"
}
/api/sip-servers application/json; charset=UTF-8
and following body:
{
"links": [{
"rel": "pbxGroup",
"href": "/api/pbx-groups/Pbx1"
}],
"data": [{
"name": "name",
"value": "sipServerName"
}, {
"name": "externalIp",
"value": "192.168.1.1"
}, {
"name": "internalIp",
"value": "192.168.1.2"
}, {
"name": "subscribersLimit",
"value": 500
}, {
"name": "partition",
"value": "P01"
}]
}
Then I should receive HTTP/1.1 404 Not Found {
"detail": "Pbx Group with name Pbx1 has not been found",
"title": "Pbx Group not found",
"described_by": "http://api.nfon.net/probs/pbx-group-not-found"
}
/api/sip-servers application/json; charset=UTF-8
and following body:
{
"links": [{
"rel": "pbxGroup",
"href": "/api/pbx-groups/Pbx1"
}],
"data": [{
"name": "name",
"value": "sipServerName"
}, {
"name": "externalIp",
"value": "192.168.1.1"
}, {
"name": "internalIp",
"value": "192.168.1.2"
}, {
"name": "partition",
"value": "P01"
}]
}
Then I should receive HTTP/1.1 403 Forbidden {
"detail": "Required role is missing",
"title": "Access forbidden",
"described_by": "http://api.nfon.net/probs/invalid-authorization"
}
/api/sip-servers application/json; charset=UTF-8
and following body:
{
"links": [{
"rel": "pbxGroup",
"href": "/api/pbx-groups/Pbx1"
}],
"data": [{
"name": "name",
"value": "sipServerName"
}, {
"name": "externalIp",
"value": "192.168.1.1"
}, {
"name": "internalIp",
"value": "192.168.1.2"
}, {
"name": "partition",
"value": "P01"
}]
}
Then I should receive HTTP/1.1 403 Forbidden {
"detail": "Required role is missing",
"title": "Access forbidden",
"described_by": "http://api.nfon.net/probs/invalid-authorization"
}
/api/sip-servers application/json; charset=UTF-8
and following body:
{
"links": [{
"rel": "pbxGroup",
"href": "/api/pbx-groups/Pbx1"
}],
"data": [{
"name": "name",
"value": "sipServerName"
}, {
"name": "externalIp",
"value": "192.168.1.1"
}, {
"name": "internalIp",
"value": "192.168.1.2"
}, {
"name": "partition",
"value": "P01"
}]
}
Then I should receive HTTP/1.1 403 Forbidden {
"title": "Access forbidden",
"detail": "Required role is missing",
"described_by": "http://api.nfon.net/probs/invalid-authorization"
}