Iot Hub Resource - List Keys

Pobierz metadane zabezpieczeń dla centrum IoT Hub. Aby uzyskać więcej informacji, zobacz 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=2023-06-30

Parametry identyfikatora URI

Nazwa W Wymagane Typ Opis
resourceGroupName
path True

string

Nazwa grupy zasobów zawierającej centrum IoT.

resourceName
path True

string

Nazwa centrum IoT.

subscriptionId
path True

string

Identyfikator subskrypcji.

api-version
query True

string

Wersja interfejsu API.

Odpowiedzi

Nazwa Typ Opis
200 OK

SharedAccessSignatureAuthorizationRuleListResult

Jest to operacja synchroniczna. Treść zawiera szeregowaną tablicę zasad dostępu współdzielonego w formacie JSON, w tym klucze, których można użyć do uzyskiwania dostępu do punktów końcowych centrum IoT.

Other Status Codes

ErrorDetails

DefaultErrorResponse

Zabezpieczenia

azure_auth

Przepływ OAuth2 usługi Azure Active Directory

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

Scopes

Nazwa Opis
user_impersonation personifikacja konta użytkownika

Przykłady

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=2023-06-30

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

Definicje

Nazwa Opis
AccessRights

Uprawnienia przypisane do zasad dostępu współdzielonego.

ErrorDetails

Szczegóły błędu.

SharedAccessSignatureAuthorizationRule

Właściwości zasad dostępu współdzielonego centrum IoT.

SharedAccessSignatureAuthorizationRuleListResult

Lista zasad dostępu współdzielonego z następnym linkiem.

AccessRights

Uprawnienia przypisane do zasad dostępu współdzielonego.

Nazwa Typ Opis
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

Szczegóły błędu.

Nazwa Typ Opis
code

string

Kod błędu.

details

string

Szczegóły błędu.

httpStatusCode

string

Kod stanu HTTP.

message

string

Komunikat o błędzie.

SharedAccessSignatureAuthorizationRule

Właściwości zasad dostępu współdzielonego centrum IoT.

Nazwa Typ Opis
keyName

string

Nazwa zasad dostępu współdzielonego.

primaryKey

string

Klucz podstawowy.

rights

AccessRights

Uprawnienia przypisane do zasad dostępu współdzielonego.

secondaryKey

string

Klucz pomocniczy.

SharedAccessSignatureAuthorizationRuleListResult

Lista zasad dostępu współdzielonego z następnym linkiem.

Nazwa Typ Opis
nextLink

string

Następny link.

value

SharedAccessSignatureAuthorizationRule[]

Lista zasad dostępu współdzielonego.