GetCrawler

Updated at:

Queries the configuration, status, and latest run information of a specified metadata crawler.

Operation description

Scenarios

Queries the configuration, availability status, and latest run information of a specified metadata crawler.

Recommended workflow

  1. Call ListCrawlers to query the crawler ID.

  2. Call this operation to obtain the crawler details.

  3. To query the complete run history, call ListCrawlerRuns.

Edition requirements

You must purchase DataWorks Basic Edition or a more advanced edition to use this operation.

Precautions

If the crawler has not been run, the latest run status and task instance ID may be empty.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

dataworks:GetCrawler

get

*All Resource

*

None None

Request syntax

POST  HTTP/1.1

Request parameters

Parameter

Type

Required

Description

Example

Id

integer

Yes

The ID of the metadata crawler. You can call ListCrawlers to query the ID.

1234

You can call ListCrawlers to query the ID.

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.

Crawler

object

The metadata crawler details.

Id

integer

The crawler ID.

1234

Name

string

The crawler name.

example_crawler

DataSourceId

integer

The data source ID.

12345

Type

string

The crawler type.

starrocks

Status

string

The crawler status. Valid values:

  • VALID: The crawler configuration is valid and the associated data source exists.

  • INVALID: The crawler configuration is invalid or the associated data source does not exist.

VALID

MetaEntityId

string

The ID of the meta-entity associated with the crawler. You can use this ID in metadata query APIs.

starrocks:example-instance

ProjectId

integer

The DataWorks workspace ID.

100

EnvType

string

The DataWorks environment type. Valid values:

  • Dev

  • Prod

Prod

ResourceGroupId

string

The ID of the Serverless 2.0 resource group used to run the crawl task.

Serverless_res_group_1234567890123456_1234567890

ScheduleConfig

object

The schedule settings.

Type

string

The scheduling type. Valid values:

  • MANUAL

  • NORMAL

NORMAL

CronExpress

string

The cron expression.

0 0 2 ? * *

LastRunStatus

string

The latest run status. Valid values:

  • WAITING

  • RUNNING

  • SUCCESS

  • ERROR

  • SHUTDOWN This parameter may be empty if the crawler has not been run.

SUCCESS

Owner

string

The DataWorks user ID of the crawler owner.

1000

CreateTime

integer

The creation time. The value is a UNIX timestamp in milliseconds.

1710239005403

ModifyTime

integer

The modification time. The value is a UNIX timestamp in milliseconds.

1710239005403

Scope

object

The crawl scope configuration.

Unit

string

The crawl scope granularity. Valid values:

  • PROJECT

  • DATABASE

  • INSTANCE

  • CATALOG

DATABASE

Items

array

The crawl scope items.

string

A single crawl scope item.

example_database

ExcludeRegex

string

The regular expression used to exclude items from the crawl scope.

^tmp_.*

EnableAiComment

boolean

Indicates whether AI metadata descriptions are enabled.

Options

object

The extension configuration for the crawler type.

{"CollectRecyclebin":"false"}

string

The value of a single extension configuration item for the crawler.

true

LastRunTaskInstanceId

integer

The DataWorks task instance ID associated with the latest run. This parameter may be empty if the crawler has not been run.

1234

TaskId

integer

The DataWorks scheduled task ID associated with the crawler. You can call GetTask to query the task definition.

1234

The Crawler response field contains the crawler configuration, availability status, and latest run information.

Examples

Success response

JSON format

{
  "RequestId": "9252F32F-D855-549E-8898-61CF5A733050",
  "Success": false,
  "Crawler": {
    "Id": 1234,
    "Name": "example_crawler",
    "DataSourceId": 12345,
    "Type": "starrocks",
    "Status": "VALID",
    "MetaEntityId": "starrocks:example-instance",
    "ProjectId": 100,
    "EnvType": "Prod",
    "ResourceGroupId": "Serverless_res_group_1234567890123456_1234567890",
    "ScheduleConfig": {
      "Type": "NORMAL",
      "CronExpress": "0 0 2 ? * *"
    },
    "LastRunStatus": "SUCCESS",
    "Owner": "1000",
    "CreateTime": 1710239005403,
    "ModifyTime": 1710239005403,
    "Scope": {
      "Unit": "DATABASE",
      "Items": [
        "example_database"
      ],
      "ExcludeRegex": "^tmp_.*"
    },
    "EnableAiComment": false,
    "Options": {
      "key": "true"
    },
    "LastRunTaskInstanceId": 1234,
    "TaskId": 1234
  }
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.