Compartilhar via


BatchClient.GetNodeExtensions Method

Definition

Overloads

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

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

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

Lists the Compute Nodes Extensions in the specified Pool.

GetNodeExtensions(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.Pageable<BinaryData> GetNodeExtensions (string poolId, string nodeId, int? timeOutInSeconds, DateTimeOffset? ocpdate, int? maxresults, System.Collections.Generic.IEnumerable<string> select, Azure.RequestContext context);
abstract member GetNodeExtensions : string * string * Nullable<int> * Nullable<DateTimeOffset> * Nullable<int> * seq<string> * Azure.RequestContext -> Azure.Pageable<BinaryData>
override this.GetNodeExtensions : string * string * Nullable<int> * Nullable<DateTimeOffset> * Nullable<int> * seq<string> * Azure.RequestContext -> Azure.Pageable<BinaryData>
Public Overridable Function GetNodeExtensions (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 Pageable(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 Pageable<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 GetNodeExtensions and parse the result.

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

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

This sample shows how to call GetNodeExtensions 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);

foreach (BinaryData item in client.GetNodeExtensions("<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

GetNodeExtensions(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.Pageable<Azure.Compute.Batch.BatchNodeVMExtension> GetNodeExtensions (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 GetNodeExtensions : string * string * Nullable<int> * Nullable<DateTimeOffset> * Nullable<int> * seq<string> * System.Threading.CancellationToken -> Azure.Pageable<Azure.Compute.Batch.BatchNodeVMExtension>
override this.GetNodeExtensions : string * string * Nullable<int> * Nullable<DateTimeOffset> * Nullable<int> * seq<string> * System.Threading.CancellationToken -> Azure.Pageable<Azure.Compute.Batch.BatchNodeVMExtension>
Public Overridable Function GetNodeExtensions (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 Pageable(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 GetNodeExtensions.

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

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

This sample shows how to call GetNodeExtensions with all parameters.

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

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

Applies to