Create Subnet

Create a new subnet for a specified subnet group.

HTTP Request

POST /api/sonar/subnet-groups/:guid/subnets
Request using cURL
curl -H "Authorization: Bearer <API_KEY>" \
     -d start_ip="192.168.253.1" \
     -d end_ip="192.168.253.255" \
     -X POST \
     https://HOSTNAME/api/sonar/subnet-groups/b76c3c81-c961-404f-a0eb-fae2f12f5bd8/subnets
Request Parameters
KeyRequiredTypeDescriptionNote
guidOStringSubnet group GUID36 characters
start_ipOStringStarting IP addressMinumum 7 to maximum 15 characters
end_ipXStringEnding IP addressMinumum 7 to maximum 15 characters
cidrX32-bit integerCIDRMinimum 0 to maximum 32
descriptionXStringSubnet descriptionMaximum 255 characters
Note
At least one of `end_ip` and `cidr` must be provided.

Success Response

{}

Error Responses

Required argument is missing

HTTP status code 400.

{
    "error_code": "null-argument",
    "error_msg": "start_ip should be not null"
}
Invalid argument length

HTTP status code 400.

{
    "error_code": "invalid-argument",
    "error_msg": "'start_ip' must be less than or equal to 15 characters."
}
cidr is not an integer

HTTP status code 400.

{
    "error_code": "invalid-argument",
    "error_msg": "'cidr' parameter should be int type"
}
No privilege to create a subnet

HTTP status code 500 .

{
    "error_code": "illegal-state",
    "error_msg": "no-permission"
}