全部产品
云市场

创建任务

更新时间:2019-10-09 18:51:38

本文将向您介绍如何通过调用API接口实现创建任务操作。

CreateTask 创建任务

API描述:

调试

点击这里在OpenAPI Explorer中可视化调试,并自动生成SDK调用示例

请求参数

参数名称 类型 是否必选 描述
Action String 系统规定参数,取值:CreateTask
Appkey String 应用Appkey
Confidence Float 过滤阈值 0-1
FilterValue Long 置信度0-100
ProductType String 产品类型:
1、动土变化检测
2、新增建筑物检测
3、建筑物提取
SrcImageId String 源影像ID
DstImageId String 目标影像ID
Description String 任务描述

返回参数

参数名称 类型 描述
Data 返回数据
RequestId String 请求id
ResultCode Integer 返回码

示例

请求示例

  1. http(s)://[Endpoint]/?Action=CreateTask
  2. &Appkey=jAxxxxxxxxxxxKH1
  3. &Confidence=0.1
  4. &FilterValue=10
  5. &ProductType=1
  6. &SrcImageId=8
  7. &\<公共请求参数\>

返回示例-Json

  1. {
  2. "RequestId": "561@c9e86ea4-5aa1-440c-b54b-823f0923dbd2",
  3. "Data": {
  4. "Items": {
  5. "Contents": [
  6. {
  7. "Status": "COMPLETED",
  8. "Progress": 0,
  9. "CreateTime": 1566112239000,
  10. "Request": "{\"srcImageName\":\"test21.photo\",\"srcImageTime\":1563864085000,\"filterValue\":10,\"confidence\":1,\"description\":\"hongyi-test\",\"user\":\"1122668997700980\"}",
  11. "StatusCode": "40000003",
  12. "Namespace": "RSBuildingExtraction",
  13. "StatusMessage": "Parameter invalid!",
  14. "Response": "",
  15. "LastUpdateTime": 1566112240000,
  16. "Version": "2",
  17. "UserId": "11xxxxxxxxxxx980",
  18. "Appkey": "jAxxxxxxx",
  19. "JobId": "821bd7e293de44469d59889943a989fc"
  20. },
  21. {
  22. "Status": "COMPLETED",
  23. "Progress": 100,
  24. "CreateTime": 1566290358000,
  25. "Request": "{\"description\":\"xxxx\",\"area_threshold\":90,\"threshold\":0.3,\"items\":[{\"src\":\"\",\"name\":\"test17.photo\",\"time\":1563863319000}],\"user\":\"1122668997700980\"}",
  26. "StatusCode": "41110400",
  27. "Namespace": "RSBuildingExtraction",
  28. "StatusMessage": "Error downloading: source path error: stat /home/admin/ossdisk/1122668997700980: no such file or directory",
  29. "Response": "",
  30. "LastUpdateTime": 1566291096000,
  31. "Version": "6",
  32. "UserId": "11xxxxxxxxxxx980",
  33. "Appkey": "jAxxxxxxxxxxxKH1",
  34. "JobId": "a06dd64c14c64268b7ed23b969e64210"
  35. },
  36. {
  37. "Status": "COMPLETED",
  38. "Progress": 100,
  39. "CreateTime": 1566351308000,
  40. "Request": "{\"area_threshold\":20,\"threshold\":0.6,\"items\":[{\"src\":\"/1232dfb52ba1460a8528eb40d9036e1e/original/src.tif\",\"name\":\"test.tif\",\"time\":1566351214000}],\"user\":\"1122668997700980\"}",
  41. "StatusCode": "0",
  42. "Namespace": "RSBuildingExtraction",
  43. "StatusMessage": "",
  44. "Response": "",
  45. "LastUpdateTime": 1566352051000,
  46. "Version": "76",
  47. "UserId": "11xxxxxxxxxxx980",
  48. "Appkey": "jAxxxxxxxxxxxKH1",
  49. "JobId": "f24066499db74df6bdcdfe69cf1c30cc"
  50. },
  51. {
  52. "Status": "COMPLETED",
  53. "Progress": 100,
  54. "CreateTime": 1566355379000,
  55. "Request": "{\"description\":\"ceshi\",\"area_threshold\":34,\"threshold\":0.8,\"items\":[{\"src\":\"/1232dfb52ba1460a8528eb40d9036e1e/original/src.tif\",\"name\":\"test.tif\",\"time\":1566351214000}],\"user\":\"1122668997700980\"}",
  56. "StatusCode": "20000000",
  57. "Namespace": "RSBuildingExtraction",
  58. "StatusMessage": "SUCCESS",
  59. "Response": "{\"file\":\"/f72a8372b2e8402e821078ccfb5666cc/out/result.zip\"}",
  60. "LastUpdateTime": 1566355564000,
  61. "Version": "21",
  62. "UserId": "11xxxxxxxxxxx980",
  63. "Appkey": "jAxxxxxxxxxxxKH1",
  64. "JobId": "f72a8372b2e8402e821078ccfb5666cc"
  65. },
  66. {
  67. "Status": "COMPLETED",
  68. "Progress": 100,
  69. "CreateTime": 1566444124000,
  70. "Request": "{\"description\":\"xx\",\"area_threshold\":20,\"threshold\":0.2,\"items\":[{\"src\":\"/1232dfb52ba1460a8528eb40d9036e1e/original/src.tif\",\"name\":\"test.tif\",\"time\":1566351214000}],\"user\":\"1122668997700980\"}",
  71. "StatusCode": "41110400",
  72. "Namespace": "RSBuildingExtraction",
  73. "StatusMessage": "Error downloading: source path error: stat /oss/1122668997700980/1232dfb52ba1460a8528eb40d9036e1e/original/src.tif: no such file or directory",
  74. "Response": "",
  75. "LastUpdateTime": 1566444142000,
  76. "Version": "4",
  77. "UserId": "11xxxxxxxxxxx980",
  78. "Appkey": "jAxxxxxxxxxxxKH1",
  79. "JobId": "f7ca3046f2b44481b2b0350cbdeceb7e"
  80. },
  81. {
  82. "Status": "COMPLETED",
  83. "Progress": 0,
  84. "CreateTime": 1566542115000,
  85. "Request": "{\"description\":\"x\",\"area_threshold\":23,\"threshold\":0.7,\"items\":[{\"src\":\"/1232dfb52ba1460a8528eb40d9036e1e/original/src.tif\",\"name\":\"test.tif\",\"time\":1566351214000}],\"user\":\"1122668997700980\"}",
  86. "StatusCode": "41110400",
  87. "Namespace": "RSBuildingExtraction",
  88. "StatusMessage": "cannot found service_id:[getter] model_id:[default]",
  89. "Response": "",
  90. "LastUpdateTime": 1566542117000,
  91. "Version": "2",
  92. "UserId": "11xxxxxxxxxxx980",
  93. "Appkey": "jAxxxxxxxxxxxKH1",
  94. "JobId": "f9034954ff3d466aac88c0a2d7347523"
  95. },
  96. {
  97. "Status": "COMPLETED",
  98. "Progress": 100,
  99. "CreateTime": 1566542641000,
  100. "Request": "{\"description\":\"45\",\"area_threshold\":1,\"threshold\":0.2,\"items\":[{\"src\":\"/158152da4ee5406f9496b38d8e9095ad/original/src.tif\",\"name\":\"qeweqw.tif\",\"time\":1566295865000}],\"user\":\"1122668997700980\"}",
  101. "StatusCode": "41110400",
  102. "Namespace": "RSBuildingExtraction",
  103. "StatusMessage": "cannot found service_id:[getter] model_id:[default]",
  104. "Response": "",
  105. "LastUpdateTime": 1566542662000,
  106. "Version": "4",
  107. "UserId": "11xxxxxxxxxxx980",
  108. "Appkey": "jAxxxxxxxxxxxKH1",
  109. "JobId": "d2744743efec4c24a416ca96066bb8ea"
  110. },
  111. {
  112. "Status": "EXECUTING",
  113. "Progress": 8,
  114. "CreateTime": 1566564889000,
  115. "Request": "{\"description\":\"xx\",\"area_threshold\":20,\"threshold\":0.1,\"items\":[{\"src\":\"http://osspath\",\"name\":\"e212\",\"time\":1566564263000}],\"user\":\"1122668997700980\"}",
  116. "StatusCode": "null",
  117. "Namespace": "RSBuildingExtraction",
  118. "StatusMessage": "",
  119. "Response": "",
  120. "LastUpdateTime": 1566564890000,
  121. "Version": "2",
  122. "UserId": "11xxxxxxxxxxx980",
  123. "Appkey": "jAxxxxxxxxxxxKH1",
  124. "JobId": "d76009d2fc3d448fa7cd0bce9158d26e"
  125. }
  126. ]
  127. }
  128. },
  129. "ResultCode": 0
  130. }

错误码

HttpCode 错误码 描述
41090001 NAMESPACE_NOT_ALLOW 命名空间不允许
41090002 NO_PERMISSION 没有权限执行当前操作
41090004 REQUEST_TOO_FAST 请求过快
51090001 JOB_FAILED 任务失败