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
feita há um ano241 visualizações
1 Resposta
1
Resposta aceita

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
ENGENHEIRO DE SUPORTE
respondido há um ano
  • Thank you for kindly answer. I solved my problem thanks for your help. God bless you always~!

Você não está conectado. Fazer login para postar uma resposta.

Uma boa resposta responde claramente à pergunta, dá feedback construtivo e incentiva o crescimento profissional de quem perguntou.

Diretrizes para responder a perguntas