How can I create global collections through the REST API?
search cancel

How can I create global collections through the REST API?


Article ID: 220513


Updated On:


CA Spectrum DX NetOps


I am planning on creating a set of Global Collections via REST API calls to the OneClick server. How can this be done?  Also, I need to be able to create the same GC on all of my landscapes.  Do I have to do this on each SpectroSERVER?


The process begins with sending a HTTPS GET request to the OneClick host to obtain a unique GUID value from the MLS.  In this case, the MLS has a landscape handle of 0x1000000


This returns a GUID value that is needed for the creation of the Global Collection.  You would need to run this command once for every new GC you want to create.  If you have 50 GC you want to create, you would need 50 GUID.

For this example, the GUID generated is:  


Then you need to create a HTTP POST request for each SpectroSERVER using the same GUID.  For example, we have 3 SpectroSERVERs with Landscape handles:

To have the GC created on these 3 SpectroSERVERs, you need to send the POST to all 3 SS using the same GUID:


This will create the same GC named "Test via REST" on all three SpectroSERVERS.


Additional Information

If you then want to update the search criteria of the GC, please refer to this knowledge doc:


1) This is the dynamicCriteriaXML attribute value for the Global Collection search rule:

<search-criteria><devices-only-search /><filtered-models><does-not-equal><attribute id="0x10024"><value>NULL</value></attribute></does-not-equal></filtered-models></search-criteria>

2) Encode the following:

<search-criteria><devices-only-search /><filtered-models><does-not-equal><attribute id="0x10024"><value>NULL</value></attribute></does-not-equal></filtered-models></search-criteria>

I used this URL:

This is the result:


3) This is the RESTful API PUT query:


Where 0x1000386 is the Global Collection model_handle and 0x12a6a is the dynamicCriteriaXML attribute ID.

How to get a list of Global Collections and CAPCIPDomain models using the REST API

This is the XML body:

<rs:model-request throttlesize="5"
  xsi:schemaLocation=" ../../../xsd/Request.xsd "> 

              <attribute id="AttributeID.MTYPE_HANDLE">
                <value>0x10474</value> <!-- Global Collection Modeltype_Handle-->

    <rs:requested-attribute id="0x1006e" /> <!-- Model_Name -->
    <rs:requested-attribute id="0x10000" /> <!-- Modeltype_Name --> 


4) I used the RESTClient:

5) This is the result: