DX NetOps

 View Only
  • 1.  How can I remove Items (Devices/Interfaces) from a group via Rest?

    Posted Aug 03, 2017 08:11 AM

    Hi,

     

    I have the following question:

     

    How can I remove Items from Groups via Rest?

     

    Thanks a lot!



  • 2.  Re: How can I remove Items (Devices/Interfaces) from a group via Rest?



  • 3.  Re: How can I remove Items (Devices/Interfaces) from a group via Rest?

    Posted Aug 03, 2017 08:34 AM

    The first link isn´t the answer to my question.

     

    The seccond link I saw in the Doc, but it´s not the solution of my Problem.

     

    I will remove a specified device or Interface from a Group. A single device/Interface or multiple devices/Interfaces. For example in my Group are devices with the deviceitemid 1, 2, 3, 4, 5, 6, 7, 8, 9. And the device 3,6,7 shoud remove. How can I do that via Rest?



  • 4.  Re: How can I remove Items (Devices/Interfaces) from a group via Rest?
    Best Answer

    Posted Aug 03, 2017 10:18 AM

    You have to do what with a script. You get the ID of the devices you want to remove and run subsequent DELETE calls for each of the items you need to remove. Couldn't that fit the need?



  • 5.  Re: How can I remove Items (Devices/Interfaces) from a group via Rest?

    Posted Aug 03, 2017 10:22 AM

    Ok, but then I delete it completly? But I only want to remove it in a Group. There I can´t find a Rest Call in combination with Group<->Device/Interface.



  • 6.  Re: How can I remove Items (Devices/Interfaces) from a group via Rest?

    Broadcom Employee
    Posted Aug 03, 2017 10:26 AM

    C S,

     

    You would follow the section in the 2nd doc link above:

     

    Remove Items from Groups

    Essentially you modify the group member rule and it does its own removal.

     

    Troy



  • 7.  Re: How can I remove Items (Devices/Interfaces) from a group via Rest?

    Posted Aug 03, 2017 10:28 AM

    No no!

    You can use the calls described here to manage your group members: Use Web Services to Manage Groups - CA Performance Management - 3.1 - CA Technologies Documentation 

    You have to change the rule and repost it. That will get rid of every group member and add only the ones you need. If you need some sort of static groups, you will have a rule naming each of your members anyway so that comes down to the same thing.

    Hope it helps!



  • 8.  Re: How can I remove Items (Devices/Interfaces) from a group via Rest?

    Posted Aug 04, 2017 04:28 AM

    I tried the introduction of the Docu, but it doesn´t work.

     

    .../pc/center/webservice/groups/false/true

     

    <GroupTree path="/All Groups/MyGroup">
       <Group name="My Device Group" desc="Here is the Device Group">
          <Rules allowDeletes="true" saveRules="true">
             <Rule add="device" name="Add Devices">
                <Match>
                   <Compare readOnly="true" using="MEMBER_OF">
                      <Property name="ItemID" type="device"/>
                         <Value reference="/All Groups">1</Value>
                   </Compare>
                   <Compare readOnly="false" using="EQUALS">
                      <Property name="ItemID" type="device"/>
                         <Value>137</Value>
                   </Compare>
                   <Compare readOnly="false" using="NOT_EQUALS">
                      <Property name="ItemID" type="device"/>
                         <Value>5571</Value>
                   </Compare>
                </Match>
             </Rule>
          </Rules>
       </Group>
    </GroupTree>

     

    I only get the Response 400 Bad Request. But when I write a new Description, it will changed the Description, but give me a 400 back.

     

    Anyone a solution?



  • 9.  Re: How can I remove Items (Devices/Interfaces) from a group via Rest?

    Posted Aug 04, 2017 05:50 AM

    I have found a solution via the Method DELETE. The Doc is as always incomplete.