Iot Hub Resource - List Keys

Lekérheti egy IoT Hub biztonsági metaadatait. További információ: 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-paraméterek

Name In Kötelező Típus Description
resourceGroupName
path True

string

Az IoT Hubot tartalmazó erőforráscsoport neve.

resourceName
path True

string

Az IoT Hub neve.

subscriptionId
path True

string

Az előfizetés azonosítója.

api-version
query True

string

Az API verziója.

Válaszok

Name Típus Description
200 OK

SharedAccessSignatureAuthorizationRuleListResult

Ez egy szinkron művelet. A törzs megosztott hozzáférési szabályzatok JSON-szerializált tömbje, beleértve a kulcsokat is, amelyeket az IoT Hub-végpontok eléréséhez használhat.

Other Status Codes

ErrorDetails

DefaultErrorResponse

Biztonság

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 felhasználói fiók megszemélyesítése

Példák

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"
    }
  ]
}

Definíciók

Name Description
AccessRights

A megosztott hozzáférési szabályzathoz rendelt engedélyek.

ErrorDetails

Hiba részletei.

SharedAccessSignatureAuthorizationRule

Az IoT Hub megosztott hozzáférési szabályzatának tulajdonságai.

SharedAccessSignatureAuthorizationRuleListResult

A megosztott hozzáférési szabályzatok listája egy következő hivatkozással.

AccessRights

A megosztott hozzáférési szabályzathoz rendelt engedélyek.

Name Típus Description
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

Hiba részletei.

Name Típus Description
code

string

A hibakód.

details

string

A hiba részletei.

httpStatusCode

string

A HTTP-állapotkód.

message

string

A hibaüzenet.

SharedAccessSignatureAuthorizationRule

Az IoT Hub megosztott hozzáférési szabályzatának tulajdonságai.

Name Típus Description
keyName

string

A megosztott hozzáférési szabályzat neve.

primaryKey

string

Az elsődleges kulcs.

rights

AccessRights

A megosztott hozzáférési szabályzathoz rendelt engedélyek.

secondaryKey

string

A másodlagos kulcs.

SharedAccessSignatureAuthorizationRuleListResult

A megosztott hozzáférési szabályzatok listája egy következő hivatkozással.

Name Típus Description
nextLink

string

A következő hivatkozás.

value

SharedAccessSignatureAuthorizationRule[]

A megosztott hozzáférési szabályzatok listája.