Update a Device Group
/rest/{versionId}/inventory/device-mgmt/device-groups/{groupId}
Request
Response
200 Response
400 Response
401 Response
403 Response
404 Response
409 Response
500 Response
Examples
Examples of Accessing the API
See Authenticate page to acquire a token.
The following example shows how to use curl to update a device group.
curl -X PUT \
-d @request.json \
-H @auth_header.txt \
"https://<tenant-url>/<tenant-name>/osdmc/ums/rest/v1.0/inventory/device-mgmt/device-groups/181"The following example shows how to use Python to update a device group.
import requests
import json
headers = {
"Accept": "application/json",
"Authorization": "Bearer <auth-token>"
}
with open("request.json") as f: data = json.load(f)
url = "https://<tenant-url>/<tenant-name>/osdmc/ums/rest/v1.0/inventory/device-mgmt/device-groups/181"
resp = requests.put(url, headers=headers, data=data)Note:
Use the Get Existing Device Groups API to find the groupId parameter.Example of the Request Body
The following shows an example of the contents of the request file sent as the request body.
{
"name":"devgrp1",
"parentGroupFullName":"qa-test"
}
Example of the Response Body
The following example shows the contents of the response body.
{
"fullName": "qa-test/devgrp1",
"id": "181",
"name": "devgrp1",
"parentGroupFullName": "qa-test",
"parentGroupId": "161"
}
Example 2 of Accessing this API
This example shows how to rename a device group.
curl -X PUT \
-d @request.json \
-H @auth_header.txt \
"https://<tenant-url>/<tenant-name>/osdmc/ums/rest/v1.0/inventory/device-mgmt/device-groups/181"The following shows an example of the request body.
{
"name": "test3"
}
The following shows an example response.
{
"fullName": "test1/test3",
"id": "102",
"name": "test3",
"parentGroupFullName": "test1",
"parentGroupId": "101"
}
Example 3 of Accessing this API
This example shows how to move a device group.
curl -X PUT \
-d @request.json \
-H @auth_header.txt \
"https://<tenant-url>/<tenant-name>/osdmc/ums/rest/v1.0/inventory/device-mgmt/device-groups/181"The following shows an example of the request body.
{
"parentGroupFullName": "testDevGrp"
}
The following shows an example response.
{
"fullName": "testDevGrp/test3",
"id": "102",
"name": "test3",
"parentGroupFullName": "testDevGrp",
"parentGroupId": "61"
}