search cancel

How to move group items from one group to another

book

Article ID: 255429

calendar_today

Updated On:

Products

CA Performance Management - Usage and Administration DX NetOps

Issue/Introduction

How can I move group items from one group to another using REST

Environment

Dx NetOps Performance Management any version

Resolution

Here are some general instructions to accomplish moving items:

 

1. Retrieve a list of group members
- Go to: http://<CAPC>:8181/pc/center/webservice/groups/groupPath/All%20Groups/
- Search for the source group and note the groupID (17881)
From my lab:

   <Group desc="" id="17881" inherit="true" name="group1" type="user group"/>
    <Group desc="" id="17882" inherit="true" name="group2" type="user group">
     
  
- Go to this URL to get output of that group: http://<CAPC>:8181/pc/center/webservice/groups/groupItemId/17881/items

Output Example:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<group id="17881" name="group1" description="" type="group" subType="user">
    <itemTypes>
        <itemType type="Interfaces">
            <items>
                <item id="16605" name="1.0" description="1.0" type="interface" subType="physical" addedBy="BY_USER" address="" model=""/>
                <item id="16660" name="0/1" description="0/1" type="interface" subType="physical" addedBy="BY_USER" address="" model=""/>
                <item id="16661" name="0/2" description="0/2" type="interface" subType="physical" addedBy="BY_USER" address="" model=""/>
            </items>
        </itemType>
    </itemTypes>
</group>

2. Manually created group2_interfaces group as a subgroup under group2
- Go to: http://<CAPC>:8181/pc/center/webservice/groups/groupPath/All%20Groups/
- Search for the destination group and note the groupID (17884)

Example:

<Group desc="" id="17884" inherit="true" name="group2_interfaces" type="user group"/></Group>


- Do a POST against: http://<CAPC>:8181/pc/center/webservice/groups/groupItemId/17884/items

Here is the body from the output of the group above:

<items>
<item id="16605" name="1.0" description="1.0" type="interface" subType="physical" addedBy="BY_USER" address="" model=""/>
<item id="16660" name="0/1" description="0/1" type="interface" subType="physical" addedBy="BY_USER" address="" model=""/>
<item id="16661" name="0/2" description="0/2" type="interface" subType="physical" addedBy="BY_USER" address="" model=""/>
</items>

 

Items should now be moved