设备接入 IOTDA-创建OTA升级包:请求示例

时间:2024-06-28 09:24:45

请求示例

  • 创建OTA升级包,上传固件包。

    POST https://{endpoint}/v5/iot/{project_id}/ota-upgrades/packages
    
    {
      "app_id" : "61f7e74d036aca5be29e1ed4",
      "package_type" : "firmwarePackage",
      "product_id" : "5ba24f5ebbe8f56f5a14f605",
      "version" : "V2.0",
      "description" : "package v2.0",
      "custom_info" : "更新了XX功能,修复了XXXX问题",
      "file_location" : {
        "obs_location" : {
          "region_name" : "cn-north-4",
          "bucket_name" : "abc",
          "object_key" : "bbb/upgrade.bin"
        }
      }
    }
  • 创建OTA升级包,上传固件包,差分包场景,支持从V1.0和V1.1版本升级。

    POST https://{endpoint}/v5/iot/{project_id}/ota-upgrades/packages
    
    {
      "app_id" : "61f7e74d036aca5be29e1ed4",
      "package_type" : "firmwarePackage",
      "product_id" : "5ba24f5ebbe8f56f5a14f605",
      "version" : "V2.0",
      "support_source_versions" : [ "V1.0", "V1.1" ],
      "description" : "package for version V1.0 and V1.1",
      "custom_info" : "更新了XX功能,修复了XXXX问题",
      "file_location" : {
        "obs_location" : {
          "region_name" : "cn-north-4",
          "bucket_name" : "abc",
          "object_key" : "bbb/upgrade.bin"
        }
      }
    }
support.huaweicloud.com/api-iothub/CreateOtaPackage.html