Share via


BatchClient.GetSupportedImages Method

Definition

Overloads

GetSupportedImages(Nullable<Int32>, Nullable<DateTimeOffset>, Nullable<Int32>, String, RequestContext)

[Protocol Method] Lists all Virtual Machine Images supported by the Azure Batch service.

GetSupportedImages(Nullable<Int32>, Nullable<DateTimeOffset>, Nullable<Int32>, String, CancellationToken)

Lists all Virtual Machine Images supported by the Azure Batch service.

GetSupportedImages(Nullable<Int32>, Nullable<DateTimeOffset>, Nullable<Int32>, String, RequestContext)

Source:
BatchClient.cs

[Protocol Method] Lists all Virtual Machine Images supported by the Azure Batch service.

public virtual Azure.Pageable<BinaryData> GetSupportedImages (int? timeOutInSeconds, DateTimeOffset? ocpdate, int? maxresults, string filter, Azure.RequestContext context);
abstract member GetSupportedImages : Nullable<int> * Nullable<DateTimeOffset> * Nullable<int> * string * Azure.RequestContext -> Azure.Pageable<BinaryData>
override this.GetSupportedImages : Nullable<int> * Nullable<DateTimeOffset> * Nullable<int> * string * Azure.RequestContext -> Azure.Pageable<BinaryData>
Public Overridable Function GetSupportedImages (timeOutInSeconds As Nullable(Of Integer), ocpdate As Nullable(Of DateTimeOffset), maxresults As Nullable(Of Integer), filter As String, context As RequestContext) As Pageable(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-support-images.

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

Service returned a non-success status code.

Examples

This sample shows how to call GetSupportedImages 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.GetSupportedImages(null, null, null, null, null))
{
    JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement;
    Console.WriteLine(result.GetProperty("nodeAgentSKUId").ToString());
    Console.WriteLine(result.GetProperty("imageReference").ToString());
    Console.WriteLine(result.GetProperty("osType").ToString());
    Console.WriteLine(result.GetProperty("verificationType").ToString());
}

This sample shows how to call GetSupportedImages 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.GetSupportedImages(1234, DateTimeOffset.Parse("Tue, 10 May 2022 18:57:31 GMT"), 1234, "<filter>", null))
{
    JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement;
    Console.WriteLine(result.GetProperty("nodeAgentSKUId").ToString());
    Console.WriteLine(result.GetProperty("imageReference").GetProperty("publisher").ToString());
    Console.WriteLine(result.GetProperty("imageReference").GetProperty("offer").ToString());
    Console.WriteLine(result.GetProperty("imageReference").GetProperty("sku").ToString());
    Console.WriteLine(result.GetProperty("imageReference").GetProperty("version").ToString());
    Console.WriteLine(result.GetProperty("imageReference").GetProperty("virtualMachineImageId").ToString());
    Console.WriteLine(result.GetProperty("imageReference").GetProperty("exactVersion").ToString());
    Console.WriteLine(result.GetProperty("osType").ToString());
    Console.WriteLine(result.GetProperty("capabilities")[0].ToString());
    Console.WriteLine(result.GetProperty("batchSupportEndOfLife").ToString());
    Console.WriteLine(result.GetProperty("verificationType").ToString());
}

Applies to

GetSupportedImages(Nullable<Int32>, Nullable<DateTimeOffset>, Nullable<Int32>, String, CancellationToken)

Source:
BatchClient.cs

Lists all Virtual Machine Images supported by the Azure Batch service.

public virtual Azure.Pageable<Azure.Compute.Batch.BatchSupportedImage> GetSupportedImages (int? timeOutInSeconds = default, DateTimeOffset? ocpdate = default, int? maxresults = default, string filter = default, System.Threading.CancellationToken cancellationToken = default);
abstract member GetSupportedImages : Nullable<int> * Nullable<DateTimeOffset> * Nullable<int> * string * System.Threading.CancellationToken -> Azure.Pageable<Azure.Compute.Batch.BatchSupportedImage>
override this.GetSupportedImages : Nullable<int> * Nullable<DateTimeOffset> * Nullable<int> * string * System.Threading.CancellationToken -> Azure.Pageable<Azure.Compute.Batch.BatchSupportedImage>
Public Overridable Function GetSupportedImages (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 cancellationToken As CancellationToken = Nothing) As Pageable(Of BatchSupportedImage)

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-support-images.

cancellationToken
CancellationToken

The cancellation token to use.

Returns

Examples

This sample shows how to call GetSupportedImages.

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

foreach (BatchSupportedImage item in client.GetSupportedImages())
{
}

This sample shows how to call GetSupportedImages with all parameters.

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

foreach (BatchSupportedImage item in client.GetSupportedImages(timeOutInSeconds: 1234, ocpdate: DateTimeOffset.Parse("Tue, 10 May 2022 18:57:31 GMT"), maxresults: 1234, filter: "<filter>"))
{
}

Applies to