[icinga-checkins] icinga.org: icingaweb2-module-director/master: ServiceSet: add CLI command , fix key

git at icinga.org git at icinga.org
Wed Oct 12 09:31:17 CEST 2016


Module: icingaweb2-module-director
Branch: master
Commit: f2f04c44e85970b870996a730705b027345c35dd
URL:    https://git.icinga.org/?p=icingaweb2-module-director.git;a=commit;h=f2f04c44e85970b870996a730705b027345c35dd

Author: Thomas Gelf <thomas at gelf.net>
Date:   Wed Oct 12 07:31:00 2016 +0000

ServiceSet: add CLI command, fix key

---

 application/clicommands/ServicesetCommand.php |   14 ++++++++++++++
 library/Director/Objects/IcingaService.php    |    2 ++
 library/Director/Objects/IcingaServiceSet.php |    2 ++
 3 files changed, 18 insertions(+)

diff --git a/application/clicommands/ServicesetCommand.php b/application/clicommands/ServicesetCommand.php
new file mode 100644
index 0000000..648a42c
--- /dev/null
+++ b/application/clicommands/ServicesetCommand.php
@@ -0,0 +1,14 @@
+<?php
+
+namespace Icinga\Module\Director\Clicommands;
+
+/**
+ * Manage Icinga Service Sets
+ *
+ * Use this command to show, create, modify or delete Icinga Service
+ * objects
+ */
+class ServicesetCommand extends ServiceCommand
+{
+    protected $type = 'ServiceSet';
+}
diff --git a/library/Director/Objects/IcingaService.php b/library/Director/Objects/IcingaService.php
index 0be8554..31eecb4 100644
--- a/library/Director/Objects/IcingaService.php
+++ b/library/Director/Objects/IcingaService.php
@@ -78,6 +78,8 @@ class IcingaService extends IcingaObject
 
     protected $supportsApplyRules = true;
 
+    protected $supportsSets = true;
+
     protected $keyName = array('host_id', 'object_name');
 
     protected $prioritizedProperties = array('host_id');
diff --git a/library/Director/Objects/IcingaServiceSet.php b/library/Director/Objects/IcingaServiceSet.php
index 5ec7de1..98e8b43 100644
--- a/library/Director/Objects/IcingaServiceSet.php
+++ b/library/Director/Objects/IcingaServiceSet.php
@@ -19,6 +19,8 @@ class IcingaServiceSet extends IcingaObject
         'description'           => null,
     );
 
+    protected $keyName = array('host_id', 'object_name');
+
     protected $supportsCustomVars = true;
 
     protected $supportsApplyRules = true;



More information about the icinga-checkins mailing list