aws-sdk-rust
aws-sdk-rust copied to clipboard
[request]: Add paginator for Route53 ListResourceRecordSets API
A note for the community
Community Note
- Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
- Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
- If you are interested in working on this issue, please leave a comment
Tell us about your request
The new pagination support is great, and I'd like to use it in more places. Please add support to it to the ListResourceRecordSets API client method.
Tell us about the problem you're trying to solve.
I want to be able to iterate over multiple pages of resource record sets in a hosted zone reliably.
Are you currently working around this issue?
My existing code uses a loop and maintains its own pagination:
let mut next_record_name = Some(dns_suffix.to_ascii());
let mut next_record_type = None;
let mut next_record_identifier = None;
loop {
let records_resp = aws_context
.route53()
.list_resource_record_sets()
.hosted_zone_id(zone_id)
.set_start_record_name(next_record_name)
.set_start_record_type(next_record_type)
.set_start_record_identifier(next_record_identifier)
.send()
.await?;
/* ... process one page of results ... */
if records_resp.is_truncated() {
next_record_name = records_resp.next_record_name().map(String::from);
next_record_type = records_resp.next_record_type().map(Clone::clone);
next_record_identifier = records_resp.next_record_identifier().map(String::from);
} else {
break;
}
}
Additional context
No response
This is a modeling issue with the upstream service. I'll report it to them using our internal system. It can take some time for them to address issues like this depending on their workload. I'll update this ticket when I hear back from them.
I looked into this further and the root of the issue is different from what I expected. The Route53 team has actually defined pagination for this API call but the pagination is defined by an internal-only modeling language, which we do not support. I see three possibilities:
- The Route53 team reworks their current model to be a smithy model
- The Rust SDK team (or a contributor) creates a customization for Route53 that creates a special pagination implementation during codegen
- Users manually create their own API-specific pagination implementation based on our current implementation for smithy services.
That last option is probably your best option and that's good because you've already done the work for it 😄. For anyone else that comes to this issue with a similar problem, I encourage you to look at our current pagination codegen for inspiration on how to implement your own streaming pagination.
I'll keep talking with the Route53 folks and see if I can make any progress on the first possibility.
Opened an issue in aws/aws-sdk which is used to track issues across multiple sdks. Closing this issue
⚠️COMMENT VISIBILITY WARNING⚠️
Comments on closed issues are hard for our team to see. If you need more assistance, please either tag a team member or open a new issue that references this one. If you wish to keep having a conversation with other community members under this issue feel free to do so.