Iot Hub Resource - Get Stats

Get the statistics from an IoT hub.

GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/IotHubStats?api-version=2023-06-30

URI Parameters

Name In Required Type Description
resourceGroupName
path True

string

The name of the resource group that contains the IoT hub.

resourceName
path True

string

The name of the IoT hub.

subscriptionId
path True

string

The subscription identifier.

api-version
query True

string

The version of the API.

Responses

Name Type Description
200 OK

RegistryStatistics

This is a synchronous operation. The body contains JSON-serialized statistics from the identity registry in the IoT hub.

Other Status Codes

ErrorDetails

DefaultErrorResponse

Security

azure_auth

Azure Active Directory OAuth2 Flow

Type: oauth2
Flow: implicit
Authorization URL: https://login.microsoftonline.com/common/oauth2/authorize

Scopes

Name Description
user_impersonation impersonate your user account

Examples

IotHubResource_GetStats

Sample request

GET https://management.azure.com/subscriptions/91d12660-3dec-467a-be2a-213b5544ddc0/resourceGroups/myResourceGroup/providers/Microsoft.Devices/IotHubs/testHub/IotHubStats?api-version=2023-06-30

Sample response

{
  "totalDeviceCount": 0,
  "enabledDeviceCount": 0,
  "disabledDeviceCount": 0
}

Definitions

Name Description
ErrorDetails

Error details.

RegistryStatistics

Identity registry statistics.

ErrorDetails

Error details.

Name Type Description
code

string

The error code.

details

string

The error details.

httpStatusCode

string

The HTTP status code.

message

string

The error message.

RegistryStatistics

Identity registry statistics.

Name Type Description
disabledDeviceCount

integer

The count of disabled devices in the identity registry.

enabledDeviceCount

integer

The count of enabled devices in the identity registry.

totalDeviceCount

integer

The total count of devices in the identity registry.