AWS Powershell:如何检索NextToken [英] AWS Powershell: How do I retrieve the NextToken

查看:142
本文介绍了AWS Powershell:如何检索NextToken的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用AWS Powershell CmdLets时从哪里检索NextToken?

Where do I retrieve the NextToken from when using the AWS Powershell CmdLets?

例如,当我呼叫 Get-CDDeploymentList 我需要提供NextToken来检索下一组部署ID.但是,Get-CDDeploymentList命令仅返回部署ID的数组,而不返回NextToken.

For example when I call Get-CDDeploymentList I need to supply the NextToken to retrieve the next set of deployment IDs. However the Get-CDDeploymentList command only returns an array of deployment IDs and not a NextToken.

推荐答案

实际上,除非您想要或需要手动控制分页,否则不需要使用NextToken .默认情况下,如果未向绝大多数cmdlet提供NextToken,则它们将在内部自动为您处理分页,并多次调用基础服务api,以将完整的数据集发送到管道.

Actually you don't need to use NextToken unless you want or need to take manual control of pagination. By default, if NextToken isn't supplied to the vast majority of the cmdlets, they will automatically handle pagination for you internally and make multiple calls to the underlying service api to emit the full data set to the pipeline.

有几个服务api,其中来自api调用的响应数据包含多个字段,我们将向管道发出这些字段(想象一下一个返回了成功"元素列表以及失败的元素).在这些情况下,这些cmdlet会将整个响应对象发送到管道,并且将包含下一个令牌元素-对于这些,您(用户)必须手动分页.

There are a couple of service apis where the response data from the api call contains more than one field that we would emit to the pipeline (imagine a call that returned a list of 'success' elements as well as a list of 'failed' elements). In these scenarios the cmdlets will emit the entire response object to the pipeline and it will contain the next token element -- for these you (the user) have to manually paginate.

我确定我们曾经在cmdlet文档中注意到cmdlet何时自动分页(何时不分页),但是在查看链接的cmdlet文档时,似乎我们已经将其丢弃了.将进行调查并解决此问题.

I'm sure we used to note when cmdlets auto-paginate (and when they don't) in the cmdlet documentation but in looking at the linked cmdlet documentation it seems we've dropped this somewhere along the way - I'll investigate and get this fixed.

这篇关于AWS Powershell:如何检索NextToken的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆