Share via


BatchClient.GetNodeExtension Method

Definition

Overloads

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

[Protocol Method] Gets information about the specified Compute Node Extension.

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

Gets information about the specified Compute Node Extension.

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

[Protocol Method] Gets information about the specified Compute Node Extension.

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

Parameters

poolId
String

The ID of the Pool that contains the Compute Node.

nodeId
String

The ID of the Compute Node that contains the extensions.

extensionName
String

The name of the Compute Node Extension that you want to get information about.

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

poolId, nodeId or extensionName is null.

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

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

Response response = client.GetNodeExtension("<poolId>", "<nodeId>", "<extensionName>", null, null, null, null);

JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
Console.WriteLine(result.ToString());

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

Response response = client.GetNodeExtension("<poolId>", "<nodeId>", "<extensionName>", 1234, DateTimeOffset.Parse("Tue, 10 May 2022 18:57:31 GMT"), new string[] { "<select>" }, null);

JsonElement result = JsonDocument.Parse(response.ContentStream).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

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

Gets information about the specified Compute Node Extension.

public virtual Azure.Response<Azure.Compute.Batch.BatchNodeVMExtension> GetNodeExtension (string poolId, string nodeId, string extensionName, int? timeOutInSeconds = default, DateTimeOffset? ocpdate = default, System.Collections.Generic.IEnumerable<string> select = default, System.Threading.CancellationToken cancellationToken = default);
abstract member GetNodeExtension : string * string * string * Nullable<int> * Nullable<DateTimeOffset> * seq<string> * System.Threading.CancellationToken -> Azure.Response<Azure.Compute.Batch.BatchNodeVMExtension>
override this.GetNodeExtension : string * string * string * Nullable<int> * Nullable<DateTimeOffset> * seq<string> * System.Threading.CancellationToken -> Azure.Response<Azure.Compute.Batch.BatchNodeVMExtension>
Public Overridable Function GetNodeExtension (poolId As String, nodeId As String, extensionName 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 Response(Of BatchNodeVMExtension)

Parameters

poolId
String

The ID of the Pool that contains the Compute Node.

nodeId
String

The ID of the Compute Node that contains the extensions.

extensionName
String

The name of the Compute Node Extension that you want to get information about.

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

poolId, nodeId or extensionName is null.

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

Examples

This sample shows how to call GetNodeExtension.

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

Response<BatchNodeVMExtension> response = client.GetNodeExtension("<poolId>", "<nodeId>", "<extensionName>");

This sample shows how to call GetNodeExtension with all parameters.

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

Response<BatchNodeVMExtension> response = client.GetNodeExtension("<poolId>", "<nodeId>", "<extensionName>", timeOutInSeconds: 1234, ocpdate: DateTimeOffset.Parse("Tue, 10 May 2022 18:57:31 GMT"), select: new string[] { "<select>" });

Applies to