The groups web service does not offer a DELETE method to delete a custom group or a custom collection based on the group ID. Deletion of groups is possible using the update method. You perform another POST of the entire XML for a group with the group elements that need to be deleted removed from the XML. Their absence, and the 'allowDeletes' parameter, removes them.
Set 'allowDeletes' on a group that is one level higher in the tree to ‘true’ to ensure that a subgroup is deleted if no entry for that group is included in the XML. This attribute is inherited by all subgroups. It is not applied to the parent group itself.
You can only delete custom groups. System groups and out-of-the-box collections cannot be deleted. To delete groups that you defined in My Custom Groups, use the user interface.
Important! The custom groups that you delete can only be restored by recreating them.
You can supply the group ID or the group path that you retrieved in a previous procedure as parameters.
The basic URL to create a group that allows deletion is as follows:
http://CA Performance Center Server IP Address:8181/pc/center/webservice/ groups/useIds/allowDeletes
For more information about the syntax, see Create Groups Using Web Services.
Example
In Create Groups Using Web Services, the example XML created a group named 'Raleigh' that was a subgroup of a group named 'USA'. The full XML for this task would be as follows:
<GroupTree path="/All Groups">
<Group name="USA" desc="Group to represent the entire United
States" inherit="true" type="custom group">
<Group name="Raleigh" desc="This is the group for managed items
in Raleigh, NC" inherit="true" type="custom group"/>
</Group>
</GroupTree>
The XML had to be posted to the following URL to enable future deletion of these groups:
http://CA Performance Center Server IP Address:8181/pc/center/webservice/groups /false/true/
Now delete the Raleigh subgroup.
Follow these steps:
http://CA Performance Center Server IP Address:8181/pc/center/webservice/groups /false/true/
<GroupTree path="/All Groups">
<Group name="USA" desc="Group to represent the entire United
States" allowDeletes="true" type="custom group"/>
</GroupTree>
For more information, see Groups Web Service Example Syntax.
The web service updates the XML for the specified group (All Groups\USA) to remove the Raleigh subgroup.
The Raleigh group is thus deleted from the Groups tree.
|
Copyright © 2015 CA Technologies.
All rights reserved.
|
|