Updated on 2025-11-25 GMT+08:00

Updating a Dump Task

Function

This API is used to update a dump task.

Calling Method

For details, see Calling APIs.

URI

PUT /v2/{project_id}/streams/{stream_name}/transfer-tasks

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Definition

Project ID. For how to obtain it, see Obtaining a Project ID.

Constraints

N/A

Range

The value can contain 1 to 64 characters. Only letters and digits are allowed.

Default Value

N/A

stream_name

Yes

String

Definition

Stream name. The system generates a name prefixed with "dis-" followed by four random characters or digits. Example: dis-HvB1. You can also customize a name.

Constraints

N/A

Range

The value can contain 1 to 64 characters. Only letters and digits are allowed.

Default Value

N/A

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

Definition

User token. You can obtain it by calling the IAM API for obtaining a user token. The user token is the value of X-Subject-Token in the response header. For details, see Token-based Authentication.

Constraints

N/A

Range

The value can contain 1 to 32,768 characters.

Default Value

N/A

Table 3 Request body parameters

Parameter

Mandatory

Type

Description

destination_type

No

String

Definition

Dump task type. OBS: Data is dumped to OBS.

Constraints

N/A

Range

N/A

Default Value

OBS

obs_destination_descriptor

No

OBSDestinationDescriptorRequest object

Parameter list of OBS to which data in the DIS stream will be dumped

Table 4 OBSDestinationDescriptorRequest

Parameter

Mandatory

Type

Description

task_name

Yes

String

Definition

Name of the dump task

Constraints

N/A

Range

It can contain 1 to 64 characters. Only letters, digits, hyphens (-), and underscores (_) are allowed.

Default Value

N/A

agency_name

No

String

Definition

Name of the agency created in IAM. DIS uses an agency to access your specified resources. If agencies are available, you can use an IAM API to obtain the available agencies. If dump tasks are used on the console or through API calls, the system displays a message indicating that an agency named dis_admin_agency will be automatically created.

Constraints

Agency parameter settings:

  • Agency Type: Cloud service

  • Cloud Service: DIS

  • Validity Period: Unlimited

  • Set Policy to Tenant Administrator on the OBS project in the Global service region.

Range

Name of the agency to be created. The value of this parameter is 1 to 64 characters long and cannot be left unspecified.

Default Value

N/A

deliver_time_interval

Yes

Integer

Definition

User-defined interval (s) at which data is imported into OBS. If no data is pushed during the current interval, no dump file package will be generated.

Constraints

N/A

Range

The value is an integer ranging from 30 to 900.

Default Value

N/A

deliver_size_interval

No

Integer

Definition

Dump file size (MB). A dump is triggered when the size of the local cache reaches the threshold.

Constraints

N/A

Range

The value is an integer ranging from 1 to 300.

Default Value

N/A

consumer_strategy

No

String

Definition

Offset

Constraints

When modifying a dump task, ensure that the offset is the same as that set when the dump task was created. For example, if the maximum offset was set during dump task creation, the maximum offset must be used during dump task modification.

Range

  • LATEST: maximum offset, indicating that the latest data will be extracted.

  • TRIM_HORIZON: minimum offset, indicating that the earliest data will be extracted.

Default Value

N/A

file_prefix

No

String

Definition

Custom OBS directory for storing stream files. It is empty by default.

Constraints

Different directory levels are separated by forward slashes (/).

Range

The value can contain a maximum of 50 characters, including letters, digits, underscores (_), and slashes (/).

Default Value

Empty

partition_format

No

String

Definition

Directory structure of the object file written into OBS. The directory structure is in the format of yyyy/MM/dd/HH/mm (time at which the dumping task was created). After the data is dumped successfully, the storage directory structure is obs_bucket_path/file_prefix/partition_format. For example, if the dump task was created at 14:49 on November 10, 2017, then the directory structure is 2017 > 11 > 10 > 14 > 49.

Constraints

N/A

Range

  • N/A: If this field is left unspecified, the time directory format will not be used.

  • yyyy: year.

  • yyyy/MM: year and month

  • yyyy/MM/dd: year, month, and day

  • yyyy/MM/dd/HH: year, month, day, and hour

  • yyyy/MM/dd/HH/mm: year, month, day, hour, and minute.

Default Value

N/A

obs_bucket_path

Yes

String

Definition

Name of the OBS bucket used to store the stream data.

Constraints

It consists of lowercase letters, digits, hyphens (-), underscores (), and periods (.). Range The value contains 3 to 63 characters, including lowercase letters, digits, hyphens (-), underscores (), and periods (.).

Default Value

N/A

destination_file_type

No

String

Definition

Dump file format

Constraints

The csv and parquet formats can be selected only when Source Data Type is set to JSON and Dump Destination is set to OBS.

Range

  • text: This is the default value.

  • csv

  • parquet

Default Value

Text

processing_schema

No

ProcessingSchema object

Definition

Dump time directory generated based on the timestamp of the source data and the configured partition_format. Directory structure of the object file written into OBS. The directory structure is in the format of yyyy/MM/dd/HH/mm.

Constraints

N/A

Range

N/A

Default Value

N/A

record_delimiter

No

String

Definition

Delimiter for the dump file, which is used to separate the user data that is written into the dump file.

Constraints

It consists of lowercase letters, digits, hyphens (-), underscores (_), and periods (.).

Range

  • ,: comma, which is the default value

  • ;: semicolon

  • |: vertical bar

  • \n: newline character

  • NULL: null

Default Value

"\n"

Table 5 ProcessingSchema

Parameter

Mandatory

Type

Description

timestamp_name

Yes

String

Definition

Attribute name of the source data timestamp

Constraints

N/A

Range

N/A

Default Value

N/A

timestamp_type

Yes

String

Definition

Type of the source data timestamp.

Constraints

N/A

Range

  • String: string type

  • Timestamp: 13-bit timestamp of the long type

Default Value

N/A

timestamp_format

No

String

Definition

OBS directory generated based on the timestamp format. This parameter is mandatory when the timestamp type of the source data is String.

Constraints

N/A

Range

N/A

Default Value

N/A

Response Parameters

Status code: 200

Normal response

None

Example Requests

Update a dump task.

PUT https://{Endpoint}/v2/{project_id}/streams/{stream_name}/transfer-tasks

{
  "destination_type" : "OBS",
  "obs_destination_descriptor" : {
    "agency_name" : "dis_admin_agency",
    "task_name" : "task-test1",
    "consumer_strategy" : "LATEST",
    "cross_account_dump" : false,
    "destination_file_type" : "text",
    "obs_bucket_path" : "obsbucket",
    "file_prefix" : "",
    "partition_format" : "yyyy/MM/dd/HH/mm",
    "record_delimiter" : "|",
    "deliver_time_interval" : 300
  }
}

Example Responses

None

Status Codes

Status Code

Description

200

Normal response

Error Codes

See Error Codes.