Search in sources :

Example 21 with ServiceModel

use of org.apache.knox.gateway.topology.discovery.cm.ServiceModel in project knox by apache.

the class HiveOnTezServiceModelGenerator method generateService.

@Override
public ServiceModel generateService(ApiService service, ApiServiceConfig serviceConfig, ApiRole role, ApiConfigList roleConfig) throws ApiException {
    ServiceModel model = super.generateService(service, serviceConfig, role, roleConfig);
    model.addRoleProperty(getRoleType(), HIVEONTEZ_HTTP_PORT, getRoleConfigValue(roleConfig, HIVEONTEZ_HTTP_PORT));
    model.addRoleProperty(getRoleType(), HIVEONTEZ_TRANSPORT_MODE, getRoleConfigValue(roleConfig, HIVEONTEZ_TRANSPORT_MODE));
    return model;
}
Also used : ServiceModel(org.apache.knox.gateway.topology.discovery.cm.ServiceModel)

Example 22 with ServiceModel

use of org.apache.knox.gateway.topology.discovery.cm.ServiceModel in project knox by apache.

the class WebHCatServiceModelGenerator method generateService.

@Override
public ServiceModel generateService(ApiService service, ApiServiceConfig serviceConfig, ApiRole role, ApiConfigList roleConfig) throws ApiException {
    String hostname = role.getHostRef().getHostname();
    String port = getRoleConfigValue(roleConfig, WEBHCAT_PORT);
    ServiceModel model = createServiceModel(String.format(Locale.getDefault(), "http://%s:%s/templeton", hostname, port));
    model.addRoleProperty(getRoleType(), WEBHCAT_PORT, getRoleConfigValue(roleConfig, WEBHCAT_PORT));
    return model;
}
Also used : ServiceModel(org.apache.knox.gateway.topology.discovery.cm.ServiceModel)

Example 23 with ServiceModel

use of org.apache.knox.gateway.topology.discovery.cm.ServiceModel in project knox by apache.

the class HueServiceModelGenerator method generateService.

@Override
public ServiceModel generateService(ApiService service, ApiServiceConfig serviceConfig, ApiRole role, ApiConfigList roleConfig) {
    String hostname = role.getHostRef().getHostname();
    String scheme;
    String port = getRoleConfigValue(roleConfig, HUE_HTTP_PORT);
    boolean sslEnabled = Boolean.parseBoolean(getRoleConfigValue(roleConfig, SSL_ENABLED));
    if (sslEnabled) {
        scheme = "https";
    } else {
        scheme = "http";
    }
    ServiceModel model = createServiceModel(String.format(Locale.getDefault(), "%s://%s:%s", scheme, hostname, port));
    model.addRoleProperty(getRoleType(), HUE_HTTP_PORT, port);
    model.addRoleProperty(getRoleType(), SSL_ENABLED, getRoleConfigValue(roleConfig, SSL_ENABLED));
    return model;
}
Also used : ServiceModel(org.apache.knox.gateway.topology.discovery.cm.ServiceModel)

Example 24 with ServiceModel

use of org.apache.knox.gateway.topology.discovery.cm.ServiceModel in project knox by apache.

the class ImpalaUIServiceModelGenerator method generateService.

@Override
public ServiceModel generateService(ApiService service, ApiServiceConfig serviceConfig, ApiRole role, ApiConfigList roleConfig) throws ApiException {
    String hostname = role.getHostRef().getHostname();
    String sslEnabled = getServiceConfigValue(serviceConfig, SSL_ENABLED);
    String scheme = Boolean.parseBoolean(sslEnabled) ? "https" : "http";
    String port = getRoleConfigValue(roleConfig, WEBSERVER_PORT);
    ServiceModel model = createServiceModel(String.format(Locale.getDefault(), "%s://%s:%s/", scheme, hostname, port));
    model.addServiceProperty(SSL_ENABLED, sslEnabled);
    model.addRoleProperty(getRoleType(), WEBSERVER_PORT, port);
    model.addRoleProperty(getRoleType(), ENABLE_WEBSERVER, getRoleConfigValue(roleConfig, ENABLE_WEBSERVER));
    return model;
}
Also used : ServiceModel(org.apache.knox.gateway.topology.discovery.cm.ServiceModel)

Example 25 with ServiceModel

use of org.apache.knox.gateway.topology.discovery.cm.ServiceModel in project knox by apache.

the class LivyServiceModelGenerator method generateService.

@Override
public ServiceModel generateService(ApiService service, ApiServiceConfig serviceConfig, ApiRole role, ApiConfigList roleConfig) {
    String hostname = role.getHostRef().getHostname();
    String scheme;
    String port = getRoleConfigValue(roleConfig, LIVY_SERVER_PORT);
    String sslEnabled = getRoleConfigValue(roleConfig, SSL_ENABLED);
    if (Boolean.parseBoolean(sslEnabled)) {
        scheme = "https";
    } else {
        scheme = "http";
    }
    ServiceModel model = createServiceModel(String.format(Locale.getDefault(), "%s://%s:%s", scheme, hostname, port));
    model.addRoleProperty(getRoleType(), SSL_ENABLED, sslEnabled);
    model.addRoleProperty(getRoleType(), LIVY_SERVER_PORT, port);
    return model;
}
Also used : ServiceModel(org.apache.knox.gateway.topology.discovery.cm.ServiceModel)

Aggregations

ServiceModel (org.apache.knox.gateway.topology.discovery.cm.ServiceModel)35 HashMap (java.util.HashMap)4 AbstractServiceModelGeneratorTest (org.apache.knox.gateway.topology.discovery.cm.model.AbstractServiceModelGeneratorTest)3 Test (org.junit.Test)3 ApiException (com.cloudera.api.swagger.client.ApiException)1 URI (java.net.URI)1 URISyntaxException (java.net.URISyntaxException)1 ArrayList (java.util.ArrayList)1 List (java.util.List)1 Map (java.util.Map)1