Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IAM roles.all should paginate #176

Closed
tmonk42 opened this issue Aug 28, 2015 · 2 comments
Closed

IAM roles.all should paginate #176

tmonk42 opened this issue Aug 28, 2015 · 2 comments
Assignees
Labels

Comments

@tmonk42
Copy link

tmonk42 commented Aug 28, 2015

As of 0.7.6, if you call iam.roles.all, and you have > 100 roles, Fog::AWS::IAM fails to use IsTruncated and Marker to request the next batch of roles.

I did some experimenting with this, and if I updated https://github.com/fog/fog-aws/blob/master/lib/fog/aws/models/iam/roles.rb#L13 to accept options, I could make a call like this:
iam_roles = iam.roles.all('MaxItems' => 1000)
and that would get all of my roles in one call.

Spent a couple hours poking at this and couldn't seem to find the right combo to get pagination working properly...

@geemus
Copy link
Member

geemus commented Sep 1, 2015

I think PagedCollection is intended to handle this: https://github.com/fog/fog-aws/blob/master/lib/fog/aws/iam/paged_collection.rb

You might try converting roles to this (from Collection) and it may "just work", otherwise, perhaps @lanej may be able to advise, as he wrote the PagedCollection code originally.

@lanej lanej self-assigned this Sep 1, 2015
@lanej lanej added the bug label Sep 1, 2015
@lanej lanej closed this as completed in #178 Sep 2, 2015
@tmonk42
Copy link
Author

tmonk42 commented Sep 3, 2015

A+ thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants