Create rest API call from custom locator search in Spectrum
search cancel

Create rest API call from custom locator search in Spectrum

book

Article ID: 277931

calendar_today

Updated On:

Products

DX NetOps

Issue/Introduction

How can we create rest API call with custom locator search in Spectrum? 

Environment

All Spectrum versions.

Cause

We are following the documentation but need guidance

Resolution

1. create a custom locator search, e.g. 

The xml file for this search will be created in /usr/Spectrum/custom/console/config

mine was called as follows:
-rw-r----- 1 spectrum spectrum 219 Jan 11 11:14 search-659fcda6-0224-1000-1834-0afd8231.xml

Swap the new xml name created on the your system in the xml below and use that with a POST to <OneClick host>:<tomcat port>/spectrum/restful/models

Swap the attributes in bold below that you want to see in the results.

<?xml version="1.0" encoding="UTF-8"?>
<rs:model-request throttlesize="50"
 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-file>
          ../../../../custom/console/config/search-659fcda6-0224-1000-1834-0afd8231.xml
        </rs:search-criteria-file>
      </rs:models-search>
    </rs:target-models>
<rs:requested-attribute id="0x1006e" />
 <rs:requested-attribute id="0x10000" />
</rs:model-request>

Additional Information

https://techdocs.broadcom.com/us/en/ca-enterprise-software/it-operations-management/spectrum/22-2/programming/web-services-api-reference/how-to-use-the-ca-spectrum-web-services-api/restful-resources-nouns/models.html#concept.dita_5ba2688dffd71df813a468578a87c653e1575e1e_POSTmodelsGETTunneling