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
posta un anno fa241 visualizzazioni
1 Risposta
1
Risposta accettata

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
TECNICO DI SUPPORTO
con risposta un anno fa
  • Thank you for kindly answer. I solved my problem thanks for your help. God bless you always~!

Accesso non effettuato. Accedi per postare una risposta.

Una buona risposta soddisfa chiaramente la domanda, fornisce un feedback costruttivo e incoraggia la crescita professionale del richiedente.

Linee guida per rispondere alle domande