Search in sources :

Example 21 with ExposedService

use of com.sequenceiq.cloudbreak.api.service.ExposedService in project cloudbreak by hortonworks.

the class ServiceEndpointCollector method getHBaseUIUrlWithHostParameterFromGatewayTopology.

private String getHBaseUIUrlWithHostParameterFromGatewayTopology(String managerIp, GatewayTopology gt, String hbaseMasterPrivateIp) {
    Gateway gateway = gt.getGateway();
    ExposedService hbaseUi = exposedServiceCollector.getHBaseUIService();
    if (gatewayListeningOnHttpsPort(gateway)) {
        return String.format("https://%s/%s/%s%s?host=%s&port=%s", managerIp, gateway.getPath(), gt.getTopologyName(), hbaseUi.getKnoxUrl(), hbaseMasterPrivateIp, hbaseUi.getPort());
    } else {
        return String.format("https://%s:%s/%s/%s%s?host=%s&port=%s", managerIp, gateway.getGatewayPort(), gateway.getPath(), gt.getTopologyName(), hbaseUi.getKnoxUrl(), hbaseMasterPrivateIp, hbaseUi.getPort());
    }
}
Also used : Gateway(com.sequenceiq.cloudbreak.domain.stack.cluster.gateway.Gateway) ExposedService(com.sequenceiq.cloudbreak.api.service.ExposedService)

Example 22 with ExposedService

use of com.sequenceiq.cloudbreak.api.service.ExposedService in project cloudbreak by hortonworks.

the class CmCommandLinkProviderTest method exposedService.

private ExposedService exposedService() {
    ExposedService service = new ExposedService();
    service.setServiceName(CM_UI_SVC_NAME);
    return service;
}
Also used : ExposedService(com.sequenceiq.cloudbreak.api.service.ExposedService)

Example 23 with ExposedService

use of com.sequenceiq.cloudbreak.api.service.ExposedService in project cloudbreak by hortonworks.

the class ExposedServiceV4Response method fromExposedServices.

public static Collection<ExposedServiceV4Response> fromExposedServices(Collection<ExposedService> exposedServices) {
    List<ExposedServiceV4Response> exposedServiceV4ResponseList = new ArrayList<>();
    for (ExposedService service : exposedServices) {
        ExposedServiceV4Response exposedServiceV4Response = new ExposedServiceV4Response();
        exposedServiceV4Response.displayName = service.getDisplayName();
        exposedServiceV4Response.serviceName = service.getServiceName();
        exposedServiceV4Response.knoxService = service.getKnoxService();
        exposedServiceV4Response.knoxUrl = service.getKnoxUrl();
        exposedServiceV4ResponseList.add(exposedServiceV4Response);
    }
    return exposedServiceV4ResponseList;
}
Also used : ExposedService(com.sequenceiq.cloudbreak.api.service.ExposedService) ArrayList(java.util.ArrayList)

Example 24 with ExposedService

use of com.sequenceiq.cloudbreak.api.service.ExposedService in project cloudbreak by hortonworks.

the class GrainPropertiesService method addNameNodeRoleForHosts.

private GrainProperties addNameNodeRoleForHosts(Cluster cluster, Set<Node> nodes) {
    GrainProperties grainProperties = new GrainProperties();
    ExposedService nameNodeService = exposedServiceCollector.getNameNodeService();
    Map<String, List<String>> nameNodeServiceLocations = filteredLocations(cluster, nameNodeService.getServiceName(), nodes);
    nameNodeServiceLocations.getOrDefault(nameNodeService.getServiceName(), List.of()).forEach(nmn -> grainProperties.computeIfAbsent(nmn, s -> new HashMap<>()).put(ROLES, "namenode"));
    return grainProperties.getProperties().isEmpty() ? null : grainProperties;
}
Also used : ExposedService(com.sequenceiq.cloudbreak.api.service.ExposedService) GrainProperties(com.sequenceiq.cloudbreak.orchestrator.model.GrainProperties) ArrayList(java.util.ArrayList) List(java.util.List)

Aggregations

ExposedService (com.sequenceiq.cloudbreak.api.service.ExposedService)24 Gateway (com.sequenceiq.cloudbreak.domain.stack.cluster.gateway.Gateway)10 ArrayList (java.util.ArrayList)8 GatewayTopology (com.sequenceiq.cloudbreak.domain.stack.cluster.gateway.GatewayTopology)6 List (java.util.List)6 Blueprint (com.sequenceiq.cloudbreak.domain.Blueprint)5 ClusterExposedServiceV4Response (com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.response.cluster.gateway.topology.ClusterExposedServiceV4Response)4 Cluster (com.sequenceiq.cloudbreak.domain.stack.cluster.Cluster)4 ExposedServices (com.sequenceiq.cloudbreak.domain.stack.cluster.gateway.ExposedServices)4 IOException (java.io.IOException)4 GatewayType (com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.base.GatewayType)3 GatewayTopologyV4Request (com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.request.cluster.gateway.topology.GatewayTopologyV4Request)3 ExposedServiceV4Response (com.sequenceiq.cloudbreak.api.endpoint.v4.util.responses.ExposedServiceV4Response)3 ExposedServiceCollector (com.sequenceiq.cloudbreak.api.service.ExposedServiceCollector)3 EntitlementService (com.sequenceiq.cloudbreak.auth.altus.EntitlementService)3 CmTemplateProcessor (com.sequenceiq.cloudbreak.cmtemplate.CmTemplateProcessor)3 CmTemplateProcessorFactory (com.sequenceiq.cloudbreak.cmtemplate.CmTemplateProcessorFactory)3 Json (com.sequenceiq.cloudbreak.common.json.Json)3 Stack (com.sequenceiq.cloudbreak.domain.stack.Stack)3 BlueprintService (com.sequenceiq.cloudbreak.service.blueprint.BlueprintService)3