Search in sources :

Example 11 with CloudbreakClient

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() });
}
Also used : CloudbreakClient(com.sequenceiq.it.cloudbreak.CloudbreakClient) ClusterTemplateV4TestDto(com.sequenceiq.it.cloudbreak.dto.ClusterTemplateV4TestDto)

Example 12 with CloudbreakClient

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());
}
Also used : CloudbreakClient(com.sequenceiq.it.cloudbreak.CloudbreakClient) ClusterTemplateV4TestDto(com.sequenceiq.it.cloudbreak.dto.ClusterTemplateV4TestDto)

Example 13 with CloudbreakClient

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());
}
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)13 ClusterTemplateV4TestDto (com.sequenceiq.it.cloudbreak.dto.ClusterTemplateV4TestDto)4 BlueprintTestDto (com.sequenceiq.it.cloudbreak.dto.blueprint.BlueprintTestDto)4 NotFoundException (javax.ws.rs.NotFoundException)3 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 BlueprintV4Response (com.sequenceiq.cloudbreak.api.endpoint.v4.blueprint.responses.BlueprintV4Response)1 BlueprintV4ViewResponse (com.sequenceiq.cloudbreak.api.endpoint.v4.blueprint.responses.BlueprintV4ViewResponse)1 ClusterTemplateV4Type (com.sequenceiq.cloudbreak.api.endpoint.v4.clustertemplate.ClusterTemplateV4Type)1 ResourceStatus (com.sequenceiq.cloudbreak.api.endpoint.v4.common.ResourceStatus)1 EnvironmentStatus (com.sequenceiq.environment.api.v1.environment.model.response.EnvironmentStatus)1 IntegrationTestContext (com.sequenceiq.it.IntegrationTestContext)1 CloudbreakTest (com.sequenceiq.it.cloudbreak.CloudbreakTest)1 Entity (com.sequenceiq.it.cloudbreak.Entity)1 ClusterTemplateAuditGrpcServiceAssertion (com.sequenceiq.it.cloudbreak.assertion.audit.ClusterTemplateAuditGrpcServiceAssertion)1