/// <summary> /// Waits for an operation on the cluster to complete. /// </summary> /// <param name="client"> /// The client instance this is extending. /// </param> /// <param name="dnsName"> /// The dnsName of the cluster. /// </param> /// <param name="location"> /// The location of the cluster. /// </param> /// <param name="operation"> /// The operation Id to check. /// </param> /// <param name="timeout"> /// The amount of time to wait for the condition to be satisfied. /// </param> /// <param name="cancellationToken"> /// A Cancelation Token that can be used to cancel the request. /// </param> /// <returns> /// An awaitable task. /// </returns> public static async Task WaitForOperationCompleteOrError(this IHDInsightManagementPocoClient client, string dnsName, string location, Guid operation, TimeSpan timeout, CancellationToken cancellationToken) { await client.WaitForCondition(() => client.GetStatus(dnsName, location, operation), s => s.State == UserChangeRequestOperationStatus.Pending?PollResult.Continue : PollResult.Stop, null, TimeSpan.FromMilliseconds(500), timeout, cancellationToken); }
public Task <UserChangeRequestStatus> GetStatus(string dnsName, string location, Guid operationId) { return(underlying.GetStatus(dnsName, location, operationId)); }