REST API query to retrieve all Spectrum models created after a certain date/time
search cancel

REST API query to retrieve all Spectrum models created after a certain date/time

book

Article ID: 385936

calendar_today

Updated On:

Products

Network Observability

Issue/Introduction

This REST query will retrieve all models created after a certain time, by using the "createtime" device attribute (0x11b41), and using the unix epoch time (in seconds, not milliseconds) as a start date/time.

Environment

All Spectrum supported versions

Resolution

POST -> http://<OC_HOSTNAME:PORT>/spectrum/restful/models

<rs:model-request throttlesize="1000"
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">
<devices-only-search />
<filtered-models>
<greater-than>
<attribute id="0x11b41"> <!-- createtime  -->
<value>1736640000</value> <!-- unix epoch time in seconds  -->
</attribute>
</greater-than>
</filtered-models>
</rs:search-criteria>
</rs:models-search>
</rs:target-models>
<rs:requested-attribute id="0x1006e" /> <!-- Model_Name -->
<rs:requested-attribute id="0x10000" /> <!-- Modeltype_Name -->
<rs:requested-attribute id="0x11b41" /> <!-- create time -->
</rs:model-request>