편집

다음을 통해 공유


Invoke-AzIotHubConfigurationMetricsQuery

Invoke an IoT device configuration metric query.

Syntax

Invoke-AzIotHubConfigurationMetricsQuery
      [-ResourceGroupName] <String>
      [-IotHubName] <String>
      -Name <String>
      -MetricName <String>
      [-MetricType <PSConfigurationMetricType>]
      [-DefaultProfile <IAzureContextContainer>]
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]
Invoke-AzIotHubConfigurationMetricsQuery
      [-InputObject] <PSIotHub>
      -Name <String>
      -MetricName <String>
      [-MetricType <PSConfigurationMetricType>]
      [-DefaultProfile <IAzureContextContainer>]
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]
Invoke-AzIotHubConfigurationMetricsQuery
      [-ResourceId] <String>
      -Name <String>
      -MetricName <String>
      [-MetricType <PSConfigurationMetricType>]
      [-DefaultProfile <IAzureContextContainer>]
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]

Description

Evaluate a target custom or system metric defined in an IoT device configuration. There are pre-defined system metrics which are calculated by Iot Hub and cannot be customized.

  • "Targeted" specifies the number of device twins that match the target condition.
  • "Applied" specified the number of device twins that have been modified by the configuration.

Examples

Example 1

Invoke-AzIotHubConfigurationMetricsQuery -ResourceGroupName "myresourcegroup" -IotHubName "myiothub" -Name "myConfig1" -MetricName "warningLimit"

Evaluate the custom defined 'warningLimit' metric.

Example 2

Invoke-AzIotHubConfigurationMetricsQuery -ResourceGroupName "myresourcegroup" -IotHubName "myiothub" -Name "myConfig1" -MetricName "applied" -MetricType "system"

Evaluate the system 'applied' metric.

Parameters

-Confirm

Prompts you for confirmation before running the cmdlet.

Type:SwitchParameter
Aliases:cf
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-DefaultProfile

The credentials, account, tenant, and subscription used for communication with Azure.

Type:IAzureContextContainer
Aliases:AzContext, AzureRmContext, AzureCredential
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-InputObject

IotHub object

Type:PSIotHub
Position:0
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-IotHubName

Name of the Iot Hub

Type:String
Position:1
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-MetricName

Target metric for evaluation.

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-MetricType

Indicates which metric collection should be used to lookup a metric.

Type:PSConfigurationMetricType
Accepted values:Custom, System
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Name

Identifier for the configuration.

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-ResourceGroupName

Name of the Resource Group

Type:String
Position:0
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-ResourceId

IotHub Resource Id

Type:String
Position:0
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Type:SwitchParameter
Aliases:wi
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

Inputs

PSIotHub

String

Outputs

PSConfigurationMetricsResult