Search in sources :

Example 1 with FlexUsageControllerJson

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;
}
Also used : FlexUsageControllerJson(com.sequenceiq.cloudbreak.api.model.flex.FlexUsageControllerJson) SmartSenseSubscription(com.sequenceiq.cloudbreak.domain.SmartSenseSubscription)

Aggregations

FlexUsageControllerJson (com.sequenceiq.cloudbreak.api.model.flex.FlexUsageControllerJson)1 SmartSenseSubscription (com.sequenceiq.cloudbreak.domain.SmartSenseSubscription)1