Comments (3)
So based on reading some different blog posts, we will want to move all the current versions into a v1 namespace with the name prepended with a starting version. We could either use date+timestamps or just an incrementing number. Because of the global nature of development and use, spanning many time zones, I propose just incrementing a single int for the version number(1,2,3 etc) vs a timestamp.
If we want to be able to support older versions of the api(for bug fixes etc) we could add a - or _ in the version number(1-1 etc) or (1_1 etc)
The challenge with the first option (the hypen - ) is we can not name the go functions the same thing(ie browsePut1-1 is an invalid method name) so the function name would be slightly different then the api version, could be an underscore or no special character.
If instead we use an underscore(_) in the URL it creates URLs that could be harder to parse(some API libraries have shown issues parsing urls with _) but since we control the consumption of this API we it might be less of a problem.
Once the version scheme is decided, the next question is how much to scope into a version of the API.
Only the browse API is changing with v2, but I think we should support calls for v2
to other api's just for consistency, even if the other apis aren't changing.
So the changes required would be to rename all our existing browse API's to be V1 first.
ex func (handler *Handler) browsePut
becomes func (handler *Handler) browsePutV1
etc
Then merge the changes from feat8-refactor-browse
branch and name those functions latest, along with all other APIs in other packages besides browse.
ex in package http/handler/docker
rename (handler *Handler) dockerOperation
to (handler *Handler) dockerOperationLatest
etc.
Then update the ServeHTTP method to strip v1 out of the URL and send any requests to the v1 functions. Also strip out v2 and then send any requests with v2(or no version) to the latest functions.
from agent.
If we want to be able to support older versions of the api(for bug fixes etc) we could add a - or _ in the version number(1-1 etc) or (1_1 etc)
I don't think we need this. If a bug is detected in a specific version of the API (and thus related to the agent, our instruction will be to simply update the agent to a version that includes the fix).
Version scheme v1
, v2
, vX
ok for me.
Only the browse API is changing with v2, but I think we should support calls for v2 to other api's just for consistency, even if the other apis aren't changing.
Yes.
Then merge the changes from feat8-refactor-browse branch and name those functions latest, along with all other APIs in other packages besides browse.
ex in package http/handler/docker rename (handler *Handler) dockerOperation to (handler *Handler) dockerOperationLatest etc.
No need to append Latest
to each handler, each handler without a version suffix should be considered the latest version of the handler.
We should start with a PR affecting the browse
and agent
API endpoints first, we'll review it and then go further with the whole API.
from agent.
In order to solve portainer/portainer#2364 I think that as a part of this work we should also introduce a new Header returned by all the agent responses that would include the current version of the Agent API.
This could be added next to the Agent version header: https://github.com/portainer/agent/blob/develop/http/server.go#L44
from agent.
Related Issues (20)
- edge agent : Missing request signature headers (err=Unauthorized) (code=403) HOT 7
- Image import doesn't work HOT 4
- CVEs in Portainer Agent HOT 2
- edge agent won't connect anymore HOT 4
- Refactor tasks
- Portainer agents enter restarting state after a few minutes HOT 2
- Swarm Image Tag empty HOT 1
- Allow the agent probe timeout and interval to be set
- Portainer Agent Version HOT 1
- Data race in the operatioons of the edge key
- edge agent error please help!
- Avoid auto switching agent to cluster mode HOT 5
- Edge agent does not work when the portainer server is accessed through a CNAME record HOT 3
- Please direct all issues to the portainer/portainer repository
- Portainer with reverse proxy (caddy) can't connect to edge agent but gets heartbeats HOT 4
- Enabled host management features - blkid: executable file not found HOT 3
- Healthcheck for Portainer Agents Running on Docker Swarm HOT 1
- Edge agent didn't start on manager HOT 1
- Older docker-compose version replaces all containers when only one changed HOT 1
- TLS handshake error HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from agent.