DeviceManagementClient.GetDeviceClassSubgroupAsync 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.
Gets device class subgroup details. A device class subgroup is the set of devices within the group that share the same device class. All devices within the same device class are compatible with the same updates.
public virtual System.Threading.Tasks.Task<Azure.Response> GetDeviceClassSubgroupAsync (string groupId, string deviceClassId, Azure.RequestContext context = default);
abstract member GetDeviceClassSubgroupAsync : string * string * Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Response>
override this.GetDeviceClassSubgroupAsync : string * string * Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Response>
Public Overridable Function GetDeviceClassSubgroupAsync (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 GetDeviceClassSubgroupAsync 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.GetDeviceClassSubgroupAsync("<groupId>", "<deviceClassId>");
JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
Console.WriteLine(result.GetProperty("deviceClassId").ToString());
Console.WriteLine(result.GetProperty("groupId").ToString());
Console.WriteLine(result.GetProperty("createdDateTime").ToString());
Console.WriteLine(result.GetProperty("deviceCount").ToString());
Console.WriteLine(result.GetProperty("deploymentId").ToString());
Remarks
Below is the JSON schema for the response payload.
Response Body:
Schema for DeviceClassSubgroup
:
{
deviceClassId: string, # Required. Device class subgroup identity. This is generated from the model Id and the compat properties reported by the device update agent in the Device Update PnP interface in IoT Hub. It is a hex-encoded SHA1 hash.
groupId: string, # Required. Group identity.
createdDateTime: string, # Required. Date and time when the device class subgroup was created.
deviceCount: number, # Optional. The number of devices in the device class subgroup.
deploymentId: string, # Optional. The active deployment Id for the device class subgroup.
}
Applies to
Azure SDK for .NET