add_downtime( params )
param = {
name: 'test',
type: 'service',
host: 'icinga2',
comment: 'test downtime',
author: 'icingaadmin',
start_time: Time.now.to_i,
end_time: Time.now.to_i + 20
}
@icinga.add_downtime( param )
remove_downtime( params )
remove all downtimes from the user icingaadmin and the comment test downtime
param = {
comment: 'test downtime',
author: 'icingaadmin'
}
@icinga.remove_downtime(param)remove a downtime from a host but not the services filtered by the author name. This example uses filter variables explained in the advanced filters chapter from the official API documentation.
param = {
filter: '"host.name == filterHost && !service && downtime.author == filterAuthor"',
filter_vars: { filterHost: 'c1-mysql-1', filterAuthor: 'icingaadmin' }
)
@icinga.remove_downtime(param)remove a downtime for service ping4 and host c1-mysql-1
param = {
host_name: 'c1-mysql-1',
service_name: 'ping4'
}
@icinga.remove_downtime(param)downtimes
@icinga.downtimes