← Back to team overview

savanna-all team mailing list archive

Clarification of REST invocation (exec_resource_action())

 

In an effort to make clear exactly what the intent is, here is the flow as we see it:

Controller exposes /hadoop endpoint at startup (or some other root context)
This allows clients to invoke provider specific REST API
Rest of URI after /hadoop/ is provider specific (i.e. it is interpreted by the plugin)
Controller receives REST request
GET /hadoop/v1/clusters/c1
Controller calls provider.exec_resource_action(request)
request contains original URI, method, body, etc.
Request body is provider specific
Response is provider specific
Provider performs any necessary action to process the request 
In the case of the HDP provider this includes
resolve host:port of Ambari server which should handle the request (for example, based on the cluster name in the URI)
each Ambari server manages a single cluster
get security credentials for management server (perhaps from Savanna credential store facility)
currently Ambari uses standard web auth
add credentials to request
invoke the provider api on the appropriate Ambari server
modify URI in request to provider specific URI
/api/v1/clusters/c1
invoke request via HTTP client
The provider may choose to decompose the request into multiple requests and aggregate the results into a single response
Because each Ambari server manages only a single cluster, the HDP provider may want to handle some requests by aggregating requests across multiple calls to different Ambari servers


Follow ups