Partilhar via


BatchClient.GetNodeExtensionsAsync Method

Definition

Overloads

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

[Protocol Method] Lists the Compute Nodes Extensions in the specified Pool.

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

Lists the Compute Nodes Extensions in the specified Pool.

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

Source:
BatchClient.cs

[Protocol Method] Lists the Compute Nodes Extensions in the specified Pool.

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

Parameters

poolId
String

The ID of the Pool that contains Compute Node.

nodeId
String

The ID of the Compute Node that you want to list extensions.

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.

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

poolId or nodeId is null.

poolId or nodeId 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 GetNodeExtensionsAsync and parse the result.

Uri endpoint = new Uri("<https://my-service.azure.com>");
TokenCredential credential = new DefaultAzureCredential();
BatchClient client = new BatchClient(endpoint, credential);

await foreach (BinaryData item in client.GetNodeExtensionsAsync("<poolId>", "<nodeId>", null, null, null, null, null))
{
    JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement;
    Console.WriteLine(result.ToString());
}

This sample shows how to call GetNodeExtensionsAsync with all parameters and parse the result.

Uri endpoint = new Uri("<https://my-service.azure.com>");
TokenCredential credential = new DefaultAzureCredential();
BatchClient client = new BatchClient(endpoint, credential);

await foreach (BinaryData item in client.GetNodeExtensionsAsync("<poolId>", "<nodeId>", 1234, DateTimeOffset.Parse("Tue, 10 May 2022 18:57:31 GMT"), 1234, new string[] { "<select>" }, null))
{
    JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement;
    Console.WriteLine(result.GetProperty("provisioningState").ToString());
    Console.WriteLine(result.GetProperty("vmExtension").GetProperty("name").ToString());
    Console.WriteLine(result.GetProperty("vmExtension").GetProperty("publisher").ToString());
    Console.WriteLine(result.GetProperty("vmExtension").GetProperty("type").ToString());
    Console.WriteLine(result.GetProperty("vmExtension").GetProperty("typeHandlerVersion").ToString());
    Console.WriteLine(result.GetProperty("vmExtension").GetProperty("autoUpgradeMinorVersion").ToString());
    Console.WriteLine(result.GetProperty("vmExtension").GetProperty("enableAutomaticUpgrade").ToString());
    Console.WriteLine(result.GetProperty("vmExtension").GetProperty("settings").GetProperty("<key>").ToString());
    Console.WriteLine(result.GetProperty("vmExtension").GetProperty("protectedSettings").GetProperty("<key>").ToString());
    Console.WriteLine(result.GetProperty("vmExtension").GetProperty("provisionAfterExtensions")[0].ToString());
    Console.WriteLine(result.GetProperty("instanceView").GetProperty("name").ToString());
    Console.WriteLine(result.GetProperty("instanceView").GetProperty("statuses")[0].GetProperty("code").ToString());
    Console.WriteLine(result.GetProperty("instanceView").GetProperty("statuses")[0].GetProperty("displayStatus").ToString());
    Console.WriteLine(result.GetProperty("instanceView").GetProperty("statuses")[0].GetProperty("level").ToString());
    Console.WriteLine(result.GetProperty("instanceView").GetProperty("statuses")[0].GetProperty("message").ToString());
    Console.WriteLine(result.GetProperty("instanceView").GetProperty("statuses")[0].GetProperty("time").ToString());
    Console.WriteLine(result.GetProperty("instanceView").GetProperty("subStatuses")[0].GetProperty("code").ToString());
    Console.WriteLine(result.GetProperty("instanceView").GetProperty("subStatuses")[0].GetProperty("displayStatus").ToString());
    Console.WriteLine(result.GetProperty("instanceView").GetProperty("subStatuses")[0].GetProperty("level").ToString());
    Console.WriteLine(result.GetProperty("instanceView").GetProperty("subStatuses")[0].GetProperty("message").ToString());
    Console.WriteLine(result.GetProperty("instanceView").GetProperty("subStatuses")[0].GetProperty("time").ToString());
}

Applies to

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

Source:
BatchClient.cs

Lists the Compute Nodes Extensions in the specified Pool.

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

Parameters

poolId
String

The ID of the Pool that contains Compute Node.

nodeId
String

The ID of the Compute Node that you want to list extensions.

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.

select
IEnumerable<String>

An OData $select clause.

cancellationToken
CancellationToken

The cancellation token to use.

Returns

Exceptions

poolId or nodeId is null.

poolId or nodeId is an empty string, and was expected to be non-empty.

Examples

This sample shows how to call GetNodeExtensionsAsync.

Uri endpoint = new Uri("<https://my-service.azure.com>");
TokenCredential credential = new DefaultAzureCredential();
BatchClient client = new BatchClient(endpoint, credential);

await foreach (BatchNodeVMExtension item in client.GetNodeExtensionsAsync("<poolId>", "<nodeId>"))
{
}

This sample shows how to call GetNodeExtensionsAsync with all parameters.

Uri endpoint = new Uri("<https://my-service.azure.com>");
TokenCredential credential = new DefaultAzureCredential();
BatchClient client = new BatchClient(endpoint, credential);

await foreach (BatchNodeVMExtension item in client.GetNodeExtensionsAsync("<poolId>", "<nodeId>", timeOutInSeconds: 1234, ocpdate: DateTimeOffset.Parse("Tue, 10 May 2022 18:57:31 GMT"), maxresults: 1234, select: new string[] { "<select>" }))
{
}

Applies to