Search in sources :

Example 1 with CloudbreakClient

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

the class StackTestDto method deleteForCleanup.

@Override
public void deleteForCleanup() {
    try {
        CloudbreakClient client = getClientForCleanup();
        client.getDefaultClient().stackV4Endpoint().delete(0L, getName(), true, Crn.fromString(getCrn()).getAccountId());
        awaitWithClient(STACK_DELETED, client);
    } catch (NotFoundException nfe) {
        LOGGER.info("resource not found, thus cleanup not needed.");
    }
}
Also used : CloudbreakClient(com.sequenceiq.it.cloudbreak.CloudbreakClient) NotFoundException(javax.ws.rs.NotFoundException)

Example 2 with CloudbreakClient

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

the class BlueprintV4Action method post.

public static void post(IntegrationTestContext integrationTestContext, Entity entity) {
    BlueprintTestDto blueprintEntity = (BlueprintTestDto) entity;
    CloudbreakClient client;
    client = integrationTestContext.getContextParam(CloudbreakClient.CLOUDBREAK_CLIENT, CloudbreakClient.class);
    Long workspaceId = integrationTestContext.getContextParam(CloudbreakTest.WORKSPACE_ID, Long.class);
    Log.log(" post ".concat(blueprintEntity.getName()).concat(" private blueprint. "));
    blueprintEntity.setResponse(client.getDefaultClient().blueprintV4Endpoint().post(workspaceId, blueprintEntity.getRequest()));
    integrationTestContext.putCleanUpParam(blueprintEntity.getName(), blueprintEntity.getResponse().getCrn());
}
Also used : CloudbreakClient(com.sequenceiq.it.cloudbreak.CloudbreakClient) BlueprintTestDto(com.sequenceiq.it.cloudbreak.dto.blueprint.BlueprintTestDto)

Example 3 with CloudbreakClient

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

the class BlueprintV4Action method get.

public static void get(IntegrationTestContext integrationTestContext, Entity entity) throws IOException {
    BlueprintTestDto blueprintEntity = (BlueprintTestDto) entity;
    CloudbreakClient client;
    client = integrationTestContext.getContextParam(CloudbreakClient.CLOUDBREAK_CLIENT, CloudbreakClient.class);
    Long workspaceId = integrationTestContext.getContextParam(CloudbreakTest.WORKSPACE_ID, Long.class);
    Log.log(" getByName ".concat(blueprintEntity.getName()).concat(" private blueprint by Name. "));
    blueprintEntity.setResponse(client.getDefaultClient().blueprintV4Endpoint().getByName(workspaceId, blueprintEntity.getName()));
    Log.whenJson(" getByName ".concat(blueprintEntity.getName()).concat(" blueprint response: "), blueprintEntity.getResponse());
}
Also used : CloudbreakClient(com.sequenceiq.it.cloudbreak.CloudbreakClient) BlueprintTestDto(com.sequenceiq.it.cloudbreak.dto.blueprint.BlueprintTestDto)

Example 4 with CloudbreakClient

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

the class ClusterTemplateV4Action method getAll.

public static void getAll(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(" get all cluster templates. ");
    clusterTemplateV4Entity.setResponses(ClusterTemplateUtil.getResponseFromViews(client.getDefaultClient().clusterTemplateV4EndPoint().list(workspaceId).getResponses()));
}
Also used : CloudbreakClient(com.sequenceiq.it.cloudbreak.CloudbreakClient) ClusterTemplateV4TestDto(com.sequenceiq.it.cloudbreak.dto.ClusterTemplateV4TestDto)

Example 5 with CloudbreakClient

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

the class ClusterTemplateV4Action method delete.

public static void delete(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(" delete %s cluster template with Name. ", clusterTemplateV4Entity.getName()));
    client.getDefaultClient().clusterTemplateV4EndPoint().deleteByName(workspaceId, clusterTemplateV4Entity.getName());
}
Also used : CloudbreakClient(com.sequenceiq.it.cloudbreak.CloudbreakClient) ClusterTemplateV4TestDto(com.sequenceiq.it.cloudbreak.dto.ClusterTemplateV4TestDto)

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