azure-iothub package
Classes
Amqp |
Transport class used by the service client to connect to the Azure IoT hub using the AMQP protocol over a secure (TLS) socket. This class should not be used directly and instead be passed to one of the Client factory methods: fromConnectionString or fromSharedAccessSignature. |
AmqpWs |
Transport class used by the service client to connect to the Azure IoT hub using the AMQP protocol over secure websockets. This class should not be used directly and instead be passed to one of the Client factory methods: fromConnectionString or fromSharedAccessSignature. |
IoTHubTokenCredentials |
Creates shared access signatures based on the connection string passed to the constructor. This class is used by the protocol layer of the SDK to add authentication headers to each request. |
DigitalTwinClient | |
DigitalTwin |
Class representing a DigitalTwin. |
Client |
The IoT Hub service client is used to communicate with devices through an Azure IoT hub. It lets the SDK user:
|
JobClient |
Provides methods to create, update, monitor and cancel long-running jobs on an IoT Hub instance, as well as query existing jobs. The Jobs API in Azure IoT Hub allows to schedule direct method calls and twin updates on multiple devices. SDK users are expected to create JobClient instances using the factory methods fromConnectionString(string) and fromSharedAccessSignature(string). |
IotHubGatewayServiceAPIs | |
IotHubGatewayServiceAPIsContext | |
Twin |
A Device Twin is document describing the state of a device that is stored by an Azure IoT hub and is available even if the device is offline. It is built around 3 sections:
For more information see Understanding Device Twins. The recommended way to obtain a Twin for a specific device is to use the getTwin(string, HttpResponseCallback<Twin>) method. |
BulkRegistry |
Class representing a BulkRegistry. |
CloudToDeviceMessages |
Class representing a CloudToDeviceMessages. |
ConfigurationOperations |
Class representing a ConfigurationOperations. |
Devices |
Class representing a Devices. |
Jobs |
Class representing a Jobs. |
Modules |
Class representing a Modules. |
Query |
Constructs a Query object that provides APIs to trigger the execution of a device query. SDK users should create queries using the createQuery(JobType, JobStatus, number) and createQuery(string, number) APIs and should not try to instantiate this class directly. |
Statistics |
Class representing a Statistics. |
Registry |
The Registry class provides access to the IoT Hub device identity service. Users of the SDK should instantiate this class with one of the factory methods: fromConnectionString or fromSharedAccessSignature. The protocol used for device identity registry operations is HTTPS. |
Interfaces
Abortable | |
DigitalTwinInvokeComponentCommandOptionalParams |
Optional Parameters. |
DigitalTwinInvokeRootLevelCommandOptionalParams |
Optional Parameters. |
Abortable | |
ServiceReceiver | |
Transport | |
Abortable | |
TransportConfigOptions | |
Configuration |
The configuration for Iot Hub device and module twins. |
ConfigurationContent |
The configuration content for devices or modules on edge devices. |
ConfigurationMetrics |
The configuration metrics for Iot Hub devices and modules. |
Device |
An interface representing Device. |
Authentication | |
Capabilities | |
X509Thumbprints | |
DeviceMethodParams |
Describes the parameters that are available for use with direct methods (also called device methods) |
Module |
The module identity on a device. |
AuthenticationMechanism |
An interface representing AuthenticationMechanism. |
BulkRegistryOperationResult |
The result of the bulk registry operation. |
CloudToDeviceMethod |
The parameters to execute a direct method on the device. |
CloudToDeviceMethodResult |
Represents the Device Method Invocation Results. |
ConfigurationCreateOrUpdateOptionalParams |
Optional Parameters. |
ConfigurationDeleteMethodOptionalParams |
Optional Parameters. |
ConfigurationGetConfigurationsOptionalParams |
Optional Parameters. |
ConfigurationQueriesTestInput |
An interface representing ConfigurationQueriesTestInput. |
ConfigurationQueriesTestResponse |
An interface representing ConfigurationQueriesTestResponse. |
DeviceCapabilities |
The status of capabilities enabled on the device. |
DeviceJobStatistics |
The job statistics regarding execution status. |
DeviceRegistryOperationError |
The device registry operation error details. |
DeviceRegistryOperationWarning |
The device registry operation warning details. |
DevicesCreateOrUpdateIdentityOptionalParams |
Optional Parameters. |
DevicesDeleteIdentityOptionalParams |
Optional Parameters. |
DevicesGetDevicesOptionalParams |
Optional Parameters. |
DevicesReplaceTwinOptionalParams |
Optional Parameters. |
DevicesUpdateTwinOptionalParams |
Optional Parameters. |
DigitalTwinGetDigitalTwinHeaders |
Defines headers for GetDigitalTwin operation. |
DigitalTwinInvokeComponentCommandHeaders |
Defines headers for InvokeComponentCommand operation. |
DigitalTwinInvokeRootLevelCommandHeaders |
Defines headers for InvokeRootLevelCommand operation. |
DigitalTwinUpdateDigitalTwinHeaders |
Defines headers for UpdateDigitalTwin operation. |
DigitalTwinUpdateDigitalTwinOptionalParams |
Optional Parameters. |
ExportImportDevice |
An interface representing ExportImportDevice. |
IotHubGatewayServiceAPIsOptions |
An interface representing IotHubGatewayServiceAPIsOptions. |
JobProperties |
An interface representing JobProperties. |
JobRequest |
An interface representing JobRequest. |
JobResponse |
An interface representing JobResponse. |
JobsQueryScheduledJobsOptionalParams |
Optional Parameters. |
ModulesCreateOrUpdateIdentityOptionalParams |
Optional Parameters. |
ModulesDeleteIdentityOptionalParams |
Optional Parameters. |
ModulesReplaceTwinOptionalParams |
Optional Parameters. |
ModulesUpdateTwinOptionalParams |
Optional Parameters. |
PropertyContainer |
The desired and reported properties of the twin. The maximum depth of the object is 10. |
PurgeMessageQueueResult |
The result of a device message queue purge operation. |
QueryGetTwinsHeaders |
Defines headers for GetTwins operation. |
QueryGetTwinsOptionalParams |
Optional Parameters. |
QueryResult |
The query result. |
QuerySpecification |
The Json query request. |
RegistryStatistics |
An interface representing RegistryStatistics. |
ServiceStatistics |
An interface representing ServiceStatistics. |
SymmetricKey |
An interface representing SymmetricKey. |
TwinProperties |
The desired and reported properties of the twin. The maximum depth of the object is 10. |
X509Thumbprint |
An interface representing X509Thumbprint. |
BulkRegistryOperationResult | |
DeviceDescription | |
DeviceRegistryOperationError | |
JobStatus | |
QueryDescription | |
RegistryStatistics | |
TransportConfig |
Type Aliases
DigitalTwinInvokeComponentCommandResponse |
Contains response data for the invokeComponentCommand operation. |
DigitalTwinInvokeRootLevelCommandResponse |
Contains response data for the invokeRootLevelCommand operation. |
DigitalTwinResponse | |
DigitalTwinUpdateResponse | |
TransportCtor | |
ConnectionState | |
DeviceStatus | |
IncomingMessageCallback | |
ResultWithIncomingMessage | |
JobCallback | |
JobStatus | |
JobStatusResponse | |
JobType | |
AuthenticationType |
Defines values for AuthenticationType. Possible values include: 'sas', 'selfSigned', 'certificateAuthority', 'none' |
BulkRegistryUpdateRegistryResponse |
Contains response data for the updateRegistry operation. |
CloudToDeviceMessagesPurgeCloudToDeviceMessageQueueResponse |
Contains response data for the purgeCloudToDeviceMessageQueue operation. |
ConfigurationCreateOrUpdateResponse |
Contains response data for the createOrUpdate operation. |
ConfigurationGetConfigurationsResponse |
Contains response data for the getConfigurations operation. |
ConfigurationGetResponse |
Contains response data for the get operation. |
ConfigurationTestQueriesResponse |
Contains response data for the testQueries operation. |
ConnectionState |
Defines values for ConnectionState. Possible values include: 'Disconnected', 'Connected' |
ConnectionState1 |
Defines values for ConnectionState1. Possible values include: 'Disconnected', 'Connected' |
ConnectionState2 |
Defines values for ConnectionState2. Possible values include: 'Disconnected', 'Connected' |
DevicesCreateOrUpdateIdentityResponse |
Contains response data for the createOrUpdateIdentity operation. |
DevicesGetDevicesResponse |
Contains response data for the getDevices operation. |
DevicesGetIdentityResponse |
Contains response data for the getIdentity operation. |
DevicesGetTwinResponse |
Contains response data for the getTwin operation. |
DevicesInvokeMethodResponse |
Contains response data for the invokeMethod operation. |
DevicesReplaceTwinResponse |
Contains response data for the replaceTwin operation. |
DevicesUpdateTwinResponse |
Contains response data for the updateTwin operation. |
DigitalTwinGetDigitalTwinResponse |
Contains response data for the getDigitalTwin operation. |
DigitalTwinUpdateDigitalTwinResponse |
Contains response data for the updateDigitalTwin operation. |
ErrorCode |
Defines values for ErrorCode. Possible values include: 'InvalidErrorCode', 'GenericBadRequest', 'InvalidProtocolVersion', 'DeviceInvalidResultCount', 'InvalidOperation', 'ArgumentInvalid', 'ArgumentNull', 'IotHubFormatError', 'DeviceStorageEntitySerializationError', 'BlobContainerValidationError', 'ImportWarningExistsError', 'InvalidSchemaVersion', 'DeviceDefinedMultipleTimes', 'DeserializationError', 'BulkRegistryOperationFailure', 'DefaultStorageEndpointNotConfigured', 'InvalidFileUploadCorrelationId', 'ExpiredFileUploadCorrelationId', 'InvalidStorageEndpoint', 'InvalidMessagingEndpoint', 'InvalidFileUploadCompletionStatus', 'InvalidStorageEndpointOrBlob', 'RequestCanceled', 'InvalidStorageEndpointProperty', 'EtagDoesNotMatch', 'RequestTimedOut', 'UnsupportedOperationOnReplica', 'NullMessage', 'ConnectionForcefullyClosedOnNewConnection', 'InvalidDeviceScope', 'ConnectionForcefullyClosedOnFaultInjection', 'ConnectionRejectedOnFaultInjection', 'InvalidEndpointAuthenticationType', 'ManagedIdentityNotEnabled', 'InvalidRouteTestInput', 'InvalidSourceOnRoute', 'RoutingNotEnabled', 'InvalidContentEncodingOrType', 'InvalidEndorsementKey', 'InvalidRegistrationId', 'InvalidStorageRootKey', 'InvalidEnrollmentGroupId', 'TooManyEnrollments', 'RegistrationIdDefinedMultipleTimes', 'CustomAllocationFailed', 'CustomAllocationIotHubNotSpecified', 'CustomAllocationUnauthorizedAccess', 'CannotRegisterModuleToModule', 'TenantHubRoutingNotEnabled', 'InvalidConfigurationTargetCondition', 'InvalidConfigurationContent', 'CannotModifyImmutableConfigurationContent', 'InvalidConfigurationCustomMetricsQuery', 'InvalidPnPInterfaceDefinition', 'InvalidPnPDesiredProperties', 'InvalidPnPReportedProperties', 'InvalidPnPWritableReportedProperties', 'InvalidDigitalTwinJsonPatch', 'InvalidDigitalTwinPayload', 'InvalidDigitalTwinPatch', 'InvalidDigitalTwinPatchPath', 'GenericUnauthorized', 'IotHubNotFound', 'IotHubUnauthorizedAccess', 'IotHubUnauthorized', 'ElasticPoolNotFound', 'SystemModuleModifyUnauthorizedAccess', 'GenericForbidden', 'IotHubSuspended', 'IotHubQuotaExceeded', 'JobQuotaExceeded', 'DeviceMaximumQueueDepthExceeded', 'IotHubMaxCbsTokenExceeded', 'DeviceMaximumActiveFileUploadLimitExceeded', 'DeviceMaximumQueueSizeExceeded', 'RoutingEndpointResponseForbidden', 'InvalidMessageExpiryTime', 'OperationNotAvailableInCurrentTier', 'KeyEncryptionKeyRevoked', 'DeviceModelMaxPropertiesExceeded', 'DeviceModelMaxIndexablePropertiesExceeded', 'IotDpsSuspended', 'IotDpsSuspending', 'GenericNotFound', 'DeviceNotFound', 'JobNotFound', 'QuotaMetricNotFound', 'SystemPropertyNotFound', 'AmqpAddressNotFound', 'RoutingEndpointResponseNotFound', 'CertificateNotFound', 'ElasticPoolTenantHubNotFound', 'ModuleNotFound', 'AzureTableStoreNotFound', 'IotHubFailingOver', 'FeatureNotSupported', 'DigitalTwinInterfaceNotFound', 'QueryStoreClusterNotFound', 'DeviceNotOnline', 'DeviceConnectionClosedRemotely', 'EnrollmentNotFound', 'DeviceRegistrationNotFound', 'AsyncOperationNotFound', 'EnrollmentGroupNotFound', 'DeviceRecordNotFound', 'GroupRecordNotFound', 'DeviceGroupNotFound', 'ProvisioningSettingsNotFound', 'ProvisioningRecordNotFound', 'LinkedHubNotFound', 'CertificateAuthorityNotFound', 'ConfigurationNotFound', 'GroupNotFound', 'DigitalTwinModelNotFound', 'InterfaceNameModelNotFound', 'GenericMethodNotAllowed', 'OperationNotAllowedInCurrentState', 'ImportDevicesNotSupported', 'BulkAddDevicesNotSupported', 'GenericConflict', 'DeviceAlreadyExists', 'LinkCreationConflict', 'CallbackSubscriptionConflict', 'ModelAlreadyExists', 'DeviceLocked', 'DeviceJobAlreadyExists', 'JobAlreadyExists', 'EnrollmentConflict', 'EnrollmentGroupConflict', 'RegistrationStatusConflict', 'DeviceRecordConflict', 'GroupRecordConflict', 'DeviceGroupConflict', 'ProvisioningSettingsConflict', 'ProvisioningRecordConflict', 'LinkedHubConflict', 'CertificateAuthorityConflict', 'ModuleAlreadyExistsOnDevice', 'ConfigurationAlreadyExists', 'ApplyConfigurationAlreadyInProgressOnDevice', 'DigitalTwinModelAlreadyExists', 'DigitalTwinModelExistsWithOtherModelType', 'InterfaceNameModelAlreadyExists', 'GenericPreconditionFailed', 'PreconditionFailed', 'DeviceMessageLockLost', 'JobRunPreconditionFailed', 'InflightMessagesInLink', 'GenericRequestEntityTooLarge', 'MessageTooLarge', 'TooManyDevices', 'TooManyModulesOnDevice', 'ConfigurationCountLimitExceeded', 'DigitalTwinModelCountLimitExceeded', 'InterfaceNameCompressionModelCountLimitExceeded', 'GenericUnsupportedMediaType', 'IncompatibleDataType', 'GenericTooManyRequests', 'ThrottlingException', 'ThrottleBacklogLimitExceeded', 'ThrottlingBacklogTimeout', 'ThrottlingMaxActiveJobCountExceeded', 'DeviceThrottlingLimitExceeded', 'ClientClosedRequest', 'GenericServerError', 'ServerError', 'JobCancelled', 'StatisticsRetrievalError', 'ConnectionForcefullyClosed', 'InvalidBlobState', 'BackupTimedOut', 'AzureStorageTimeout', 'GenericTimeout', 'InvalidThrottleParameter', 'EventHubLinkAlreadyClosed', 'ReliableBlobStoreError', 'RetryAttemptsExhausted', 'AzureTableStoreError', 'CheckpointStoreNotFound', 'DocumentDbInvalidReturnValue', 'ReliableDocDbStoreStoreError', 'ReliableBlobStoreTimeoutError', 'ConfigReadFailed', 'InvalidContainerReceiveLink', 'InvalidPartitionEpoch', 'RestoreTimedOut', 'StreamReservationFailure', 'SerializationError', 'UnexpectedPropertyValue', 'OrchestrationOperationFailed', 'ModelRepoEndpointError', 'ResolutionError', 'UnableToFetchCredentials', 'UnableToFetchTenantInfo', 'UnableToShareIdentity', 'UnableToExpandDiscoveryInfo', 'UnableToExpandComponentInfo', 'UnableToCompressComponentInfo', 'UnableToCompressDiscoveryInfo', 'OrphanDiscoveryDocument', 'GenericBadGateway', 'InvalidResponseWhileProxying', 'GenericServiceUnavailable', 'ServiceUnavailable', 'PartitionNotFound', 'IotHubActivationFailed', 'ServerBusy', 'IotHubRestoring', 'ReceiveLinkOpensThrottled', 'ConnectionUnavailable', 'DeviceUnavailable', 'ConfigurationNotAvailable', 'GroupNotAvailable', 'HostingServiceNotAvailable', 'GenericGatewayTimeout', 'GatewayTimeout' |
ImportMode |
Defines values for ImportMode. Possible values include: 'create', 'update', 'updateIfMatchETag', 'delete', 'deleteIfMatchETag', 'updateTwin', 'updateTwinIfMatchETag' |
JobsCancelImportExportJobResponse |
Contains response data for the cancelImportExportJob operation. |
JobsCancelScheduledJobResponse |
Contains response data for the cancelScheduledJob operation. |
JobsCreateImportExportJobResponse |
Contains response data for the createImportExportJob operation. |
JobsCreateScheduledJobResponse |
Contains response data for the createScheduledJob operation. |
JobsGetImportExportJobResponse |
Contains response data for the getImportExportJob operation. |
JobsGetImportExportJobsResponse |
Contains response data for the getImportExportJobs operation. |
JobsGetScheduledJobResponse |
Contains response data for the getScheduledJob operation. |
JobsQueryScheduledJobsResponse |
Contains response data for the queryScheduledJobs operation. |
ModulesCreateOrUpdateIdentityResponse |
Contains response data for the createOrUpdateIdentity operation. |
ModulesGetIdentityResponse |
Contains response data for the getIdentity operation. |
ModulesGetModulesOnDeviceResponse |
Contains response data for the getModulesOnDevice operation. |
ModulesGetTwinResponse |
Contains response data for the getTwin operation. |
ModulesInvokeMethodResponse |
Contains response data for the invokeMethod operation. |
ModulesReplaceTwinResponse |
Contains response data for the replaceTwin operation. |
ModulesUpdateTwinResponse |
Contains response data for the updateTwin operation. |
QueryGetTwinsResponse |
Contains response data for the getTwins operation. |
StatisticsGetDeviceStatisticsResponse |
Contains response data for the getDeviceStatistics operation. |
StatisticsGetServiceStatisticsResponse |
Contains response data for the getServiceStatistics operation. |
Status |
Defines values for Status. Possible values include: 'enabled', 'disabled' |
Status1 |
Defines values for Status1. Possible values include: 'enabled', 'disabled' |
Status2 |
Defines values for Status2. Possible values include: 'enabled', 'disabled' |
Status3 |
Defines values for Status3. Possible values include: 'unknown', 'enqueued', 'running', 'completed', 'failed', 'cancelled', 'scheduled', 'queued' |
Status4 |
Defines values for Status4. Possible values include: 'unknown', 'enqueued', 'running', 'completed', 'failed', 'cancelled', 'scheduled', 'queued' |
StorageAuthenticationType |
Defines values for StorageAuthenticationType. Possible values include: 'keyBased', 'identityBased' |
Type |
Defines values for Type. Possible values include: 'sas', 'selfSigned', 'certificateAuthority', 'none' |
Type1 |
Defines values for Type1. Possible values include: 'unknown', 'export', 'import', 'backup', 'readDeviceProperties', 'writeDeviceProperties', 'updateDeviceConfiguration', 'rebootDevice', 'factoryResetDevice', 'firmwareUpdate', 'scheduleDeviceMethod', 'scheduleUpdateTwin', 'restoreFromBackup', 'failoverDataCopy' |
Type2 |
Defines values for Type2. Possible values include: 'unknown', 'export', 'import', 'backup', 'readDeviceProperties', 'writeDeviceProperties', 'updateDeviceConfiguration', 'rebootDevice', 'factoryResetDevice', 'firmwareUpdate', 'scheduleDeviceMethod', 'scheduleUpdateTwin', 'restoreFromBackup', 'failoverDataCopy' |
Type3 |
Defines values for Type3. Possible values include: 'unknown', 'export', 'import', 'backup', 'readDeviceProperties', 'writeDeviceProperties', 'updateDeviceConfiguration', 'rebootDevice', 'factoryResetDevice', 'firmwareUpdate', 'scheduleDeviceMethod', 'scheduleUpdateTwin', 'restoreFromBackup', 'failoverDataCopy' |
Type4 |
Defines values for Type4. Possible values include: 'unknown', 'twin', 'deviceJob', 'jobResponse', 'raw', 'enrollment', 'enrollmentGroup', 'deviceRegistration' |
WarningCode |
Defines values for WarningCode. Possible values include: 'DeviceRegisteredWithoutTwin' |
BulkRegistryOperationType | |
JobCallback | |
ResponseCallback |
Functions
parse(string) | Parses a string in the format of a Shared Access Signature token and returns a fromSharedAccessSignature(string, Client.TransportCtor). |
create |
|
create |
|
create(string, string, string, string | number) | Creates a shared access signature token to authenticate a service connection with an Azure IoT hub. |
version |
Function Details
parse(string)
Parses a string in the format of a Shared Access Signature token and returns a fromSharedAccessSignature(string, Client.TransportCtor).
function parse(source: string): SharedAccessSignature
Parameters
- source
-
string
A shared access signature string.
Returns
SharedAccessSignature
An object containing the different shared access signature properties extracted from the string given as a parameter
createResultWithIncomingMessage<TResult>(TResult, IncomingMessage)
function createResultWithIncomingMessage<TResult>(result: TResult, message: IncomingMessage): ResultWithIncomingMessage<TResult>
Parameters
- result
-
TResult
- message
-
IncomingMessage
Returns
ResultWithIncomingMessage<TResult>
createJobStatusResponse(any, any)
function createJobStatusResponse(jobStatus: any, response: any): JobStatusResponse
Parameters
- jobStatus
-
any
- response
-
any
Returns
create(string, string, string, string | number)
Creates a shared access signature token to authenticate a service connection with an Azure IoT hub.
function create(host: string, policy: string, key: string, expiry: string | number): SharedAccessSignature
Parameters
- host
-
string
Hostname of the Azure IoT hub.
- policy
-
string
Name of the policy to use to connect to the Azure IoT hub (typically ServiceConnect
, iothubowner
etc. See Control access to your Azure IoT hub.
- key
-
string
Symmetric key to use to create shared access signature tokens.
- expiry
-
string | number
Expiry time for the token that will be created.
Returns
SharedAccessSignature
A shared access signature to be used to connect with an Azure IoT hub.
versionQueryString()
function versionQueryString(): string
Returns
string