다음을 통해 공유


DeviceManagementClient.GetInstallableUpdatesForDeviceClassesAsync Method

Definition

Gets a list of installable updates for a device class.

public virtual Azure.AsyncPageable<BinaryData> GetInstallableUpdatesForDeviceClassesAsync (string deviceClassId, Azure.RequestContext context = default);
abstract member GetInstallableUpdatesForDeviceClassesAsync : string * Azure.RequestContext -> Azure.AsyncPageable<BinaryData>
override this.GetInstallableUpdatesForDeviceClassesAsync : string * Azure.RequestContext -> Azure.AsyncPageable<BinaryData>
Public Overridable Function GetInstallableUpdatesForDeviceClassesAsync (deviceClassId As String, Optional context As RequestContext = Nothing) As AsyncPageable(Of BinaryData)

Parameters

deviceClassId
String

Device class identifier.

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

deviceClassId is null.

deviceClassId 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 GetInstallableUpdatesForDeviceClassesAsync with required parameters and parse the result.

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

await foreach (var data in client.GetInstallableUpdatesForDeviceClassesAsync("<deviceClassId>"))
{
    JsonElement result = JsonDocument.Parse(data.ToStream()).RootElement;
    Console.WriteLine(result.GetProperty("updateId").GetProperty("provider").ToString());
    Console.WriteLine(result.GetProperty("updateId").GetProperty("name").ToString());
    Console.WriteLine(result.GetProperty("updateId").GetProperty("version").ToString());
    Console.WriteLine(result.GetProperty("description").ToString());
    Console.WriteLine(result.GetProperty("friendlyName").ToString());
}

Remarks

Below is the JSON schema for one item in the pageable response.

Response Body:

Schema for UpdateInfoListValue:

{
              updateId: {
                provider: string, # Required. Update provider.
                name: string, # Required. Update name.
                version: string, # Required. Update version.
              }, # Required. Update identifier.
              description: string, # Optional. Update description.
              friendlyName: string, # Optional. Friendly update name.
            }

Applies to