use of com.vmware.photon.controller.model.adapters.awsadapter.enumeration.AWSLoadBalancerEnumerationAdapterService.AWSLoadBalancerEnumerationRequest in project photon-model by vmware.
the class AWSEnumerationAndCreationAdapterService method refreshLoadBalancerInformation.
private void refreshLoadBalancerInformation(EnumerationCreationContext aws, AWSEnumerationRefreshSubStage next) {
AWSLoadBalancerEnumerationRequest awsLoadBalancerEnumerationRequest = new AWSLoadBalancerEnumerationRequest();
awsLoadBalancerEnumerationRequest.computeRequest = aws.request;
awsLoadBalancerEnumerationRequest.enumeratedNetworks = aws.enumeratedNetworks;
awsLoadBalancerEnumerationRequest.enumeratedSecurityGroups = aws.enumeratedSecurityGroups;
Operation patchLoadBalancerOperation = Operation.createPatch(this, AWSLoadBalancerEnumerationAdapterService.SELF_LINK).setBody(awsLoadBalancerEnumerationRequest).setReferer(UriUtils.buildUri(getHost().getPublicUri(), getSelfLink()));
this.getHost().sendWithDeferredResult(patchLoadBalancerOperation).thenAccept(ignore -> {
logFine(() -> "Successfully enumerated load balancer states");
aws.refreshSubStage = next;
processRefreshSubStages(aws);
}).exceptionally(throwable -> {
logWarning("Failed to enumerate load balancer states: %s ", throwable.getLocalizedMessage());
aws.error = throwable;
aws.refreshSubStage = next;
processRefreshSubStages(aws);
return null;
});
}
Aggregations