Iot Hub Resource - Test All Routes

この Iot Hub で構成されているすべてのルートをテストする

POST https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{iotHubName}/routing/routes/$testall?api-version=2026-11-01

URI パラメーター

Name / 必須 型 説明
iotHubName
path True

string

resourceGroupName
path True

string

minLength: 1
maxLength: 90

リソース グループの名前。 名前は大文字と小文字を区別しません。

subscriptionId
path True

string (uuid)

ターゲット サブスクリプションの ID。 値は UUID である必要があります。

api-version
query True

string

minLength: 1

この操作に使用する API バージョン。

要求本文

Name 型 説明
message

RoutingMessage

メッセージのルーティング

routingSource

RoutingSource

ルーティングソース

twin

RoutingTwin

ルーティング ツイン リファレンス

応答

Name 型 説明
200 OK

TestAllRoutesResult

Azureの運用は無事に完了しました。

Other Status Codes

ErrorDetails

予期しないエラー応答。

セキュリティ

azure_auth

Azure Active Directory OAuth2 フロー。

型: oauth2
フロー: implicit
Authorization URL (承認 URL): https://login.microsoftonline.com/common/oauth2/authorize

スコープ

Name 説明
user_impersonation あなたのユーザー アカウントになりすます

例

IotHubResource_TestAllRoutes

要求のサンプル

POST https://management.azure.com/subscriptions/91d12660-3dec-467a-be2a-213b5544ddc0/resourceGroups/myResourceGroup/providers/Microsoft.Devices/IotHubs/testHub/routing/routes/$testall?api-version=2026-11-01

{
  "message": {
    "appProperties": {
      "key1": "value1"
    },
    "body": "Body of message",
    "systemProperties": {
      "key1": "value1"
    }
  },
  "routingSource": "DeviceMessages"
}

応答のサンプル

{
  "routes": [
    {
      "properties": {
        "name": "Routeid",
        "endpointNames": [
          "id1"
        ],
        "isEnabled": true,
        "source": "DeviceMessages"
      }
    }
  ]
}

定義

Name 説明
ErrorDetails

エラーの詳細。

MatchedRoute

一致したルート

RouteProperties

IoT ハブがエンドポイントにメッセージをルーティングするために使用するルーティング規則のプロパティ。

RoutingMessage

メッセージのルーティング

RoutingSource

ルーティング規則を適用するソース (DeviceMessages など)。

RoutingTwin

ツイン参照入力パラメーター。 これはオプションのパラメーターです

RoutingTwinProperties
TestAllRoutesInput

すべてのルートをテストするための入力

TestAllRoutesResult

全ルートテスト結果

ErrorDetails

エラーの詳細。

Name 型 説明
code

string

エラー コード。

details

string

エラーの詳細。

httpStatusCode

string

HTTP 状態コード。

message

string

エラー メッセージ。

MatchedRoute

一致したルート

Name 型 説明
properties

RouteProperties

一致したルートのプロパティ

RouteProperties

IoT ハブがエンドポイントにメッセージをルーティングするために使用するルーティング規則のプロパティ。

Name 型 説明
condition

string

ルーティング規則を適用するために評価される条件。 条件が指定されていない場合は、既定で true に評価されます。 文法については、以下を参照してください。 https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-query-language

endpointNames

string[]

条件を満たすメッセージがルーティングされるエンドポイントの一覧。 現在、許可されているエンドポイントは 1 つだけです。

isEnabled

boolean

ルートを有効にするかどうかを指定するために使用します。

name

string

pattern: ^[A-Za-z0-9-._]{1,64}$

ルートの名前。 名前には、英数字、ピリオド、アンダースコア、ハイフンのみを含めることができます。最大長は 64 文字で、一意である必要があります。

source

RoutingSource

ルーティング規則を適用するソース (DeviceMessages など)。

RoutingMessage

メッセージのルーティング

Name 型 説明
appProperties

object

アプリのプロパティ

body

string

ルーティング メッセージの本文

systemProperties

object

System properties (システムのプロパティ)

RoutingSource

ルーティング規則を適用するソース (DeviceMessages など)。

値 説明
Invalid

無効です

DeviceMessages

デバイスメッセージ

TwinChangeEvents

ツインチェンジイベント

DeviceLifecycleEvents

デバイスライフサイクルイベント

DeviceJobLifecycleEvents

デバイスジョブライフサイクルイベント

DeviceConnectionStateEvents

デバイス接続状態イベント

RoutingTwin

ツイン参照入力パラメーター。 これはオプションのパラメーターです

Name 型 説明
properties

RoutingTwinProperties

tags

ツインタグ

RoutingTwinProperties

Name 型 説明
desired

ツインの望ましいプロパティ

reported

ツインレポートプロパティ

TestAllRoutesInput

すべてのルートをテストするための入力

Name 型 説明
message

RoutingMessage

メッセージのルーティング

routingSource

RoutingSource

ルーティングソース

twin

RoutingTwin

ルーティング ツイン リファレンス

TestAllRoutesResult

全ルートテスト結果

Name 型 説明
routes

MatchedRoute[]

一致したルートの JSON シリアル化された配列