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

Add "Name" ListOption for filtering list results #143

Closed
sunny-b opened this issue Oct 1, 2020 · 2 comments
Closed

Add "Name" ListOption for filtering list results #143

sunny-b opened this issue Oct 1, 2020 · 2 comments

Comments

@sunny-b
Copy link
Contributor

sunny-b commented Oct 1, 2020

The Mongo Atlas API supports filtering list results based on a name parameter.

Link: https://docs.atlas.mongodb.com/reference/api/organization-get-all/#resource

It would be really useful to have this supported in the Go Client as well. At the moment, it looks like the only ListOptions that are supported are PageNum, and ItemsPerPage

// ListOptions specifies the optional parameters to List methods that
// support pagination.
type ListOptions struct {
// For paginated result sets, page of results to retrieve.
PageNum int `url:"pageNum,omitempty"`
// For paginated result sets, the number of results to include per page.
ItemsPerPage int `url:"itemsPerPage,omitempty"`
}

We use Ops Manager at work and we depend on this feature in the API. We want to use this Go client but we would need this feature to be supported.

It is a pretty small change and I could easily make a PR for it. I've already made the change in my own fork:
sunny-b@c581130

@sunny-b
Copy link
Contributor Author

sunny-b commented Oct 1, 2020

Ah I see it might be better to create an OrganizationListOptions struct similar to ContainerListOptions

type ContainersListOptions struct {
ProviderName string `url:"providerName,omitempty"`
ListOptions
}

@sunny-b
Copy link
Contributor Author

sunny-b commented Oct 6, 2020

I'm closing this as it was fixed by #144

@sunny-b sunny-b closed this as completed Oct 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant