aws / aws-tools-for-powershell

The AWS Tools for PowerShell lets developers and administrators manage their AWS services from the PowerShell scripting environment.
Apache License 2.0
236 stars 78 forks source link

Other AWS.Tools.* cmdlets: Support automated pagination #117

Closed mtboren closed 1 year ago

mtboren commented 4 years ago

This is to track the feature request of adding AutoIteration to the rest of the AWS.Tools.* cmdlets that do not already have it and on which it makes sense. I have come across just one cmdlet so far (listed below), but this Issue could cover the same for any such remaining cmdlet (there are already hundreds of cmdlets that do support auto-iteration -- hurray!). And, this has been discussed/addressed for other cmdlets in #30 Support automated pagination for operations returning multiple lists

Cmdlets still needing auto-iteration:

Cmdlet Module
Get-CWLLogEvent AWS.Tools.CloudWatchLogs

Expected Behavior

When a request would yield more than the "limit" for one response, the cmdlet should auto-iterate through the subsequent responses (presumably using the NextForwardToken and NextBackwardToken values accordingly). Example of a cmdlet that already has this expected behavior: Get-CWLFilteredLogEvent

Current Behavior

The current behavior is that the response limit (1MB or 10,000 items) is hit, and a single object is returned with the events, and with the NextForwardToken and NextBackwardToken properties with which a user can iterate on their own. This differs, obviously, in that the desired behavior is that the cmdlet will auto-iterate for the user (unless the user specifies the -NoAutoIteration parameter that would be added in this new feature, too).

Possible Solution

Seems like the how-to is established with the hundreds of other cmdlets that already support auto-iteration. This feature request is just to add such functionality to remaining cmdlet(s) that do not already support it.

Context

This is in efforts to more easily (for the user) retrieve things from AWS (CWLLogEvents, for example), adding the feature of auto-iteration of item retrieval to the cmdlet itself, removing the need for users to write their own iteration code.

Your Environment

Include as many relevant details about the environment where the bug was discovered.

matteo-prosperi commented 4 years ago

Hello, thanks for opening this issue. Unfortunately the GetLogEvents API has an unconventional pagination mechanism that we cannot automatically support with the existing code generation. But I will take this feature request open for future improvements.

ashishdhingra commented 3 years ago

Also reported under https://github.com/aws/aws-tools-for-powershell/issues/147

github-actions[bot] commented 1 year ago

We have noticed this issue has not received attention in 1 year. We will close this issue for now. If you think this is in error, please feel free to comment and reopen the issue.