Share via


DeviceManagementClient.GetDeviceClassSubgroupUpdateComplianceAsync Method

Definition

Get device class subgroup update compliance information such as how many devices are on their latest update, how many need new updates, and how many are in progress on receiving a new update.

public virtual System.Threading.Tasks.Task<Azure.Response> GetDeviceClassSubgroupUpdateComplianceAsync (string groupId, string deviceClassId, Azure.RequestContext context = default);
abstract member GetDeviceClassSubgroupUpdateComplianceAsync : string * string * Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Response>
override this.GetDeviceClassSubgroupUpdateComplianceAsync : string * string * Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Response>
Public Overridable Function GetDeviceClassSubgroupUpdateComplianceAsync (groupId As String, deviceClassId As String, Optional context As RequestContext = Nothing) As Task(Of Response)

Parameters

groupId
String

Group identifier.

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 response returned from the service. Details of the response body schema are in the Remarks section below.

Exceptions

groupId or deviceClassId is null.

groupId or 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 GetDeviceClassSubgroupUpdateComplianceAsync 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);

Response response = await client.GetDeviceClassSubgroupUpdateComplianceAsync("<groupId>", "<deviceClassId>");

JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
Console.WriteLine(result.GetProperty("totalDeviceCount").ToString());
Console.WriteLine(result.GetProperty("onLatestUpdateDeviceCount").ToString());
Console.WriteLine(result.GetProperty("newUpdatesAvailableDeviceCount").ToString());
Console.WriteLine(result.GetProperty("updatesInProgressDeviceCount").ToString());

Remarks

Below is the JSON schema for the response payload.

Response Body:

Schema for UpdateCompliance:

{
              totalDeviceCount: number, # Required. Total number of devices.
              onLatestUpdateDeviceCount: number, # Required. Number of devices on the latest update.
              newUpdatesAvailableDeviceCount: number, # Required. Number of devices with a newer update available.
              updatesInProgressDeviceCount: number, # Required. Number of devices with update in-progress.
            }

Applies to