Adding DLI Dump Tasks
Function
This API is used to add DLI dump tasks.
Calling Method
For details, see Calling APIs.
URI
POST /v2/{project_id}/streams/{stream_name}/transfer-tasks
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
project_id |
Yes |
String |
Project ID |
stream_name |
Yes |
String |
Name of the stream Maximum: 60 |
Request Parameters
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
X-Auth-Token |
Yes |
String |
User token. It can be obtained by calling the IAM API used to obtain a user token. The value of X-Subject-Token in the response header is the user token. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
destination_type |
Yes |
String |
Type of the dump task.
Default: NOWHERE Enumeration values:
|
dli_destination_descriptor |
No |
Parameter list of the DLI to which data in the DIS stream will be dumped |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
task_name |
Yes |
String |
Name of the dump task. The task name consists of letters, digits, hyphens (-), and underscores (_). It contains 1 to 64 characters. |
agency_name |
Yes |
String |
Name of the agency created on IAM. DIS uses an agency to access your specified resources. 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.If agencies are available, you can use an IAM API to obtain the available agencies.This parameter cannot be left unspecified and the parameter value cannot exceed 64 characters.If there are dump tasks on the console, the system displays a message indicating that an agency will be automatically created. The name of the automatically created agency is dis_admin_agency. Maximum: 64 |
deliver_time_interval |
Yes |
Integer |
User-defined interval at which data is imported from the current DIS stream into OBS. If no data is pushed to the DIS stream during the current interval, no dump file package will be generated. Unit: second Minimum: 30 Maximum: 900 Default: 300 |
consumer_strategy |
No |
String |
Offset.
Default: LATEST Enumeration values:
|
dli_database_name |
Yes |
String |
Name of the DLI database to which data in the DIS stream will be dumped |
dli_table_name |
Yes |
String |
Name of the DLI table to which data in the DIS stream will be dumped. Note: Only tables whose data location is DLI are supported, and you must have the permission to insert data into the tables. |
obs_bucket_path |
Yes |
String |
Name of the OBS bucket used to temporarily store data in the DIS stream |
file_prefix |
No |
String |
Self-defined directory created in the OBS bucket and used to temporarily store data in the DIS stream. Directory levels are separated by slashes (/) and cannot start with slashes. The value can contain a maximum of 50 characters, including letters, digits, underscores (_), and slashes (/). This parameter is left blank by default. |
retry_duration |
No |
String |
Time duration for DIS to retry if data fails to be dumped to DLI. If the retry time exceeds the value of this parameter, the data that fails to be dumped is backed up to the OBS bucket/file_prefix/dli_error directory.Value range: 0–7200Unit: secondDefault value: 1800If the value is set to 0, no retry is allowed. |
Response Parameters
None
Example Requests
Adding DLI Dump Tasks
POST https://{Endpoint}/v2/{project_id}/streams/{stream_name}/transfer-tasks { "destination_type" : "DLI", "dli_destination_descriptor" : { "task_name" : "dlitask", "consumer_strategy" : "LATEST", "agency_name" : "dis_admin_agency", "dli_database_name" : "dlidatabasename", "dli_table_name" : "dlitablename", "obs_bucket_path" : "obsbucket", "file_prefix" : "", "deliver_time_interval" : 300, "retry_duration " : 300 } }
Example Responses
None
Status Codes
Status Code |
Description |
---|---|
201 |
Normal response |
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.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot