Add a Device Group
/rest/{versionId}/inventory/device-mgmt/device-groups
Request
Response
201 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 add a Device Group.
curl -X POST \
-d @request.json \
-H @auth_header.txt \
"https://<tenant-url>/<tenant-name>/osdmc/ums/rest/<versionId>/inventory/device-mgmt/device-groups"The following example shows how to use Python to add 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/<versionId>/inventory/device-mgmt/device-groups"
resp = requests.post(url, headers=headers, data=data)Example of the Request Body
The following shows an example of the contents of the request file sent as the request body.
{
"name": "test2",
"parentGroupFullName":"test1"
}
Example of the Response Body
The following example shows the contents of the response body.
{
"fullName": "test1/test2",
"id": "102",
"name": "test2",
"parentGroupFullName": "test1",
"parentGroupId": "101"
}
Example 2 of Accessing this API
When parentGroupFullName is not specified, the group is added at the "Home" level, with parentGroupId set to "ID0" as a placeholder.
curl -X POST \
-d @request.json \
-H @auth_header.txt \
"https://<tenant-url>/<tenant-name>/osdmc/ums/rest/<versionId>/inventory/device-mgmt/device-groups"The following shows an example of the request body.
{
"name":"dg2"
}
The following shows an example response.
{
"fullName": "dg2",
"id": "21",
"name": "dg2",
"parentGroupId": "ID0"
}