Global Collection Child Count Attribute in Spectrum
search cancel

Global Collection Child Count Attribute in Spectrum

book

Article ID: 215404

calendar_today

Updated On:

Products

CA Spectrum

Issue/Introduction

I have created some Global Collections to collect/group models where we see a certain combination of attribute values.

What I would like to do is be able to create a watch on on A Global Collection to say IF Child Count is greater than X raise event.

The trouble is I don't seem to be able to find an attribute for Global Collection Child count.  Is there one and is this possible to create a watch on?

Environment

Release : 10.4.1

Component : Spectrum Core / SpectroSERVER

Cause

Spectrum use a pseudo attribute to show the count of children of a Global Collection as it is not a static number that can be stored in a normal attribute. Pseudo attributes are used when development wants to display some type of data that either needs to be formatted to be readable or cannot simply be stored in an attribute. Using a pseudo attribute usually triggers some type of Java code to be executed on the OneClick Server to produce what is displayed.

Resolution

To pull this information dynamically, you would need a custom method.

A. one possibility would be to make a cron job cli script to list the associations (show associations) of the global collection and count the output of dynamicGlobalCollects relationships. You can create an alarms/event from CLI based on the number received.

Or

B. use the Restful API with the following POST models (GET Tunneling)

 
POST 
URL: http://<OC_server><:portnumber>/spectrum/restful/models
 
Body:
 
<?xml version="1.0" encoding="UTF-8"?>
<rs:model-request  throttlesize="100000"
            xmlns:rs="http://www.ca.com/spectrum/restful/schema/request"
            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.ca.com/spectrum/restful/schema/request ../../../xsd/Request.xsd">
  <rs:target-models>
    <rs:models-search>
      <rs:search-criteria
                                                xmlns="http://www.ca.com/spectrum/restful/schema/filter">
        <filtered-models>
          <has-substring>
            <attribute id="0x12adb">
              <!-- This attribute stores the list of global collections that contains the devices you want being processed
                          so change NOC-xx into yout GC name  -->
              <value>NOC-xx</value>
              <!-- Name of the Global Collection -->
            </attribute>
          </has-substring>
        </filtered-models>
      </rs:search-criteria>
    </rs:models-search>
  </rs:target-models>
  <!-- Model Name -->
  <rs:requested-attribute id="0x1006e" />
</rs:model-request>
 
In the body you should supply the name of your GC and in the output you will have the model name of the models the global collection contains but you will have also the throttlesize actual value that identifies the number of models.
 

Additional Information

the <has-substring> comparison will only work correctly if there are no similarly named Global Collections.

We cannot use the <equals> comparison with the 0x12adb attribute if the models are members of more than 1 Global Collection which they usually are. 

In more recent versions the 0x12adb has been throttled to reduce impact on the SS.

Please use instead

https://knowledge.broadcom.com/external/article?articleId=209503