In DX NetOps Spectrum, Device models and Maintenance Schedule models are separate objects. While the device model indicates if maintenance is active via the isManaged attribute (0x1295d), it does not store schedule metadata such as the schedule description, schedule name, or duration. This article provides the REST API workflow to retrieve a list of devices along with their specific maintenance schedule details.
To retrieve the complete list of devices in maintenance including their schedule description, use a two-step API process to bridge the device and schedule models.
Step 1: Retrieve Maintenance Schedules and Metadata Perform a POST request to find all models of type 0x10456 (Maintenance Schedule).
https://<OC_HOST>:<PORT>/spectrum/restful/modelsExample Curl Command:
Example of the curl output:
<model mh="0x10b2fce">
<attribute id="0x1006e">Every week on Sun, Mon, Tue, Wed, Thu, Fri and Sat from 9 AM for 8 hours</attribute>
<attribute id="0x12bbc">"Schedule Description"</attribute>
<attribute id="0x12993">28800</attribute>
</model>
Step 2: Identify Associated Devices For each Schedule Model Handle (mh) returned in Step 1, query the MAINT_SCHEDULE relation (0x10034) to find the linked devices.
GET https://<OC_HOST>:<PORT>/spectrum/restful/associations/relation/0x10034/model/<SCHEDULE_MH>?side=rightExample Curl Command:
The left_model_handle in the response represents the device(s) currently tied to that specific maintenance task.
Example of the curl output:
<association-responses>
<association rh="0x10034" leftmh="0x10b1956" rightmh="0x10b2fce"/>
</association-responses>
</association-response-list>
Where 0x10b1956 is the model_handle of the device associated with the Schedule description model_handle: 0x10b2fce
Run the following syntax to get the schedule associated with a particular device (0x10b1956):
curl -k -u "your_username:your_password" -H "Accept: application/xml" "https://<OC_Host>:<Port>/spectrum/restful/associations/relation/0x10034/model/0x10b1956?side=left" | xmllint --format -
Example of the curl output:
<association-responses>
<association rh="0x10034" leftmh="0x10b1956" rightmh="0x10b2fce"/>
</association-responses>
</association-response-list>
Where 0x10b2fce is the model_handle of the schedule associated with device model_handle: 0x10b1956