Search in sources :

Example 1 with HostGroupV4Request

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

the class ClusterCommonService method recreateCluster.

private FlowIdentifier recreateCluster(Stack stack, UpdateClusterV4Request updateCluster) throws TransactionExecutionException {
    Set<HostGroup> hostGroups = new HashSet<>();
    for (HostGroupV4Request json : updateCluster.getHostgroups()) {
        HostGroup hostGroup = hostGroupV4RequestToHostGroupConverter.convert(json);
        hostGroup = hostGroupDecorator.decorate(hostGroup, json, stack);
        hostGroups.add(hostGroup);
    }
    return clusterOperationService.recreate(stack, updateCluster.getBlueprintName(), hostGroups, updateCluster.getValidateBlueprint());
}
Also used : HostGroupV4Request(com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.request.HostGroupV4Request) HostGroup(com.sequenceiq.cloudbreak.domain.stack.cluster.host.HostGroup) HashSet(java.util.HashSet)

Example 2 with HostGroupV4Request

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

the class HostGroupV4RequestToHostGroupConverterTest method testConvertWhenHostNameUpperCase.

@Test
public void testConvertWhenHostNameUpperCase() {
    HostGroupV4Request source = new HostGroupV4Request();
    source.setName("MixEdName");
    HostGroup actual = underTest.convert(source);
    assertEquals(actual.getName(), "mixedname");
}
Also used : HostGroupV4Request(com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.request.HostGroupV4Request) HostGroup(com.sequenceiq.cloudbreak.domain.stack.cluster.host.HostGroup) Test(org.junit.jupiter.api.Test)

Aggregations

HostGroupV4Request (com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.request.HostGroupV4Request)2 HostGroup (com.sequenceiq.cloudbreak.domain.stack.cluster.host.HostGroup)2 HashSet (java.util.HashSet)1 Test (org.junit.jupiter.api.Test)1