Description
Currently ns_server's pluggable UI / REST API capability is limited to a single port per service. As an example the pluggable spec for Analytics is as follows:
{
|
"service": "cbas",
|
"proxy-strategy": "local",
|
"rest-api-prefix": "cbas",
|
"version-dirs": [
|
{"version": [5, 0], "dir": "."}
|
],
|
"doc-root": "cbas-ui"
|
}
|
This will proxy reqs to the default analytics port (cbas_http_port). However, we should additionally support proxying to arbitrary ports associated with services. Suggested representation of the pluggable spec would be as follows:
{
|
"service": "cbas",
|
"port": "cbas_admin_port",
|
"proxy-strategy": "local",
|
"rest-api-prefix": "cbas-admin",
|
"version-dirs": [
|
{"version": [5, 0], "dir": "."}
|
],
|
"doc-root": "cbas-ui"
|
}
|
If the port is not specified we can use the default port for the service - that is to say the ports that are currently hardcoded in the spec. Once this piece is in, we can change each of the components that create pluggable specs to always explicitly specify a port in the spec and we can remove the service-to-port mapping from ns_server code.
The Analytics folks could use this capability now and going forward it may be useful for other services.
Attachments
For Gerrit Dashboard: MB-27996 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
89639,5 | MB-27996: Proxying to arbitrary ports in pluggable ui | master | ns_server | Status: MERGED | +2 | +1 |