2014-09-11 17:18:07 +02:00
|
|
|
<?php
|
2015-02-04 10:46:36 +01:00
|
|
|
/* Icinga Web 2 | (c) 2013-2015 Icinga Development Team | GPLv2+ */
|
2014-09-11 17:18:07 +02:00
|
|
|
|
|
|
|
namespace Icinga\Module\Monitoring\Command\Object;
|
|
|
|
|
2015-04-27 18:04:10 +02:00
|
|
|
use Icinga\Module\Monitoring\Command\IcingaCommand;
|
|
|
|
|
2014-09-11 17:18:07 +02:00
|
|
|
/**
|
|
|
|
* Delete a host or service downtime
|
|
|
|
*/
|
2015-04-27 18:04:10 +02:00
|
|
|
class DeleteDowntimeCommand extends IcingaCommand
|
2014-09-11 17:18:07 +02:00
|
|
|
{
|
|
|
|
/**
|
2015-04-27 18:04:10 +02:00
|
|
|
* Downtime for a host
|
|
|
|
*/
|
|
|
|
const DOWNTIME_TYPE_HOST = 'host';
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Downtime for a service
|
2014-09-11 17:18:07 +02:00
|
|
|
*/
|
2015-04-27 18:04:10 +02:00
|
|
|
const DOWNTIME_TYPE_SERVICE = 'service';
|
2014-09-11 17:18:07 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* ID of the downtime that is to be deleted
|
|
|
|
*
|
|
|
|
* @var int
|
|
|
|
*/
|
|
|
|
protected $downtimeId;
|
2015-04-27 18:04:10 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
*
|
|
|
|
* @var type
|
|
|
|
*/
|
|
|
|
protected $downtimeType = self::DOWNTIME_TYPE_HOST;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Set the downtime type, either host or service
|
|
|
|
*
|
|
|
|
* @param string $type the downtime type
|
|
|
|
*/
|
|
|
|
public function setDowntimeType($type)
|
|
|
|
{
|
|
|
|
$this->downtimeType = $type;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
*
|
|
|
|
* @return type
|
|
|
|
*/
|
|
|
|
public function getDowntimeType()
|
|
|
|
{
|
|
|
|
return $this->downtimeType;
|
|
|
|
}
|
2014-09-11 17:18:07 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Set the ID of the downtime that is to be deleted
|
|
|
|
*
|
|
|
|
* @param int $downtimeId
|
|
|
|
*
|
|
|
|
* @return $this
|
|
|
|
*/
|
|
|
|
public function setDowntimeId($downtimeId)
|
|
|
|
{
|
|
|
|
$this->downtimeId = (int) $downtimeId;
|
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the ID of the downtime that is to be deleted
|
|
|
|
*
|
|
|
|
* @return int
|
|
|
|
*/
|
|
|
|
public function getDowntimeId()
|
|
|
|
{
|
|
|
|
return $this->downtimeId;
|
|
|
|
}
|
|
|
|
}
|