using REST API for managing maintenance scheduling


Article ID: 196313


Updated On:


CA Spectrum CA eHealth


We are using REST API to manage our device maintenance schedules. What are the best practices? 


Release : 10.3

Component : Spectrum Core / SpectroSERVER


A user can utilize RESTful commands to manage Maintenance mode on devices. 

The Schedule gets created per Landscape. If there is only one Landscape in the environment, then the Landscape does not have to be defined in the initial call to create the Schedule. However, in a DSS environment, the Schedule will need to be created on the same landscape as where the model to be associated with the schedule resides. To do this, the landscapeid must be determined. This is the same as landscape_handle, except landscapeid is in decimal format, and would need to be converted to hex for landscape_handle. 

First make a call on the model_handle to determine which Landscape it resides: 

http://<OC Host>:<PORT>/spectrum/restful/model/<Model MH>?attr=0x129ac

The returned landscapeid needs to be converted to hex. This can be scripted:

String convertToHex(String landscapeID) {
var id = int.parse(landscapeID);
var hexVal = '0x' + id.toRadixString(16);
return hexVal;


A sample call to create the schedule: 


mtypeid=0x10456 = Schedule Model Type
attr=0x129ac = Landscape Handle
attr=0x12bbc = Schedule Name
attr=0x1298f = Hour
attr=0x1298e = Minute
attr=0x12993 = Duration
attr=0x129e4 = Day
attr=0x12992 = Month - (NOTE month is base-0, so Jan - 00, Feb = 01, etc)
attr=0x129e3 = Start Year
attr=0x12994 = Recurrence (1=Always, 2=Daily, 3=Weekly, 4=Monthly, 5=Yearly, 6=None)

The user must then obtain the model_handle of the Schedule, and the model to apply the schedule to

The next call sets the Association between the model and the schedule: 



Additional Information

Restful Web API reference: