Registry class
登錄類別提供IoT中樞裝置身分識別服務的存取權。 SDK 的用戶應該使用其中一個 Factory 方法具現化此類別:fromConnectionString,或從SharedAccessSignature 。
用於裝置身分識別登錄作業的通訊協定是 HTTPS。
方法
方法詳細資料
addConfiguration(Configuration)
function addConfiguration(configuration: Configuration): Promise<ResultWithHttpResponse<any>>
參數
- configuration
- Configuration
傳回
Promise<ResultWithHttpResponse<any>>
addConfiguration(Configuration, HttpResponseCallback<any>)
將設定新增至IoT中樞。
function addConfiguration(configuration: Configuration, done?: HttpResponseCallback<any>)
參數
- configuration
- Configuration
module:azure-iothub 類型的物件。要新增至中樞的組態
- done
-
HttpResponseCallback<any>
作業完成時要呼叫的選擇性函式。
done
會以三個自變數呼叫:Error 物件(可以是 null)、響應主體,以及可用於記錄或偵錯的傳輸特定回應物件。
addDevices(DeviceDescription[])
function addDevices(devices: DeviceDescription[]): Promise<ResultWithHttpResponse<BulkRegistryOperationResult>>
參數
- devices
傳回
Promise<ResultWithHttpResponse<BulkRegistryOperationResult>>
addDevices(DeviceDescription[], HttpResponseCallback<BulkRegistryOperationResult>)
新增裝置陣列。
function addDevices(devices: DeviceDescription[], done?: HttpResponseCallback<BulkRegistryOperationResult>)
參數
- devices
對象的陣列,必須包含值為有效裝置標識碼的 deviceId
屬性。
- done
-
HttpResponseCallback<BulkRegistryOperationResult>
作業完成時要呼叫的選擇性函式。
done
會使用三個自變數來呼叫:Error 物件(可以是 null)、BulkRegistryOperationResult 和可用於記錄或偵錯的傳輸特定回應物件。
addModule(Module)
function addModule(module: Module): Promise<ResultWithHttpResponse<any>>
參數
- module
- Module
傳回
Promise<ResultWithHttpResponse<any>>
addModule(Module, HttpResponseCallback<any>)
將指定的模組新增至登錄。
function addModule(module: Module, done?: HttpResponseCallback<any>)
參數
- module
- Module
要新增至登錄的Module物件。
- done
-
HttpResponseCallback<any>
作業完成時要呼叫的選擇性函式。
done
會以三個自變數呼叫:Error 物件(可以是 null)、響應主體,以及可用於記錄或偵錯的傳輸特定回應物件。
applyConfigurationContentOnDevice(string, ConfigurationContent)
function applyConfigurationContentOnDevice(deviceId: string, content: ConfigurationContent): Promise<ResultWithHttpResponse<any>>
參數
- deviceId
-
string
- content
- ConfigurationContent
傳回
Promise<ResultWithHttpResponse<any>>
applyConfigurationContentOnDevice(string, ConfigurationContent, HttpResponseCallback<any>)
將指定的設定套用至IoT中樞上的裝置
function applyConfigurationContentOnDevice(deviceId: string, content: ConfigurationContent, done?: HttpResponseCallback<any>)
參數
- deviceId
-
string
要套用設定的裝置標識碼
- content
- ConfigurationContent
要套用的組態
- done
-
HttpResponseCallback<any>
作業完成時要呼叫的選擇性函式。
done
會以三個自變數呼叫:Error 物件(可以是 null)、響應主體,以及可用於記錄或偵錯的傳輸特定回應物件。
cancelJob(string)
cancelJob(string, Callback<JobStatus>)
取消大容量導入/匯出作業。
function cancelJob(jobId: string, done?: Callback<JobStatus>)
參數
- jobId
-
string
使用者想要取得狀態信息的作業標識碼。
- done
-
Callback<JobStatus>
要以兩個自變數呼叫的選擇性函式:如果發生錯誤,則為錯誤對象,否則為 null,以及其標識元傳遞為自變數之作業的狀態。
create(DeviceDescription)
function create(deviceInfo: DeviceDescription): Promise<ResultWithHttpResponse<Device>>
參數
- deviceInfo
- DeviceDescription
傳回
Promise<ResultWithHttpResponse<Device>>
create(DeviceDescription, HttpResponseCallback<Device>)
在 IoT 中樞上建立新的裝置身分識別。
function create(deviceInfo: DeviceDescription, done?: HttpResponseCallback<Device>)
參數
- deviceInfo
- DeviceDescription
對象必須包含具有有效裝置識別碼的 deviceId
屬性。
createQuery(string, number)
建立可在IoT中樞實例上執行的查詢,以尋找裝置或作業的相關信息。
function createQuery(sqlQuery: string, pageSize?: number): Query
參數
- sqlQuery
-
string
寫入為 SQL 字串的查詢。
- pageSize
-
number
每個頁面所需的結果數目(選擇性。預設值:1000、最大值:10000)。
傳回
Query
delete(string)
function delete(deviceId: string): Promise<ResultWithHttpResponse<any>>
參數
- deviceId
-
string
傳回
Promise<ResultWithHttpResponse<any>>
delete(string, HttpResponseCallback<any>)
從 IoT 中樞移除現有的裝置身分識別。
function delete(deviceId: string, done?: HttpResponseCallback<any>)
參數
- deviceId
-
string
現有裝置身分識別的標識碼。
- done
-
HttpResponseCallback<any>
作業完成時要呼叫的選擇性函式。
done
會使用三個自變數來呼叫:Error 物件(可以是 null)、always-null 自變數(適用於與其他方法的一致性),以及適用於記錄或偵錯的傳輸特定回應物件。
exportDevicesToBlob(string, boolean)
function exportDevicesToBlob(outputBlobContainerUri: string, excludeKeys: boolean): Promise<JobStatus>
參數
- outputBlobContainerUri
-
string
- excludeKeys
-
boolean
傳回
Promise<JobStatus>
exportDevicesToBlob(string, boolean, Callback<JobStatus>)
將裝置導出至大量作業中的 Blob。
function exportDevicesToBlob(outputBlobContainerUri: string, excludeKeys: boolean, done?: Callback<JobStatus>)
參數
- outputBlobContainerUri
-
string
容器的 URI,其中將建立名為 『devices.txt』 的 Blob,其中包含裝置清單。
- excludeKeys
-
boolean
布爾值,指出是否應該從匯出的數據中排除安全性密鑰。
- done
-
Callback<JobStatus>
建立作業時要呼叫的選擇性函式,包含兩個自變數:如果發生錯誤,則為錯誤對象,否則為 Null,以及可用來追蹤裝置導出進度的作業狀態。
exportDevicesToBlobByIdentity(string, boolean)
function exportDevicesToBlobByIdentity(outputBlobContainerUri: string, excludeKeys: boolean): Promise<JobStatus>
參數
- outputBlobContainerUri
-
string
- excludeKeys
-
boolean
傳回
Promise<JobStatus>
exportDevicesToBlobByIdentity(string, boolean, Callback<JobStatus>)
使用已設定的身分識別,將裝置導出至大量作業中的 Blob。
function exportDevicesToBlobByIdentity(outputBlobContainerUri: string, excludeKeys: boolean, done?: Callback<JobStatus>)
參數
- outputBlobContainerUri
-
string
容器的 URI,其中將建立名為 『devices.txt』 的 Blob,其中包含裝置清單。
- excludeKeys
-
boolean
布爾值,指出是否應該從匯出的數據中排除安全性密鑰。
- done
-
Callback<JobStatus>
建立作業時要呼叫的選擇性函式,包含兩個自變數:如果發生錯誤,則為錯誤對象,否則為 Null,以及可用來追蹤裝置導出進度的作業狀態。
exportDevicesToBlobByIdentity(string, boolean, string)
function exportDevicesToBlobByIdentity(outputBlobContainerUri: string, excludeKeys: boolean, userAssignedIdentity: string): Promise<JobStatus>
參數
- outputBlobContainerUri
-
string
- excludeKeys
-
boolean
- userAssignedIdentity
-
string
傳回
Promise<JobStatus>
exportDevicesToBlobByIdentity(string, boolean, string, Callback<JobStatus>)
function exportDevicesToBlobByIdentity(outputBlobContainerUri: string, excludeKeys: boolean, userAssignedIdentity: string, done: Callback<JobStatus>)
參數
- outputBlobContainerUri
-
string
- excludeKeys
-
boolean
- userAssignedIdentity
-
string
- done
-
Callback<JobStatus>
fromConnectionString(string)
從指定的連接字串建構 Registry 物件。
static function fromConnectionString(value: string): Registry
參數
- value
-
string
連接字串,封裝適當的登錄許可權(讀取和/或寫入)。
傳回
fromSharedAccessSignature(string)
從指定的共用存取簽章建構 Registry 物件。
static function fromSharedAccessSignature(value: string): Registry
參數
- value
-
string
共用存取簽章,封裝適當的登錄許可權(讀取和/或寫入)。
傳回
fromTokenCredential(string, TokenCredential)
從指定的 Azure TokenCredential 建構登錄物件。
static function fromTokenCredential(hostName: string, tokenCredential: TokenCredential): Registry
參數
- hostName
-
string
Azure 服務的主機名。
- tokenCredential
- TokenCredential
用來向 Azure 服務進行驗證的 Azure TokenCredential
傳回
get(string)
function get(deviceId: string): Promise<ResultWithHttpResponse<Device>>
參數
- deviceId
-
string
傳回
Promise<ResultWithHttpResponse<Device>>
get(string, HttpResponseCallback<Device>)
要求 IoT 中樞上現有裝置身分識別的相關信息。
function get(deviceId: string, done?: HttpResponseCallback<Device>)
參數
- deviceId
-
string
現有裝置身分識別的標識碼。
getConfiguration(string)
function getConfiguration(configurationId: string): Promise<ResultWithHttpResponse<Configuration>>
參數
- configurationId
-
string
傳回
Promise<ResultWithHttpResponse<Configuration>>
getConfiguration(string, HttpResponseCallback<Configuration>)
從IoT中樞取得單一組態
function getConfiguration(configurationId: string, done?: HttpResponseCallback<Configuration>)
參數
- configurationId
-
string
要擷取之組態的標識碼
- done
-
HttpResponseCallback<Configuration>
選擇性回呼,其會以 Error 物件或 module:azure-iothub 呼叫。組態物件與組態詳細數據。
getConfigurations()
function getConfigurations(): Promise<ResultWithHttpResponse<Configuration[]>>
傳回
Promise<ResultWithHttpResponse<Configuration[]>>
getConfigurations(HttpResponseCallback<Configuration[]>)
取得IoT中樞上的所有設定
function getConfigurations(done?: HttpResponseCallback<Configuration[]>)
參數
- done
-
HttpResponseCallback<Configuration[]>
選擇性回呼,其會以 Error 物件或 module:azure-iothub 陣列呼叫。所有組態的組態物件。
getJob(string)
getJob(string, Callback<JobStatus>)
取得大容量導入/匯出作業的狀態。
function getJob(jobId: string, done?: Callback<JobStatus>)
參數
- jobId
-
string
使用者想要取得狀態信息的作業標識碼。
- done
-
Callback<JobStatus>
要以兩個自變數呼叫的選擇性函式:如果發生錯誤,則為錯誤對象,否則為 null,以及標識元傳遞為自變數之作業的狀態。
getModule(string, string)
function getModule(deviceId: string, moduleId: string): Promise<ResultWithHttpResponse<Module>>
參數
- deviceId
-
string
- moduleId
-
string
傳回
Promise<ResultWithHttpResponse<Module>>
getModule(string, string, HttpResponseCallback<Module>)
從 IoT 中樞上的裝置取得單一模組
function getModule(deviceId: string, moduleId: string, done?: HttpResponseCallback<Module>)
參數
- deviceId
-
string
擁有模組的裝置識別碼。
- moduleId
-
string
要擷取的模組標識碼
- done
-
HttpResponseCallback<Module>
選擇性回呼,其會使用 Error 物件或 module:azure-iothub 呼叫。所要求模組的Module物件
getModulesOnDevice(string)
function getModulesOnDevice(deviceId: string): Promise<ResultWithHttpResponse<Module[]>>
參數
- deviceId
-
string
傳回
Promise<ResultWithHttpResponse<Module[]>>
getModulesOnDevice(string, HttpResponseCallback<Module[]>)
取得IoT中樞裝置上所有模組的清單
function getModulesOnDevice(deviceId: string, done?: HttpResponseCallback<Module[]>)
參數
- deviceId
-
string
我們取得模組的裝置標識碼
- done
-
HttpResponseCallback<Module[]>
選擇性回呼,其會以 Error 物件或 module:azure-iothub 陣列呼叫。所有模組的模組物件。
getModuleTwin(string, string)
function getModuleTwin(deviceId: string, moduleId: string): Promise<ResultWithHttpResponse<Twin>>
參數
- deviceId
-
string
- moduleId
-
string
傳回
Promise<ResultWithHttpResponse<Twin>>
getModuleTwin(string, string, HttpResponseCallback<Twin>)
取得具有指定模組識別碼之模組的模組對應項。
function getModuleTwin(deviceId: string, moduleId: string, done?: HttpResponseCallback<Twin>)
參數
- deviceId
-
string
裝置標識碼。
- moduleId
-
string
模組標識碼。
- done
-
HttpResponseCallback<Twin>
將搭配 Error 物件或模組對應項實例呼叫的選擇性回呼。
getRegistryStatistics()
function getRegistryStatistics(): Promise<ResultWithHttpResponse<RegistryStatistics>>
傳回
Promise<ResultWithHttpResponse<RegistryStatistics>>
getRegistryStatistics(HttpResponseCallback<RegistryStatistics>)
取得裝置身分識別登錄中裝置的相關統計數據。
function getRegistryStatistics(done?: HttpResponseCallback<RegistryStatistics>)
參數
- done
-
HttpResponseCallback<RegistryStatistics>
將搭配 Error 物件或裝置登錄統計數據呼叫的選擇性回呼。
getTwin(string)
function getTwin(deviceId: string): Promise<ResultWithHttpResponse<Twin>>
參數
- deviceId
-
string
傳回
Promise<ResultWithHttpResponse<Twin>>
getTwin(string, HttpResponseCallback<Twin>)
取得具有指定裝置標識碼之裝置的裝置對應項。
function getTwin(deviceId: string, done?: HttpResponseCallback<Twin>)
參數
- deviceId
-
string
裝置標識碼。
- done
-
HttpResponseCallback<Twin>
將搭配 Error 物件或裝置對應項實例呼叫的選擇性回呼。
importDevicesFromBlob(string, string)
function importDevicesFromBlob(inputBlobContainerUri: string, outputBlobContainerUri: string): Promise<JobStatus>
參數
- inputBlobContainerUri
-
string
- outputBlobContainerUri
-
string
傳回
Promise<JobStatus>
importDevicesFromBlob(string, string, Callback<JobStatus>)
從大量作業中的 Blob 匯入裝置。
function importDevicesFromBlob(inputBlobContainerUri: string, outputBlobContainerUri: string, done?: Callback<JobStatus>)
參數
- inputBlobContainerUri
-
string
容器的 URI,其中包含要匯入之裝置清單的 Blob 名為 『devices.txt』。
- outputBlobContainerUri
-
string
容器的 URI,其中 Blob 會使用匯入程式的記錄來建立。
- done
-
Callback<JobStatus>
建立作業時要呼叫的選擇性函式,有兩個自變數:發生錯誤時發生錯誤對象,否則為 Null,以及可用來追蹤裝置匯入進度的作業狀態。
importDevicesFromBlobByIdentity(string, string)
function importDevicesFromBlobByIdentity(inputBlobContainerUri: string, outputBlobContainerUri: string): Promise<JobStatus>
參數
- inputBlobContainerUri
-
string
- outputBlobContainerUri
-
string
傳回
Promise<JobStatus>
importDevicesFromBlobByIdentity(string, string, Callback<JobStatus>)
使用已設定的身分識別,從 Blob 匯入大量作業中的裝置。
function importDevicesFromBlobByIdentity(inputBlobContainerUri: string, outputBlobContainerUri: string, done?: Callback<JobStatus>)
參數
- inputBlobContainerUri
-
string
容器的 URI,其中包含要匯入之裝置清單的 Blob 名為 『devices.txt』。
- outputBlobContainerUri
-
string
容器的 URI,其中 Blob 會使用匯入程式的記錄來建立。
- done
-
Callback<JobStatus>
建立作業時要呼叫的選擇性函式,有兩個自變數:發生錯誤時發生錯誤對象,否則為 Null,以及可用來追蹤裝置匯入進度的作業狀態。
importDevicesFromBlobByIdentity(string, string, string)
function importDevicesFromBlobByIdentity(inputBlobContainerUri: string, outputBlobContainerUri: string, userAssignedIdentity: string): Promise<JobStatus>
參數
- inputBlobContainerUri
-
string
- outputBlobContainerUri
-
string
- userAssignedIdentity
-
string
傳回
Promise<JobStatus>
importDevicesFromBlobByIdentity(string, string, string, Callback<JobStatus>)
function importDevicesFromBlobByIdentity(inputBlobContainerUri: string, outputBlobContainerUri: string, userAssignedIdentity: string, done: Callback<JobStatus>)
參數
- inputBlobContainerUri
-
string
- outputBlobContainerUri
-
string
- userAssignedIdentity
-
string
- done
-
Callback<JobStatus>
list()
function list(): Promise<ResultWithHttpResponse<Device[]>>
傳回
Promise<ResultWithHttpResponse<Device[]>>
list(HttpResponseCallback<Device[]>)
要求 IoT 中樞上前 1000 個裝置身分識別的相關信息。
function list(done?: HttpResponseCallback<Device[]>)
參數
listJobs()
function listJobs(): Promise<ResultWithHttpResponse<any>>
傳回
Promise<ResultWithHttpResponse<any>>
listJobs(HttpResponseCallback<any>)
列出最後一個匯入/匯出作業(包括作用中作業,如果有的話)。
function listJobs(done?: HttpResponseCallback<any>)
參數
- done
-
HttpResponseCallback<any>
要以兩個自變數呼叫的選擇性函式:如果發生錯誤,則為錯誤對象,否則為 Null,以及過去的作業清單做為自變數。
removeConfiguration(string)
function removeConfiguration(configurationId: string): Promise<ResultWithHttpResponse<any>>
參數
- configurationId
-
string
傳回
Promise<ResultWithHttpResponse<any>>
removeConfiguration(string, HttpResponseCallback<any>)
從 IoT 中樞移除具有指定識別碼的設定
function removeConfiguration(configurationId: string, done?: HttpResponseCallback<any>)
參數
- configurationId
-
string
要移除之組態的標識碼
- done
-
HttpResponseCallback<any>
作業完成時要呼叫的選擇性函式。
done
會以三個自變數呼叫:Error 物件(可以是 null)、響應主體,以及可用於記錄或偵錯的傳輸特定回應物件。
removeDevices(DeviceDescription[], boolean)
function removeDevices(devices: DeviceDescription[], forceRemove: boolean): Promise<ResultWithHttpResponse<BulkRegistryOperationResult>>
參數
- devices
- forceRemove
-
boolean
傳回
Promise<ResultWithHttpResponse<BulkRegistryOperationResult>>
removeDevices(DeviceDescription[], boolean, HttpResponseCallback<BulkRegistryOperationResult>)
更新裝置陣列。
function removeDevices(devices: DeviceDescription[], forceRemove: boolean, done?: HttpResponseCallback<BulkRegistryOperationResult>)
參數
- devices
對象的陣列,必須包含值為有效裝置標識碼的 deviceId
屬性。
- forceRemove
-
boolean
如果 forceRemove
為 true,則不論 etag 為何,都會移除裝置。 否則 etag 必須相符。
- done
-
HttpResponseCallback<BulkRegistryOperationResult>
作業完成時要呼叫的選擇性函式。
done
會使用三個自變數來呼叫:Error 物件(可以是 null)、BulkRegistryOperationResult 和可用於記錄或偵錯的傳輸特定回應物件。
removeModule(Module, TripleValueCallback<any, any>)
從登錄中移除指定的模組
function removeModule(module: Module, done?: TripleValueCallback<any, any>)
參數
- module
- Module
- done
-
TripleValueCallback<any, any>
作業完成時要呼叫的選擇性函式。
done
會以三個自變數呼叫:Error 物件(可以是 null)、響應主體,以及可用於記錄或偵錯的傳輸特定回應物件。
removeModule(string | Module)
function removeModule(moduleOrDeviceId: string | Module): Promise<ResultWithHttpResponse<any>>
參數
- moduleOrDeviceId
-
string | Module
傳回
Promise<ResultWithHttpResponse<any>>
removeModule(string | Module, string)
function removeModule(moduleOrDeviceId: string | Module, moduleId: string): Promise<ResultWithHttpResponse<any>>
參數
- moduleOrDeviceId
-
string | Module
- moduleId
-
string
傳回
Promise<ResultWithHttpResponse<any>>
removeModule(string, string, TripleValueCallback<any, any>)
function removeModule(deviceId: string, moduleId: string, done: TripleValueCallback<any, any>)
參數
- deviceId
-
string
- moduleId
-
string
- done
-
TripleValueCallback<any, any>
update(DeviceDescription)
function update(deviceInfo: DeviceDescription): Promise<ResultWithHttpResponse<Device>>
參數
- deviceInfo
- DeviceDescription
傳回
Promise<ResultWithHttpResponse<Device>>
update(DeviceDescription, HttpResponseCallback<Device>)
使用指定的裝置資訊,更新IoT中樞上現有的裝置身分識別。
deviceInfo
參數必須包含所有可更新的屬性。 例如,如果將 status
屬性從 disabled
更新為 enabled
,則 deviceInfo
對象也應該具有 statusReason、authentication(及其子屬性)、功能,以及 deviceScope 設定為裝置目前的值,或這些屬性將會重設。 建議您先呼叫 get api,再執行更新。
function update(deviceInfo: DeviceDescription, done?: HttpResponseCallback<Device>)
參數
- deviceInfo
- DeviceDescription
物件,其值必須是有效的裝置標識碼 deviceId
屬性。
updateConfiguration(Configuration)
function updateConfiguration(configuration: Configuration): Promise<ResultWithHttpResponse<any>>
參數
- configuration
- Configuration
傳回
Promise<ResultWithHttpResponse<any>>
updateConfiguration(Configuration, boolean)
function updateConfiguration(configuration: Configuration, forceUpdate: boolean): Promise<ResultWithHttpResponse<any>>
參數
- configuration
- Configuration
- forceUpdate
-
boolean
傳回
Promise<ResultWithHttpResponse<any>>
updateConfiguration(Configuration, boolean, HttpResponseCallback<any>)
function updateConfiguration(configuration: Configuration, forceUpdate: boolean, done: HttpResponseCallback<any>)
參數
- configuration
- Configuration
- forceUpdate
-
boolean
- done
-
HttpResponseCallback<any>
updateConfiguration(Configuration, HttpResponseCallback<any>)
更新IoT中樞中的組態
function updateConfiguration(configuration: Configuration, done?: HttpResponseCallback<any>)
參數
- configuration
- Configuration
module:azure-iothub 類型的物件。要新增至中樞的組態
- done
-
HttpResponseCallback<any>
作業完成時要呼叫的選擇性函式。
done
會以三個自變數呼叫:Error 物件(可以是 null)、響應主體,以及可用於記錄或偵錯的傳輸特定回應物件。
updateDevices(DeviceDescription[], boolean)
function updateDevices(devices: DeviceDescription[], forceUpdate: boolean): Promise<ResultWithHttpResponse<BulkRegistryOperationResult>>
參數
- devices
- forceUpdate
-
boolean
傳回
Promise<ResultWithHttpResponse<BulkRegistryOperationResult>>
updateDevices(DeviceDescription[], boolean, HttpResponseCallback<BulkRegistryOperationResult>)
更新裝置陣列。
devices
參數的個別元素必須包含可更新的所有屬性。 例如,如果將 status
屬性從 disabled
更新為 enabled
,對象也應該將 statusReason、authentication(及其子屬性)、功能及 deviceScope 設定為裝置目前的值,或重設這些屬性。 建議您先呼叫 get api,再執行更新。
function updateDevices(devices: DeviceDescription[], forceUpdate: boolean, done?: HttpResponseCallback<BulkRegistryOperationResult>)
參數
- devices
對象的陣列,必須包含值為有效裝置標識碼的 deviceId
屬性。
- forceUpdate
-
boolean
如果 forceUpdate
為 true,則不論 etag 為何,裝置都會更新。 否則 etag 必須相符。
- done
-
HttpResponseCallback<BulkRegistryOperationResult>
作業完成時要呼叫的選擇性函式。
done
會使用三個自變數來呼叫:Error 物件(可以是 null)、BulkRegistryOperationResult 和可用於記錄或偵錯的傳輸特定回應物件。
updateModule(Module)
function updateModule(module: Module): Promise<ResultWithHttpResponse<any>>
參數
- module
- Module
傳回
Promise<ResultWithHttpResponse<any>>
updateModule(Module, boolean)
function updateModule(module: Module, forceUpdate: boolean): Promise<ResultWithHttpResponse<any>>
參數
- module
- Module
- forceUpdate
-
boolean
傳回
Promise<ResultWithHttpResponse<any>>
updateModule(Module, boolean, HttpResponseCallback<any>)
function updateModule(module: Module, forceUpdate: boolean, done: HttpResponseCallback<any>)
參數
- module
- Module
- forceUpdate
-
boolean
- done
-
HttpResponseCallback<any>
updateModule(Module, TripleValueCallback<any, any>)
更新登錄中的指定模組物件
function updateModule(module: Module, done?: TripleValueCallback<any, any>)
參數
- module
- Module
要更新的Module物件。
- done
-
TripleValueCallback<any, any>
作業完成時要呼叫的選擇性函式。
done
會以三個自變數呼叫:Error 物件(可以是 null)、響應主體,以及可用於記錄或偵錯的傳輸特定回應物件。
updateModuleTwin(string, string, any, string)
function updateModuleTwin(deviceId: string, moduleId: string, patch: any, etag: string): Promise<ResultWithHttpResponse<Twin>>
參數
- deviceId
-
string
- moduleId
-
string
- patch
-
any
- etag
-
string
傳回
Promise<ResultWithHttpResponse<Twin>>
updateModuleTwin(string, string, any, string, HttpResponseCallback<Twin>)
使用指定的修補程式更新特定模組的對應項。
function updateModuleTwin(deviceId: string, moduleId: string, patch: any, etag: string, done?: HttpResponseCallback<Twin>)
參數
- deviceId
-
string
裝置標識碼。
- moduleId
-
string
模組標識碼
- patch
-
any
要修補模組對應項所需的屬性和標籤。
- etag
-
string
即使模組對應項自取得 etag 之後已更新模塊對應項,此模組對應項或 『*』 的最新 etag 仍會強制更新。
- done
-
HttpResponseCallback<Twin>
將搭配 Error 物件或模組對應項實例呼叫的選擇性回呼。
updateTwin(string, any, string)
function updateTwin(deviceId: string, patch: any, etag: string): Promise<ResultWithHttpResponse<Twin>>
參數
- deviceId
-
string
- patch
-
any
- etag
-
string
傳回
Promise<ResultWithHttpResponse<Twin>>
updateTwin(string, any, string, HttpResponseCallback<Twin>)
使用指定的修補程式更新特定裝置的裝置對應項。
function updateTwin(deviceId: string, patch: any, etag: string, done?: HttpResponseCallback<Twin>)
參數
- deviceId
-
string
裝置標識碼。
- patch
-
any
要修補裝置對應項的所需屬性和標籤。
- etag
-
string
即使裝置對應項自取得 etag 之後已更新裝置對應項,此裝置對應項或 『*』 的最新 etag 仍會強制更新。
- done
-
HttpResponseCallback<Twin>
將搭配 Error 物件或裝置對應項實例呼叫的選擇性回呼。