[Hawkular-dev] execute op

John Mazzitelli mazz at redhat.com
Fri Jul 24 16:45:12 EDT 2015


As part of the new UI-server-feed comm work, the following now works.

In our agent config, if a resource-type has an operation defined, you can execute that operation from end-to-end. I don't have the UI coded up - I mock out the UI with a simulated websocket client.

These are the log messages I got in the logs to show it working:

1) The UI sends in the request over websocket - the content of the request looks like this:

    ExecuteOperationRequest={"resourceId":"mazztower~Local~/subsystem=hawkular-monitor", "operationName":"Status"}

2) The server receives it over the websocket. Log message:

   Received message from UI client [AjEP4Q3X0ViCalHvAsodkve92mshxsCxJTy9PQ9r]

3) And then puts it on the bus. Whatever server is currently connected to that feed will have a bus listener for this particular command for that particular feed and picks it up. Log message from the bus listener:

   Asking feed [mazztower] to execute operation [Status] on resource ID [mazztower~Local~/subsystem=hawkular-monitor]

4) That bus listener does what it needs to do - in this case, forwards the message to the appropriate feed/agent. Log message:

    Attempting to send async message to [1] clients: [ExecuteOperationRequest={"resourceId":"mazztower~Local~/subsystem=hawkular-monitor","operationName":"Status"}]

5) The agent gets the message from its websocket. Log messages:

    Received message from server
    Received request to execute operation [Status] on resource [mazztower~Local~/subsystem=hawkular-monitor]

6) Once the operation is executed, the results are sent back to the server - these are logs back on the server again:

    Received message from feed [mazztower]
    Operation execution completed. Resource=[mazztower~Local~/subsystem=hawkular-monitor], Operation=[Status], Status=[OK], Message=["STOPPED"]

So you can see the server was told that the operation succeeded and what the results were in Message.

Lots more to do. But the end-to-end is working. Need to support parameters, next. Then have to figure out how to do resource configuration using this same comm mechanism.


More information about the hawkular-dev mailing list