use of com.microsoft.azure.management.compute.implementation.OperationStatusResponseInner in project photon-model by vmware.
the class AzureInstanceService method deleteVirtualMachine.
private DeferredResult<AzureInstanceContext> deleteVirtualMachine(AzureInstanceContext ctx) {
String msg = "Deleting virtual machine [" + ctx.vmName + "]";
ComputeManagementClientImpl computeManager = getComputeManagementClientImpl(ctx);
AzureDeferredResultServiceCallback<OperationStatusResponseInner> deleteVirtualMachineCallback = new AzureDeferredResultServiceCallback<OperationStatusResponseInner>(this, msg) {
@Override
protected DeferredResult<OperationStatusResponseInner> consumeSuccess(OperationStatusResponseInner result) {
logInfo("Successfully deleted VM: " + ctx.vmName);
return DeferredResult.completed(result);
}
};
computeManager.virtualMachines().deleteAsync(ctx.resourceGroupName, ctx.vmName, deleteVirtualMachineCallback);
return deleteVirtualMachineCallback.toDeferredResult().thenApply(result -> ctx);
}
Aggregations