Pipeline
The pipeline can be divided into free type and private type"
- The transcoding jobs in the free pipeline share about 400 ways of 720P transcoding computing resources provided by Baidu AI Cloud for the transcoding of audio and video.
- The private pipeline needs procurement additionally to better meet the users with higher business requirements for transcoding timeliness and stability.
The user can use pipelines to realize job priorities. You can distinguish job priority by creating multiple pipelines. Create most jobs in the pipeline with normal priority, and place high- priority jobs in the pipeline with high priority. Use the principle of first-come-first-served for pipelines to adjust the priority of jobs.
For the pipeline interface parameter meanings and vales please refer to Pipeline API.
Create New Pipeline
The following code creates a pipeline, and the capacity value is 20 by default:
pipeline_name = "your_pipeline";
source_bucket = "your_source_bucket";
target_bucket = "your_target_bucket";
# create a new pipeline
client.create_pipeline(pipeline_name, source_bucket, target_bucket);
List All Pipelines
The following code can list all the users' Pipeline:
response = client.list_pipelines()
for pipeline in response.pipelines:
print pipeline
Query Assigned Pipeline
If you only query a certain Pipeline, use the following code:
pipeline_name = "your_pipeline"
response = client.get_pipeline(pipeline_name)
print response
Delete Pipeline
The following code can delete a Pipeline:
pipeline_name = "your_pipeline"
response = client.delete_pipeline(pipeline_name)
print response
You should note that if Job associated with the Pipeline is not completed, you cannot delete the Pipeline. You can delete it successfully only after Job is completed.
Update Assigned Pipeline
To update the notification of a Pipeline, use the following code:
pipeline_name = "your_pipeline"
notification = "your_notification"
pipeline = self.the_client.get_pipeline_for_update(pipeline_name)
pipeline.config.notification = notification
response = self.the_client.update_pipeline(pipeline_name, pipeline)
print response
Update the other similar parameters of pipeline