Request recommend the API for a Postman How to query devices the data of the devices from CA spectrum
search cancel

Request recommend the API for a Postman How to query devices the data of the devices from CA spectrum

book

Article ID: 231015

calendar_today

Updated On:

Products

CA Spectrum

Issue/Introduction

How to query devices in Global Collection show name, network address, type, firmware?
 
 

Environment

Release : 10.4.x,21.2.x

Component : Spectrum Applications

Cause

Out of the box it will search all devices.

Resolution

Create an xml file to search the models for a Global Collection

Contents of the xml file 

<?xml version="1.0"?>
    <search-criteria>
      <filtered-models>
        <has-substring>
          <attribute id="0x12adb">
            <value>GC-NAME</value>  <==Give Global Collection Name
          </attribute>
       </has-substring>
     </filtered-models>
  </search-criteria>

Save this file as ModelsFromGC.xml

place this xml file under 

%SPECROOT%\tomcat\webapps\spectrum\WEB-INF\topo\config

In postman use the end point as below

Method:
POST
 
URL:
http://Oneclick:Port/spectrum/restful/models   <== Replace Oneclick with Oneclick Servername and Port with Oneclick Port
 
Authorization:
Basic Auth
 
Content-Type:
application/xml
 
Body:
<?xml version="1.0" encoding="UTF-8"?>
<!-- CA Technologies, Inc. One CA Plaza Islandia, NY 11749 USA Copyright (c) 2012 CA Technologies, Inc. All rights reserved. IN NO EVENT SHALL CA TECHNOLOGIES INCORPORATED BE LIABLE FOR ANY INCIDENTAL, INDIRECT, SPECIAL, OR CONSEQUENTIAL DAMAGES WHATSOEVER (INCLUDING BUT NOT LIMITED TO LOST PROFITS) ARISING OUT OF OR RELATED TO THIS SOFTWARE, EVEN IF CA TECHNOLOGIES INCORPORATED HAS BEEN ADVISED OF, KNOWN, OR SHOULD HAVE KNOWN, THE POSSIBILITY OF SUCH DAMAGES. -->
<rs:model-request xsi:schemaLocation="http://www.ca.com/spectrum/restful/schema/request ../../../xsd/Request.xsd " xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:rs="http://www.ca.com/spectrum/restful/schema/request" throttlesize="100">
<rs:target-models>
  <rs:models-search>
     <rs:search-criteria-file> topo/config/ModelsFromGC.xml </rs:search-criteria-file>
  </rs:models-search>
</rs:target-models>
   <rs:requested-attribute id="0x1006e"/> <!-- attribute to get name-->
   <rs:requested-attribute id="0x10000"/> <!-- attribute to get network address-->
   <rs:requested-attribute id="0x12d7f"/> <!-- attribute to get type-->
   <rs:requested-attribute id="0x210ffa"/> <!-- attribute to get firmware-->
</rs:model-request>
 
 

 

Additional Information

XML Examples Documentation:

https://techdocs.broadcom.com/us/en/ca-enterprise-software/it-operations-management/spectrum/10-4-2/programming/web-services-api-reference/java-code-and-xml-examples.html#concept.dita_0479aaddb0a1985372970cd16ec7b2dca271d66a_XMLExamples