Devices - Get Command History
取得裝置命令歷程記錄
GET https://{subdomain}.{baseDomain}/api/devices/{deviceId}/commands/{commandName}?api-version=2022-07-31
URI 參數
名稱 | 位於 | 必要 | 類型 | Description |
---|---|---|---|---|
base
|
path | True |
string |
所有 Azure IoT Central 服務要求的基底網域。 |
command
|
path | True |
string |
此裝置命令的名稱。 |
device
|
path | True |
string |
裝置的唯一標識碼。 |
subdomain
|
path | True |
string |
應用程式子域。 |
api-version
|
query | True |
string |
所呼叫之 API 的版本。 |
回應
名稱 | 類型 | Description |
---|---|---|
200 OK |
Success |
|
Other Status Codes |
從 IoT Central 服務收到的錯誤回應。 Headers x-ms-error-code: string |
安全性
azure_auth
Azure Active Directory OAuth2 Flow
Type:
oauth2
Flow:
implicit
Authorization URL:
https://login.microsoftonline.com/common/oauth2/authorize
Scopes
名稱 | Description |
---|---|
user_impersonation | 模擬您的用戶帳戶 |
範例
Get command history
Sample Request
GET https://appsubdomain.azureiotcentral.com/api/devices/mx1/commands/CoolDown?api-version=2022-07-31
Sample Response
{
"value": [
{
"request": 20,
"id": "4e17dd2e-7bf2-458d-8466-19bc6fc9b642",
"response": 58.795679629034694,
"responseCode": 200
}
]
}
定義
名稱 | Description |
---|---|
Device |
裝置命令定義。 |
Device |
裝置命令執行的分頁結果。 |
Error |
回應錯誤定義。 |
Error |
錯誤的詳細資訊。 |
DeviceCommand
裝置命令定義。
名稱 | 類型 | Description |
---|---|---|
connectionTimeout |
integer |
線上逾時,以秒為單位等候中斷連線的裝置上線。 預設值為 0 秒。 |
id |
string |
裝置命令執行的要求識別碼。 |
request |
裝置命令的承載支援任何基本類型或物件。 |
|
response |
裝置命令回應的承載支援任何基本類型或物件。 |
|
responseCode |
integer |
裝置命令回應的狀態代碼。 |
responseTimeout |
integer |
回應逾時,以秒為單位等候裝置上的命令完成。 預設為 30 秒。 |
DeviceCommandCollection
裝置命令執行的分頁結果。
名稱 | 類型 | Description |
---|---|---|
nextLink |
string |
取得裝置命令執行下一頁的 URL。 |
value |
裝置命令執行的集合。 |
Error
回應錯誤定義。
名稱 | 類型 | Description |
---|---|---|
error |
目前要求的錯誤詳細數據。 |
ErrorDetails
錯誤的詳細資訊。
名稱 | 類型 | Description |
---|---|---|
code |
string |
錯誤碼。 |
message |
string |
錯誤訊息詳細數據。 |
requestId |
string |
目前要求的相互關聯標識碼。 |
time |
string |
錯誤要求失敗的時間。 |