Unanswered
Hi All,
Is There Anyway To Get The Id Of The Pipeline Using Pipeline Name? I Need The Id Of The Pipeline So That I Can Schedule The Pipeline To Run Via
Hi @<1523701205467926528:profile|AgitatedDove14> , It works if I dont specify the project name and just give the task name. So I modified the above code a bit and now I'm able to get the id of the latest pipeline run.
task_to_schedule: Task = Task.get_task(task_id='b0732c334115432f8dc0cec0dbfdbdcb')
print(task_to_schedule.get_project_name())
# Output: Project Team NASA/.pipelines/NASA Pipeline
print(task_to_schedule.name)
# Output: NASA Pipeline #11
# task: Task = Task.get_task(project_name=task_to_schedule.get_project_name(),
# task_name=task_to_schedule.name)
# Error: ValueError: No projects found when searching for `Project Team NASA/.pipelines/NASA Pipeline`
tasks = Task.get_tasks(task_name= task_to_schedule.name,
task_filter={
"status": ["completed"],
"order_by": ["-last_update"]
})
# Returns multiple tasks by the same name
# (The pipeline was run by scheduler multiple times, so same name)
required_task: Task = tasks[0]
# Here I'm picking the latest completed pipeline
print(required_task.id)
# Output: 80836a14e8b0482cab14fa58484b99d0 (id of latest pipeline run)
126 Views
0
Answers
one year ago
one year ago