Updated on 2023-12-14 GMT+08:00

Querying the List of a Processing Task

Function

This API is used to obtain processing tasks, including feature analysis tasks and data processing tasks. You can specify the task_type parameter to obtain a specific type of tasks.

  • During data feature analysis, images or target bounding boxes are analyzed based on image features, such as blurs and brightness to draw visualized curves to assist in dataset processing.

  • Data processing is used to extract valuable data from a large amount of disordered, difficult-to-understand data. Data processing includes data validation, data cleansing, data selection, and data augmentation.

  • Data validation indicates that the dataset is verified to ensure data accuracy.

  • Data cleansing refers to the process of denoising, correcting, or supplementing data.

  • Data selection indicates the process of selecting data subsets from full data.

  • Data augmentation indicates that data volume is increased through simple data amplification operations such as scaling, cropping, transformation, and composition.

Debugging

You can debug this API through automatic authentication in API Explorer or use the SDK sample code generated by API Explorer.

URI

GET /v2/{project_id}/processor-tasks

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID. For details about how to obtain a project ID, see Obtaining a Project ID and Name.

Table 2 Query Parameters

Parameter

Mandatory

Type

Description

limit

No

Integer

Maximum number of records returned on each page. The value ranges from 1 to 100. The default value is 10.

offset

No

Integer

Start page of the paging list. The default value is 0.

order

No

String

Sorting sequence of the query. Options:

  • asc: ascending order

  • desc: descending order (default value)

query_current

No

Boolean

Whether to query only the latest tasks of dataset version. Options:

  • true: Query only the latest tasks of the dataset version.

  • false: Query all tasks of the dataset version. (Default value)

return_result

No

Boolean

Whether to return the task result. Options:

  • true: Return the task result. (Default value)

  • false: Do not return the task result.

sort_by

No

String

Sorting mode of the query. Options:

  • create_time: Sort by creation time. (Default value)

  • name: Sort by task name.

  • duration_seconds: Sort by running time.

source

No

String

Data source path of the query. Options:

  • If type is set to OBS, source is an OBS path.

  • If type is set to TASK, source is a task ID.

  • If type is set to DATASET, source is a dataset ID.

  • If type is set to CUSTOM and the API is called by resource tenants, set source to the project_id of the actual user. Otherwise, this field is left blank.

source_type

No

String

Data source type of the query. If this parameter is not specified, all data sources are queried by default. Options:

  • OBS: Data obtained from OBS

  • TASK: Data processing task

  • DATASET: Dataset

  • CUSTOM: Data called by resource tenants

status

No

Integer

Task status of the query. If this parameter is not specified, tasks in all states are queried by default. Options:

  • 0: initialized

  • 1: running

  • 2: completed

  • 3: failed

  • 4: stopped

task_name

No

String

Fuzzy search keyword.

task_type

No

String

Task type, which is the ID of a data processing template. Options:

  • sys_data_analyse: feature analysis

  • sys_data_cleaning: data cleansing

  • sys_data_augmentation: data augmentation

  • sys_data_validation: data validation

  • sys_data_selection: data filtering

version_id

No

Array

Version ID list of a specific dataset of the query.

workspace_id

No

String

Workspace ID. If no workspace is created, the default value is 0. If a workspace is created and used, use the actual value.

Request Parameters

None

Response Parameters

Status code: 200

Table 3 Response body parameters

Parameter

Type

Description

count

Integer

Total number of data processing tasks.

tasks

Array of DescribeProcessorTaskResp objects

Data processing task list queried by page.

Table 4 DescribeProcessorTaskResp

Parameter

Type

Description

create_time

Long

Time when a data processing task is created.

data_source

ProcessorDataSource object

Input of a data processing task. Either this parameter or inputs is delivered.

description

String

Description of a data processing task.

duration_seconds

Integer

Running time of data processing, in seconds.

error_msg

String

Error message. This field is displayed when the value of status is 3.

inputs

Array of ProcessorDataSource objects

Input channel list of a data processing task. Either this parameter or data_source is delivered.

is_current

Boolean

Whether the current task is the latest of the same type of this version.

name

String

Name of a data processing task.

result

Object

Output result of a data processing task. This field is displayed when status is set to 2 and is valid for a feature analysis task.

status

Integer

Status of a data processing task. Options:

  • 0: initialized

  • 1: running

  • 2: completed

  • 3: failed

  • 4: stopped

task_id

String

ID of a data processing task.

template

TemplateParam object

Data processing template, such as the algorithm ID and parameters.

version_count

Integer

Version number of a data processing task.

version_id

String

Dataset version ID corresponding to a data processing task.

version_name

String

Dataset version name corresponding to a data processing task.

work_path

WorkPath object

Working directory of a data processing task.

workspace_id

String

Workspace ID of a data processing task. If no workspace is created, the default value is 0. If a workspace is created and used, use the actual value.

Table 5 ProcessorDataSource

Parameter

Type

Description

name

String

Dataset name.

source

String

Data source path. Options:

  • If type is set to OBS, source is an OBS path.

  • If type is set to TASK, source is a task ID.

  • If type is set to DATASET, source is a dataset ID.

  • If type is set to CUSTOM and the API is called by resource tenants, set source to the project_id of the actual user. Otherwise, this field is left blank.

type

String

Data source type. Options:

  • OBS: Data obtained from OBS

  • TASK: Data processing task

  • DATASET: Dataset

  • CUSTOM: Data called by resource tenants

version_id

String

Version of a dataset.

version_name

String

Dataset version name.

Table 6 TemplateParam

Parameter

Type

Description

id

String

Task type, which is the ID of a data processing template. Options:

  • sys_data_analyse: feature analysis

  • sys_data_cleaning: data cleansing

  • sys_data_augmentation: data augmentation

  • sys_data_validation: data validation

  • sys_data_selection: data filtering

name

String

Template name.

operator_params

Array of OperatorParam objects

Operator parameter list.

Table 7 OperatorParam

Parameter

Type

Description

advanced_params_switch

Boolean

Advanced parameter switch.

id

String

ID of an operator.

name

String

Name of an operator.

params

Object

Operator parameter. The parameter type is map<string,object>. Currently, object only supports the types of Boolean, Integer, Long, String, List[/topic/body/section/table/tgroup/tbody/row/entry/p/br {""}) (br] and Map<String,String>. For two special scenarios of object detection and image classification in a data preprocessing task, the value of task_type is object_detection or image_classification.

Table 8 WorkPath

Parameter

Type

Description

name

String

Dataset name.

output_path

String

Output path, for example, /datasets/demo.

path

String

Working path. Options:

  • If type is set to OBS, source is an OBS path.

  • If type is set to DATASET, source is a dataset ID.

type

String

Type of a working path. Options:

  • OBS: OBS path

  • DATASET: dataset

version_id

String

Version of a dataset.

version_name

String

Name of a dataset version. The value can contain 0 to 32 characters. Only digits, letters, underscores (_), and hyphens (-) are allowed.

Example Requests

  • Querying the Historical List of Feature Analysis Tasks of a Dataset

    GET https://{endpoint}/v2/{project_id}/processor-tasks?offset=0&limit=10&sort_by=create_time&order=desc&source_type=DATASET&source=X6c3N3eztX7cr3Arvqu&task_type=sys_data_analyse&return_result=false&query_current=false
  • Querying the Latest Feature Analysis Task Result for the Specified Version List of a Dataset

    GET https://{endpoint}/v2/{project_id}/processor-tasks?offset=0&limit=100&source_type=DATASET&source=X6c3N3eztX7cr3Arvqu&version_id=XwTuRqI9En7xuZskW70%2CJ4Eh2FDEWH1qnDlD3hQ&task_type=sys_data_analyse&return_result=true&query_current=true

Example Responses

Status code: 200

OK

{
  "count" : 1,
  "tasks" : [ {
    "task_id" : "ddwRJeTnjpiq4dNUZOq",
    "name" : "V001",
    "data_source" : {
      "type" : "DATASET",
      "source" : "X6c3N3eztX7cr3Arvqu"
    },
    "inputs" : [ {
      "type" : "DATASET",
      "source" : "X6c3N3eztX7cr3Arvqu"
    } ],
    "template" : {
      "id" : "sys_data_analyse",
      "name" : "data analyse template name",
      "operator_params" : [ {
        "id" : "sys_data_analyse",
        "params" : {
          "op_list" : [ ],
          "task_type" : "image_classification",
          "manifest_path" : "s3://test-obs/classify/output/dataset-3026-X6c3N3eztX7cr3Arvqu/annotation/V001/V001.manifest",
          "file_path" : "s3://test-obs/classify/output/dataset-3026-X6c3N3eztX7cr3Arvqu/annotation/evaluation/V001",
          "is_normed" : false
        }
      } ]
    },
    "status" : 2,
    "duration_seconds" : 11,
    "create_time" : 1606372570023,
    "version_id" : "J4Eh2FDEWH1qnDlD3hQ",
    "version_name" : "V001",
    "is_current" : true
  } ]
}

Status Codes

Status Code

Description

200

OK

401

Unauthorized

403

Forbidden

404

Not Found

Error Codes

See Error Codes.