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

How to control the version in the request? #29

Open
kimpenhaus opened this issue Dec 31, 2016 · 4 comments
Open

How to control the version in the request? #29

kimpenhaus opened this issue Dec 31, 2016 · 4 comments

Comments

@kimpenhaus
Copy link

First of all - thanks for implementing - that saved me a lot of work and its usage is really straight forward.

But I do have a question about the control of the request version (not that of the API). I am trying to enable/disable a camera based on an event. I know that the surveillance api has the possibility to since v3 (based on your _full.json)

By default it looks to me that it is always using v1 - because of this:
version = 'minVersion' in definitions[api] ? definitions[api].minVersion : 1;

So I changed the min version to 8, which actually helps me with this problem but opens up another one :) getInfoCamera changed its response data between those versions 1 and 8.

So what I am trying is to control the version on each request. So that I can go with v1 on getInfoCamera and with v8 on enableCamera/disableCamera.

Is that possible?
And what is the recommended way to enable a specific version - I don't think changing the minor version in the _full.json is the recommended one ;-)

Thanks and have a happy new year!
m.

@kwent
Copy link
Owner

kwent commented Jan 4, 2017

Very interesting. It's true it's not possible for now.

I should be able to implement a flag to be able to control this version.

I also think it should be maxVersion by default and not minVersion.

@kimpenhaus
Copy link
Author

Maybe an options array containing meta data for the request makes sense. Not sure if there will be ever more than a version to control...

Thanks.

@kwent
Copy link
Owner

kwent commented Jan 17, 2017

What about ?

In JS

# For a call with API version 2
syno.api(2).method(params, callback);
# Call with last API version
syno.api.method(params, callback);

In CLI

# For a call with API version 2
syno api --version 2 method;
# For a call with las API version
syno api method;

@kimpenhaus
Copy link
Author

wow - yeah that looks pretty cool and intuitive.
I vote +1 for that!

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

No branches or pull requests

2 participants