Bulk Registry - Update Registry

從 IoT 中樞 身分識別登錄建立、更新或刪除多個裝置的身分識別。 裝置身分識別只能在清單中指定一次。 允許在不同裝置上建立、更新、刪除) 的不同作業 (。 每個叫用最多可以指定100部裝置。 針對大規模的作業,請使用 blob 記憶體的匯入功能, (https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry#import-and-export-device-identities) 。

POST https://fully-qualified-iothubname.azure-devices.net/devices?api-version=2021-04-12

URI 參數

名稱 位於 必要 類型 Description
api-version
query True

string

Api 的版本。

要求本文

名稱 類型 Description
devices

ExportImportDevice[]

要執行的登錄作業。

回應

名稱 類型 Description
200 OK

BulkRegistryOperationResult

正常。

400 Bad Request

BulkRegistryOperationResult

不正確的要求。

定義

名稱 Description
AuthenticationMechanism
BulkRegistryOperationResult

大量登錄作業的結果。

DeviceCapabilities

裝置上啟用的功能狀態。

DeviceRegistryOperationError

裝置登錄作業錯誤詳細數據。

DeviceRegistryOperationWarning

裝置登錄作業警告詳細數據。

ExportImportDevice
PropertyContainer

對應項的所需和報告屬性。 物件的深度上限為 10。

SymmetricKey
X509Thumbprint

AuthenticationMechanism

名稱 類型 Description
symmetricKey

SymmetricKey

用於 SAS 型驗證的主要和次要金鑰。

type enum:
  • certificateAuthority
  • none
  • sas
  • selfSigned

用來連線至服務的驗證類型。

x509Thumbprint

X509Thumbprint

用於 x509 型驗證的主要和次要 x509 指紋。

BulkRegistryOperationResult

大量登錄作業的結果。

名稱 類型 Description
errors

DeviceRegistryOperationError[]

裝置登錄作業錯誤。

isSuccessful

boolean

運算結果。

warnings

DeviceRegistryOperationWarning[]

裝置登錄作業警告。

DeviceCapabilities

裝置上啟用的功能狀態。

名稱 類型 Description
iotEdge

boolean

判斷裝置是否為邊緣裝置的屬性。

DeviceRegistryOperationError

裝置登錄作業錯誤詳細數據。

名稱 類型 Description
deviceId

string

裝置的唯一識別碼。

errorCode enum:
  • AmqpAddressNotFound
  • ApplyConfigurationAlreadyInProgressOnDevice
  • ArgumentInvalid
  • ArgumentNull
  • AsyncOperationNotFound
  • AzureStorageTimeout
  • AzureTableStoreError
  • AzureTableStoreNotFound
  • BackupTimedOut
  • BlobContainerValidationError
  • BulkAddDevicesNotSupported
  • BulkRegistryOperationFailure
  • CallbackSubscriptionConflict
  • CannotModifyImmutableConfigurationContent
  • CannotRegisterModuleToModule
  • CertificateAuthorityConflict
  • CertificateAuthorityNotFound
  • CertificateNotFound
  • CheckpointStoreNotFound
  • ClientClosedRequest
  • ConfigReadFailed
  • ConfigurationAlreadyExists
  • ConfigurationCountLimitExceeded
  • ConfigurationNotAvailable
  • ConfigurationNotFound
  • ConnectionForcefullyClosed
  • ConnectionForcefullyClosedOnFaultInjection
  • ConnectionForcefullyClosedOnNewConnection
  • ConnectionRejectedOnFaultInjection
  • ConnectionUnavailable
  • CustomAllocationFailed
  • CustomAllocationIotHubNotSpecified
  • CustomAllocationUnauthorizedAccess
  • DefaultStorageEndpointNotConfigured
  • DeserializationError
  • DeviceAlreadyExists
  • DeviceConnectionClosedRemotely
  • DeviceDefinedMultipleTimes
  • DeviceDisabled
  • DeviceGroupConflict
  • DeviceGroupNotFound
  • DeviceInvalidResultCount
  • DeviceJobAlreadyExists
  • DeviceLocked
  • DeviceMaximumActiveFileUploadLimitExceeded
  • DeviceMaximumQueueDepthExceeded
  • DeviceMaximumQueueSizeExceeded
  • DeviceMessageLockLost
  • DeviceModelMaxIndexablePropertiesExceeded
  • DeviceModelMaxPropertiesExceeded
  • DeviceNotFound
  • DeviceNotOnline
  • DeviceRecordConflict
  • DeviceRecordNotFound
  • DeviceRegistrationNotFound
  • DeviceStorageEntitySerializationError
  • DeviceThrottlingLimitExceeded
  • DeviceUnavailable
  • DigitalTwinInterfaceNotFound
  • DigitalTwinModelAlreadyExists
  • DigitalTwinModelCountLimitExceeded
  • DigitalTwinModelExistsWithOtherModelType
  • DigitalTwinModelNotFound
  • DocumentDbInvalidReturnValue
  • ElasticPoolNotFound
  • ElasticPoolTenantHubNotFound
  • EnrollmentConflict
  • EnrollmentGroupConflict
  • EnrollmentGroupNotFound
  • EnrollmentNotFound
  • EtagDoesNotMatch
  • EventHubLinkAlreadyClosed
  • ExpiredFileUploadCorrelationId
  • FeatureNotSupported
  • GatewayTimeout
  • GenericBadGateway
  • GenericBadRequest
  • GenericConflict
  • GenericForbidden
  • GenericGatewayTimeout
  • GenericMethodNotAllowed
  • GenericNotFound
  • GenericPreconditionFailed
  • GenericRequestEntityTooLarge
  • GenericServerError
  • GenericServiceUnavailable
  • GenericTimeout
  • GenericTooManyRequests
  • GenericUnauthorized
  • GenericUnsupportedMediaType
  • GroupNotAvailable
  • GroupNotFound
  • GroupRecordConflict
  • GroupRecordNotFound
  • HostingServiceNotAvailable
  • ImportDevicesNotSupported
  • ImportWarningExistsError
  • IncompatibleDataType
  • InflightMessagesInLink
  • InterfaceNameCompressionModelCountLimitExceeded
  • InterfaceNameModelAlreadyExists
  • InterfaceNameModelNotFound
  • InvalidBlobState
  • InvalidConfigurationContent
  • InvalidConfigurationCustomMetricsQuery
  • InvalidConfigurationTargetCondition
  • InvalidContainerReceiveLink
  • InvalidContentEncodingOrType
  • InvalidDeviceScope
  • InvalidDigitalTwinJsonPatch
  • InvalidDigitalTwinPatch
  • InvalidDigitalTwinPatchPath
  • InvalidDigitalTwinPayload
  • InvalidEndorsementKey
  • InvalidEndpointAuthenticationType
  • InvalidEnrollmentGroupId
  • InvalidErrorCode
  • InvalidFileUploadCompletionStatus
  • InvalidFileUploadCorrelationId
  • InvalidMessageExpiryTime
  • InvalidMessagingEndpoint
  • InvalidOperation
  • InvalidPartitionEpoch
  • InvalidPnPDesiredProperties
  • InvalidPnPInterfaceDefinition
  • InvalidPnPReportedProperties
  • InvalidPnPWritableReportedProperties
  • InvalidProtocolVersion
  • InvalidRegistrationId
  • InvalidResponseWhileProxying
  • InvalidRouteTestInput
  • InvalidSchemaVersion
  • InvalidSourceOnRoute
  • InvalidStorageEndpoint
  • InvalidStorageEndpointOrBlob
  • InvalidStorageEndpointProperty
  • InvalidStorageRootKey
  • InvalidThrottleParameter
  • IotDpsSuspended
  • IotDpsSuspending
  • IotHubActivationFailed
  • IotHubFailingOver
  • IotHubFormatError
  • IotHubMaxCbsTokenExceeded
  • IotHubNotFound
  • IotHubQuotaExceeded
  • IotHubRestoring
  • IotHubSuspended
  • IotHubUnauthorized
  • IotHubUnauthorizedAccess
  • JobAlreadyExists
  • JobCancelled
  • JobNotFound
  • JobQuotaExceeded
  • JobRunPreconditionFailed
  • KeyEncryptionKeyRevoked
  • LinkCreationConflict
  • LinkedHubConflict
  • LinkedHubNotFound
  • ManagedIdentityNotEnabled
  • MessageTooLarge
  • ModelAlreadyExists
  • ModelRepoEndpointError
  • ModuleAlreadyExistsOnDevice
  • ModuleNotFound
  • NullMessage
  • OperationNotAllowedInCurrentState
  • OperationNotAvailableInCurrentTier
  • OrchestrationOperationFailed
  • OrphanDiscoveryDocument
  • PartitionNotFound
  • PreconditionFailed
  • ProvisioningRecordConflict
  • ProvisioningRecordNotFound
  • ProvisioningSettingsConflict
  • ProvisioningSettingsNotFound
  • QueryStoreClusterNotFound
  • QuotaMetricNotFound
  • ReceiveLinkOpensThrottled
  • RegistrationIdDefinedMultipleTimes
  • RegistrationStatusConflict
  • ReliableBlobStoreError
  • ReliableBlobStoreTimeoutError
  • ReliableDocDbStoreStoreError
  • RequestCanceled
  • RequestTimedOut
  • ResolutionError
  • RestoreTimedOut
  • RetryAttemptsExhausted
  • RoutingEndpointResponseForbidden
  • RoutingEndpointResponseNotFound
  • RoutingNotEnabled
  • SerializationError
  • ServerBusy
  • ServerError
  • ServiceUnavailable
  • StatisticsRetrievalError
  • StreamReservationFailure
  • SystemModuleModifyUnauthorizedAccess
  • SystemPropertyNotFound
  • TenantHubRoutingNotEnabled
  • ThrottleBacklogLimitExceeded
  • ThrottlingBacklogTimeout
  • ThrottlingException
  • ThrottlingMaxActiveJobCountExceeded
  • TooManyDevices
  • TooManyEnrollments
  • TooManyModulesOnDevice
  • UnableToCompressComponentInfo
  • UnableToCompressDiscoveryInfo
  • UnableToExpandComponentInfo
  • UnableToExpandDiscoveryInfo
  • UnableToFetchCredentials
  • UnableToFetchTenantInfo
  • UnableToShareIdentity
  • UnexpectedPropertyValue
  • UnsupportedOperationOnReplica

錯誤碼。

errorStatus

string

錯誤的詳細數據。

moduleId

string

如果適用,模組的唯一標識符。

operation

string

失敗之作業的類型。

DeviceRegistryOperationWarning

裝置登錄作業警告詳細數據。

名稱 類型 Description
deviceId

string

裝置的唯一識別碼。

warningCode enum:

DeviceRegisteredWithoutTwin

警告碼。

warningStatus

string

警告的詳細數據。

ExportImportDevice

名稱 類型 Description
authentication

AuthenticationMechanism

模組所使用的驗證機制。 此參數是選擇性的,如果未提供,則預設為 SAS。 在此情況下,會自動產生主要/次要存取金鑰。

capabilities

DeviceCapabilities

裝置上啟用的功能狀態。

deviceScope

string

裝置的範圍。

eTag

string

字串,表示裝置RFC7232的弱式 ETag。 只有在匯入模式為 updateIfMatchETag 時,才會使用此值,在此情況下,只有在此 ETag 符合伺服器維護的值時,才會執行匯入作業。

id

string

裝置的唯一識別碼。

importMode enum:
  • create
  • delete
  • deleteIfMatchETag
  • update
  • updateIfMatchETag
  • updateTwin
  • updateTwinIfMatchETag

登錄作業和 ETag 喜好設定的類型。

moduleId

string

如果適用,模組的唯一標識符。

parentScopes

string[]

如果適用,則為上層邊緣裝置的範圍。 僅適用於邊緣裝置。

properties

PropertyContainer

裝置所需的和報告屬性。

status enum:
  • disabled
  • enabled

模組的狀態。 如果停用,模組就無法連線到服務。

statusReason

string

儲存裝置身分識別狀態原因的 128 個字元長字串。 允許所有 UTF-8 字元。

tags

object

解決方案後端讀取和寫入的 JSON 檔。 裝置應用程式看不到標記。

twinETag

string

字串,表示裝置對應項的弱式 ETag RFC7232。 只有在匯入模式為 updateIfMatchETag 時,才會使用此值,在此情況下,只有在此 ETag 符合伺服器維護的值時,才會執行匯入作業。

PropertyContainer

對應項的所需和報告屬性。 物件的深度上限為 10。

名稱 類型 Description
desired

object

所需屬性索引鍵/值組的集合。 索引鍵的長度為UTF-8編碼、區分大小寫且長度上限為1 KB。 允許的字元會排除 UNICODE 控制字元 (區段 C0 和 C1) 、'.'、'$' 和空格。 所需的 porperty 值是 JSON 對象,長度上限為 4 KB。

reported

object

報告屬性索引鍵/值組的集合。 索引鍵的長度為UTF-8編碼、區分大小寫且長度上限為1 KB。 允許的字元會排除 UNICODE 控制字元 (區段 C0 和 C1) 、'.'、'$' 和空格。 報告屬性值為 JSON 對象,長度上限為 4KB。

SymmetricKey

名稱 類型 Description
primaryKey

string

裝置的base64編碼主鍵。

secondaryKey

string

裝置的base64編碼次要金鑰。

X509Thumbprint

名稱 類型 Description
primaryThumbprint

string

X509 用戶端憑證主要指紋。

secondaryThumbprint

string

X509 用戶端憑證次要指紋。