Skip to content Skip to sidebar Skip to footer

Unable To Paginate EMR Cluster Using Boto

I have about 55 EMR clusters (all of them were terminated) and have been trying to retrieve the entire 55 EMR clusters using the list_clusters method in boto. I've been searching f

Solution 1:

Tried with

emr_object.describe_jobflows(states=["TERMINATED"])

and it works! This method returns all the clusters.


Solution 2:

You can pass in None the first time round.

If the ClusterListResult you get back has a marker attribute then you can pass that in later, e.g.

m=None
while True:
    try:
        cluster_list_result=emr_object.describe_jobflows(states=['TERMINATED'], marker=m)
        .... Do whatever with cluster_list_result.clusters
        m=cluster_list_result.marker  # See if there are more
    except AttributeError:
        break

Post a Comment for "Unable To Paginate EMR Cluster Using Boto"