更新时间:2024-05-30 GMT+08:00
分享

查询数据处理任务的版本列表

功能介绍

查询数据处理任务的版本列表。

调试

您可以在API Explorer中调试该接口,支持自动认证鉴权。API Explorer可以自动生成SDK代码示例,并提供SDK代码示例调试功能。

URI

GET /v2/{project_id}/processor-tasks/{task_id}/versions

表1 路径参数

参数

是否必选

参数类型

描述

project_id

String

用户项目ID。获取方法请参见获取项目ID和名称

task_id

String

数据处理任务ID。

表2 Query参数

参数

是否必选

参数类型

描述

limit

Integer

指定每一页返回的最大条目数,取值范围[1,100],默认为100。

offset

Integer

分页列表的起始页,默认为0。

order

String

指定查询的排序顺序。可选值如下:

  • asc:递增排序

  • desc:递减排序(默认值)

sort_by

String

指定查询的排序方式。可选值如下:

  • create_time:按创建时间排序(默认值)

  • version_name:按任务版本名称排序

请求参数

响应参数

状态码: 200

表3 响应Body参数

参数

参数类型

描述

count

Integer

版本总数。

versions

Array of DescTaskVersionResp objects

分页查询到的数据处理任务版本列表。

表4 DescTaskVersionResp

参数

参数类型

描述

add_sample_count

Integer

处理后新增的图片数量。

create_time

Long

数据处理任务的创建时间。

deleted_sample_count

Integer

处理后删除的图片数量。

description

String

数据处理任务的版本描述。

duration_seconds

Integer

数据处理任务的运行时间,单位秒。

inputs

Array of ProcessorDataSource objects

数据处理任务的输入通道。

modified_sample_count

Integer

处理后修改的图片数量。

origin_sample_count

Integer

处理前的图片数量。

status

Integer

数据处理任务的状态。可选值如下:

  • 0:初始化

  • 1:运行中

  • 2:已完成

  • 3:失败

  • 4:停止

task_id

String

数据处理任务ID。

task_version_id

String

数据处理任务的版本ID。

template

TemplateParam object

算法模板,如算法ID和参数等。

unmodified_sample_count

Integer

处理后无修改的图片数量。

update_time

Long

数据处理任务的创建时间。

version_name

String

数据处理任务的版本名称。

work_path

WorkPath object

数据处理任务的输出通道。

表5 ProcessorDataSource

参数

参数类型

描述

name

String

数据集的名称。

source

String

数据源所在路径。可选值如下:

  • 如果type是OBS,source为OBS路径。

  • 如果type是TASK,source为任务ID。

  • 如果type是DATASET,source为数据集ID。

  • 如果type是CUSTOM且是资源租户调用,source为真实用户的project_id, 否则不需要这个字段。

type

String

数据源类型。可选值如下:

  • OBS:数据来源于OBS

  • TASK:数据处理任务

  • DATASET:数据集

  • CUSTOM:资源租户调用

version_id

String

数据集的版本。

version_name

String

数据集的版本名称。

表6 TemplateParam

参数

参数类型

描述

id

String

任务类型,即数据处理模板ID。可选值如下:

  • sys_data_analyse:特征分析

  • sys_data_cleaning:数据清洗

  • sys_data_augmentation:数据增强

  • sys_data_validation:数据校验

  • sys_data_selection:数据筛选

name

String

模板名称。

operator_params

Array of OperatorParam objects

算子的参数列表。

表7 OperatorParam

参数

参数类型

描述

advanced_params_switch

Boolean

高级参数开关。

id

String

算子ID。

name

String

算子名称。

params

Object

算子参数,参数类型是map<string,object>,object目前只支持Boolean、Integer、Long、String、List[/topic/body/section/table/tgroup/tbody/row/entry/p/br {""}) (br]、Map<String,String>类型。对于数据预处理任务比较特殊的两个场景物体检测和图像分类,键“task_type”对应的值为“object_detection”或“image_classification”。

表8 WorkPath

参数

参数类型

描述

name

String

数据集的名称。

output_path

String

输出路径,例如/datasets/demo。

path

String

工作路径。可选值如下:

  • 如果type是OBS,source为OBS路径。

  • 如果type是DATASET,source为数据集ID。

type

String

工作路径的类型。可选值如下:

  • OBS:OBS路径

  • DATASET:数据集

version_id

String

数据集的版本。

version_name

String

数据集的版本名称,名称仅包含数字、字母、中划线和下划线,长度是0-32位。

请求示例

查询数据处理任务版本列表

GET https://{endpoint}/v2/{project_id}/processor-tasks/{task_id}/versions?offset=0&limit=5

响应示例

状态码: 200

OK

{
  "count" : 2,
  "versions" : [ {
    "task_version_id" : "qSaudx2sbPvthHygckA",
    "task_id" : "kM7j9TSa611ZzBThzSr",
    "version_name" : "V002",
    "description" : "",
    "status" : 0,
    "create_time" : 1606377874450,
    "inputs" : [ {
      "type" : "DATASET",
      "source" : "PYc9H2HGv5BJNwBGXyK",
      "version_id" : "Osc8SZ7TZStiRV4vYkZ",
      "name" : "dataset-test",
      "version_name" : "V0010"
    } ],
    "work_path" : {
      "type" : "DATASET",
      "path" : "PYc9H2HGv5BJNwBGXyK",
      "name" : "dataset-test",
      "version_name" : "V0011",
      "output_path" : "/test-obs/classify/output/qSaudx2sbPvthHygckA/"
    },
    "template" : {
      "id" : "sys_data_validation",
      "name" : "name to translate",
      "operator_params" : [ {
        "name" : "MetaValidation",
        "advanced_params_switch" : false,
        "params" : {
          "task_type" : "image_classification",
          "dataset_type" : "manifest",
          "source_service" : "select",
          "filter_func" : "data_validation_select",
          "image_max_width" : "1920",
          "image_max_height" : "1920",
          "total_status" : "[0,1,2]"
        }
      } ]
    },
    "duration_seconds" : 151
  }, {
    "task_version_id" : "YHFWU18zXuNbqxtzegG",
    "task_id" : "kM7j9TSa611ZzBThzSr",
    "version_name" : "V001",
    "description" : "",
    "status" : 2,
    "create_time" : 1606375407276,
    "inputs" : [ {
      "type" : "DATASET",
      "source" : "PYc9H2HGv5BJNwBGXyK",
      "version_id" : "yoJ5ssClpNlOrsjjFDa",
      "name" : "dataset-test",
      "version_name" : "V009"
    } ],
    "work_path" : {
      "type" : "DATASET",
      "path" : "PYc9H2HGv5BJNwBGXyK",
      "name" : "dataset-test",
      "version_id" : "Osc8SZ7TZStiRV4vYkZ",
      "version_name" : "V0010",
      "output_path" : "/test-obs/classify/output/YHFWU18zXuNbqxtzegG/"
    },
    "template" : {
      "id" : "sys_data_validation",
      "name" : "name to translate",
      "operator_params" : [ {
        "name" : "MetaValidation",
        "advanced_params_switch" : false,
        "params" : {
          "task_type" : "image_classification",
          "dataset_type" : "manifest",
          "source_service" : "select",
          "filter_func" : "data_validation_select",
          "image_max_width" : "1920",
          "image_max_height" : "1920",
          "total_status" : "[0,1,2]"
        }
      } ]
    },
    "duration_seconds" : 812,
    "origin_sample_count" : 18,
    "add_sample_count" : 0,
    "modified_sample_count" : 0,
    "unmodified_sample_count" : 18,
    "deleted_sample_count" : 0
  } ]
}

状态码

状态码

描述

200

OK

401

Unauthorized

403

Forbidden

404

Not Found

错误码

请参见错误码

分享:

    相关文档

    相关产品