Get Existing Device Groups

get

/rest/{versionId}/inventory/deviceMgmt/deviceGroups

Use this (GET) method to retrieve all device groups created and maintained in Device Manager. Folder groups that are defined within Network Function (NF) device groups are not returned.

Request

Path Parameters
Query Parameters
Back to Top

Response

Supported Media Types

200 Response

successful operation
Body ()
Root Schema : deviceGroups
Type: object
Show Source
Nested Schema : deviceGroup
Type: array
Show Source
Nested Schema : deviceGroup
Type: object
Show Source
Nested Schema : parameters
Type: array
Show Source
Nested Schema : parameter
Type: object
Show Source
Nested Schema : validValues
Type: array
Show Source
Nested Schema : validLists
Type: array
Show Source

400 Response

The user input is invalid.

401 Response

The session ID is invalid.

404 Response

The object (resource URI, device, and so on) of your input request cannot be found.
Back to Top

Examples

Example of Accessing the API with cURL

The following example shows how to get existing device groups by submitting a GET request on the REST resource using cURL. For more information about cURL, see Use cURL.

curl -X GET -b sessionid.txt \
    --header "Accept: application/xml" \
    "https://example.com:8443/rest/v1.3/inventory/deviceMgmt/deviceGroups"

Example of Accessing the API with Python

The following example shows how to get existing device groups by submitting a GET request on the REST resource using Python. This example assumes the cookie variable contains a valid authentication cookie. For an example of authenticating with Python, see Authenticate.

import requests
url = "https://example.com:8443/rest/v1.3/inventory/deviceMgmt/deviceGroups"
headers = { "Accept":"application/xml", "Cookie":cookie }
resp = requests.get(url, headers=headers)

Example of the Response Headers

The following shows an example of the response headers.

HTTP/1.1 200 OK
Date: Wed, 08 May 2019 16:40:20 GMT
Server: Apache
X-Frame-Options: SAMEORIGIN
vary: Origin,Accept-Encoding
Content-Length: 225
Content-Type: application/xml

Example of the Response Body

The following example shows the contents of the response body in XML format.

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<deviceGroups>
  <deviceGroup>
    <fullName>Home</fullName>
    <id>ID1</id>
    <isHidden>false</isHidden>
    <name>Home</name>
    <parentGroupId>ID0</parentGroupId>
  </deviceGroup>
</deviceGroups>
Back to Top