Delete Firmware

删除一个指定的固件。

操作权限

需授权的资源

所需操作权限

设备管理

Full Access

请求格式

POST https://{apigw-address}/connect-service/v2.1/ota-firmwares?action=delete

请求参数(URI)

名称

位置(Path/Query)

必需/可选

数据类型

描述

orgId

Query

必需

String

资产所属的组织ID。 如何获取orgId信息>>

firmwareId

Query

必需

String

待删除固件的ID。

错误码

代码

错误信息

描述

24404

Firmware not found

找不到固件。

24604

Firmware cannot be deleted

无法删除固件。

示例

请求示例

url: https://{apigw-address}/connect-service/v2.1/ota-firmwares?action=delete&orgId=yourOrgId&firmwareId=yourFirmwareId
method: POST

返回示例

{
    "code":0,
    "msg":"OK",
    "requestId":"3bdf31b4-e357-4d4c-8cf9-a40dc129a407",
    "data":null
}

Java SDK调用示例

package com.envisioniot.enos.connect_service.ota.firmware;

import com.envision.apim.poseidon.config.PConfig;
import com.envision.apim.poseidon.core.Poseidon;
import com.envisioniot.enos.connect_service.v2_1.ota.firmware.DeleteFirmwareFileRequest;
import com.envisioniot.enos.connect_service.v2_1.ota.firmware.DeleteFirmwareFileResponse;

public class DeleteFirmware {
    public static void main(String[] args) {
        final String appKey = "yourAppKey";
        final String appSecret = "yourAppSecret";
        String serverUrl = "yourServerUrl";

        String orgId = "yourOrgId";
        String firmwareId = "yourFirmwareId";

        DeleteFirmwareFileRequest request = new DeleteFirmwareFileRequest();
        request.setOrgId(orgId);
        request.setFirmwareId(firmwareId);

        DeleteFirmwareFileResponse response = Poseidon
                .config(PConfig.init().appKey(appKey).appSecret(appSecret).debug())
                .url(serverUrl)
                .getResponse(request, DeleteFirmwareFileResponse.class);
    }
}