          (some? service-id)
          (contains? supported-actions (:Action event)))))
 
-(def service-container-event
+(defn- service-info-data
+  [event]
+  (let [service-id (get-in event [:Actor :Attributes :com.docker.swarm.service.id])
+        service (api/service service-id)
+        tasks (api/service-tasks service-id)
+        networks (api/service-networks service-id)]
+    {:service  service
+     :tasks    tasks
+     :networks networks}))
+
+(def service-list-container-event
   (reify Rule
     (match? [_ event]
       (service-container-event? event))

    (subscribed-data [_ event]
      (api/nodes))))

(def list [service-container-event
           task-container-event
           service-event
           node-event])
    (subscribed-data [_ event]
      (api/services))))

(def service-info-by-name-event
  (reify Rule
    (match? [_ event]
      (= "service" (:Type event)))
    (subscription [_ event]
      (let [service-name (get-in event [:Actor :Attributes :com.docker.swarm.service.name])]
        {:handler :service-info
         :params  {:id service-name}}))
    (subscribed-data [_ event]
      (service-info-data event))))

(def service-info-by-id-event
  (reify Rule
    (match? [_ event]
      (= "service" (:Type event)))
    (subscription [_ event]
      (let [service-id (get-in event [:Actor :Attributes :com.docker.swarm.service.id])]
        {:handler :service-info
         :params  {:id service-id}}))
    (subscribed-data [_ event]
      (service-info-data event))))

(def node-list-event
  (reify Rule
    (match? [_ event]
      (= "node" (:Type event)))
