Amazon ec2 将ec2的结果限制在1000。获取现货价格历史()?
我正在使用boto库访问AWS EC2的get_spot_price_history函数中的信息。我注意到它将结果限制在1000个-即使我没有设置最大结果。有没有办法获得超过1000个结果?即使我将max_results设置为2000,我仍然只能得到1000个结果 我在boto代码中没有看到任何将结果限制为1000的内容,这令人费解。下面是我正在使用的示例脚本,它说明了问题:Amazon ec2 将ec2的结果限制在1000。获取现货价格历史()?,amazon-ec2,boto,Amazon Ec2,Boto,我正在使用boto库访问AWS EC2的get_spot_price_history函数中的信息。我注意到它将结果限制在1000个-即使我没有设置最大结果。有没有办法获得超过1000个结果?即使我将max_results设置为2000,我仍然只能得到1000个结果 我在boto代码中没有看到任何将结果限制为1000的内容,这令人费解。下面是我正在使用的示例脚本,它说明了问题: #!/usr/bin/python import boto import boto.ec2 ec2 = boto.ec2
#!/usr/bin/python
import boto
import boto.ec2
ec2 = boto.ec2.connect_to_region("us-west-1", aws_access_key_id="KEY", aws_secret_access_key="SECRET")
start = '2013-11-17T00:14:45.000Z'
end = '2013-12-17T00:14:45.000Z'
output = ec2.get_spot_price_history(start_time=start, end_time=end, availability_zone="us-west-1a")
print "Length: %d" % (len(output))
这似乎是由于底层AWS EC2 API的行为: Amazon似乎返回了一个令牌,您可以在后续请求中使用它,但我还没有看到
boto
公开该令牌。我还试图获得1000多个实例的信息
编辑:看起来有一个已经修复的bug被归档了:
返回的列表应该是一个结果集,它将为您提供nextToken
MaxResults
The maximum number of items to return for this call. The call also returns a token that you can specify in a subsequent call to get the next set of results.
Type: Integer
Default: The call returns all items.
Constraint: If the value is greater than 1000, we return only 1000 items.
Required: No