Iot Hub Resource - Get Keys For Key Name

Obtenha uma política de acesso partilhado por nome a partir de um hub IoT. Para obter mais informações, consulte: 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}/IotHubKeys/{keyName}/listkeys?api-version=2018-04-01

Parâmetros do URI

Name Em Necessário Tipo Description
keyName
path True

string

O nome da política de acesso partilhado.

resourceGroupName
path True

string

O nome do grupo de recursos que contém o hub IoT.

resourceName
path True

string

O nome do hub IoT.

subscriptionId
path True

string

O identificador da subscrição.

api-version
query True

string

A versão da API.

Respostas

Name Tipo Description
200 OK

SharedAccessSignatureAuthorizationRule

Esta é uma operação síncrona. O corpo contém uma política de acesso partilhado serializado JSON, incluindo chaves, que pode utilizar para aceder a um ou mais pontos finais do hub IoT.

Other Status Codes

ErrorDetails

DefaultErrorResponse

Segurança

azure_auth

Fluxo OAuth2 do Azure Active Directory

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

Scopes

Name Description
user_impersonation representar a sua conta de utilizador

Exemplos

IotHubResource_GetKeysForKeyName

Sample Request

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

Sample Response

{
  "keyName": "iothubowner",
  "primaryKey": "<primaryKey>",
  "secondaryKey": "<secondaryKey>",
  "rights": "RegistryWrite, ServiceConnect, DeviceConnect"
}

Definições

Name Description
AccessRights

As permissões atribuídas à política de acesso partilhado.

ErrorDetails

Detalhes do erro.

SharedAccessSignatureAuthorizationRule

As propriedades de uma política de acesso partilhado do hub IoT.

AccessRights

As permissões atribuídas à política de acesso partilhado.

Name Tipo 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

Detalhes do erro.

Name Tipo Description
code

string

O código de erro.

details

string

Os detalhes do erro.

httpStatusCode

string

O código de estado HTTP.

message

string

A mensagem de erro.

SharedAccessSignatureAuthorizationRule

As propriedades de uma política de acesso partilhado do hub IoT.

Name Tipo Description
keyName

string

O nome da política de acesso partilhado.

primaryKey

string

A chave primária.

rights

AccessRights

As permissões atribuídas à política de acesso partilhado.

secondaryKey

string

A chave secundária.