/// <summary> /// Resize this pool /// </summary> public async System.Threading.Tasks.Task ResizeAsync(int target, TimeSpan timeout, TVMDeallocationOption deallocationOption) { try { System.Threading.Tasks.Task asyncTask = this.Pool.ResizeAsync(target, timeout, deallocationOption); AsyncOperationTracker.Instance.AddTrackedOperation(new AsyncOperationModel( asyncTask, new PoolOperation(PoolOperation.Resize, this.Pool.Name))); await asyncTask; await this.RefreshAsync(ModelRefreshType.Basic, showTrackedOperation : false); } catch (Exception e) { Messenger.Default.Send <GenericDialogMessage>(new GenericDialogMessage(e.ToString())); } }
private bool IsInputValid(out TVMDeallocationOption? deallocationOption) { deallocationOption = null; if (!string.IsNullOrEmpty(this.DeallocationOptionString)) { TVMDeallocationOption innerDeallocationOption; bool parsedCorrectly = Enum.TryParse(this.DeallocationOptionString, out innerDeallocationOption); if (parsedCorrectly) { deallocationOption = innerDeallocationOption; } else { Messenger.Default.Send(new GenericDialogMessage("Invalid value for Deallocation Option")); return false; } } if (string.IsNullOrEmpty(this.PoolName)) { Messenger.Default.Send(new GenericDialogMessage("Invalid values for Pool Name")); return false; } else if (this.TargetDedicated < 0) { Messenger.Default.Send(new GenericDialogMessage("Invalid value for TargetDedicated")); return false; } return true; }
public async Task ResizePool( string poolName, int targetDedicated, TimeSpan? timeout, TVMDeallocationOption? deallocationOption) { using (IPoolManager poolManager = this.Client.OpenPoolManager()) { await poolManager.ResizePoolAsync(poolName, targetDedicated, timeout, deallocationOption); } }
public async Task ResizePoolAsync(string poolName, int targetDedicated, TimeSpan? timeout, TVMDeallocationOption? deallocationOption) { await this.Service.ResizePool(poolName, targetDedicated, timeout, deallocationOption); }