Iot Hub Resource - List Keys

IoT hub'ına yönelik güvenlik meta verilerini alın. Daha fazla bilgi için, bkz. 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 Parametreleri

Name İçinde Gerekli Tür Description
resourceGroupName
path True

string

IoT hub'ını içeren kaynak grubunun adı.

resourceName
path True

string

IoT hub'ının adı.

subscriptionId
path True

string

Abonelik tanımlayıcısı.

api-version
query True

string

API'nin sürümü.

Yanıtlar

Name Tür Description
200 OK

SharedAccessSignatureAuthorizationRuleListResult

Bu zaman uyumlu bir işlemdir. Gövde, IoT hub uç noktalarına erişmek için kullanabileceğiniz anahtarlar da dahil olmak üzere JSON serileştirilmiş bir paylaşılan erişim ilkeleri dizisi içerir.

Other Status Codes

ErrorDetails

DefaultErrorResponse

Güvenlik

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 kullanıcı hesabınızın kimliğine bürünme

Örnekler

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

Tanımlar

Name Description
AccessRights

Paylaşılan erişim ilkesine atanan izinler.

ErrorDetails

Hata ayrıntıları.

SharedAccessSignatureAuthorizationRule

IoT hub paylaşılan erişim ilkesinin özellikleri.

SharedAccessSignatureAuthorizationRuleListResult

Sonraki bağlantıyla paylaşılan erişim ilkelerinin listesi.

AccessRights

Paylaşılan erişim ilkesine atanan izinler.

Name Tür 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

Hata ayrıntıları.

Name Tür Description
code

string

Hata kodu.

details

string

Hata ayrıntıları.

httpStatusCode

string

HTTP durum kodu.

message

string

Hata iletisi.

SharedAccessSignatureAuthorizationRule

IoT hub paylaşılan erişim ilkesinin özellikleri.

Name Tür Description
keyName

string

Paylaşılan erişim ilkesinin adı.

primaryKey

string

Birincil anahtar.

rights

AccessRights

Paylaşılan erişim ilkesine atanan izinler.

secondaryKey

string

İkincil anahtar.

SharedAccessSignatureAuthorizationRuleListResult

Sonraki bağlantıyla paylaşılan erişim ilkelerinin listesi.

Name Tür Description
nextLink

string

Sonraki bağlantı.

value

SharedAccessSignatureAuthorizationRule[]

Paylaşılan erişim ilkelerinin listesi.