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

Api broken? #33

Open
nicoduck opened this issue Nov 25, 2019 · 8 comments
Open

Api broken? #33

nicoduck opened this issue Nov 25, 2019 · 8 comments
Assignees
Labels
Minor Up to 4 hours No code change Fixing the issue will not require touching the code

Comments

@nicoduck
Copy link

Hi,

I have some issues with the refactoring and the documentation, for example:
pdb.all(resource.Network, asn=2906) is listed as an example in the documentation but throws an error nowadays:

>>> pdb.all(resource.Network, asn=2906)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: all() got an unexpected keyword argument 'asn'

I assume that my setup works completely since pdb.get(resource.Network, 16954) returns the expected network.
>>> pdb.get(resource.Network, 16954) <Network: Pfalzkom>
It also seems that the presentation about PeeringDB 2 refers to the old library implementation as pdb.all('ix', name='chix', country='us') does not seem to work anymore too.

Could you please clarify how the syntax has changed, how to get the expected results and update the documentation?
I'm running python 3.6.8 and peeringdb --version returns:
peeringdb 1.0.0

Thanks
Nico

@svaio
Copy link

svaio commented Dec 10, 2019

try to use pdb.fetch_all(resource.Network, 999, asn=2906)

@arnoldnipper
Copy link

did that fix your problem, @nicoduck?

@arnoldnipper arnoldnipper self-assigned this May 12, 2020
@arnoldnipper arnoldnipper added this to the 1 Decide milestone May 12, 2020
@nicoduck
Copy link
Author

Yes, but that also means that the documentation seems to be outdated.
fetch_all is not listed, as is "import resource from peeringdb", which is necessary to execute it.

@arnoldnipper
Copy link

Would you mind to list the URL, @nicoduck you are referring to?

@nicoduck
Copy link
Author

nicoduck commented Jul 6, 2020

I'm referring to the docs linked in the Readme (aka the startpage) of the project: http://peeringdb.github.io/peeringdb-py/api/

@arnoldnipper
Copy link

@vegu | @grizz could you please look into the documentation. TIA

@grizz grizz added Minor Up to 4 hours No code change Fixing the issue will not require touching the code labels Sep 4, 2020
@toomuchio
Copy link

fetch_all avoids the local database and requests data directly from the API, is that intentional?

@grizz
Copy link
Member

grizz commented Sep 15, 2020

fetch_all avoids the local database and requests data directly from the API, is that intentional?

Yes, fetch is fetching from server.

If you are looking to access local data django's objects.all is what you would want.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Minor Up to 4 hours No code change Fixing the issue will not require touching the code
Projects
None yet
Development

No branches or pull requests

5 participants