use of com.microsoft.azure.management.compute.implementation.AvailabilitySetInner in project photon-model by vmware.
the class AzureInstanceService method getAvailabilitySets.
private DeferredResult<AzureInstanceContext> getAvailabilitySets(AzureInstanceContext ctx) {
String msg = "Getting availability sets. ResourceGroup [" + ctx.resourceGroupName + "]";
ComputeManagementClientImpl computeManager = getComputeManagementClientImpl(ctx);
AzureDeferredResultServiceCallbackWithRetry<List<AvailabilitySetInner>> getAvailabilitySetsCallback = new AzureDeferredResultServiceCallbackWithRetry<List<AvailabilitySetInner>>(this, msg) {
@Override
protected DeferredResult<List<AvailabilitySetInner>> consumeSuccess(List<AvailabilitySetInner> result) {
ctx.availabilitySetInners = result;
return DeferredResult.completed(result);
}
@Override
protected Runnable retryServiceCall(ServiceCallback<List<AvailabilitySetInner>> retryCallback) {
return () -> computeManager.availabilitySets().listByResourceGroupAsync(ctx.resourceGroupName, retryCallback);
}
};
computeManager.availabilitySets().listByResourceGroupAsync(ctx.resourceGroupName, getAvailabilitySetsCallback);
return getAvailabilitySetsCallback.toDeferredResult().thenApply(result -> ctx);
}
Aggregations