Search in sources :

Example 6 with ApiClusterTemplateHostTemplate

use of com.cloudera.api.swagger.model.ApiClusterTemplateHostTemplate in project cloudbreak by hortonworks.

the class GeneratedCmTemplateService method prepareApiClusterTemplateHostTemplates.

private List<ApiClusterTemplateHostTemplate> prepareApiClusterTemplateHostTemplates(Map<String, Set<String>> hostServiceMap) {
    List<ApiClusterTemplateHostTemplate> hostTemplates = new ArrayList<>();
    hostServiceMap.forEach((key, roleConfigRefNames) -> {
        ApiClusterTemplateHostTemplate apiClusterTemplateHostTemplate = new ApiClusterTemplateHostTemplate();
        apiClusterTemplateHostTemplate.setRefName(key);
        apiClusterTemplateHostTemplate.setRoleConfigGroupsRefNames(new ArrayList<>());
        apiClusterTemplateHostTemplate.getRoleConfigGroupsRefNames().addAll(roleConfigRefNames);
        hostTemplates.add(apiClusterTemplateHostTemplate);
    });
    return hostTemplates;
}
Also used : ArrayList(java.util.ArrayList) ApiClusterTemplateHostTemplate(com.cloudera.api.swagger.model.ApiClusterTemplateHostTemplate)

Aggregations

ApiClusterTemplateHostTemplate (com.cloudera.api.swagger.model.ApiClusterTemplateHostTemplate)6 ServiceComponent (com.sequenceiq.cloudbreak.template.model.ServiceComponent)3 ArrayList (java.util.ArrayList)3 HashMap (java.util.HashMap)3 List (java.util.List)3 Map (java.util.Map)3 ApiClusterTemplateConfig (com.cloudera.api.swagger.model.ApiClusterTemplateConfig)2 ApiClusterTemplateRoleConfigGroup (com.cloudera.api.swagger.model.ApiClusterTemplateRoleConfigGroup)2 ApiClusterTemplateService (com.cloudera.api.swagger.model.ApiClusterTemplateService)2 VisibleForTesting (com.google.common.annotations.VisibleForTesting)2 HostgroupView (com.sequenceiq.cloudbreak.template.views.HostgroupView)2 Optional (java.util.Optional)2 Set (java.util.Set)2 Collectors.toMap (java.util.stream.Collectors.toMap)2 ApiClusterTemplate (com.cloudera.api.swagger.model.ApiClusterTemplate)1 ApiClusterTemplateInstantiator (com.cloudera.api.swagger.model.ApiClusterTemplateInstantiator)1 ApiClusterTemplateRoleConfigGroupInfo (com.cloudera.api.swagger.model.ApiClusterTemplateRoleConfigGroupInfo)1 InstanceMetadataType (com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.base.InstanceMetadataType)1 InstanceStatus (com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.base.InstanceStatus)1 StackV4Response (com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.response.StackV4Response)1