use of com.sequenceiq.it.cloudbreak.CloudbreakClient in project cloudbreak by hortonworks.
the class ClusterTemplateV4Action method get.
public static void get(IntegrationTestContext integrationTestContext, Entity entity) throws IOException {
ClusterTemplateV4TestDto clusterTemplateV4Entity = (ClusterTemplateV4TestDto) entity;
CloudbreakClient client;
client = integrationTestContext.getContextParam(CloudbreakClient.CLOUDBREAK_CLIENT, CloudbreakClient.class);
Long workspaceId = integrationTestContext.getContextParam(CloudbreakTest.WORKSPACE_ID, Long.class);
Log.log(String.format(" get %s cluster template by Name. ", clusterTemplateV4Entity.getName()));
clusterTemplateV4Entity.setResponse(client.getDefaultClient().clusterTemplateV4EndPoint().getByName(workspaceId, clusterTemplateV4Entity.getName()));
Log.whenJson(String.format(" get %s cluster template response: ", clusterTemplateV4Entity.getName()), new Object[] { clusterTemplateV4Entity.getResponse() });
}
use of com.sequenceiq.it.cloudbreak.CloudbreakClient in project cloudbreak by hortonworks.
the class ClusterTemplateV4Action method post.
public static void post(IntegrationTestContext integrationTestContext, Entity entity) {
ClusterTemplateV4TestDto clusterTemplateV4Entity = (ClusterTemplateV4TestDto) entity;
CloudbreakClient client;
client = integrationTestContext.getContextParam(CloudbreakClient.CLOUDBREAK_CLIENT, CloudbreakClient.class);
Long workspaceId = integrationTestContext.getContextParam(CloudbreakTest.WORKSPACE_ID, Long.class);
Log.log(String.format(" post %s cluster template. ", clusterTemplateV4Entity.getName()));
clusterTemplateV4Entity.setResponse(client.getDefaultClient().clusterTemplateV4EndPoint().post(workspaceId, clusterTemplateV4Entity.getRequest()));
integrationTestContext.putCleanUpParam(clusterTemplateV4Entity.getName(), clusterTemplateV4Entity.getResponse().getId());
}
use of com.sequenceiq.it.cloudbreak.CloudbreakClient 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());
}
Aggregations