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
質問済み 1年前244ビュー
1回答
1
承認された回答

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
サポートエンジニア
回答済み 1年前
  • Thank you for kindly answer. I solved my problem thanks for your help. God bless you always~!

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ