You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Would be nice to have a NS1.listZones() and/or Zone.list() #68
huh, definitely fair to want easier access to list, seems like an oversight.
I don't think I'd want it on Zone objects, as it's higher scope, but I think a listZones method on the client is appropriate. I'll see if i can whip up a PR.
yep, that works, but it's not really the way we envisioned its use. usually we access this via the "rest layer"
zones = client.zones()
zones.list()
for the "high-level" interface, I still believe that a listZones function is appropriate - my suspicion is that it hasn't been implemented as it should return Zone objects, and loading all of those zones would take N API calls. I would not want that happening if i had thousands of zones in my list!
what I'd like to do, and proposed, is to make listZones return a list of mostly empty Zone objects, and you would have to make a call to "load" the ones you want. That would need a bit of docs/comments explaining it, and i worry a bit if it would be more confusing than useful, but I'm inclined to add it. it's definitely on the radar!
Activity
nyetwurk commentedon Jul 22, 2020
Perhaps
Zoneitself can have alist()method that just extracts a list of barezone['zone']s[-]Would be nice to have a api.listZones()[/-][+]Would be nice to have a NS1.listZones() and/or Zone.list()[/+]rupa commentedon Jul 23, 2020
huh, definitely fair to want easier access to list, seems like an oversight.
I don't think I'd want it on Zone objects, as it's higher scope, but I think a
listZonesmethod on the client is appropriate. I'll see if i can whip up a PR.nyetwurk commentedon Jul 29, 2020
this code more or less works for me (from an api client, not an api patch)
rupa commentedon Jul 30, 2020
yep, that works, but it's not really the way we envisioned its use. usually we access this via the "rest layer"
for the "high-level" interface, I still believe that a
listZonesfunction is appropriate - my suspicion is that it hasn't been implemented as it should return Zone objects, and loading all of those zones would take N API calls. I would not want that happening if i had thousands of zones in my list!what I'd like to do, and proposed, is to make
listZonesreturn a list of mostly emptyZoneobjects, and you would have to make a call to "load" the ones you want. That would need a bit of docs/comments explaining it, and i worry a bit if it would be more confusing than useful, but I'm inclined to add it. it's definitely on the radar!ThiagoYU commentedon Oct 6, 2021
Hi @nyetwurk @rupa, thanks for this report
We already created a ticket about this.