Documentation is now available for the Fall 2020 Update release!

Update device groups

This endpoint is used to update the details of a device group.

Leave Feedback

URL

POST https://{api-url}/api/v2/tenants/{tenantId}/deviceGroups

Sample URLs

https://{api-url}/api/v2/tenants/client_10/deviceGroups

This endpoint updates the details of a device group performing one of these actions:

  1. Rename a device group
  2. Change the set of devices residing in a device group
  3. Change knowledge base articles assigned to a device group
  4. Add a device group as a child under an existing device group (the parent)

Parameters

FieldData TypeDescription
nameStringUnique name for the device group. The device group is identified with this name.
entityTypeString(Optional) Type of resources in a group. Example: DEVICE_GROUP, SNS
parent
  • id
StringAdd a device group as child under an existing device group (parent). This field is mandatory while adding a child device group to parent device group.
filterCriteria(Optional) Set of rules to filter resources.
matchTypeString(Optional) The type of match:
  • To match all the filter conditions, provide matchType: ALL.
  • To match any one of the filter conditions, provide matchType: ANY.
rules
  • key
  • operator
  • resource type
  • value
String(Optional) Filter devices with specific attributes:
  • Attribute name of device. Example: Name, Operating System. Attribute names change with device types.
  • Matching parameter. Supported operators are: Equals, Contains, Not Contains, Starts with, Ends with, Regex. Learn more about Regex.
  • Type of resource.
  • Specific details of the resource.
kbArticleIdsInteger(Optional) Assign knowledge base articles to a device group. To fetch a knowledge base article ID:
  1. Log into OpsRamp.
  2. Click Knowledge Base.
  3. Select the required article and then copy the article ID without #.
  4. Provide the article ID in kbArticleIds field. Example: "kbArticleIds": [22089]

Status code

200 OK

Rename device groups

Sample request

[{
	"id": "DGP-a20e13ad-e98f-416e-a9dd-40158ffdb2af",
	"name": "Network Device Groups",
	"description": "Network Devices in SJ Office",
	"entityType": "DEVICE_GROUP",
	"kbArticlesIds": [10897]
}]

Sample response

[{
	"id": "DGP-a20e13ad-e98f-416e-a9dd-40158ffdb2af",
	"name": "Network Device Groups",
	"description": "Network Device Groups in SJ Site",
	"entityType": "DEVICE_GROUP",
	"kbArticlesIds": [10897]
}]

Add a device group as a child in an existing device group

The existing device group becomes the parent of the child device group.

Sample request

[{
		"name": "Communications Server",
		"description": "Communications server in SJ",
		"parent": {
			"id": "DGP-a20e13ad-e98f-416e-a9dd-40158ffdb2af"
		},
		"entityType": "DEVICE_GROUP",
		"kbArticlesIds": [20123]
	},
	{
		"name": "Print Servers",
		"description": "Print Servers in SJ",
		"parent": {
			"id": "DGP-a20e13ad-e98f-416e-a9dd-40158ffdb2af"
		},
		"entityType": "DEVICE_GROUP",
		"filterCriteria": {
			"matchType": "ALL",
			"rules": [{
					"key": "Name",
					"operator": "Contains",
					"value": "Luminax",
					"resourceType": "DEVICE"
				},
				{
					"key": "Region Name",
					"operator": "Contains",
					"value": "SJ",
					"resourceType": "DEVICE"
				}
			]
		},
		"kbArticlesIds": [20122]

	}
]

Sample response

[{
		"id": "DGP-1d021aca-f360-4c14-967c-892296b7d4f5",
		"name": "Commincations Server",
		"description": "Communications Server in SJ",
		"createdDate": "2017-08-10T07:40:55+0000",
		"updatedDate": "2017-08-10T07:40:55+0000",
		"entityType": "DEVICE_GROUP",
		"kbArticlesIds": [20123]
	},
	{
		"id": "DGP-c87c9dd5-b7fe-498d-a242-338683e745b4",
		"name": "Print Servers",
		"description": "Print Servers in SJ",
		"createdDate": "2017-08-10T07:40:55+0000",
		"updatedDate": "2017-08-10T07:40:55+0000",
		"entityType": "DEVICE_GROUP",
		"filterCriteria": {
			"matchType": "ALL",
			"rules": [{
					"key": "Name",
					"operator": "Contains",
					"value": "Luminax",
					"resourceType": "DEVICE"
				},
				{
					"key": "Region Name",
					"operator": "Contains",
					"value": "SJ",
					"resourceType": "DEVICE"
				}
			]
		},
		"kbArticlesIds": [20122]
	}
]