Search in sources :

Example 1 with BlueprintV4ViewResponse

use of com.sequenceiq.cloudbreak.api.endpoint.v4.blueprint.responses.BlueprintV4ViewResponse in project cloudbreak by hortonworks.

the class BlueprintToBlueprintV4ViewResponseConverter method convert.

public BlueprintV4ViewResponse convert(Blueprint source) {
    BlueprintV4ViewResponse blueprintV4ViewResponse = new BlueprintV4ViewResponse();
    blueprintV4ViewResponse.setName(source.getName());
    blueprintV4ViewResponse.setDescription(source.getDescription());
    blueprintV4ViewResponse.setCrn(source.getResourceCrn());
    blueprintV4ViewResponse.setId(source.getId());
    blueprintV4ViewResponse.setStackType(source.getStackType());
    blueprintV4ViewResponse.setStackVersion(source.getStackVersion());
    blueprintV4ViewResponse.setHostGroupCount(source.getHostGroupCount());
    blueprintV4ViewResponse.setStatus(source.getStatus());
    blueprintV4ViewResponse.setTags(source.getTags().getMap());
    blueprintV4ViewResponse.setCreated(source.getCreated());
    return blueprintV4ViewResponse;
}
Also used : BlueprintV4ViewResponse(com.sequenceiq.cloudbreak.api.endpoint.v4.blueprint.responses.BlueprintV4ViewResponse)

Example 2 with BlueprintV4ViewResponse

use of com.sequenceiq.cloudbreak.api.endpoint.v4.blueprint.responses.BlueprintV4ViewResponse in project cloudbreak by hortonworks.

the class BlueprintViewToBlueprintV4ViewResponseConverter method convert.

public BlueprintV4ViewResponse convert(BlueprintView entity) {
    BlueprintV4ViewResponse blueprintV4ViewResponse = new BlueprintV4ViewResponse();
    blueprintV4ViewResponse.setName(entity.getName());
    blueprintV4ViewResponse.setDescription(entity.getDescription());
    blueprintV4ViewResponse.setId(entity.getId());
    blueprintV4ViewResponse.setStackType(entity.getStackType());
    blueprintV4ViewResponse.setStackVersion(entity.getStackVersion());
    blueprintV4ViewResponse.setHostGroupCount(entity.getHostGroupCount());
    blueprintV4ViewResponse.setStatus(entity.getStatus());
    blueprintV4ViewResponse.setTags(entity.getTags().getMap());
    blueprintV4ViewResponse.setCrn(entity.getResourceCrn());
    blueprintV4ViewResponse.setCreated(entity.getCreated());
    blueprintV4ViewResponse.setUpgradeable(getBlueprintBasedUpgradeOption(entity));
    return blueprintV4ViewResponse;
}
Also used : BlueprintV4ViewResponse(com.sequenceiq.cloudbreak.api.endpoint.v4.blueprint.responses.BlueprintV4ViewResponse)

Example 3 with BlueprintV4ViewResponse

use of com.sequenceiq.cloudbreak.api.endpoint.v4.blueprint.responses.BlueprintV4ViewResponse in project cloudbreak by hortonworks.

the class UpgradePreconditionServiceTest method createClusterResponse.

private ClusterViewV4Response createClusterResponse(Status clusterStatus, BlueprintBasedUpgradeOption upgradeable) {
    ClusterViewV4Response dataHubCluster = new ClusterViewV4Response();
    dataHubCluster.setStatus(clusterStatus);
    BlueprintV4ViewResponse blueprint = new BlueprintV4ViewResponse();
    blueprint.setUpgradeable(upgradeable);
    dataHubCluster.setBlueprint(blueprint);
    return dataHubCluster;
}
Also used : BlueprintV4ViewResponse(com.sequenceiq.cloudbreak.api.endpoint.v4.blueprint.responses.BlueprintV4ViewResponse) ClusterViewV4Response(com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.views.ClusterViewV4Response)

Example 4 with BlueprintV4ViewResponse

use of com.sequenceiq.cloudbreak.api.endpoint.v4.blueprint.responses.BlueprintV4ViewResponse in project cloudbreak by hortonworks.

the class BlueprintV4Action method getAll.

public static void getAll(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(" getByName all private blueprints. ");
    Collection<BlueprintV4ViewResponse> blueprints = client.getDefaultClient().blueprintV4Endpoint().list(workspaceId, true).getResponses();
    Set<BlueprintV4Response> detailedBlueprints = blueprints.stream().map(bp -> client.getDefaultClient().blueprintV4Endpoint().getByName(workspaceId, bp.getName())).collect(Collectors.toSet());
    blueprintEntity.setResponses(detailedBlueprints);
}
Also used : Collection(java.util.Collection) BlueprintV4ViewResponse(com.sequenceiq.cloudbreak.api.endpoint.v4.blueprint.responses.BlueprintV4ViewResponse) BlueprintV4Response(com.sequenceiq.cloudbreak.api.endpoint.v4.blueprint.responses.BlueprintV4Response) CloudbreakTest(com.sequenceiq.it.cloudbreak.CloudbreakTest) Log(com.sequenceiq.it.cloudbreak.log.Log) Set(java.util.Set) Entity(com.sequenceiq.it.cloudbreak.Entity) IOException(java.io.IOException) IntegrationTestContext(com.sequenceiq.it.IntegrationTestContext) BlueprintTestDto(com.sequenceiq.it.cloudbreak.dto.blueprint.BlueprintTestDto) CloudbreakClient(com.sequenceiq.it.cloudbreak.CloudbreakClient) Collectors(java.util.stream.Collectors) CloudbreakClient(com.sequenceiq.it.cloudbreak.CloudbreakClient) BlueprintTestDto(com.sequenceiq.it.cloudbreak.dto.blueprint.BlueprintTestDto) BlueprintV4Response(com.sequenceiq.cloudbreak.api.endpoint.v4.blueprint.responses.BlueprintV4Response) BlueprintV4ViewResponse(com.sequenceiq.cloudbreak.api.endpoint.v4.blueprint.responses.BlueprintV4ViewResponse)

Aggregations

BlueprintV4ViewResponse (com.sequenceiq.cloudbreak.api.endpoint.v4.blueprint.responses.BlueprintV4ViewResponse)4 BlueprintV4Response (com.sequenceiq.cloudbreak.api.endpoint.v4.blueprint.responses.BlueprintV4Response)1 ClusterViewV4Response (com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.views.ClusterViewV4Response)1 IntegrationTestContext (com.sequenceiq.it.IntegrationTestContext)1 CloudbreakClient (com.sequenceiq.it.cloudbreak.CloudbreakClient)1 CloudbreakTest (com.sequenceiq.it.cloudbreak.CloudbreakTest)1 Entity (com.sequenceiq.it.cloudbreak.Entity)1 BlueprintTestDto (com.sequenceiq.it.cloudbreak.dto.blueprint.BlueprintTestDto)1 Log (com.sequenceiq.it.cloudbreak.log.Log)1 IOException (java.io.IOException)1 Collection (java.util.Collection)1 Set (java.util.Set)1 Collectors (java.util.stream.Collectors)1