use of com.sequenceiq.cloudbreak.api.model.HardwareInfoResponse in project cloudbreak by hortonworks.
the class StackResponseHardwareInfoProvider method providerEntriesToStackResponse.
@Override
public StackResponse providerEntriesToStackResponse(Stack stack, StackResponse stackResponse) {
Set<HardwareInfoResponse> hardwareInfoResponses = new HashSet<>();
for (InstanceGroup instanceGroup : stack.getInstanceGroups()) {
for (InstanceMetaData instanceMetaData : instanceGroup.getAllInstanceMetaData()) {
HostMetadata hostMetadata = null;
if (stack.getCluster() != null && instanceMetaData.getDiscoveryFQDN() != null) {
hostMetadata = hostMetadataRepository.findHostInClusterByName(stack.getCluster().getId(), instanceMetaData.getDiscoveryFQDN());
}
HardwareInfoResponse hardwareInfoResponse = new HardwareInfoResponse();
hardwareInfoResponse.setInstanceMetaData(conversionService.convert(instanceMetaData, InstanceMetaDataJson.class));
hardwareInfoResponse.setHostMetadata(conversionService.convert(hostMetadata, HostMetadataResponse.class));
hardwareInfoResponses.add(hardwareInfoResponse);
}
}
stackResponse.setHardwareInfos(hardwareInfoResponses);
return stackResponse;
}
Aggregations