-
Notifications
You must be signed in to change notification settings - Fork 3
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
base: main
Are you sure you want to change the base?
Conversation
@@ -0,0 +1,15 @@ | |||
ISC License |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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!)
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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} |
There was a problem hiding this comment.
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: |
There was a problem hiding this comment.
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''' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
line length
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. |
I was suggested via email to create a PR for the API class I created for MANRS