CreateCrawler
Creates a metadata crawler and configures the data source, collection scope, resource group, and scheduling method.
Operation description
Scenarios
Create a metadata crawler for a specified data source, and configure the collection scope, resource group, scheduling method, and extended configurations.
Recommended procedure
Call GetCrawlerTypeCapabilities to query the crawler types supported in the current region and their configuration capabilities.
Create a crawler by using a data source that matches the Type. Before you create the crawler, make sure that the data source and the selected resource group pass the connectivity test by calling the TestDataSourceConnectivity API. This prevents you from creating an invalid crawler.
After the crawler is created, call RunCrawler to manually run the crawler, or configure periodic scheduling to automatically run the crawler.
Edition requirements
You must purchase DataWorks Basic Edition or higher to use this feature.
Precautions
A successful creation only indicates that the crawler configuration is generated. The metadata collection is not immediately executed.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
dataworks:CreateCrawler |
create |
*All Resource
|
None | None |
Request syntax
POST HTTP/1.1
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| Name |
string |
Yes |
The name of the metadata crawler. The name can be up to 128 characters in length. |
example_crawler |
| DataSourceId |
integer |
Yes |
The ID of the data source associated with the crawler. The data source must be bound to a DataWorks workspace, and the data source type must match the Type. |
12345 |
| Type |
string |
Yes |
The type of the crawler. You can call GetCrawlerTypeCapabilities to query the valid values supported in the current region. |
starrocks |
| ResourceGroupId |
string |
No |
The ID of the Serverless 2.0 resource group used to run the collection task. Whether this parameter is required depends on the RequireResourceGroup value returned by GetCrawlerTypeCapabilities. |
Serverless_res_group_1234567890123456_1234567890 |
| Scope |
object |
No |
The collection scope configuration. If this parameter is not specified, the DefaultScopeUnit value returned by GetCrawlerTypeCapabilities is used. |
|
| Unit |
string |
Yes |
The granularity of the collection scope. For valid values, see SupportedScopeUnits in the GetCrawlerTypeCapabilities response. |
DATABASE |
| Items |
array |
No |
The list of database names. This parameter is supported only when Unit is set to DATABASE. You can specify up to 1,000 database names. The names cannot be empty or duplicate. |
|
|
string |
No |
The name of a single database. The name can be up to 256 characters in length. |
example_database |
|
| ExcludeRegex |
string |
No |
The regular expression used to exclude objects from the collection scope. This parameter is supported only when the SupportExcludeRegex value returned by GetCrawlerTypeCapabilities is true. |
^tmp_.* |
| ScheduleConfig |
object |
No |
The scheduling configuration. If this parameter is not specified, manual scheduling is used. |
|
| Type |
string |
Yes |
The scheduling type. Valid values: MANUAL (manual execution) and NORMAL (periodic scheduling). Data sources in the development environment support only MANUAL. Whether NORMAL is available depends on the SupportSchedule value returned by GetCrawlerTypeCapabilities. |
NORMAL |
| CronExpress |
string |
No |
The six-part cron expression for periodic scheduling. This parameter is required when Type is set to NORMAL. The seconds field must be 0, and the scheduling frequency cannot be higher than once per hour. |
0 0 2 ? * * |
| EnableAiComment |
boolean |
No |
Specifies whether to enable AI metadata descriptions. This parameter is supported only when the SupportAiComment value returned by GetCrawlerTypeCapabilities is true. |
|
| Options |
object |
No |
The extended configuration for the crawler type. The key names, value types, required status, default values, and valid values are subject to the SupportedOptionKeys value returned by GetCrawlerTypeCapabilities. |
{} |
|
string |
No |
The value of a single extended configuration item for the crawler. The supported configuration items, value types, and value ranges are subject to the SupportedOptionKeys value returned by GetCrawlerTypeCapabilities. |
v1 |
The DataSourceId must match the Type. The support for ResourceGroupId, Scope, ScheduleConfig, EnableAiComment, and Options is subject to the values returned by GetCrawlerTypeCapabilities.
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The response. |
||
| RequestId |
string |
The request ID. You can use the ID to locate logs and troubleshoot issues. |
9252F32F-D855-549E-8898-61CF5A733050 |
| Success |
boolean |
Indicates whether the request is successful. |
|
| Id |
integer |
The ID of the newly created metadata crawler. |
1234 |
The Id is the ID of the newly created metadata crawler. A successful response does not indicate that the metadata collection is completed.
Examples
Success response
JSON format
{
"RequestId": "9252F32F-D855-549E-8898-61CF5A733050",
"Success": false,
"Id": 1234
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.