Creating a Dump Task
Initialize a DIS SDK client instance as instructed in Initializing a DIS SDK Client Instance.
The add_dump_task_sample.py file provides a code sample. Open the add_dump_task_sample.py file and configure parameters. For details about how to configure the parameters, go to Adding a Dump Task.
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 osb_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.
Last Article: Creating a Stream
Next Article: Deleting a Stream
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.