Remove Subnets

Deletes the specified subnets.

Required Permissions

Requires the ADMIN role or higher.

HTTP Request

DELETE /api/sonar/subnet-groups/:guid/subnets
cURL Example
curl -H "Authorization: Bearer <API_KEY>" \
     -X DELETE \
     "https://HOSTNAME/api/sonar/subnet-groups/638cfeb2-e259-46af-961a-1eeb65ea35f0/subnets?ids=10"
Request Parameters
Path Parameters
KeyTypeDescriptionNote
guidStringSubnet group GUID36 characters
Request Body Parameters
KeyRequiredTypeDescriptionNote
idsYesList (of 32-bit integers)Subnet ID listComma-separated list

Success Response

{
    "failures": []
}

Error Responses

guid is not a valid GUID

HTTP status code 400

{
  "error_code": "invalid-param-type",
  "error_msg": "guid should be guid type."
}
ids is not a list of 32-bit integers

HTTP status code 400

{
  "error_code": "invalid-argument",
  "error_msg": "'ids' parameter should be int_list type"
}
ids is missing

HTTP status code 400

{
  "error_code": "null-argument",
  "error_msg": "ids should be not null"
}
Subnet is not found

A subnet that does not exist does not stop the request; it is returned in the failure list.

HTTP status code 200

{
  "failures": [
    {
      "id": "6",
      "reason": "subnet-not-found"
    }
  ]
}
Subnet group is not found

HTTP status code 500

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

HTTP status code 500

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