diff options
author | Vitezslav Crhonek <vcrhonek@redhat.com> | 2013-12-05 14:12:43 +0100 |
---|---|---|
committer | Vitezslav Crhonek <vcrhonek@redhat.com> | 2013-12-05 14:12:43 +0100 |
commit | 2a0ab172d96c5f8eeab45641d5129aaacd78aa7a (patch) | |
tree | 59cd823e4bbf710d58317c6897657737cf99df63 | |
parent | 3695375f9949eea9666e7802d4fff5a13f77b553 (diff) | |
download | openlmi-providers-2a0ab172d96c5f8eeab45641d5129aaacd78aa7a.tar.gz openlmi-providers-2a0ab172d96c5f8eeab45641d5129aaacd78aa7a.tar.xz openlmi-providers-2a0ab172d96c5f8eeab45641d5129aaacd78aa7a.zip |
doc: service indication example
-rw-r--r-- | doc/admin/service-dbus/index.rst | 4 | ||||
-rw-r--r-- | doc/admin/service-dbus/usage.rst | 31 |
2 files changed, 33 insertions, 2 deletions
diff --git a/doc/admin/service-dbus/index.rst b/doc/admin/service-dbus/index.rst index dab439a..e35577c 100644 --- a/doc/admin/service-dbus/index.rst +++ b/doc/admin/service-dbus/index.rst @@ -6,8 +6,8 @@ the systemd D-Bus interface). It allows to enumerate system services and get their status, start/stop/restart/... a service and enable/disable a service. -The provider should be also able to do event based monitoring of service status -(emit indication event upon service status change) in the future. +The provider is also able to do event based monitoring of service status +(emit indication event upon service property change). Contents: diff --git a/doc/admin/service-dbus/usage.rst b/doc/admin/service-dbus/usage.rst index 2d8c706..cb70d31 100644 --- a/doc/admin/service-dbus/usage.rst +++ b/doc/admin/service-dbus/usage.rst @@ -44,3 +44,34 @@ Disable and enable 'cups' service, print EnabledDefault property:: print cups.EnabledDefault cups.TurnServiceOn() print cups.EnabledDefault + +Indications +----------- +OpenLMI Service provider is able (using indication manager and polling) to emit indication +event upon service (i. e. :ref:`LMI_Service <LMI-Service>` instance) property modification +(:ref:`LMI_ServiceInstanceModificationIndication <LMI-ServiceInstanceModificationIndication>`). + +This is useful mainly for being notified when a service has changed state (has been started, +or stopped). + +In order to receive indications, create instances of CIM_IndicationFilter (which indications +should be delivered), CIM_IndicationHandler (what to do with those indications) and +CIM_IndicationSubscription (links filter and handler together). + +The following example in LMIShell does it all in one step:: + + c.subscribe_indication( + Name="service_modification", + QueryLanguage="DMTF:CQL", + Query="SELECT * FROM LMI_ServiceInstanceModificationIndication WHERE SOURCEINSTANCE ISA LMI_Service", + CreationNamespace="root/interop", + SubscriptionCreationClassName="CIM_IndicationSubscription", + FilterCreationClassName="CIM_IndicationFilter", + FilterSystemCreationClassName="CIM_ComputerSystem", + FilterSourceNamespace="root/cimv2", + HandlerCreationClassName="CIM_IndicationHandlerCIMXML", + HandlerSystemCreationClassName="CIM_ComputerSystem", + Destination="http://localhost:12121" + ) + +Indications are sent to the location specified in 'Destination' argument. |