Get Subnets

Gets a list of the subnets that belong to a specified subnet group.

HTTP Request

GET /api/sonar/subnet-groups/:guid/subnets
Request using cURL
curl -H "Authorization: Bearer <API_KEY>" \
     https://HOSTNAME/api/sonar/subnet-groups/bb994ca4-1471-4b91-89f2-99a61bd529b5/subnets
Request Parameters
KeyRequiredTypeDescriptionNote
guidOStringSubnet group GUID36 characters
offsetX32-bit integerNumber of records to skipDefault: 0
limitX32-bit integerMaximum number of records to loadIf not spcified, 20.
keywordsXStringKeywordSearch available by description

Success Response

{
  "total_count": 3,
  "subnets": [
    {
      "id": 1,
      "start_ip": "10.0.0.0",
      "end_ip": "10.255.255.255",
      "cidr": 0,
      "description": "A class"
    },
    {
      "id": 2,
      "start_ip": "172.16.0.0",
      "end_ip": "172.31.255.255",
      "cidr": 0,
      "description": null
    },
    {
      "id": 3,
      "start_ip": "192.168.0.0",
      "end_ip": "192.168.255.255",
      "cidr": 0,
      "description": null
    }
  ]
}
  • total_count (32-bit integer): Total number of the subnet groups that match the search keyword
  • subnets (Array): Paged list of subnets
    • id (32-bit integer): Subnet ID
    • start_ip (String): Starting IP address
    • end_ip (String): Ending IP address
    • cidr (32-bit integer): CIDR subnet mask value
    • description (String): Description

Error Responses

offset or limit value is not an integer

HTTP status code 400

{
  "error_code": "invalid-argument",
  "error_msg": "'offset' parameter should be int type"
}
offset or limit value is negative

HTTP status code 400

{
  "error_code": "invalid-argument",
  "error_msg": "'offset' must be greater than or equal to 0."
}