可以获取过去90天的AWS Spot价格历史记录。使用Java SDK时,可以创建一个查询来获取部分历史记录,但由于此列表非常长,因此会将其拆分。使用令牌,您应该能够获取列表的下一部分,并重复此操作,直到接收整个列表为止。
问题在于,使用给定的令牌,我尚未能够检索超出列表第一部分的内容。在搜索互联网时,清楚地表明了对该令牌的理解是正确的。
问题在于,使用给定的令牌,我尚未能够检索超出列表第一部分的内容。在搜索互联网时,清楚地表明了对该令牌的理解是正确的。
// Create the AmazonEC2Client object so we can call various APIs.
AmazonEC2 ec2 = new AmazonEC2Client(credentials);
// Get the spot price history
DescribeSpotPriceHistoryResult result = ec2.describeSpotPriceHistory();
// Print first part of list
for (int i = 0; i < result.getSpotPriceHistory().size(); i++) {
System.out.println(result.getSpotPriceHistory().get(i));
}
result = result.withNextToken(result.getNextToken());
// Print second part of list
for (int i = 0; i < result.getSpotPriceHistory().size(); i++) {
System.out.println(result.getSpotPriceHistory().get(i));
}
查询结果中的“nextToken”没有发生变化。我做错了什么?SDK有问题吗?我是通过Eclipse安装的。
提前致谢!