/// <summary> /// // State is used to retrieve all the checks in a given state. The wildcard "any" state can also be used for all checks. /// </summary> /// <param name="status">The health status to filter for</param> /// <param name="q">Customized query options</param> /// <param name="ct">Cancellation token for long poll request. If set, OperationCanceledException will be thrown if the request is cancelled before completing</param> /// <returns>A query result containing a list of health checks in the specified state, or a query result with a null response if no health checks matched the provided state</returns> public Task <QueryResult <HealthCheck[]> > State(CheckStatus status, QueryOptions q, CancellationToken ct = default(CancellationToken)) { return(_client.Get <HealthCheck[]>(string.Format("/v1/health/state/{0}", status.Status), q).Execute(ct)); }
/// <summary> /// State is used to retrieve all the checks in a given state. The wildcard "any" state can also be used for all checks. /// </summary> /// <param name="status">The health status to filter for</param> /// <returns>A query result containing a list of health checks in the specified state, or a query result with a null response if no health checks matched the provided state</returns> public Task <QueryResult <HealthCheck[]> > State(CheckStatus status, CancellationToken ct = default(CancellationToken)) { return(State(status, QueryOptions.Default, ct)); }
/// <summary> /// // State is used to retreive all the checks in a given state. The wildcard "any" state can also be used for all checks. /// </summary> /// <param name="status">The health status to filter for</param> /// <returns>A query result containing a list of health checks in the specified state, or a query result with a null response if no health checks matched the provided state</returns> public QueryResult <HealthCheck[]> State(CheckStatus status, QueryOptions q) { return(State(status, q, CancellationToken.None)); }
/// <summary> /// // State is used to retreive all the checks in a given state. The wildcard "any" state can also be used for all checks. /// </summary> /// <param name="status">The health status to filter for</param> /// <param name="q">Customized query options</param> /// <param name="ct">Cancellation token for long poll request. If set, OperationCanceledException will be thrown if the request is cancelled before completing</param> /// <returns>A query result containing a list of health checks in the specified state, or a query result with a null response if no health checks matched the provided state</returns> public QueryResult <HealthCheck[]> State(CheckStatus status, QueryOptions q, CancellationToken ct) { return(_client.CreateQuery <HealthCheck[]>(string.Format("/v1/health/state/{0}", status.Status), q) .Execute(ct)); }
/// <summary> /// State is used to retrieve all the checks in a given state. The wildcard "any" state can also be used for all checks. /// </summary> /// <param name="status">The health status to filter for</param> /// <returns>A query result containing a list of health checks in the specified state, or a query result with a null response if no health checks matched the provided state</returns> public Task <QueryResult <HealthCheck[]> > State(CheckStatus status) { return(State(status, QueryOptions.Default, CancellationToken.None)); }