Previous Topic: Add Items to GroupsNext Topic: Remove Items from Groups


Add Group Rules

Add rules to groups that determine the managed items to include. As items are discovered, they are automatically added to the groups whose rules apply to those items.

The same URL that is used to create groups is used to add group rules. The body of the XML in the POST is modified to include rules. The web service adds XML to the group definition to create the rules.

Follow these steps:

  1. Set up a REST client with a connection to the CA Performance Center server.
  2. Use the following format for the URL in the REST client:
    http://CA Performance Center Server IP Address:8181/pc/center/webservice/groups
    /idName/idValue/groupItemId
    
  3. Select POST for the HTTP method.
  4. Provide a valid Username and Password in the request header for a user account that has global administrator access to CA Performance Center.
  5. Select 'application/xml' as the 'Body Content-type'.
  6. Add the following XML within the "Body" text section, replacing the values with the values that you want to use for the group rule:
    <GroupTree path="/All Groups/USA"> 
       <Group name="Austin" desc="The group for items in Austin, TX">
          <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="DisplayName" type="device"/>
                         <Value>Cisco-3345</Value>
                   </Compare>
                </Match>
             </Rule>
          </Rules>
       </Group>
    </GroupTree>
    

    This example creates a rule that adds a device named 'Cisco-3345' to the group named "Austin".

    For more information, see Groups Web Service Example Syntax.

  7. Run the method.
  8. Repeat the preceding steps until you have created as many rules as you require.

We recommend using the Manage Groups page to create a few rules before you use the groups web service to create them. You can view the syntax for a rule that you have applied by taking the steps in Get Identifying Information for a Group. The XML that is returned includes group rules.