Yes that is possible. The filter you’ve posted won’t work because your search 
is based on the modeltype-hierachy
and the model-class is just an attribute on a model.

You want your search-criteria look like this:

  <filtered-models>
    <equals>
      <model-class>9</model-class>
    </equals>
  </filtered-models>

In general if you struggle using the xml-filter, a good hint is to build your 
search-criteria within OC and get the filter by looking at the generated 
search-file

Regards,
Jan

Von: Ave, Rene [mailto:[email protected]]
Gesendet: Donnerstag, 11. Juli 2013 13:22
An: spectrum
Betreff: [spectrum] Search by Model_Class in REST Interface

Hi there,

is it possible to search for models (HTTP POST method) by model class?
I want to get all workstation-server classed models via the RESTful API, but 
this Request failed:

<?xml version="1.0" encoding="UTF-8"?>
<!--

   throttlesize="2"

-->

<rs:model-request
  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 
<http://www.ca.com/spectrum/restful/xsd/Request.xsd%20> ">

    <rs:target-models>
      <rs:models-search>
        <rs:search-criteria
             xmlns="http://www.ca.com/spectrum/restful/schema/filter";>
          <filtered-models>
            <is-derived-from>
              <attribute id="AttributeID.MODEL_CLASS"> <!-- Model_Class -->
                <value>9</value> <!-- MTH Legacy Agent Workstation-Server -->
              </attribute>
            </is-derived-from>
          </filtered-models>
        </rs:search-criteria>
      </rs:models-search>
    </rs:target-models>

<rs:requested-attribute id="0x1006e" /> <!-- Servername -->
<rs:requested-attribute id="0x12e4d" /> <!-- is_virtual -->
<rs:requested-attribute id="0x1295d" /> <!-- is_managed -->
<rs:requested-attribute id="0x11ee8" /> <!-- Model_Class Workstation-Server=9 
-->

</rs:model-request>

If I search for modeltype_handle everything works fine. I can´t find something 
references to the problem in the Spectrum Web API documentation.

Regards

René Ave

LK – Prozessmanager SACM

Tel.:          +49 (0)385 / 4800 - 422
Mobil:       +49 (0)171 / 5654465
Fax.:         +49 (0)385 / 4800 - 98422

eMail :      [email protected]<mailto:[email protected]>
Internet :  http://www.dvz-mv.de<http://www.dvz-mv.de/>

DVZ Datenverarbeitungszentrum
Mecklenburg-Vorpommern GmbH
Lübecker Str. 283 - 19059 Schwerin
Sitz der Gesellschaft: Schwerin – Eintrag im Handelsregister: HRB 187 / 
Amtsgericht Schwerin
Geschäftsführer: Hubert Ludwig – Aufsichtsratsvorsitzender: Peter Bäumer
P E-Mails sparen Zeit und Geld, sie nicht auszudrucken spart Bäume.



  *   --To unsubscribe from spectrum, send email to 
[email protected]<mailto:[email protected]> with the body: unsubscribe spectrum 
[email protected]<mailto:[email protected]>

---
To unsubscribe from spectrum, send email to [email protected] with the body: 
unsubscribe spectrum [email protected]

Reply via email to