AnsweredAssumed Answered

Setting Maintenance mode via the API

Question asked by kbocsl on Jun 21, 2017
Latest reply on Jun 23, 2017 by PeteBennett

Hi everyone, I've been developing a script to set maintenance mode via the API, so following this guide:


Maintenance Calls - CA Unified Infrastructure Management Probes - CA Technologies Documentation 


I get the CS ID of the machine I want, fire an API call to create a schedule on the appropriate hub and then take that schedule ID and add the machine to it.


The API calls work fine, and if I use the get_next_fire_time_for_schedules call i can see that yes, the schedules have been created. however I don't have USM on my test instance so I have no way of seeing if the machines have been added, but if I keep the infrastructure manager program open I never see these machines go into maintenance mode.


So I have a few questions


1) Is there a way either via the API or by some method that isn't USM that I can see which machines are in which schedules

2) Is it normal to not see machines go into maintenance mode in infrastructure manager using the new method?

3) I see you can check for individual devices using a device_id which looks similar to a UUID but when pulling data out from either robots or computer systems I can't seem to find a field that correlates to this, so is there a way i can map computer systems or robots to deviceIDs? (using an API call, this all needs to sit in a programmatic loop)


And also is there a way to set schedules to "auto-clean" themselves up when no longer required? This script is designed to fire off when a machine is about to reboot, so it's a one-shot deal only.