Create Collection Task
Function
Create a collection task.
Calling Method
For details, see Calling APIs.
URI
POST /v3/{project_id}/metadata/tasks/create
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| project_id | Yes | String | Project ID. For details about how to obtain it, see Project ID and Account ID. |
Request Parameters
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| X-Auth-Token | Yes | String | User token. This parameter is mandatory when token authentication is used. You can obtain it from the value of X-Subject-Token in the response message header returned by the "Obtaining a User Token" API of the IAM service. |
| workspace | Yes | String | Workspace ID. For details about how to obtain it, see Instance ID and Workspace ID. |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| id | No | String | Task ID |
| name | Yes | String | Task name |
| description | No | String | Task description. |
| user_id | Yes | String | User ID. |
| create_time | No | String | Creation time. |
| project_id | No | String | Product ID. |
| dir_id | Yes | String | Directory ID |
| schedule_config | Yes | SchedulerInfo object | Scheduling information |
| parameter_config | No | Array of CustomMetadata objects | User-defined metadata information. |
| update_time | No | String | Modification time. |
| user_name | No | String | User name. |
| path | No | String | Path |
| last_run_time | No | String | Last execution time. |
| start_time | No | String | Start time |
| end_time | No | String | End time |
| next_run_time | No | String | Next execution time. |
| duty_person | No | String | Owner |
| update_type | No | String | Modification type |
| data_source_type | Yes | String | Data source type |
| task_config | Yes | Object | Task information, which is Map(String, Object) The key is the attribute name, and value is the attribute value. |
| data_source_workspace_id | No | String | Workspace ID of the data source |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| cron_expression | No | String | Expression |
| end_time | No | String | End time |
| max_time_out | No | Integer | Maximum timeout interval |
| interval | No | String | Interval |
| schedule_type | No | String | Scheduling type |
| start_time | No | String | Start time |
| job_id | No | Integer | Job ID |
| enabled | No | Integer | Enabled |
Response Parameters
Status code: 200
| Parameter | Type | Description |
|---|---|---|
| task_id | String | Task ID |
Status code: 400
| Parameter | Type | Description |
|---|---|---|
| error_code | String | Error code. |
| error_msg | String | Error description. |
Status code: 401
| Parameter | Type | Description |
|---|---|---|
| error_code | String | Error code. |
| error_msg | String | Error description. |
Status code: 403
| Parameter | Type | Description |
|---|---|---|
| error_code | String | Error code. |
| error_msg | String | Error description. |
Status code: 404
| Parameter | Type | Description |
|---|---|---|
| error_code | String | Error code. |
| error_msg | String | Error description. |
Example Requests
{
"id" : null,
"data_source_type" : "DLI",
"description" : "",
"name" : "Test collection 110",
"user_id" : "0833a573fe80d5401f6dc010a775569a",
"dir_id" : "0",
"task_config" : {
"data_connection_name" : "dli_test",
"data_connection_id" : "14bb947454e64de784eadaab759081e8",
"databaseName" : [ "ygy1" ],
"tableName" : [ "ygy1.ygy" ],
"alive_object_policy" : "3",
"deleted_object_policy" : "3",
"enableDataProfile" : false,
"enableDataClassification" : false,
"enable_table_filter_by_regex" : false
},
"schedule_config" : {
"schedule_type" : "RUN_ONCE",
"max_time_out" : 10
}
} Example Responses
Status code: 200
OK.
{
"task_id" : "8a9480ed8353e491018354b87f63009e"
} Status Codes
| Status Code | Description |
|---|---|
| 200 | OK. |
| 400 | Bad request. |
| 401 | Unauthorized. |
| 403 | Forbidden. |
| 404 | Not found. |
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.