We have model outages which appear to remain open after in reality the outage has ben cleared. There are certain maintenance tasks the group that manages the spectrum servers do every night and the clear events for these outages are not getting processed to populate the end_time in the SRM database. Below is the query against the database to identify these outages. My question to the community is has anyone cleared events by using the REST API.
The solution will be wrapped up in a C# utility that will periodically throughout the day to attempt to clear the events. I have figured out how to clear the maintenance mode events but not the specific unplanned outages by start_event_key. Any assistance /direction would be appreciated.
select
vfmo.model_outage_id,
vfmo.model_key,
vdm.model_h_hex,
vdm.model_name,
vfmo.start_time,
vfmo.end_time,
vfmo.duration_seconds,
vfmo.start_event_key,
vfmo.end_event_key,aaaaaaaa
vfmo.outage_type,
concat
(
case
when (vfmo.duration_seconds div 3600) < 10
then lpad(vfmo.duration_seconds div 3600, 2, 0)
else vfmo.duration_seconds div 3600
end, ':',
lpad(((vfmo.duration_seconds mod 3600)div 60), 2, 0),':',
lpad(vfmo.duration_seconds mod 60, 2, 0)
) as 'duration_time', timestampadd(second, vfmo.duration_seconds, vfmo.start_time) as 'calculated_end_time'
from
srmdbapi.v_fact_model_outage vfmo
inner join srmdbapi.v_dim_model vdm on vdm.model_key = vfmo.model_key
where
start_time <= "2021-11-01 00:00:00" and end_time IS NULL and outage_type = 1;