Update Subnet

Updates the subnet of a specified subnet group.

Required Permissions

Requires the ADMIN role or higher.

HTTP Request

PUT /api/sonar/subnet-groups/:guid/subnets/:id
cURL Example
curl -H "Authorization: Bearer <API_KEY>" \
     -d start_ip="192.168.253.1" \
     -d end_ip="192.168.253.2" \
     -X POST \
     https://HOSTNAME/api/sonar/subnet-groups/b76c3c81-c961-404f-a0eb-fae2f12f5bd8/subnets/10
Request Parameters
Path Parameters
KeyTypeDescriptionNote
guidStringSubnet group GUID36 characters
id32-bit integerSubnet ID
Request Body Parameters
KeyRequiredTypeDescriptionNote
start_ipYesStringStarting IP addressMinimum 7 to maximum 15characters
end_ipNoStringEnding IP addressMinimum 7 to maximum 15characters
cidrNo32-bit integerCIDRMinimum 0 to maximum 32
descriptionNoStringSubnet descriptionMaximum 255 characters
Note
At least one of end_ip and cidr must be provided.

Success Response

{}

Error Responses

start_ip is missing

HTTP status code 400

{
  "error_code": "null-argument",
  "error_msg": "start_ip should be not null"
}
start_ip or end_ip parameter length is invalid

HTTP status code 400

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

HTTP status code 400

{
  "error_code": "invalid-argument",
  "error_msg": "'cidr' parameter should be int type"
}
cidr value is out of range

HTTP status code 400

{
  "error_code": "invalid-argument",
  "error_msg": "'cidr' must be less than or equal to 32."
}
description parameter length is invalid

HTTP status code 400

{
  "error_code": "invalid-argument",
  "error_msg": "'description' must be shorter than or equal to 255 characters."
}
end_ip and cidr are specified together

HTTP status code 400

{
  "error_code": "invalid-argument",
  "error_msg": "cannot use both 'end_ip' and 'cidr' parameter in the same time."
}
Subnet group is not found

HTTP status code 500

{
  "error_code": "illegal-state",
  "error_msg": "subnet group not found: a1b2c3d4-e5f6-7890-abcd-ef1234567890"
}
Subnet is not found

HTTP status code 500

{
  "error_code": "illegal-state",
  "error_msg": "subnet not found: group guid-a1b2c3d4-e5f6-7890-abcd-ef1234567890 id-10"
}
Permission denied

HTTP status code 500

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