@@ -396,6 +396,46 @@ def _interpolate_step_collection_name_in_depends_on(self, step_requests: list):
396
396
)
397
397
self ._interpolate_step_collection_name_in_depends_on (sub_step_requests )
398
398
399
+ def list_executions (
400
+ self ,
401
+ sort_by : str = None ,
402
+ sort_order : str = None ,
403
+ max_results : int = None ,
404
+ next_token : str = None ,
405
+ ) -> Dict [str , Any ]:
406
+ """Lists a pipeline's executions.
407
+
408
+ Args:
409
+ sort_by (str): The field by which to sort results(CreationTime/PipelineExecutionArn).
410
+ sort_order (str): The sort order for results (Ascending/Descending).
411
+ max_results (int): The maximum number of pipeline executions to return in the response.
412
+ next_token (str): If the result of the previous ListPipelineExecutions request was
413
+ truncated, the response includes a NextToken. To retrieve the next set of pipeline
414
+ executions, use the token in the next request.
415
+
416
+ Returns:
417
+ List of Pipeline Execution Summaries. See
418
+ boto3 client list_pipeline_executions
419
+ https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/sagemaker.html#SageMaker.Client.list_pipeline_executions
420
+ """
421
+ kwargs = dict (PipelineName = self .name )
422
+ update_args (
423
+ kwargs ,
424
+ SortBy = sort_by ,
425
+ SortOrder = sort_order ,
426
+ NextToken = next_token ,
427
+ MaxResults = max_results ,
428
+ )
429
+ response = self .sagemaker_session .sagemaker_client .list_pipeline_executions (** kwargs )
430
+
431
+ # Return only PipelineExecutionSummaries and NextToken from the list_pipeline_executions
432
+ # response
433
+ return {
434
+ key : response [key ]
435
+ for key in ["PipelineExecutionSummaries" , "NextToken" ]
436
+ if key in response
437
+ }
438
+
399
439
400
440
def format_start_parameters (parameters : Dict [str , Any ]) -> List [Dict [str , Any ]]:
401
441
"""Formats start parameter overrides as a list of dicts.
0 commit comments