Search in sources :

Example 1 with ClusterTemplateV4TestDto

use of com.sequenceiq.it.cloudbreak.dto.ClusterTemplateV4TestDto 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 2 with ClusterTemplateV4TestDto

use of com.sequenceiq.it.cloudbreak.dto.ClusterTemplateV4TestDto 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)

Example 3 with ClusterTemplateV4TestDto

use of com.sequenceiq.it.cloudbreak.dto.ClusterTemplateV4TestDto 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 4 with ClusterTemplateV4TestDto

use of com.sequenceiq.it.cloudbreak.dto.ClusterTemplateV4TestDto 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)

Aggregations

CloudbreakClient (com.sequenceiq.it.cloudbreak.CloudbreakClient)4 ClusterTemplateV4TestDto (com.sequenceiq.it.cloudbreak.dto.ClusterTemplateV4TestDto)4