use of com.sequenceiq.it.spark.ambari.EmptyAmbariClusterResponse in project cloudbreak by hortonworks.
the class MockSparkServer method addAmbariMappings.
private static void addAmbariMappings(Map<String, CloudVmMetaDataStatus> instanceMap) {
post(AMBARI_API_ROOT + "/views/:view/versions/1.0.0/instances/*", new EmptyAmbariResponse());
get(AMBARI_API_ROOT + "/views/*", new AmbariViewResponse(MOCK_SERVER_ADDRESS));
get(AMBARI_API_ROOT + "/clusters", new AmbariClusterResponse(instanceMap));
get(AMBARI_API_ROOT + "/clusters/:cluster", (req, resp) -> {
ITResponse itResp = CLUSTER_CREATED.contains(Integer.valueOf(req.params(":cluster"))) ? new AmbariClusterResponse(instanceMap) : new EmptyAmbariClusterResponse();
return itResp.handle(req, resp);
});
get(AMBARI_API_ROOT + "/clusters/:cluster/hosts", new AmbariClustersHostsResponse(instanceMap, "SUCCESSFUL"));
post(AMBARI_API_ROOT + "/clusters/:cluster/requests", new AmbariClusterRequestsResponse());
get(AMBARI_API_ROOT + "/clusters/:cluster/requests/:request", new AmbariStatusResponse());
post(AMBARI_API_ROOT + "/clusters/:cluster", (req, resp) -> {
CLUSTER_CREATED.add(Integer.valueOf(req.params(":cluster")));
return new EmptyAmbariResponse().handle(req, resp);
}, GSON::toJson);
get(AMBARI_API_ROOT + "/services/AMBARI/components/AMBARI_SERVER", new AmbariServicesComponentsResponse(), GSON::toJson);
get(AMBARI_API_ROOT + "/hosts", new AmbariHostsResponse(instanceMap), GSON::toJson);
get(AMBARI_API_ROOT + "/blueprints/:blueprintname", (request, response) -> {
response.type("text/plain");
return responseFromJsonFile("blueprint/" + request.params("blueprintname") + ".bp");
});
post(AMBARI_API_ROOT + "/blueprints/*", new EmptyAmbariResponse());
put(AMBARI_API_ROOT + "/users/admin", new EmptyAmbariResponse());
post(AMBARI_API_ROOT + "/users", new EmptyAmbariResponse());
get(AMBARI_API_ROOT + "/check", new AmbariCheckResponse());
put(AMBARI_API_ROOT + "/stacks/HDP/versions/:version/operating_systems/:os/repositories/:hdpversion", new EmptyAmbariResponse());
get(AMBARI_API_ROOT + "/version_definitions", new AmbariVersionDefinitionResponse());
post(AMBARI_API_ROOT + "/version_definitions", new EmptyAmbariResponse());
}
Aggregations