Querying Smart Connect Tasks
Function
This API is used to query Smart Connect tasks.
Calling Method
For details, see Calling APIs.
URI
GET /v2/{project_id}/instances/{instance_id}/connector/tasks
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| project_id | Yes | String | Project ID. For details, see Obtaining a Project ID. |
| instance_id | Yes | String | Instance ID. |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| offset | No | Integer | Offset, which is the position where the query starts. The value must be greater than or equal to 0. |
| limit | No | Integer | Maximum number of instances returned in the current query. The default value is 10. The value ranges from 1 to 50. |
Request Parameters
None
Response Parameters
Status code: 200
| Parameter | Type | Description |
|---|---|---|
| tasks | Array of SmartConnectTaskEntity objects | Smart Connect task details. |
| total_number | Integer | Number of Smart Connect tasks. |
| max_tasks | Integer | Maximum number of Smart Connect tasks. |
| quota_tasks | Integer | Smart Connect task quota. |
| Parameter | Type | Description |
|---|---|---|
| task_name | String | Definition: Smart Connect task name. Range: N/A |
| topics | String | Definition: Topic of a Smart Connect task. Range: N/A |
| topics_regex | String | Definition: Topic regular expression of a Smart Connect task. Range: N/A |
| source_type | String | Definition: Source type of a Smart Connect task. Range: |
| source_task | Definition: Source configuration of a Smart Connect task. | |
| sink_type | String | Definition: Target type of a Smart Connect task. Range: |
| sink_task | Definition: Target configuration of a Smart Connect task. | |
| id | String | Definition: ID of a Smart Connect task. Range: N/A |
| status | String | Definition Status of a Smart Connect task. Range |
| create_time | Long | Definition: Time when a Smart Connect task was created. Range: N/A |
| Parameter | Type | Description |
|---|---|---|
| current_cluster_name | String | Definition: Current Kafka instance name. (Displayed only when the source type is Kafka.) Range: N/A |
| cluster_name | String | Definition: Target Kafka instance name. (Displayed only when the source type is Kafka.) Range: N/A |
| user_name | String | Definition: Username of a target Kafka instance. (Displayed only when the source type is Kafka.) Range: N/A |
| sasl_mechanism | String | Definition: Target Kafka authentication mode. (Displayed only when the source type is Kafka.) Range: |
| instance_id | String | Definition: Target Kafka instance ID. (Displayed only when the source type is Kafka.) Range: N/A |
| bootstrap_servers | String | Definition: Target Kafka instance address. (Displayed only when the source type is Kafka.) Range: N/A |
| security_protocol | String | Definition: Target Kafka authentication mode. (Displayed only when the source type is Kafka.) Range: |
| direction | String | Definition: Synchronization direction. (Displayed only when the source type is Kafka.) Range: |
| sync_consumer_offsets_enabled | Boolean | Definition: Whether to synchronize the consumer offset. (Displayed only when the source type is Kafka.) Range: |
| replication_factor | Integer | Definition: Number of replicas. (Displayed only when the source type is Kafka.) Range: N/A |
| task_num | Integer | Definition: Number of tasks. (Displayed only when the source type is Kafka.) Range: N/A |
| rename_topic_enabled | Boolean | Definition: Whether to rename a topic. (Displayed only when the source type is Kafka.) Range: |
| provenance_header_enabled | Boolean | Definition: Whether to add the source header. (Displayed only when the source type is Kafka.) Range: |
| consumer_strategy | String | Definition: Start offset. (Displayed only when the source type is Kafka.) Range: |
| compression_type | String | Definition: Compression algorithm. (Displayed only when the source type is Kafka.) Range: |
| topics_mapping | String | Definition: Topic mapping. (Displayed only when the source type is Kafka.) Range: N/A |
| Parameter | Type | Description |
|---|---|---|
| consumer_strategy | String | Definition: Dump start offset. (Displayed only when the target type is OBS.) Range: |
| destination_file_type | String | Definition Dump file format. Only text is supported. (Displayed only when the target type is OBS.) Range TEXT |
| deliver_time_interval | Integer | Definition: Dumping period (s). (Displayed only when the target type is OBS.) Range: N/A |
| obs_bucket_name | String | Definition: Dumping address. (Displayed only when the target type is OBS.) Range: N/A |
| obs_path | String | Definition: Dump directory. (Displayed only when the target type is OBS.) Range: N/A |
| partition_format | String | Definition: Time directory format. (Displayed only when the target type is OBS.) Range: N/A |
| record_delimiter | String | Definition: Line break. (Displayed only when the target type is OBS.) Range: N/A |
| store_keys | Boolean | Definition: Storage key. (Displayed only when the target type is OBS.) Range: N/A |
| obs_part_size | Integer | Definition: Size (in bytes) of each file to be uploaded. The default value is 5242880. (Displayed only when the target type is OBS.) Range: N/A |
| flush_size | Integer | Definition: Size of flushed data. (Displayed only when the target type is OBS.) Range: N/A |
| timezone | String | Definition: Time zone. (Displayed only when the target type is OBS.) Range: N/A |
| schema_generator_class | String | Definition: schema_generator class. The default value is io.confluent.connect.storage.hive.schema.DefaultSchemaGenerator. (Displayed only when the target type is OBS.) Range: N/A |
| partitioner_class | String | Definition: partitioner class. The default value is io.confluent.connect.storage.partitioner.TimeBasedPartitioner. (Displayed only when the target type is OBS.) Range: N/A |
| value_converter | String | Definition: Value converter. The default value is org.apache.kafka.connect.converters.ByteArrayConverter. (Displayed only when the target type is OBS.) Range: N/A |
| key_converter | String | Definition: Key converter. The default value is org.apache.kafka.connect.converters.ByteArrayConverter. (Displayed only when the target type is OBS.) Range: N/A |
| kv_delimiter | String | Definition: Key-value delimiter. The default value is :. (Displayed only when the target type is OBS.) Range: N/A |
Example Requests
None
Example Responses
Status code: 200
Successful.
{
"tasks" : [ {
"task_name" : "smart-connect-1571576841",
"topics" : "topic-1643449744",
"source_task" : {
"current_cluster_name" : "A",
"cluster_name" : "B",
"direction" : "pull",
"bootstrap_servers" : "192.168.45.58:9092,192.168.44.1:9092,192.168.41.230:9092,192.168.43.112:9092",
"instance_id" : "59f6d088-****-****-****-********",
"consumer_strategy" : "earliest",
"sync_consumer_offsets_enabled" : false,
"rename_topic_enabled" : false,
"provenance_header_enabled" : false,
"security_protocol" : "PLAINTEXT",
"sasl_mechanism" : "PLAIN",
"user_name" : "",
"topics_mapping" : "",
"compression_type" : "none",
"task_num" : 2,
"replication_factor" : 3
},
"source_type" : "KAFKA_REPLICATOR_SOURCE",
"sink_task" : null,
"sink_type" : "NONE",
"id" : "194917d0-****-****-****-********",
"status" : "RUNNING",
"create_time" : 1708427753133
}, {
"task_name" : "smart-connect-1",
"topics_regex" : "topic-obs*",
"source_task" : null,
"source_type" : "NONE",
"sink_task" : {
"consumer_strategy" : "earliest",
"destination_file_type" : "TEXT",
"obs_bucket_name" : "abcabc",
"obs_path" : "obsTransfer-1810125534",
"partition_format" : "yyyy/MM/dd/HH/mm",
"record_delimiter" : "\\n",
"deliver_time_interva" : 300,
"obs_part_size" : 5242880,
"flush_size" : 1000000,
"timezone" : "Asia/Chongqing",
"schema_generator_class" : "io.confluent.connect.storage.hive.schema.DefaultSchemaGenerator",
"partitioner_class" : "io.confluent.connect.storage.partitioner.TimeBasedPartitioner",
"value_converter" : "org.apache.kafka.connect.converters.ByteArrayConverter",
"key_converter" : "org.apache.kafka.connect.converters.ByteArrayConverter",
"store_keys" : false,
"kv_delimiter" : ":"
},
"sink_type" : "OBS_SINK",
"id" : "3c0ac4d1-****-****-****-********",
"status" : "RUNNING",
"create_time" : 1708565483911
} ],
"total_number" : 2,
"max_tasks" : 18,
"quota_tasks" : 18
} Status Codes
| Status Code | Description |
|---|---|
| 200 | Successful. |
Error Codes
See Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.