---
title: List Device Group Subnets
slug: kronpam-api-collection-350/list-device-group-subnets
docTags: 
createdAt: 2024-07-22T09:58:47.221Z
---

{
  "id": "jXqdc9uktVBEG-kA9PbW7",
  "type": "api-oas-v2",
  "data": {
    "method": "GET",
    "url": "{{url}}/aioc-rest-web/rest/discovery/getDeviceGroupSubnets/ID",
    "name": "",
    "description": "This method lists subnet of the device group.\n\nEnter the Device group id of chosen device group to \"ID\" field in get url.",
    "contentType": "application/json",
    "request": {
      "headerParameters": [
        {
          "name": "Content-Type",
          "description": "",
          "default": "application/json",
          "value": "application/json",
          "type": "string"
        },
        {
          "name": "X-XSRF-TOKEN",
          "description": "",
          "default": "{{csrftoken}}",
          "value": "{{csrftoken}}",
          "type": "string"
        }
      ],
      "queryParameters": [],
      "pathParameters": [
        {
          "name": "url",
          "description": "",
          "default": "url",
          "value": "url",
          "type": "string"
        }
      ],
      "bodyDataParameters": [],
      "formDataParameters": [],
      "oAuthParameters": []
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "getDeviceGroupSubnets",
        "jsonExample": "[\n    {\n        \"dbId\": 3481062,\n        \"deviceGroupId\": \"7dad2aa5-414a-4b20-86c0-346876ea88b5\",\n        \"subnetIp\": \"10.20.40.1\",\n        \"mask\": null,\n        \"cidr\": 24,\n        \"firstIp\": 169093121,\n        \"lastIp\": 169093376,\n        \"interfaceName\": null\n    }\n]"
      }
    ],
    "examples": {
      "languages": [
        {
          "id": "k07ZvpREbn1NPQjtUpFI2",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request GET \\\n     --url {{url}}/aioc-rest-web/rest/discovery/getDeviceGroupSubnets/ID \\\n     --header 'accept: application/json' \\\n     --header 'x-xsrf-token: {{csrftoken}}'"
        },
        {
          "id": "druYAGEqogsVUKVeGlnL7",
          "language": "javascript",
          "label": "javascript",
          "code": "var myHeaders = new Headers();\nmyHeaders.append(\"accept\", \"application/json\");\nmyHeaders.append(\"content-type\", \"application/json\");\nmyHeaders.append(\"x-xsrf-token\", \"{{csrftoken}}\");\n\nvar requestOptions = {\n   method: 'GET',\n   headers: myHeaders,\n   redirect: 'follow'\n};\n\nfetch(\"{{url}}/aioc-rest-web/rest/discovery/getDeviceGroupSubnets/ID\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "1b_pSdtxL_fTVOJQuKjjd",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"{{url}}/aioc-rest-web/rest/discovery/getDeviceGroupSubnets/ID\")\n\nhttp = Net::HTTP.new(url.host, url.port);\nrequest = Net::HTTP::Get.new(url)\nrequest[\"accept\"] = \"application/json\"\nrequest[\"content-type\"] = \"application/json\"\nrequest[\"x-xsrf-token\"] = \"{{csrftoken}}\"\n\nresponse = http.request(request)\nputs response.read_body\n"
        },
        {
          "id": "umui_bWtsj1FkadtuE9YL",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"{{url}}/aioc-rest-web/rest/discovery/getDeviceGroupSubnets/ID\"\n\npayload = {}\nheaders = {\n   'accept': 'application/json',\n   'content-type': 'application/json',\n   'x-xsrf-token': '{{csrftoken}}'\n}\n\nresponse = requests.request(\"GET\", url, headers=headers, data=payload)\n\nprint(response.text)\n"
        }
      ],
      "selectedLanguageId": "k07ZvpREbn1NPQjtUpFI2"
    },
    "results": {
      "languages": [
        {
          "id": "ObuXYkxw1oKrSP2_Q7o1M",
          "language": "200",
          "code": "[\n    {\n        \"dbId\": 3481062,\n        \"deviceGroupId\": \"7dad2aa5-414a-4b20-86c0-346876ea88b5\",\n        \"subnetIp\": \"10.20.40.1\",\n        \"mask\": null,\n        \"cidr\": 24,\n        \"firstIp\": 169093121,\n        \"lastIp\": 169093376,\n        \"interfaceName\": null\n    }\n]"
        }
      ],
      "selectedLanguageId": "ObuXYkxw1oKrSP2_Q7o1M"
    }
  },
  "children": [
    {
      "text": ""
    }
  ]
}