Exemple #1
0
 /// <summary>
 /// Waits for the cluster to not exist (null) or go into an error state or be in one of the listed states.
 /// </summary>
 /// <param name="client">
 /// The client instance this is extending.
 /// </param>
 /// <param name="notifyHandler">
 /// A notification handler used to notify when the state changes.
 /// </param>
 /// <param name="dnsName">
 /// The dnsName of the cluster.
 /// </param>
 /// <param name="location">
 /// The location of the cluster.
 /// </param>
 /// <param name="timeout">
 /// The amount of time to wait for the condition to be satisfied.
 /// </param>
 /// <param name="interval">
 /// A time frame to wait between polls.
 /// </param>
 /// <param name="context">
 /// A Cancelation Token that can be used to cancel the request.
 /// </param>
 /// <param name="states">
 /// The set of states that would cause this funciton to terminate.
 /// </param>
 /// <returns>
 /// An awaitable task.
 /// </returns>
 public static async Task WaitForClusterInConditionOrError(this IHDInsightManagementPocoClient client, Action <ClusterDetails> notifyHandler, string dnsName, string location, TimeSpan timeout, TimeSpan interval, IAbstractionContext context, params ClusterState[] states)
 {
     await client.WaitForCondition(() => client.ListContainer(dnsName, location), c => client.PollSignal(c, states), notifyHandler, interval, timeout, context.CancellationToken);
 }