Search in sources :

Example 6 with TagsV4Request

use of com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.request.tags.TagsV4Request in project cloudbreak by hortonworks.

the class StackToStackV4RequestConverter method prepareTags.

private void prepareTags(Stack source, StackV4Request stackV2Request) {
    try {
        if (source.getTags() != null && source.getTags().getValue() != null) {
            StackTags stackTags = source.getTags().get(StackTags.class);
            if (stackTags.getUserDefinedTags() != null) {
                TagsV4Request tags = new TagsV4Request();
                tags.setApplication(null);
                tags.setDefaults(null);
                tags.setUserDefined(stackTags.getUserDefinedTags());
                stackV2Request.setTags(tags);
            }
        }
    } catch (IOException e) {
        stackV2Request.setTags(null);
    }
}
Also used : StackTags(com.sequenceiq.cloudbreak.cloud.model.StackTags) TagsV4Request(com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.request.tags.TagsV4Request) IOException(java.io.IOException)

Aggregations

TagsV4Request (com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.request.tags.TagsV4Request)6 IOException (java.io.IOException)3 StackV4Request (com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.request.StackV4Request)2 StackTags (com.sequenceiq.cloudbreak.cloud.model.StackTags)2 BadRequestException (com.sequenceiq.cloudbreak.common.exception.BadRequestException)2 HashMap (java.util.HashMap)2 DatabaseRequest (com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.request.database.DatabaseRequest)1 Json (com.sequenceiq.cloudbreak.common.json.Json)1 CDPTagMergeRequest (com.sequenceiq.cloudbreak.tag.request.CDPTagMergeRequest)1 DistroXV1Request (com.sequenceiq.distrox.api.v1.distrox.model.DistroXV1Request)1 DistroXDatabaseRequest (com.sequenceiq.distrox.api.v1.distrox.model.database.DistroXDatabaseRequest)1 Test (org.junit.jupiter.api.Test)1 ParameterizedTest (org.junit.jupiter.params.ParameterizedTest)1