use of com.sequenceiq.cloudbreak.api.model.flex.FlexUsageControllerJson in project cloudbreak by hortonworks.
the class FlexUsageGenerator method getFlexUsageControllerJson.
private FlexUsageControllerJson getFlexUsageControllerJson(List<CloudbreakUsage> usages, Optional<CloudbreakUsage> aUsage) {
Optional<SmartSenseSubscription> smartSenseSubscriptionOptional = smartSenseSubscriptionService.getDefault();
FlexUsageControllerJson controllerJson = new FlexUsageControllerJson();
String parentUuid = cloudbreakNodeConfig.getInstanceUUID();
controllerJson.setGuid(parentUuid);
controllerJson.setInstanceId(parentUuid);
controllerJson.setProvider(cbInstanceProvider);
controllerJson.setRegion(cbInstanceRegion);
aUsage.ifPresent(cloudbreakUsage -> controllerJson.setUserName(getUserEmail(cloudbreakUsage)));
smartSenseSubscriptionOptional.ifPresent(smartSenseSubscription -> controllerJson.setSmartSenseId(smartSenseSubscription.getSubscriptionId()));
return controllerJson;
}
Aggregations