Updated on 2023-06-21 GMT+08:00

Creating a Dump Task

Initialize a DIS SDK client instance as instructed in Initializing a DIS SDK Client Instance.

For details about how to configure parameters, see configuration methods in .

Configure the following parameters:
streamname ="dis-test1"  #Name of an existing stream
task_name='113'

Adding an OBS dump task is used as an example. The value parameter corresponds to the key parameter.

basic_Schema=DumpTask.setSchema(key=['consumer_strategy','deliver_time_int       erval','agency_name','retry_duration'],
      value=['LATEST', 30, 'dis_admin_agency',1800])
obs_dump_task =['destination_file_type','obs_bucket_path','file_prefix', 'partition_format','record_delimiter']
obs_Schema = DumpTask.setSchema(basic_Schema=basic_Schema,
                key=obs_dump_task,value=['text','obs-1253', '','yyyy', '|'])

#Add an OBS dump task and configure obs_Schema.

  cli.add_dump_task(streamname, task_name,'OBS',obs_Schema)
  • After configuring the parameters, run the add_dump_task_sample.py file to call add_dump_task_test by default. If response code 201 is returned, the dump task is successfully created.