調用該介面修改升級包資訊,包括升級包名稱、升級包描述和自訂資訊。
QPS限制
單個阿里雲帳號調用該介面的每秒請求數(QPS)最大限制為5。
說明 RAM使用者共用阿里雲帳號配額。
調試
您可以在OpenAPI Explorer中直接運行該介面,免去您計算簽名的困擾。運行成功後,OpenAPI Explorer可以自動產生SDK程式碼範例。
請求參數
| 名稱 | 類型 | 是否必選 | 樣本值 | 描述 |
| Action | String | 是 | ModifyOTAFirmware | 系統規定參數。取值:ModifyOTAFirmware。 |
| FirmwareId | String | 是 | s8SSHiKjpBfrM3BSN0z803**** | OTA升級包ID,OTA升級包的唯一識別碼。 OTA升級包ID是調用介面CreateOTAFirmware建立OTA升級包時,返回的參數之一。 您也可以調用介面ListOTAFirmware,從返回參數中查看。 |
| ProductKey | String | 是 | a1uctKe**** | OTA升級包所屬產品的ProductKey。 |
| FirmwareDesc | String | 否 | OTA function updated | OTA升級包描述。長度不可超過100個字元。一個中文漢字算一個字元。 |
| IotInstanceId | String | 否 | iot-0pp1n8t**** | 執行個體ID。您可在物聯網平台控制台的執行個體概覽頁面,查看當前執行個體的ID。 重要
執行個體的更多資訊,請參見執行個體概述。 |
| FirmwareName | String | 否 | Firmwaretest | OTA升級包名稱,需在阿里雲帳號下唯一。支援中文、英文字母、日文、數字、短劃線(-)、底線(_)和半形圓括弧(()),必須以中文、英文、日文或數字開頭,長度限制為1~40個字元。 |
| FirmwareUdi | String | 否 | {"ota_notice":"升級底層網路攝影機驅動,解決視頻映像模糊的問題。"} | 推送給裝置的自訂資訊。不限制常值內容格式,長度不超過4096個字元。 |
調用API時,除了本文介紹的該API的特有請求參數,還需傳入公用請求參數。公用請求參數說明,請參見公用參數文檔。
返回資料
| 名稱 | 類型 | 樣本值 | 描述 |
| Code | String | iot.ota.FirmwareNotFound | 調用失敗時,返回錯誤碼。詳細資料,請參見下文錯誤碼。 |
| ErrorMessage | String | The specified firmware does not exist. | 調用失敗時,返回的出錯資訊。 |
| RequestId | String | E55E50B7-40EE-4B6B-8BBE-D3ED55CCF565 | 阿里雲為該請求產生的唯一識別碼。 |
| Success | Boolean | true | 是否調用成功。
|
樣本
請求樣本
https://iot.cn-shanghai.aliyuncs.com/?Action=ModifyOTAFirmware
&FirmwareUid=s8SSHiKjpBfrM3BSN0z803****
&ProductKey=a1uctKe****
&FirmwareName=Firmwaretest
&IotInstanceId=iot-0pp1n8t****
&<公用請求參數>
正常返回樣本
XML格式
<ModifyOTAFirmwareResponse>
<RequestId>E55E50B7-40EE-4B6B-8BBE-D3ED55CCF565</RequestId>
<Success>true</Success>
</ModifyOTAFirmwareResponse>
JSON格式
{
"RequestId": "E55E50B7-40EE-4B6B-8BBE-D3ED55CCF565",
"Success": true
}
錯誤碼
| HttpCode | 錯誤碼 | 錯誤資訊 | 描述 |
| 400 | iot.firmware.AlreadyExistedFirmwareName | The OTA update package already exists. | 同名的OTA升級包已經存在。 |
| 400 | iot.ota.FirmwareNotFound | The specified firmware does not exist. | 指定的升級包不存在。 |
| 400 | iot.ota.FirmwareAndProductKeyMismatch | The OTA update package is not consistent with the ProductKey. | OTA升級包與產品ProductKey不匹配。 |
| 400 | iot.ota.TenantIdMisMatch | The tenantId is invalid. | 租戶非法操作。 |
| 400 | iot.firmware.FirmwareUdiExceedLimit | The UDI of the firmware is longer than the limit. | 升級包的自訂資訊長度超過限制。 |
| 400 | iot.firmware.FirmwareDescExceedLimit | The description of the firmware is longer than the limit. | 升級包描述的長度超過限制。 |
| 400 | iot.firmware.IncorrectFormattedFirmwareName | The format of the OTA update package name is invalid. | OTA升級包名稱格式錯誤。 |
| 400 | iot.ota.InstanceIdMisMatch | The instanceId is invalid. | 執行個體ID不匹配。 |
訪問錯誤中心查看更多錯誤碼。