From bcd0882e9f85f972878c64d28399849438d2234b Mon Sep 17 00:00:00 2001 From: Gianluca Piccolo Date: Mon, 13 Feb 2023 16:48:45 +0100 Subject: [PATCH 1/2] Add cli delete importsource --- application/clicommands/ImportsourceCommand.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/application/clicommands/ImportsourceCommand.php b/application/clicommands/ImportsourceCommand.php index 477fdf592..6bee37d05 100644 --- a/application/clicommands/ImportsourceCommand.php +++ b/application/clicommands/ImportsourceCommand.php @@ -67,6 +67,23 @@ public function checkAction() $this->showImportStateDetails($source); } + /** + * This command deletes the given Import Source. + * + * USAGE + * + * icingacli director importsource delete --id + * + * OPTIONS + * + * --id An Import Source ID. Use the list command to figure out + */ + public function deleteAction() + { + $source = $this->getImportSource(); + $source->delete(); + } + /** * Fetch current data from a given Import Source * From f792ec64642ccda767da8edfc717588a7d1eef34 Mon Sep 17 00:00:00 2001 From: Gianluca Piccolo Date: Mon, 13 Feb 2023 16:54:36 +0100 Subject: [PATCH 2/2] Add cli delete syncrule --- application/clicommands/SyncruleCommand.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/application/clicommands/SyncruleCommand.php b/application/clicommands/SyncruleCommand.php index 37a3f0e93..4556ae48d 100644 --- a/application/clicommands/SyncruleCommand.php +++ b/application/clicommands/SyncruleCommand.php @@ -77,6 +77,23 @@ public function checkAction() exit($this->getSyncStateExitCode($rule)); } + /** + * This command deletes a Sync Rule. + * + * USAGE + * + * icingacli director syncrule delete --id + * + * OPTIONS + * + * --id A Sync Rule ID. Use the list command to figure out + */ + public function deleteAction() + { + $rule = $this->getSyncRule(); + $rule->delete(); + } + protected function getExpectedModificationCounts(SyncRule $rule) { $modifications = $rule->getExpectedModifications();