clarencen/lshift — Issue #399: Add REST call to list repair actions for a pair
Author: clarencen
Created: 2011-11-14 22:42:54+00:00
State: open

The UI needs to

* Show available repair options for an event/pair
* Invoke a repair option and then show the result

So the way this will work is that

* The client will be able to request a list of actions that can be invoked on a pair. This action can either be:
* An RPC to the agent, in which case the each action will have these attributes:
* Name - an identifier
* Type - the type will be "rpc"
* Action - a REST URL to the agent that has a mandatory entity id attribute
* Method - the HTTP method for the action
* An external link to a UI for more complicated repair actions. It has these attributes:
* Name - see above
* Type - "external"
* Link - a link to the external application with the mandatory entity id attribute

The REST API should look like this:

Request:

GET /fastdiff-agent/pair/${pairId}/actions

Response (eg, after request to /fastdiff-agent/pair/PAIR-1/actions):
[
{"name":"Resend Source", "type":"rpc", "action":"/fastdiff-agent/pair/PAIR-1/action/foo/${id}", "method":"POST"},
{"name":"Console", "type":"external", "action":"http://someapp/entities/${id}"},
]

RPC Result:

{
"result":"success",
"output":"foo"
}
{
"result":"error",
"output":"bar"
}