Search in sources :

Example 1 with MasterWebUIInit

use of alluxio.wire.MasterWebUIInit in project alluxio by Alluxio.

the class AlluxioMasterRestServiceHandler method getWebUIInit.

/**
 * Gets Web UI initialization data.
 *
 * @return the response object
 */
@GET
@Path(WEBUI_INIT)
public Response getWebUIInit() {
    return RestUtils.call(() -> {
        MasterWebUIInit response = new MasterWebUIInit();
        String proxyHostname = NetworkAddressUtils.getConnectHost(NetworkAddressUtils.ServiceType.PROXY_WEB, ServerConfiguration.global());
        int proxyPort = ServerConfiguration.getInt(PropertyKey.PROXY_WEB_PORT);
        Map<String, String> proxyDowloadFileApiUrl = new HashMap<>();
        proxyDowloadFileApiUrl.put("prefix", "http://" + proxyHostname + ":" + proxyPort + "/api/v1/paths/");
        proxyDowloadFileApiUrl.put("suffix", "/download-file/");
        response.setDebug(ServerConfiguration.getBoolean(PropertyKey.DEBUG)).setNewerVersionAvailable(mMetaMaster.getNewerVersionAvailable()).setWebFileInfoEnabled(ServerConfiguration.getBoolean(PropertyKey.WEB_FILE_INFO_ENABLED)).setSecurityAuthorizationPermissionEnabled(ServerConfiguration.getBoolean(PropertyKey.SECURITY_AUTHORIZATION_PERMISSION_ENABLED)).setWorkerPort(ServerConfiguration.getInt(PropertyKey.WORKER_WEB_PORT)).setRefreshInterval((int) ServerConfiguration.getMs(PropertyKey.WEB_REFRESH_INTERVAL)).setProxyDownloadFileApiUrl(proxyDowloadFileApiUrl);
        return response;
    }, ServerConfiguration.global());
}
Also used : HashMap(java.util.HashMap) MasterWebUIInit(alluxio.wire.MasterWebUIInit) Path(javax.ws.rs.Path) GET(javax.ws.rs.GET)

Aggregations

MasterWebUIInit (alluxio.wire.MasterWebUIInit)1 HashMap (java.util.HashMap)1 GET (javax.ws.rs.GET)1 Path (javax.ws.rs.Path)1