Search in sources :

Example 1 with BaseStackDetailsV4Response

use of com.sequenceiq.cloudbreak.api.endpoint.v4.imagecatalog.responses.BaseStackDetailsV4Response in project cloudbreak by hortonworks.

the class ImageCatalogServiceTest method getImageResponse.

private ImageV4Response getImageResponse() {
    Map<String, Map<String, String>> imageSetsByProvider = new HashMap<>();
    imageSetsByProvider.put("aws", null);
    BaseStackDetailsV4Response stackDetails = new BaseStackDetailsV4Response();
    stackDetails.setVersion("7.2.7");
    ImageV4Response imageV4Response = new ImageV4Response();
    imageV4Response.setImageSetsByProvider(imageSetsByProvider);
    imageV4Response.setStackDetails(stackDetails);
    return imageV4Response;
}
Also used : HashMap(java.util.HashMap) ImageV4Response(com.sequenceiq.cloudbreak.api.endpoint.v4.imagecatalog.responses.ImageV4Response) HashMap(java.util.HashMap) Map(java.util.Map) BaseStackDetailsV4Response(com.sequenceiq.cloudbreak.api.endpoint.v4.imagecatalog.responses.BaseStackDetailsV4Response)

Example 2 with BaseStackDetailsV4Response

use of com.sequenceiq.cloudbreak.api.endpoint.v4.imagecatalog.responses.BaseStackDetailsV4Response in project cloudbreak by hortonworks.

the class SdxServiceTest method getImageResponse.

private ImageV4Response getImageResponse() {
    Map<String, Map<String, String>> imageSetsByProvider = new HashMap<>();
    imageSetsByProvider.put("aws", null);
    BaseStackDetailsV4Response stackDetails = new BaseStackDetailsV4Response();
    stackDetails.setVersion("7.2.7");
    ImageV4Response imageV4Response = new ImageV4Response();
    imageV4Response.setImageSetsByProvider(imageSetsByProvider);
    imageV4Response.setStackDetails(stackDetails);
    return imageV4Response;
}
Also used : LinkedHashMap(java.util.LinkedHashMap) HashMap(java.util.HashMap) ImageV4Response(com.sequenceiq.cloudbreak.api.endpoint.v4.imagecatalog.responses.ImageV4Response) ArgumentMatchers.anyString(org.mockito.ArgumentMatchers.anyString) Map(java.util.Map) LinkedHashMap(java.util.LinkedHashMap) HashMap(java.util.HashMap) BaseStackDetailsV4Response(com.sequenceiq.cloudbreak.api.endpoint.v4.imagecatalog.responses.BaseStackDetailsV4Response)

Example 3 with BaseStackDetailsV4Response

use of com.sequenceiq.cloudbreak.api.endpoint.v4.imagecatalog.responses.BaseStackDetailsV4Response in project cloudbreak by hortonworks.

the class ImageToImageV4ResponseConverter method convert.

public ImageV4Response convert(Image source) {
    ImageV4Response result = new ImageV4Response();
    result.setDate(source.getDate());
    result.setCreated(source.getCreated());
    result.setPublished(source.getPublished());
    result.setDescription(source.getDescription());
    result.setOs(source.getOs());
    result.setOsType(source.getOsType());
    result.setUuid(source.getUuid());
    result.setVersion(source.getVersion());
    result.setDefaultImage(source.isDefaultImage());
    result.setPackageVersions(source.getPackageVersions());
    result.setRepository(source.getRepo());
    result.setImageSetsByProvider(source.getImageSetsByProvider());
    result.setCmBuildNumber(source.getCmBuildNumber());
    result.setPreWarmCsd(source.getPreWarmCsd());
    result.setPreWarmParcels(source.getPreWarmParcels());
    result.setAdvertised(source.isAdvertised());
    ImageStackDetails stackDetails = source.getStackDetails();
    if (stackDetails != null) {
        BaseStackDetailsV4Response stackDetailsResponse = new BaseStackDetailsV4Response();
        stackDetailsResponse.setStackBuildNumber(stackDetails.getStackBuildNumber());
        stackDetailsResponse.setVersion(stackDetails.getVersion());
        result.setStackDetails(stackDetailsResponse);
    }
    result.setBaseParcelUrl(source.getBaseParcelUrl());
    result.setSourceImageId(source.getSourceImageId());
    return result;
}
Also used : ImageStackDetails(com.sequenceiq.cloudbreak.cloud.model.catalog.ImageStackDetails) ImageV4Response(com.sequenceiq.cloudbreak.api.endpoint.v4.imagecatalog.responses.ImageV4Response) BaseStackDetailsV4Response(com.sequenceiq.cloudbreak.api.endpoint.v4.imagecatalog.responses.BaseStackDetailsV4Response)

Aggregations

BaseStackDetailsV4Response (com.sequenceiq.cloudbreak.api.endpoint.v4.imagecatalog.responses.BaseStackDetailsV4Response)3 ImageV4Response (com.sequenceiq.cloudbreak.api.endpoint.v4.imagecatalog.responses.ImageV4Response)3 HashMap (java.util.HashMap)2 Map (java.util.Map)2 ImageStackDetails (com.sequenceiq.cloudbreak.cloud.model.catalog.ImageStackDetails)1 LinkedHashMap (java.util.LinkedHashMap)1 ArgumentMatchers.anyString (org.mockito.ArgumentMatchers.anyString)1