listStep API, Marker is not valid

0

I am using EMR API, listSteps on boto3 python library. I assigned "1" to Marker item but recevied the error message, "Marker '1' is not valid."

What value is valid at Marker?

API : https://docs.aws.amazon.com/emr/latest/APIReference/API_ListSteps.html

CS
demandé il y a un an244 vues
1 réponse
1
Réponse acceptée

Hello there,

Thank you for raising this question in re:Post.

The Marker string is to facilitate pagination as the list_steps API would return only 50 steps at a time and this is helpful only when your list_steps API call for a 'ClusterId' has more than 50 steps.

Say for example if you list_steps API response had more than 50 steps, it would also have a 'Marker' element returned with list of 50 steps. A subsequent 'list_steps' API call, this time with the string you got for 'Marker' in the earlier response also passed on will fetch you the next 50 steps for the cluster. You can loop through pages until the last response is received where the response will not have the 'Marker' element.

You could use Paginators to automatically iterate through pages without having to set the 'Marker'. A sample code given below for reference, in the sample it will print all the steps details from each response one after the other.

cluster_id='j-*************'
client = boto3.client('emr', region_name='us-west-2')
paginator = client.get_paginator('list_steps')
page_iterator = paginator.paginate(ClusterId = cluster_id)
for page in page_iterator:
  print(page['Steps'])

Hope this answers your query, please feel free to reply to us if you have follow up questions. Have a great day!

AWS
INGÉNIEUR EN ASSISTANCE TECHNIQUE
répondu il y a un an
  • Thank you for kindly answer. I solved my problem thanks for your help. God bless you always~!

Vous n'êtes pas connecté. Se connecter pour publier une réponse.

Une bonne réponse répond clairement à la question, contient des commentaires constructifs et encourage le développement professionnel de la personne qui pose la question.

Instructions pour répondre aux questions