List of all accountable models using the REST API
search cancel

List of all accountable models using the REST API

book

Article ID: 128063

calendar_today

Updated On:

Products

Spectrum

Issue/Introduction

How to get a list of all accountable models in Spectrum using Spectrum Web Services.

Is there a way for your reporting programmer to run Locator searches via a WebService call? They are pulling data from Spectrum and one effective Locator Search you want to run is "All Accountable Models". How would you run that search via webservice?

Environment

  • Spectrum 10.2.x
  • Spectrum 10.3.x
  • Spectrum 10.4.x

Resolution

To get the list of accountable models in Spectrum using the REST API you can use the following URL and XML post body:

http://localhost/spectrum/restful/models/
 

<?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 throttlesize="5" 
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 
xmlns="http://www.ca.com/spectrum/restful/schema/filter"> 
<filtered-models> 
<or> 
<and> 
<is-derived-from> 
<model-type>0x102bc</model-type> 
<!-- IPAddress --> 
</is-derived-from> 
<or> 
<is-derived-from> 
<model-type>0x2c70040</model-type> 
<!-- Dirig_Node --> 
</is-derived-from> 
<is-derived-from> 
<model-type>0x3d002e</model-type> 
<!-- GenCblModem --> 
</is-derived-from> 
<is-derived-from> 
<model-type>0x3d002d</model-type> 
<!-- GenSetTop --> 
</is-derived-from> 
<is-derived-from> 
<model-type>0x6330007</model-type> 
<!-- VMware ESX Host --> 
</is-derived-from> 
</or> 
</and> 
<and> 
<is-derived-from> 
<model-type>0x102bc</model-type> 
<!-- IPAddress --> 
</is-derived-from> 
<is-derived-from> 
<model-type>0x1004b</model-type> 
<!-- Device --> 
</is-derived-from> 
<or> 
<and> 
<is-derived-from> 
<model-type>0x10290</model-type> 
<!-- Pingable --> 
</is-derived-from> 
<equals> 
<attribute id="0x10001"> 
<!-- Modeltype --> 
<value>0x6330002</value> 
<!-- NimsoftHostServer --> 
</attribute> 
</equals> 
</and> 
<and> 
<not-is-derived-from> 
<model-type>0x10290</model-type> 
<!-- Pingable --> 
</not-is-derived-from> 
</and> 
</or> 
<not-is-derived-from> 
<model-type>0xf50000</model-type> 
<!-- Windows_PC --> 
</not-is-derived-from> 
<not-is-derived-from> 
<model-type>0x1cb00f5</model-type> 
<!-- Patrol_Pet --> 
</not-is-derived-from> 
<not-is-derived-from> 
<model-type>0x6210006</model-type> 
<!-- ClusterBaseResourceGroup --> 
</not-is-derived-from> 
<not-is-derived-from> 
<model-type>0x230083</model-type> 
<!-- No ContainerDevice --> 
</not-is-derived-from> 
<and> 
<does-not-equal> 
<attribute id="0x12e4a"> 
<!-- VirtualEntityType --> 
<value>0x102</value> 
<!-- Service Console --> 
</attribute> 
</does-not-equal> 
<does-not-equal> 
<attribute id="0x12e4a"> 
<!-- VirtualEntityType --> 
<value>0x201</value> 
<!-- Global Zone --> 
</attribute> 
</does-not-equal> 
<does-not-equal> 
<attribute id="0x12e4a"> 
<!-- VirtualEntityType --> 
<value>0x302</value> 
<!-- Manager in M_OS --> 
</attribute> 
</does-not-equal> 
<does-not-equal> 
<attribute id="0x12e4a"> 
<!-- VirtualEntityType --> 
<value>0x305</value> 
<!-- M_OS independently --> 
</attribute> 
</does-not-equal> 
</and> 
</and> 
</or> 
</filtered-models> 
</rs:search-criteria> 
</rs:models-search> 
</rs:target-models> 

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

</rs:model-request>