Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added <summary> to GetCARoots, added GetCARoots with QueryOptions parameter #338

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion Consul/Agent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1164,9 +1164,25 @@ public async Task<QueryResult<ServiceConfiguration>> GetServiceConfiguration(str
return await _client.Get<ServiceConfiguration>($"/v1/agent/service/{serviceId}", q).Execute(ct).ConfigureAwait(false);
}

/// <summary>
/// GetCARoots returns root certificates in the cluster
/// </summary>
/// <param name="ct">Cancellation Token</param>
/// <returns>Root certificates</returns>
public async Task<QueryResult<CARoots>> GetCARoots(CancellationToken ct = default)
{
return await _client.Get<CARoots>("v1/agent/connect/ca/roots", QueryOptions.Default).Execute(ct).ConfigureAwait(false);
return await GetCARoots(QueryOptions.Default, ct).ConfigureAwait(false);
}

/// <summary>
/// GetCARoots returns root certificates in the cluster
/// </summary>
/// <param name="q">Query Options</param>
/// <param name="ct">Cancellation Token</param>
/// <returns>Root certificates</returns>
public async Task<QueryResult<CARoots>> GetCARoots(QueryOptions q, CancellationToken ct = default)
{
return await _client.Get<CARoots>("v1/agent/connect/ca/roots", q).Execute(ct).ConfigureAwait(false);
}

/// <summary>
Expand Down
1 change: 1 addition & 0 deletions Consul/Interfaces/IAgentEndpoint.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ public interface IAgentEndpoint
Task<QueryResult<LocalServiceHealth>> GetLocalServiceHealthByID(string serviceID, CancellationToken ct = default);
Task<QueryResult<Metrics>> GetAgentMetrics(CancellationToken ct = default);
Task<QueryResult<CARoots>> GetCARoots(CancellationToken ct = default);
Task<QueryResult<CARoots>> GetCARoots(QueryOptions q, CancellationToken ct = default);
Task<QueryResult<AgentVersion>> GetAgentVersion(CancellationToken ct = default);
Task<WriteResult> Reload(CancellationToken ct = default);
[Obsolete]
Expand Down