Search in sources :

Example 6 with ImageCatalogV4Response

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

the class ImageCatalogToImageCatalogV4ResponseConverter method convert.

public ImageCatalogV4Response convert(ImageCatalog source) {
    ImageCatalogV4Response imageCatalogResponse = new ImageCatalogV4Response();
    imageCatalogResponse.setUrl(source.getImageCatalogUrl());
    String imageCatalogName = source.getName();
    imageCatalogResponse.setUsedAsDefault(isDefault(imageCatalogName));
    imageCatalogResponse.setName(imageCatalogName);
    imageCatalogResponse.setDescription(source.getDescription());
    imageCatalogResponse.setCreator(source.getCreator());
    imageCatalogResponse.setCreated(source.getCreated());
    imageCatalogResponse.setCrn(source.getResourceCrn());
    return imageCatalogResponse;
}
Also used : ImageCatalogV4Response(com.sequenceiq.cloudbreak.api.endpoint.v4.imagecatalog.responses.ImageCatalogV4Response)

Example 7 with ImageCatalogV4Response

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

the class ImageCatalogService method getResourceCrnByResourceName.

@Override
public String getResourceCrnByResourceName(String resourceName) {
    String initiatorUserCrn = ThreadBasedUserCrnProvider.getUserCrn();
    ImageCatalogV4Endpoint imageCatalogV4Endpoint = cloudbreakInternalCrnClient.withInternalCrn().imageCatalogV4Endpoint();
    ImageCatalogV4Response response = imageCatalogV4Endpoint.getByNameInternal(SdxService.WORKSPACE_ID_DEFAULT, resourceName, false, initiatorUserCrn);
    return response.getCrn();
}
Also used : ImageCatalogV4Endpoint(com.sequenceiq.cloudbreak.api.endpoint.v4.imagecatalog.ImageCatalogV4Endpoint) ImageCatalogV4Response(com.sequenceiq.cloudbreak.api.endpoint.v4.imagecatalog.responses.ImageCatalogV4Response)

Aggregations

ImageCatalogV4Response (com.sequenceiq.cloudbreak.api.endpoint.v4.imagecatalog.responses.ImageCatalogV4Response)7 Images (com.sequenceiq.cloudbreak.cloud.model.catalog.Images)3 ImageCatalog (com.sequenceiq.cloudbreak.domain.ImageCatalog)3 CheckPermissionByResourceCrn (com.sequenceiq.authorization.annotation.CheckPermissionByResourceCrn)1 CheckPermissionByResourceName (com.sequenceiq.authorization.annotation.CheckPermissionByResourceName)1 InternalOnly (com.sequenceiq.authorization.annotation.InternalOnly)1 ImageCatalogV4Endpoint (com.sequenceiq.cloudbreak.api.endpoint.v4.imagecatalog.ImageCatalogV4Endpoint)1 ImageCatalogV4Request (com.sequenceiq.cloudbreak.api.endpoint.v4.imagecatalog.requests.ImageCatalogV4Request)1 UpdateImageCatalogV4Request (com.sequenceiq.cloudbreak.api.endpoint.v4.imagecatalog.requests.UpdateImageCatalogV4Request)1 ImageCatalogV4Responses (com.sequenceiq.cloudbreak.api.endpoint.v4.imagecatalog.responses.ImageCatalogV4Responses)1 ImagesV4Response (com.sequenceiq.cloudbreak.api.endpoint.v4.imagecatalog.responses.ImagesV4Response)1 CloudPlatform (com.sequenceiq.cloudbreak.common.mappable.CloudPlatform)1 ImageCatalogGetImagesByNameAction (com.sequenceiq.it.cloudbreak.action.v4.imagecatalog.ImageCatalogGetImagesByNameAction)1 EnvironmentTestClient (com.sequenceiq.it.cloudbreak.client.EnvironmentTestClient)1 ImageCatalogTestClient (com.sequenceiq.it.cloudbreak.client.ImageCatalogTestClient)1 StackTestClient (com.sequenceiq.it.cloudbreak.client.StackTestClient)1 Description (com.sequenceiq.it.cloudbreak.context.Description)1 MockedTestContext (com.sequenceiq.it.cloudbreak.context.MockedTestContext)1 RunningParameter.expectedMessage (com.sequenceiq.it.cloudbreak.context.RunningParameter.expectedMessage)1 RunningParameter.key (com.sequenceiq.it.cloudbreak.context.RunningParameter.key)1