Share via


BatchClient.GetCertificateAsync Method

Definition

Overloads

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

[Protocol Method] Gets information about the specified Certificate.

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

Gets information about the specified Certificate.

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

Source:
BatchClientCustom.cs

[Protocol Method] Gets information about the specified Certificate.

public virtual System.Threading.Tasks.Task<Azure.Response> GetCertificateAsync(string thumbprintAlgorithm, string thumbprint, int? timeOutInSeconds, DateTimeOffset? ocpdate, System.Collections.Generic.IEnumerable<string> select, Azure.RequestContext context);
abstract member GetCertificateAsync : string * string * Nullable<int> * Nullable<DateTimeOffset> * seq<string> * Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Response>
override this.GetCertificateAsync : string * string * Nullable<int> * Nullable<DateTimeOffset> * seq<string> * Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Response>
Public Overridable Function GetCertificateAsync (thumbprintAlgorithm As String, thumbprint As String, timeOutInSeconds As Nullable(Of Integer), ocpdate As Nullable(Of DateTimeOffset), select As IEnumerable(Of String), context As RequestContext) As Task(Of Response)

Parameters

thumbprintAlgorithm
String

The algorithm used to derive the thumbprint parameter. This must be sha1.

thumbprint
String

The thumbprint of the Certificate to get.

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.

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 response returned from the service.

Exceptions

thumbprintAlgorithm or thumbprint is null.

thumbprintAlgorithm or thumbprint is an empty string, and was expected to be non-empty.

Service returned a non-success status code.

Examples

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

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

Response response = await client.GetCertificateAsync("sha1", "0123456789abcdef0123456789abcdef01234567", null, DateTimeOffset.Parse("Fri, 17 Feb 2017 00:00:00 GMT"), null, null);

JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
Console.WriteLine(result.GetProperty("thumbprint").ToString());
Console.WriteLine(result.GetProperty("thumbprintAlgorithm").ToString());

Applies to

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

Source:
BatchClientCustom.cs

Gets information about the specified Certificate.

public virtual System.Threading.Tasks.Task<Azure.Response<Azure.Compute.Batch.GetCertificateResponse>> GetCertificateAsync(string thumbprintAlgorithm, string thumbprint, int? timeOutInSeconds = default, DateTimeOffset? ocpdate = default, System.Collections.Generic.IEnumerable<string> select = default, System.Threading.CancellationToken cancellationToken = default);
abstract member GetCertificateAsync : string * string * Nullable<int> * Nullable<DateTimeOffset> * seq<string> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response<Azure.Compute.Batch.GetCertificateResponse>>
override this.GetCertificateAsync : string * string * Nullable<int> * Nullable<DateTimeOffset> * seq<string> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response<Azure.Compute.Batch.GetCertificateResponse>>
Public Overridable Function GetCertificateAsync (thumbprintAlgorithm As String, thumbprint As String, Optional timeOutInSeconds As Nullable(Of Integer) = Nothing, Optional ocpdate As Nullable(Of DateTimeOffset) = Nothing, Optional select As IEnumerable(Of String) = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Task(Of Response(Of GetCertificateResponse))

Parameters

thumbprintAlgorithm
String

The algorithm used to derive the thumbprint parameter. This must be sha1.

thumbprint
String

The thumbprint of the Certificate to get.

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.

select
IEnumerable<String>

An OData $select clause.

cancellationToken
CancellationToken

The cancellation token to use.

Returns

Exceptions

thumbprintAlgorithm or thumbprint is null.

thumbprintAlgorithm or thumbprint is an empty string, and was expected to be non-empty.

Examples

This sample shows how to call GetCertificateAsync.

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

Response<GetCertificateResponse> response = await client.GetCertificateAsync("sha1", "0123456789abcdef0123456789abcdef01234567");

Applies to