Share via


BatchClient.GetCertificatesAsync Method

Definition

Overloads

GetCertificatesAsync(Nullable<Int32>, Nullable<DateTimeOffset>, Nullable<Int32>, String, IEnumerable<String>, CancellationToken)

Lists all of the Certificates that have been added to the specified Account.

GetCertificatesAsync(Nullable<Int32>, Nullable<DateTimeOffset>, Nullable<Int32>, String, IEnumerable<String>, RequestContext)

[Protocol Method] Lists all of the Certificates that have been added to the specified Account.

GetCertificatesAsync(Nullable<Int32>, Nullable<DateTimeOffset>, Nullable<Int32>, String, IEnumerable<String>, CancellationToken)

Source:
BatchClient.cs

Lists all of the Certificates that have been added to the specified Account.

public virtual Azure.AsyncPageable<Azure.Compute.Batch.BatchCertificate> GetCertificatesAsync(int? timeOutInSeconds = default, DateTimeOffset? ocpdate = default, int? maxresults = default, string filter = default, System.Collections.Generic.IEnumerable<string> select = default, System.Threading.CancellationToken cancellationToken = default);
abstract member GetCertificatesAsync : Nullable<int> * Nullable<DateTimeOffset> * Nullable<int> * string * seq<string> * System.Threading.CancellationToken -> Azure.AsyncPageable<Azure.Compute.Batch.BatchCertificate>
override this.GetCertificatesAsync : Nullable<int> * Nullable<DateTimeOffset> * Nullable<int> * string * seq<string> * System.Threading.CancellationToken -> Azure.AsyncPageable<Azure.Compute.Batch.BatchCertificate>
Public Overridable Function GetCertificatesAsync (Optional timeOutInSeconds As Nullable(Of Integer) = Nothing, Optional ocpdate As Nullable(Of DateTimeOffset) = Nothing, Optional maxresults As Nullable(Of Integer) = Nothing, Optional filter As String = Nothing, Optional select As IEnumerable(Of String) = Nothing, Optional cancellationToken As CancellationToken = Nothing) As AsyncPageable(Of BatchCertificate)

Parameters

timeOutInSeconds
Nullable<Int32>

The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used instead.".

ocpdate
Nullable<DateTimeOffset>

The time the request was issued. Client libraries typically set this to the current system clock time; set it explicitly if you are calling the REST API directly.

maxresults
Nullable<Int32>

The maximum number of items to return in the response. A maximum of 1000 applications can be returned.

filter
String

An OData $filter clause. For more information on constructing this filter, see https://docs.microsoft.com/en-us/rest/api/batchservice/odata-filters-in-batch#list-certificates.

select
IEnumerable<String>

An OData $select clause.

cancellationToken
CancellationToken

The cancellation token to use.

Returns

Examples

This sample shows how to call GetCertificatesAsync.

Uri endpoint = new Uri("<endpoint>");
TokenCredential credential = new DefaultAzureCredential();
BatchClient client = new BatchClient(endpoint, credential);

await foreach (BatchCertificate item in client.GetCertificatesAsync())
{
}

Applies to

GetCertificatesAsync(Nullable<Int32>, Nullable<DateTimeOffset>, Nullable<Int32>, String, IEnumerable<String>, RequestContext)

Source:
BatchClient.cs

[Protocol Method] Lists all of the Certificates that have been added to the specified Account.

public virtual Azure.AsyncPageable<BinaryData> GetCertificatesAsync(int? timeOutInSeconds, DateTimeOffset? ocpdate, int? maxresults, string filter, System.Collections.Generic.IEnumerable<string> select, Azure.RequestContext context);
abstract member GetCertificatesAsync : Nullable<int> * Nullable<DateTimeOffset> * Nullable<int> * string * seq<string> * Azure.RequestContext -> Azure.AsyncPageable<BinaryData>
override this.GetCertificatesAsync : Nullable<int> * Nullable<DateTimeOffset> * Nullable<int> * string * seq<string> * Azure.RequestContext -> Azure.AsyncPageable<BinaryData>
Public Overridable Function GetCertificatesAsync (timeOutInSeconds As Nullable(Of Integer), ocpdate As Nullable(Of DateTimeOffset), maxresults As Nullable(Of Integer), filter As String, select As IEnumerable(Of String), context As RequestContext) As AsyncPageable(Of BinaryData)

Parameters

timeOutInSeconds
Nullable<Int32>

The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used instead.".

ocpdate
Nullable<DateTimeOffset>

The time the request was issued. Client libraries typically set this to the current system clock time; set it explicitly if you are calling the REST API directly.

maxresults
Nullable<Int32>

The maximum number of items to return in the response. A maximum of 1000 applications can be returned.

filter
String

An OData $filter clause. For more information on constructing this filter, see https://docs.microsoft.com/en-us/rest/api/batchservice/odata-filters-in-batch#list-certificates.

select
IEnumerable<String>

An OData $select clause.

context
RequestContext

The request context, which can override default behaviors of the client pipeline on a per-call basis.

Returns

The AsyncPageable<T> from the service containing a list of BinaryData objects. Details of the body schema for each item in the collection are in the Remarks section below.

Exceptions

Service returned a non-success status code.

Examples

This sample shows how to call GetCertificatesAsync and parse the result.

Uri endpoint = new Uri("<endpoint>");
TokenCredential credential = new DefaultAzureCredential();
BatchClient client = new BatchClient(endpoint, credential);

await foreach (BinaryData item in client.GetCertificatesAsync(null, DateTimeOffset.Parse("Fri, 17 Feb 2017 00:00:00 GMT"), null, null, null, null))
{
    JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement;
    Console.WriteLine(result.GetProperty("thumbprint").ToString());
    Console.WriteLine(result.GetProperty("thumbprintAlgorithm").ToString());
    Console.WriteLine(result.GetProperty("data").ToString());
}

Applies to