Updated on 2026-01-13 GMT+08:00

Creating a Metadata Scan Task

Function

This API is used to create a metadata scan task. You can create an executable metadata scan task by specifying parameters such as the task name, data source, scheduling type, and scan configuration.

Calling Method

For details, see Calling APIs.

URI

POST /v1/{project_id}/metadata/task-templates

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Unique project ID.

Request Parameters

Table 2 Request body parameters

Parameter

Mandatory

Type

Description

data_sources

Yes

Array of DataSource objects

Data source list.

delete_failed_meta

No

Boolean

Whether to delete failed metadata.

scan_config

No

ScanConfig object

Scanning configuration information.

schedule_switch

No

Boolean

Scheduling switch.

schedule_type

Yes

String

Scheduling type.

start_now

No

Boolean

Whether to start immediately

start_time

Yes

Long

Start time.

task_description

Yes

String

Task description.

task_name

Yes

String

Task name.

Table 3 DataSource

Parameter

Mandatory

Type

Description

db_type

Yes

String

Database type.

ins_id

Yes

String

Instance ID.

Table 4 ScanConfig

Parameter

Mandatory

Type

Description

scan_column_constraints

No

Boolean

Whether to scan column constraints.

scan_comment

No

Boolean

Whether to scan comments.

scan_privileges

No

Boolean

Whether to scan permissions.

scan_system_db

No

Boolean

Whether to scan system databases.

scan_tables

No

Boolean

Whether to scan tables.

scan_views

No

Boolean

Whether to scan views.

Response Parameters

Status code: 200

Table 5 Response body parameters

Parameter

Type

Description

id

String

Task ID.

msg

String

Operation status message.

status

String

Operation status.

Status code: 201

Resource being created.

Example Requests

POST /v1/{project_id}/metadata/task-templates

{
  "data_sources" : [ {
    "db_type" : "MySQL",
    "ins_id" : "XXXXX"
  } ],
  "delete_failed_meta" : true,
  "scan_config" : { },
  "schedule_switch" : true,
  "schedule_type" : "string",
  "start_now" : true,
  "start_time" : 0,
  "task_description" : "string",
  "task_name" : "string"
}

Example Responses

None

Status Codes

Status Code

Description

200

Created.

201

Resource being created.

401

Unauthorized. The user is not logged in or the token is invalid.

403

Unauthorized to access the resource.

404

The specified project does not exist.

Error Codes

See Error Codes.