Devices - Get Component Command History

取得元件命令歷程記錄

GET https://{subdomain}.{baseDomain}/api/devices/{deviceId}/components/{componentName}/commands/{commandName}?api-version=2022-07-31

URI 參數

名稱 位於 必要 類型 Description
baseDomain
path True

string

所有 Azure IoT Central 服務要求的基底網域。

commandName
path True

string

此裝置命令的名稱。

componentName
path True

string

裝置元件的名稱。

deviceId
path True

string

裝置的唯一標識碼。

subdomain
path True

string

應用程式子域。

api-version
query True

string

所呼叫 API 的版本。

回應

名稱 類型 Description
200 OK

DeviceCommandCollection

Success

Other Status Codes

Error

從 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/components/Thermostat_1o/commands/CoolDown?api-version=2022-07-31

Sample Response

{
  "value": [
    {
      "request": 20,
      "id": "4e17dd2e-7bf2-458d-8466-19bc6fc9b642",
      "response": 58.795679629034694,
      "responseCode": 200
    }
  ]
}

定義

名稱 Description
DeviceCommand

裝置命令定義。

DeviceCommandCollection

裝置命令執行的分頁結果。

Error

回應錯誤定義。

ErrorDetails

錯誤的詳細資訊。

DeviceCommand

裝置命令定義。

名稱 類型 Description
connectionTimeout

integer

線上逾時,以秒為單位等候中斷連線的裝置上線。 預設值為 0 秒。

id

string

裝置命令執行的要求識別碼。

request

裝置命令的承載支援任何基本類型或物件。

response

裝置命令回應的承載,支援任何基本類型或物件。

responseCode

integer

裝置命令回應的狀態代碼。

responseTimeout

integer

回應逾時,以秒為單位等候裝置上的命令完成。 預設為 30 秒。

DeviceCommandCollection

裝置命令執行的分頁結果。

名稱 類型 Description
nextLink

string

取得裝置命令執行下一頁的 URL。

value

DeviceCommand[]

裝置命令執行的集合。

Error

回應錯誤定義。

名稱 類型 Description
error

ErrorDetails

目前要求的錯誤詳細數據。

ErrorDetails

錯誤的詳細資訊。

名稱 類型 Description
code

string

錯誤碼。

message

string

錯誤訊息詳細數據。

requestId

string

目前要求的相互關聯標識碼。

time

string

錯誤要求失敗的時間。