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 Vision NPB API version support #8

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

ccorciu
Copy link
Collaborator

@ccorciu ccorciu commented Feb 15, 2021

No description provided.

Comment on lines +273 to +274
if self.version:
request_headers.update({'Version': self.version})
Copy link
Collaborator

Choose a reason for hiding this comment

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

This very interesting, I didn't know we could select the API version. Very cool!

When using the curl command, 'version' has to be all lower case, otherwise it is ignored. Does 'Version' work in Python?
% curl -s -k -u admin:admin 'https://192.168.29.143:9000/api/ports/P3-32?version=9.0.0'
Unknown Web API version: 9.0.0
% curl -s -k -u admin:admin 'https://192.168.29.143:9000/api/ports/P3-32?Version=9.0.0'
{
"afm_pipeline_direction": "INGRESS",
"burst_buffer_settings": null,
"cdr_bypass_enabled": false,

Isn't it better to have these changes in the init function? That way we only add the version header only once.

If we make the library to support the following syntax:
% curl -s -k -u admin:admin 'https://192.168.29.143:9000/api/ports/P3-32?version=4.4.0'
{
"afm_pipeline_direction": "INGRESS",
"burst_buffer_settings": null,

or
% curl -s -k -u admin:admin 'https://192.168.29.143:9000/api/ports/P3-32?{properties=id&version=4.4.0}'
{"id": 246}
then it will make sense to implement the changes in the _sendRequest function. But then we will have to modify every method so that we could pass the version, or define a setter for the version variable, i.e., @version.setter.

Copy link
Collaborator

@fredmota fredmota left a comment

Choose a reason for hiding this comment

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

Please review my previous comments, and please make the changes in the init function.

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

Successfully merging this pull request may close these issues.

2 participants