Search in sources :

Example 1 with RedbeamsClient

use of com.sequenceiq.it.cloudbreak.RedbeamsClient in project cloudbreak by hortonworks.

the class TestContext method as.

public TestContext as(CloudbreakUser cloudbreakUser) {
    checkShutdown();
    LOGGER.info(" Acting user as: \ndisplay name: {} \naccess key: {} \nsecret key: {} \ncrn: {} \nadmin: {} ", cloudbreakUser.getDisplayName(), cloudbreakUser.getAccessKey(), cloudbreakUser.getSecretKey(), cloudbreakUser.getCrn(), cloudbreakUser.getAdmin());
    Log.as(LOGGER, cloudbreakUser.toString());
    setActingUser(cloudbreakUser);
    if (clients.get(cloudbreakUser.getAccessKey()) == null) {
        CloudbreakClient cloudbreakClient = CloudbreakClient.createProxyCloudbreakClient(testParameter, cloudbreakUser, regionAwareInternalCrnGeneratorFactory.iam());
        FreeIpaClient freeIpaClient = FreeIpaClient.createProxyFreeIpaClient(testParameter, cloudbreakUser, regionAwareInternalCrnGeneratorFactory.iam());
        EnvironmentClient environmentClient = EnvironmentClient.createProxyEnvironmentClient(testParameter, cloudbreakUser, regionAwareInternalCrnGeneratorFactory.iam());
        SdxClient sdxClient = SdxClient.createProxySdxClient(testParameter, cloudbreakUser);
        UmsClient umsClient = UmsClient.createProxyUmsClient(tracer, umsHost);
        SdxSaasItClient sdxSaasItClient = SdxSaasItClient.createProxySdxSaasClient(tracer, umsHost, regionAwareInternalCrnGeneratorFactory);
        RedbeamsClient redbeamsClient = RedbeamsClient.createProxyRedbeamsClient(testParameter, cloudbreakUser);
        Map<Class<? extends MicroserviceClient>, MicroserviceClient> clientMap = Map.of(CloudbreakClient.class, cloudbreakClient, FreeIpaClient.class, freeIpaClient, EnvironmentClient.class, environmentClient, SdxClient.class, sdxClient, RedbeamsClient.class, redbeamsClient, UmsClient.class, umsClient, SdxSaasItClient.class, sdxSaasItClient);
        clients.put(cloudbreakUser.getAccessKey(), clientMap);
        cloudbreakClient.setWorkspaceId(0L);
    }
    return this;
}
Also used : MicroserviceClient(com.sequenceiq.it.cloudbreak.MicroserviceClient) CloudbreakClient(com.sequenceiq.it.cloudbreak.CloudbreakClient) FreeIpaClient(com.sequenceiq.it.cloudbreak.FreeIpaClient) RedbeamsClient(com.sequenceiq.it.cloudbreak.RedbeamsClient) EnvironmentClient(com.sequenceiq.it.cloudbreak.EnvironmentClient) SdxClient(com.sequenceiq.it.cloudbreak.SdxClient) UmsClient(com.sequenceiq.it.cloudbreak.UmsClient) SdxSaasItClient(com.sequenceiq.it.cloudbreak.SdxSaasItClient)

Example 2 with RedbeamsClient

use of com.sequenceiq.it.cloudbreak.RedbeamsClient in project cloudbreak by hortonworks.

the class TestContext method initMicroserviceClientsForUMSAccountAdmin.

private void initMicroserviceClientsForUMSAccountAdmin(CloudbreakUser accountAdmin) {
    if (clients.get(accountAdmin.getAccessKey()) == null) {
        CloudbreakClient cloudbreakClient = CloudbreakClient.createProxyCloudbreakClient(testParameter, accountAdmin, regionAwareInternalCrnGeneratorFactory.iam());
        FreeIpaClient freeIpaClient = FreeIpaClient.createProxyFreeIpaClient(testParameter, accountAdmin, regionAwareInternalCrnGeneratorFactory.iam());
        EnvironmentClient environmentClient = EnvironmentClient.createProxyEnvironmentClient(testParameter, accountAdmin, regionAwareInternalCrnGeneratorFactory.iam());
        SdxClient sdxClient = SdxClient.createProxySdxClient(testParameter, accountAdmin);
        UmsClient umsClient = UmsClient.createProxyUmsClient(tracer, umsHost);
        SdxSaasItClient sdxSaasItClient = SdxSaasItClient.createProxySdxSaasClient(tracer, umsHost, regionAwareInternalCrnGeneratorFactory);
        RedbeamsClient redbeamsClient = RedbeamsClient.createProxyRedbeamsClient(testParameter, accountAdmin);
        Map<Class<? extends MicroserviceClient>, MicroserviceClient> clientMap = Map.of(CloudbreakClient.class, cloudbreakClient, FreeIpaClient.class, freeIpaClient, EnvironmentClient.class, environmentClient, SdxClient.class, sdxClient, RedbeamsClient.class, redbeamsClient, UmsClient.class, umsClient, SdxSaasItClient.class, sdxSaasItClient);
        clients.put(accountAdmin.getAccessKey(), clientMap);
    }
    LOGGER.info(" Microservice clients have been initialized successfully for UMS account admin:: \nDisplay name: {} \nAccess key: {} \nSecret key: {} " + "\nCrn: {} ", accountAdmin.getDisplayName(), accountAdmin.getAccessKey(), accountAdmin.getSecretKey(), accountAdmin.getCrn());
}
Also used : MicroserviceClient(com.sequenceiq.it.cloudbreak.MicroserviceClient) CloudbreakClient(com.sequenceiq.it.cloudbreak.CloudbreakClient) FreeIpaClient(com.sequenceiq.it.cloudbreak.FreeIpaClient) RedbeamsClient(com.sequenceiq.it.cloudbreak.RedbeamsClient) EnvironmentClient(com.sequenceiq.it.cloudbreak.EnvironmentClient) SdxClient(com.sequenceiq.it.cloudbreak.SdxClient) UmsClient(com.sequenceiq.it.cloudbreak.UmsClient) SdxSaasItClient(com.sequenceiq.it.cloudbreak.SdxSaasItClient)

Aggregations

CloudbreakClient (com.sequenceiq.it.cloudbreak.CloudbreakClient)2 EnvironmentClient (com.sequenceiq.it.cloudbreak.EnvironmentClient)2 FreeIpaClient (com.sequenceiq.it.cloudbreak.FreeIpaClient)2 MicroserviceClient (com.sequenceiq.it.cloudbreak.MicroserviceClient)2 RedbeamsClient (com.sequenceiq.it.cloudbreak.RedbeamsClient)2 SdxClient (com.sequenceiq.it.cloudbreak.SdxClient)2 SdxSaasItClient (com.sequenceiq.it.cloudbreak.SdxSaasItClient)2 UmsClient (com.sequenceiq.it.cloudbreak.UmsClient)2