BatchClient.GetSupportedImagesAsync Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
GetSupportedImagesAsync(Nullable<Int32>, Nullable<DateTimeOffset>, Nullable<Int32>, String, RequestContext) |
[Protocol Method] Lists all Virtual Machine Images supported by the Azure Batch service.
|
GetSupportedImagesAsync(Nullable<Int32>, Nullable<DateTimeOffset>, Nullable<Int32>, String, CancellationToken) |
Lists all Virtual Machine Images supported by the Azure Batch service. |
GetSupportedImagesAsync(Nullable<Int32>, Nullable<DateTimeOffset>, Nullable<Int32>, String, RequestContext)
- Source:
- BatchClient.cs
[Protocol Method] Lists all Virtual Machine Images supported by the Azure Batch service.
- This protocol method allows explicit creation of the request and processing of the response for advanced scenarios.
- Please try the simpler GetSupportedImagesAsync(Nullable<Int32>, Nullable<DateTimeOffset>, Nullable<Int32>, String, CancellationToken) convenience overload with strongly typed models first.
public virtual Azure.AsyncPageable<BinaryData> GetSupportedImagesAsync (int? timeOutInSeconds, DateTimeOffset? ocpdate, int? maxresults, string filter, Azure.RequestContext context);
abstract member GetSupportedImagesAsync : Nullable<int> * Nullable<DateTimeOffset> * Nullable<int> * string * Azure.RequestContext -> Azure.AsyncPageable<BinaryData>
override this.GetSupportedImagesAsync : Nullable<int> * Nullable<DateTimeOffset> * Nullable<int> * string * Azure.RequestContext -> Azure.AsyncPageable<BinaryData>
Public Overridable Function GetSupportedImagesAsync (timeOutInSeconds As Nullable(Of Integer), ocpdate As Nullable(Of DateTimeOffset), maxresults As Nullable(Of Integer), filter As String, context As RequestContext) As AsyncPageable(Of BinaryData)
Parameters
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.
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 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
Service returned a non-success status code.
Examples
This sample shows how to call GetSupportedImagesAsync 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.GetSupportedImagesAsync(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 GetSupportedImagesAsync 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.GetSupportedImagesAsync(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
GetSupportedImagesAsync(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.AsyncPageable<Azure.Compute.Batch.BatchSupportedImage> GetSupportedImagesAsync (int? timeOutInSeconds = default, DateTimeOffset? ocpdate = default, int? maxresults = default, string filter = default, System.Threading.CancellationToken cancellationToken = default);
abstract member GetSupportedImagesAsync : Nullable<int> * Nullable<DateTimeOffset> * Nullable<int> * string * System.Threading.CancellationToken -> Azure.AsyncPageable<Azure.Compute.Batch.BatchSupportedImage>
override this.GetSupportedImagesAsync : Nullable<int> * Nullable<DateTimeOffset> * Nullable<int> * string * System.Threading.CancellationToken -> Azure.AsyncPageable<Azure.Compute.Batch.BatchSupportedImage>
Public Overridable Function GetSupportedImagesAsync (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 AsyncPageable(Of BatchSupportedImage)
Parameters
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.
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 GetSupportedImagesAsync.
Uri endpoint = new Uri("<https://my-service.azure.com>");
TokenCredential credential = new DefaultAzureCredential();
BatchClient client = new BatchClient(endpoint, credential);
await foreach (BatchSupportedImage item in client.GetSupportedImagesAsync())
{
}
This sample shows how to call GetSupportedImagesAsync with all parameters.
Uri endpoint = new Uri("<https://my-service.azure.com>");
TokenCredential credential = new DefaultAzureCredential();
BatchClient client = new BatchClient(endpoint, credential);
await foreach (BatchSupportedImage item in client.GetSupportedImagesAsync(timeOutInSeconds: 1234, ocpdate: DateTimeOffset.Parse("Tue, 10 May 2022 18:57:31 GMT"), maxresults: 1234, filter: "<filter>"))
{
}
Applies to
Azure SDK for .NET