Search in sources :

Example 1 with FlexUsageProductJson

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;
}
Also used : FlexUsageComponentJson(com.sequenceiq.cloudbreak.api.model.flex.FlexUsageComponentJson) ArrayList(java.util.ArrayList) FlexUsageCbdInstanceJson(com.sequenceiq.cloudbreak.api.model.flex.FlexUsageCbdInstanceJson) FlexUsageProductJson(com.sequenceiq.cloudbreak.api.model.flex.FlexUsageProductJson)

Aggregations

FlexUsageCbdInstanceJson (com.sequenceiq.cloudbreak.api.model.flex.FlexUsageCbdInstanceJson)1 FlexUsageComponentJson (com.sequenceiq.cloudbreak.api.model.flex.FlexUsageComponentJson)1 FlexUsageProductJson (com.sequenceiq.cloudbreak.api.model.flex.FlexUsageProductJson)1 ArrayList (java.util.ArrayList)1