Create a Restful API search to collect all models contained within a Global Collection


Article ID: 209503


Updated On:


CA Spectrum DX NetOps


We are looking for search on CollectionsModelNameString to collect models contained within a specific GC Name via RestAPI


Release: All Supported Releases

Component: SPCAPP - Spectrum Applications


POST: http://<OC Host name>:<port>/spectrum/restful/models


The Restful XML Body suggestion is below:


<?xml version="1.0" encoding="UTF-8"?>

<rs:model-request throttlesize="5"



  xsi:schemaLocation=" ../../../xsd/Request.xsd">



        <rs:search-criteria xmlns="">






        <model-type>0x10474</model-type>  <!-- GC mtype -->



         <attribute id="AttributeID.MODEL_NAME">

           <value>Fault</value> <!-- ModelName -->





     <relation>0x1003a</relation> <!-- 0x1003a DynamicGlobalCollects relation-->

                                  <!-- 0x1003b StaticGlobalCollects relation-->







    <rs:requested-attribute id="0x1006e" />



You can replace the GC name.


This search query will satisfy your requirement by replacing the GC name.


This query looks for all models under specified GC with either StaticGlobalCollects or DynamicGlobalCollects child relation.



You can also use this CURL command: 


curl --user spectrum:spectrum http://model/0x700154d?side=leftum/restful/associations/relation/0x0001003a/

This is the curl command you can use to get the list of models associated with a Global Collection. The parameter after the model is the model handle of the Global Collection. The parameter after relation is the DynamicGlobalCollects relation handle and the side is the side the global collection is on in the association. In this case the left side.

The output looks like the following:

<association-response-list xmlns="">
<association rh="0x1003a" leftmh="0x700154d" rightmh="0x700007d"/>
<association rh="0x1003a" leftmh="0x700154d" rightmh="0x70010bd"/>
<association rh="0x1003a" leftmh="0x700154d" rightmh="0x7000762"/>
<association rh="0x1003a" leftmh="0x700154d" rightmh="0x7001515"/>