设备接入 IOTDA-创建批量任务:请求示例

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

请求示例

  • 创建批量软件升级任务,指定设备升级。

    POST https://{endpoint}/v5/iot/{project_id}/batchtasks
    
    {
      "app_id" : "Ev8FVvCfOdQDzrFrxSOemiw_aMca",
      "task_name" : "BatchSoftwareUpgradeTask",
      "task_type" : "softwareUpgrade",
      "targets" : [ "e495cf17-ff79-4294-8f64-4d367919d665" ],
      "document" : {
        "package_id" : "32822e5744a45ede319d2c50"
      },
      "task_policy" : {
        "schedule_time" : "20151212T121212Z",
        "retry_count" : 5,
        "retry_interval" : 60
      }
    }
  • 创建批量软件升级任务,指定设备组中设备进行升级。

    POST https://{endpoint}/v5/iot/{project_id}/batchtasks
    
    {
      "app_id" : "Ev8FVvCfOdQDzrFrxSOemiw_aMca",
      "task_name" : "BatchSoftwareUpgradeTask",
      "task_type" : "softwareUpgrade",
      "document" : {
        "package_id" : "32822e5744a45ede319d2c50"
      },
      "targets_filter" : {
        "group_ids" : [ "e495cf17-ff79-4294-8f64-4d367919d665" ]
      },
      "task_policy" : {
        "schedule_time" : "20151212T121212Z",
        "retry_count" : 5,
        "retry_interval" : 60
      }
    }
  • 创建批量注册设备任务,从文件中读取参数。

    POST https://{endpoint}/v5/iot/{project_id}/batchtasks
    
    {
      "app_id" : "Ev8FVvCfOdQDzrFrxSOemiw_aMca",
      "task_name" : "BatchCreateDevicesTask",
      "task_type" : "createDevices",
      "task_policy" : {
        "schedule_time" : "20151212T121212Z",
        "retry_count" : 5,
        "retry_interval" : 60
      },
      "document_source" : "jeQDJQZltU8iKgFFoW060F5SGZka"
    }
support.huaweicloud.com/api-iothub/iot_06_v5_0045.html