REST Method to delete individual devices statically added to Group
search cancel

REST Method to delete individual devices statically added to Group

book

Article ID: 115472

calendar_today

Updated On:

Products

CA Infrastructure Management CA Performance Management - Usage and Administration

Issue/Introduction

You can use REST to manipulate many functions in DX NetOps


I need to programmatically manage a group in DX NetOps

.
I need to delete devices from a group that were programmatically added to the group via REST and not with a rule.
I've reviewed the following links below. Add isn't the issue, it's the Delete.
There doesn't appear to be a way to remove a device in a group by it's DeviceID.

How to list all members of a group in DX NetOps.

Environment

DX NetOps 22.2.x

Resolution

Yes, there is a method to use REST to add or delete items from a group.  
Items being devices/interfaces/etc, NOT subgroups or references to other groups.

Basically a POST or DELETE to

http://YOUR-PC:8181/pc/center/webservice/groups/groupItemId/ITEMID/items


(replace ITEMID with the itemid if the device you wish to delete)

...

To see all groups do a GET

http://YOUR-CAPC:8181/pc/center/webservice/groups/groupPath/All%20Groups

+++

curl -kv -u admin -X GET -H 'Content-type: application/xml' http://YOUR-CAPC:8181/pc/center/webservice/groups/groupPath/All%20Groups

+++

From the results we got

<Group desc="" id="6362" inherit="true" name="richard" type="user group"/>

 

Now to see a single group using the id= from the above GET

http://YOUR-CAPC:8181/pc/center/webservice/groups/groupItemId/6362/

+++

curl -kv -u admin -X GET -H 'Content-type: application/xml' http://YOUR-CAPC:8181/pc/center/webservice/groups/groupItemId/6362/

+++

To see the members of this group GET

http://YOUR_PC:8181/pc/center/webservice/groups/groupItemId/6362/items

+++

curl -kv -u admin -X GET -H 'Content-type: application/xml' http://YOUR-CAPC:8181/pc/center/webservice/groups/groupItemId/6362/items

+++

Additional Information

http://PC:8181/pc/center/rest/groups/documentation  (replace PC with your PC hostname)

 https://PC:8182/pc/center/rest/groups/documentation

...

https://techdocs.broadcom.com/us/en/ca-enterprise-software/it-operations-management/performance-management/22-2/apis/performance-center-rest-web-services.html