-
Notifications
You must be signed in to change notification settings - Fork 40k
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
Resolve the form of special "verbs" in the api for v1beta3 #3652
Comments
Doesn't this make the verb names invalid resource names? For example, /api/v1beta3/ns/default/pods/watch Am I asking for a pod named watch or am I watching all pods in the default namespace? Or maybe I misunderstand example, but if you are suggesting /api/v1beta3/ns/default/pods/methods/watch Am I watching for changes to the pod named methods or for all pods in namespace? Sent from my iPhone
|
@derekwaynecarr Fair point. Currently they conflict with object Kinds, which are less numerous and under our control. We could insert a character that couldn't be used in object names but is legal in URLs. For example: That said, I have to admit that watch, proxy, and redirect have a very different flavor than stop, resize, and clone. Maybe it makes sense to handle them differently. |
I think having seen a lot of other attempts to make this work.... that treating them higher in the chain actually makes it cleaner in the long run. They look a bit out of place, but if HTTP clients and servers supported truly flexible verbs we would use them for this. In the meantime, ns/foo/watch/pods is pretty clear. ----- Original Message -----
|
Ok, I'm fine with that. Thanks. |
/cc @nikhiljindal |
Thinking about bindings, ideally you name the last segment of the path the resource type you are posting. In this case a pod can have only a single binding, so you are |
I changed my mind about watch. Starting to feel like that's a different mime type/query param on LIST and GET. Proxy of wildcard never made sense (so that is going to always be a subresource). Redirect can be a query param or subresources. If we do that we don't need global verbs anymore. |
Yeah! |
I prefer the use of a query param. |
@derekwaynecarr A query param vs. what? And why? |
I prefer that a WATCH was done by the following:
over
It's closer to the behavior in etcd where I can convert any get/list query to a watch by passing ?wait=true |
That works for me. |
Tell me if this is a correct summary of what was decided:
|
Once this is settled, I need to figure out implications for mapping requests to policy verbs (#2877). |
They are resources - "pod/size" is a resource, with the verb "GET" (show me the current size) and "PUT" (change the current size). So the verb would stay a verb, but the resource would be a different resource. "pod" and "pod/status" are not the same resource. ----- Original Message -----
|
Generic proxy would probably just be a path (non-API) while "pod/proxy", "service/proxy", "pod/logs" are all separate resources. ----- Original Message -----
|
Currently, we support custom "verbs" such as proxy, redirect, and watch. These prefix the object paths, such as /api/v1beta1/watch/... (Note that proxy doesn't follow the actual path convention: api/v1beta1/proxy/minion/minion1:10250 -- note that minion is singular, and the port number.) See #3548 and #3612 for more examples.
More verbs are proposed, such as stop (#1535), resize (#1629), and clone (#170).
In order to be more compatible with REST/OO style, to simplify auth, and to facilitate discoverability and shardability, I propose we change these to SUFFIX api paths, in the standard collection/instance pattern. Something like: object_path/methods/verb_name. Note that some "verbs" (e.g., resize) require the ability to GET as well as POST, which is somewhat different than our REST objects.
@smarterclayton @lavalamp
The text was updated successfully, but these errors were encountered: