Iot Hub Resource - List Keys

IoT ハブのセキュリティ メタデータを取得します。 詳細については、「https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-security」を参照してください。

POST https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/listkeys?api-version=2018-04-01

URI パラメーター

名前 / 必須 説明
resourceGroupName
path True

string

IoT ハブを含むリソース グループの名前。

resourceName
path True

string

IoT ハブの名前。

subscriptionId
path True

string

サブスクリプションの識別子です。

api-version
query True

string

API のバージョン。

応答

名前 説明
200 OK

SharedAccessSignatureAuthorizationRuleListResult

これは同期操作です。 本文には、IoT ハブ エンドポイントへのアクセスに使用できるキーを含む、共有アクセス ポリシーの JSON でシリアル化された配列が含まれています。

Other Status Codes

ErrorDetails

DefaultErrorResponse

セキュリティ

azure_auth

Azure Active Directory OAuth2 フロー

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

Scopes

名前 説明
user_impersonation ユーザー アカウントの借用

IotHubResource_ListKeys

Sample Request

POST https://management.azure.com/subscriptions/91d12660-3dec-467a-be2a-213b5544ddc0/resourceGroups/myResourceGroup/providers/Microsoft.Devices/IotHubs/testHub/listkeys?api-version=2018-04-01

Sample Response

{
  "value": [
    {
      "keyName": "iothubowner",
      "primaryKey": "<primaryKey>",
      "secondaryKey": "<secondaryKey>",
      "rights": "RegistryWrite, ServiceConnect, DeviceConnect"
    },
    {
      "keyName": "service",
      "primaryKey": "<primaryKey>",
      "secondaryKey": "<secondaryKey>",
      "rights": "ServiceConnect"
    },
    {
      "keyName": "device",
      "primaryKey": "<primaryKey>",
      "secondaryKey": "<secondaryKey>",
      "rights": "DeviceConnect"
    },
    {
      "keyName": "registryRead",
      "primaryKey": "<primaryKey>",
      "secondaryKey": "<secondaryKey>",
      "rights": "RegistryRead"
    },
    {
      "keyName": "registryReadWrite",
      "primaryKey": "<primaryKey>",
      "secondaryKey": "<secondaryKey>",
      "rights": "RegistryWrite"
    }
  ]
}

定義

名前 説明
AccessRights

共有アクセス ポリシーに割り当てられたアクセス許可。

ErrorDetails

エラーの詳細。

SharedAccessSignatureAuthorizationRule

IoT ハブの共有アクセス ポリシーのプロパティ。

SharedAccessSignatureAuthorizationRuleListResult

次のリンクを含む共有アクセス ポリシーの一覧。

AccessRights

共有アクセス ポリシーに割り当てられたアクセス許可。

名前 説明
DeviceConnect

string

RegistryRead

string

RegistryRead, DeviceConnect

string

RegistryRead, RegistryWrite

string

RegistryRead, RegistryWrite, DeviceConnect

string

RegistryRead, RegistryWrite, ServiceConnect

string

RegistryRead, RegistryWrite, ServiceConnect, DeviceConnect

string

RegistryRead, ServiceConnect

string

RegistryRead, ServiceConnect, DeviceConnect

string

RegistryWrite

string

RegistryWrite, DeviceConnect

string

RegistryWrite, ServiceConnect

string

RegistryWrite, ServiceConnect, DeviceConnect

string

ServiceConnect

string

ServiceConnect, DeviceConnect

string

ErrorDetails

エラーの詳細。

名前 説明
code

string

エラー コード。

details

string

エラーの詳細です。

httpStatusCode

string

HTTP 状態コード。

message

string

エラー メッセージ。

SharedAccessSignatureAuthorizationRule

IoT ハブの共有アクセス ポリシーのプロパティ。

名前 説明
keyName

string

共有アクセス ポリシーの名前。

primaryKey

string

主キー。

rights

AccessRights

共有アクセス ポリシーに割り当てられたアクセス許可。

secondaryKey

string

セカンダリ キー。

SharedAccessSignatureAuthorizationRuleListResult

次のリンクを含む共有アクセス ポリシーの一覧。

名前 説明
nextLink

string

次のリンク。

value

SharedAccessSignatureAuthorizationRule[]

共有アクセス ポリシーの一覧。