awslabs / awslabs/aws-sdk-rust

[request]: Implement paginator for DescribeRules in aws-sdk-elasticloadbalancingv2

Open
#447 1 comment 3 reactions 0 assignees View on GitHub
feature-request p2
Dominant language
Rust
Stars
3.3k
Forks
290
Avg merge
1d 12h
Merged PRs (30d)
3

Description

### A note for the community

### Community Note
* Please vote on this issue by adding a 👍 [reaction](https://blog.github.com/2016-03-10-add-reactions-to-pull-requests-issues-and-comments/) 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

Paginator for `DescribeRules` in aws-sdk-elasticloadbalancingv2.

### Tell us about the problem you're trying to solve.

I want to describe all rules for a listener by listener's ARN. `DescribeRules` operation has an interface for pagination (`marker`, `next_marker`, etc.) and I have to use them to list up all rules for a listener. Some operations in aws-sdk-elasticloadbalancingv2 has paginator implementations so they can be paginated easily, but `DescribeRules` does not. Having paginator for `DescribeRules` would be nice.

### Are you currently working around this issue?

Implements pagination manually. Note that the following code is for v0.3.0.

```rust
client
.describe_rules()
.listener_arn(listener_arn.clone())
.send()
.and_then(move |output| async move {
let next_marker = output.next_marker.clone();
let head = futures::stream::once(async { Ok(output) });
let tail = futures::stream::try_unfold(next_marker, move |next_marker| {
let listener_arn = listener_arn.clone();
async move {
let next_marker = match next_marker {
Some(marker) if !marker.is_empty() => marker,
_ => return Ok(None),
};

let output = elbv2
.describe_rules()
.marker(next_marker)
.listener_arn(listener_arn.clone())
.send()
.await?;
let next_marker = output.next_marker.clone();
Ok(Some((output, next_marker)))
}
});
Ok(head.chain(tail))
})
.try_flatten_stream()
```

### Additional context

_No response_

Contributor guide

Open the contributing guide

Research direction

Start by comparing the existing paginator implementations in aws-sdk-elasticloadbalancingv2 with the DescribeRules operation and its marker and next_marker fields. Done means DescribeRules can paginate rules for a listener ARN without the manual stream workaround shown in the issue; verify behavior using the repository's existing paginator tests or patterns.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, rust
Domain
api, cloud
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.