monitoring/commands: Add common `ToggleFeature' command
`ToggleFeature' should be used for enabling/disabling concrete features of the monitoring host. refs #6593
This commit is contained in:
parent
4d353ac7bf
commit
8c82f1a868
|
@ -0,0 +1,42 @@
|
|||
<?php
|
||||
// {{{ICINGA_LICENSE_HEADER}}}
|
||||
// {{{ICINGA_LICENSE_HEADER}}}
|
||||
|
||||
namespace Icinga\Module\Monitoring\Command\Common;
|
||||
|
||||
use Icinga\Module\Monitoring\Command\IcingaCommand;
|
||||
|
||||
/**
|
||||
* Enable/disable features of the monitoring host
|
||||
*/
|
||||
abstract class ToggleFeature extends IcingaCommand
|
||||
{
|
||||
/**
|
||||
* Whether the feature should be enabled or disabled
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
protected $enable = true;
|
||||
|
||||
/**
|
||||
* Enable the feature
|
||||
*
|
||||
* @return self
|
||||
*/
|
||||
public function enable()
|
||||
{
|
||||
$this->enable = true;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Disable the feature
|
||||
*
|
||||
* @return self
|
||||
*/
|
||||
public function disable()
|
||||
{
|
||||
$this->enable = false;
|
||||
return $this;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue