Update a Device Group
/rest/{versionId}/inventory/deviceMgmt/deviceGroups/{groupId}
Request
- application/xml
- application/json
object
-
description(optional):
string
-
label(optional):
string
-
maxValue(optional):
integer(int64)
-
minValue(optional):
integer(int64)
-
name(optional):
string
-
readOnly(optional):
boolean
-
validValues(optional):
array validValues
-
value(optional):
string
-
valueList(optional):
array validLists
-
valueType(optional):
string
Response
- application/xml
- application/json
200 Response
object
-
description(optional):
string
-
label(optional):
string
-
maxValue(optional):
integer(int64)
-
minValue(optional):
integer(int64)
-
name(optional):
string
-
readOnly(optional):
boolean
-
validValues(optional):
array validValues
-
value(optional):
string
-
valueList(optional):
array validLists
-
valueType(optional):
string
400 Response
401 Response
404 Response
Examples
Example of Accessing the API with cURL
The following example shows how to update a device group by submitting a PUT request on the REST resource using cURL. For more information about cURL, see Use cURL.
curl -X PUT -b sessionid.txt \
--header "Accept: application/xml" \
--header "Content-Type: application/xml" \
"https://example.com:8443/rest/v1.3/inventory/deviceMgmt/deviceGroups/ID24"
The following shows an example of the contents of the request.xml
file sent as the request body.
<?xml version="1.0" encoding="UTF-8"?>
<deviceGroup>
<parentGroupFullName>HG1</parentGroupFullName>
<name>testGroup</name>
</deviceGroup>
Example of Accessing the API with Python
The following example shows how to update a device group by submitting a PUT 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
from lxml import etree
url = "https://example.com:8443/rest/v1.3/inventory/deviceMgmt/deviceGroups/ID24"
headers = { "Accept":"application/xml", "Content-Type":"application/xml", "Cookie":cookie }
data = etree.tostring(etree.parse("request.xml"))
resp = requests.put(url, headers=headers, data=data)
Example of the Response Headers
The following shows an example of the response headers.
HTTP/1.1 200 OK
Date: Mon, 18 Sep 2017 20:21:46 GMT
Server: Apache
X-Frame-Options: SAMEORIGIN
Content-Length: 257
Vary: Accept-Encoding
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"?>
<deviceGroup>
<fullName>HG1/testGroup</fullName>
<id>ID24</id>
<isHidden>false</isHidden>
<name>testGroup</name>
<parentGroupFullName>HG1</parentGroupFullName>
<parentGroupId>ID3</parentGroupId>
</deviceGroup>