How can I create global collections through the REST API?

book

Article ID: 220513

calendar_today

Updated On:

Products

CA Spectrum

Issue/Introduction

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?

Resolution

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

https://specoc01:8443/spectrum/restful/action/0x10474?mh=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:  

61002ede-cc53-1000-03a4-008010ef0000

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:
0x1000000
0x2000000
0x3000000

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

https://specoc01:8443/spectrum/restful/model?landscapeid=0x1000000&mtypeid=0x10474&attr=0x1006e&val=Test+via+REST&attr=0x12e56&val=61002ede-cc53-1000-03a4-008010ef0000
https://specoc01:8443/spectrum/restful/model?landscapeid=0x2000000&mtypeid=0x10474&attr=0x1006e&val=Test+via+REST&attr=0x12e56&val=61002ede-cc53-1000-03a4-008010ef0000
https://specoc01:8443/spectrum/restful/model?landscapeid=0x3000000&mtypeid=0x10474&attr=0x1006e&val=Test+via+REST&attr=0x12e56&val=61002ede-cc53-1000-03a4-008010ef0000

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:
https://knowledge.broadcom.com/external/article?articleId=130786