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

Added my python API class #16

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

acidvegas
Copy link

I was suggested via email to create a PR for the API class I created for MANRS

@@ -0,0 +1,15 @@
ISC License
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is there a reason you picked ISC instead of apache2 here?

'''
Retrieve data about ROAs by ASN

:param asn: The ASN you would like to query either as a number or in AS12345 format
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there's a pylint line length limit of 80 chars.
(I'm not sure that pylint applies here, but.. it's sure handy!)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you telling me my lines have to be 80 chars to be approved for merging, or just suggesting it?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i'm saying that the python linter is going to complain, so it'd sure be nicer if it didn't complain.


:param endpoint: The endpoint you would like to query
'''
headers = {'Accept': 'application/json', 'Authorization': 'Bearer ' + self.api_key}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

line length

'''List conformance for all IXPs that are participanting in MANRS'''
return self.call('/conformance/ixps')

def conformance_by_network_operator(self) -> dict:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

line length

return self.call('/conformance/net-ops')

def conformance_by_vendor(self) -> dict:
'''List conformance for all equipment vendors that are participanting in MANRS'''
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

line length

@andy-isoc
Copy link

I'm one of the developers at the Internet Society and I work closely on the MANRS project (and am primarily responsible for the API). Thanks for the PR, it's great to see the community use the API and create tools to help others use it.

Have you looked into tools that can generate clients from the OpenAPI spec that we publish? Some examples are:

Personally, I would be concerned about publishing a "static" client that needs manual updating when the API changes. Using an auto-generated client allows users to be in complete control of how and when they update without relying on downstream repositories. I have used the first tool listed above before, though not to create a Python client.

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

Successfully merging this pull request may close these issues.

3 participants