Previous Topic: Basic Operations in REST Web ServicesNext Topic: Get a List of Group Members


Get Identifying Information for a Group

You can use the group path or the group ID for a group to identify that group when you want to update it. The group path shows the position of a group within the Groups tree. The group ID is typically a better way to retrieve group information and to manage a group than using the group path, which can be lengthy.

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
    
    idName

    A supported ID name for specifying a group. Possible values can be retrieved by performing a GET operation on the following URL:
    http://CA Performance Center Server IP Address:8181/pc/center/webservice/groups/idNames. Use one of the following parameters for the idName:

    groupItemId - The internally assigned ID of the group.

    groupPath - The path of the group, with each group delimited by encoded front slashes (%F2).

    idValue

    The value that is used to specify a group, based on the nature of the ID name. Dependent on the value of the idName field, as follows:

    groupItemId - The ID of the group is expected.

    groupPath - The path of the group, with each group delimited by encoded front slashes (%20) is expected.

  3. Select GET 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. Run the method.

    The XML that is returned contains the group item identifier.

    You can also use this method to get the full group path.

In the following example, the XML that is returned includes information about the system group named Inventory:

<?xml version="1.0" encoding="UTF-8"?>
<GroupTree id="5" inheritDefault="true" path="Inventory">
  <Group desc="This group contains groups for the various item types
  that are associated with all data sources." id="12" inherit="false"
  location="" name="All Items" type="automatic group">
    <Group desc="Includes networks from all Application Delivery
     Analysis data sources." id="40" inherit="true" location=""
     name="Application Delivery Analysis Networks" type="automatic
     group" />
    <Group desc="This group contains all the applications reported by
     each data source." id="41" inherit="true" location="" name=
     "Applications" type="automatic group" />
    <Group desc="This group contains all the device components reported
     by each data source." id="113" inherit="true" name="Device
     Components" type="automatic group" />
    <Group desc="This group contains all the VMware ESX hosts reported
     by each data source." id="35" inherit="true" location="" name="ESX
     Hosts" type="automatic group" />
    <Group desc="Includes interfaces from all data sources." id="50"
     inherit="true" location="" name="Interfaces" type="automatic group" />
    <Group desc="This group contains all the pingable devices reported 
     by each data source." id="114" inherit="true" name="Pingable
     Devices" type="automatic group" />
    <Group desc="Includes routers from all data sources." id="31"
     inherit="true" location="" name="Routers" type="automatic group" />
    <Group desc="Includes servers from all data sources." id="32"
     inherit="true" location="" name="Servers" type="automatic group" />
    <Group desc="Includes switches from all data sources." id="33"
     inherit="true" location="" name="Switches" type="automatic group" />
    <Group desc="This group contains all the virtual machines reported
     by each data source." id="34" inherit="true" location=""
     name="Virtual Machines" type="automatic group" />
    <Group desc="This group contains all the voice interfaces reported
     by each data source." id="51" inherit="true" location="" name=
     "Voice Interfaces" type="automatic group" />
    <Group desc="This group contains all the voip locations reported 
     by each data source." id="52" inherit="true" location="" name=
     "VoIP Locations" type="automatic group" />
  </Group>
  <Group desc="Includes every data source that has reported
  configuration information to the performance center." id="4"
  inherit="false" location="" name="Data Sources" type="automatic
  group">
    <Group desc="Contains configuration information reported to the
     performance center by Data Aggregator" id="115" inherit="true"
     name="da" type="system group" />
    <Group desc="Contains configuration information reported to the
     performance center by Event Manager" id="100" inherit="true"
     name="EventManager@servername.domain.com" type="system group">
      <Group desc="Devices created by event manager" id="101" inherit=
      "true" name="Devices" type="system group" />
    </Group>
  </Group>

The above results show that the group ID for the Inventory group is 5:

<GroupTree id="5" inheritDefault="true" path="Inventory">

You can use this value to get the complete group path. Enter the following URL:

http://CA Performance Center Server IP Address:8181/pc/center/webservice/groups
/groupItemId/5

The results that are returned resemble the following:

<?xml version="1.0" encoding="UTF-8"?>
<GroupTree id="5" inheritDefault="true" path="/All Groups/Inventory">
  <Group desc="This group contains groups for the various item types
  that are associated with all data sources." id="12" inherit="false"
  location="" name="All Items" type="automatic group">
    <Group desc="Includes networks from all Application Delivery
     Analysis data sources." id="40" inherit="true" location=""
     name="Application Delivery Analysis Networks" type="automatic group" />
    <Group desc="This group contains all the applications reported 
     by each data source." id="41" inherit="true" location="" name=
     "Applications" type="automatic group" />
    <Group desc="This group contains all the device components reported
     by each data source." id="113" inherit="true" name="Device
     Components" type="automatic group" />
    <Group desc="This group contains all the VMware ESX hosts reported
     by each data source." id="35" inherit="true" location="" name="ESX
     Hosts" type="automatic group" />
    <Group desc="Includes interfaces from all data sources." id="50"
     inherit="true" location="" name="Interfaces" type="automatic group" />
    <Group desc="This group contains all the pingable devices reported
     by each data source." id="114" inherit="true" name="Pingable
     Devices" type="automatic group" />
    <Group desc="Includes routers from all data sources." id="31"
     inherit="true" location="" name="Routers" type="automatic group" />
    <Group desc="Includes servers from all data sources." id="32"
     inherit="true" location="" name="Servers" type="automatic group" />
    <Group desc="Includes switches from all data sources." id="33"
     inherit="true" location="" name="Switches" type="automatic group" />
    <Group desc="This group contains all the virtual machines reported
     by each data source." id="34" inherit="true" location=""
     name="Virtual Machines" type="automatic group" />
    <Group desc="This group contains all the voice interfaces reported
     by each data source." id="51" inherit="true" location="" name="Voice
     Interfaces" type="automatic group" />
    <Group desc="This group contains all the voip locations reported 
     by each data source." id="52" inherit="true" location="" name="VoIP
     Locations" type="automatic group" />
  </Group>
  <Group desc="Includes every data source that has reported
  configuration information to the performance center." id="4"
  inherit="false" location="" name="Data Sources" type="automatic
  group">
    <Group desc="Contains configuration information reported to the
    performance center by Data Aggregator" id="115" inherit="true"
    name="Data Aggregator" type="system group" />
    <Group desc="Contains configuration information reported to the
    performance center by Event Manager" id="100" inherit="true"
    name="EventManager@servername.domain.com" type="system group">
      <Group desc="Devices created by event manager" id="101"
      inherit="true" name="Devices" type="system group" />
    </Group>
  </Group>

From this result, you can see that the complete path to the Inventory group is "/All Groups/Inventory". All subgroups of the Inventory system group are also returned.

You can then use the values that are returned for the group name parameter to construct a group path for a subgroup, as in the following example:

/All%20Groups/Inventory/Device%20Components

The URL to get the group ID from the group path would resemble the following example:

http://CA Performance Center Server IP Address:8181/pc/center/webservice/groups/
groupPath/All%20Groups%2FInventory%2FDevice%20Components

Note: When specifying a group path in the URL, use the percent encoded value for front slashes (%2F, as shown above) to delimit each group in the path. This requirement comes from the fact that non-encoded front slashes are reserved as the delimiting character for path segments in the URL syntax.