use of com.sequenceiq.cloudbreak.api.model.flex.FlexUsageProductJson in project cloudbreak by hortonworks.
the class FlexUsageGenerator method getFlexUsageProductJsons.
private List<FlexUsageProductJson> getFlexUsageProductJsons(Iterable<CloudbreakUsage> usages, Long fromDate) {
List<FlexUsageProductJson> flexUsageProducts = new ArrayList<>();
FlexUsageProductJson flexUsageProductJson = new FlexUsageProductJson();
flexUsageProductJson.setProductId(productId);
List<FlexUsageComponentJson> components = new ArrayList<>();
FlexUsageComponentJson cbdComponent = new FlexUsageComponentJson();
cbdComponent.setComponentId(controllerComponentId);
FlexUsageCbdInstanceJson cbdComponentInstance = getFlexUsageCbdInstance(fromDate);
cbdComponent.setInstances(Collections.singletonList(cbdComponentInstance));
components.add(cbdComponent);
FlexUsageComponentJson hdpComponent = new FlexUsageComponentJson();
hdpComponent.setComponentId(clustersComponentId);
hdpComponent.setInstances(getFlexUsageHdpInstances(usages));
components.add(hdpComponent);
flexUsageProductJson.setComponents(components);
flexUsageProducts.add(flexUsageProductJson);
return flexUsageProducts;
}
Aggregations