-
Notifications
You must be signed in to change notification settings - Fork 2k
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
API Support for Topology Visualization #9017
Comments
These fields? (Node.Resources and Node.Reserved are deprecated as of 0.9 although that could be made more clear.) ( Sample {
"Tasks": {
"redis": {
"Cpu": {
"CpuShares": 100
},
"Memory": {
"MemoryMB": 300
},
"Networks": null,
"Devices": null
}
},
"TaskLifecycles": {
"redis": null
},
"Shared": {
"Networks": null,
"DiskMB": 300,
"Ports": null
}
} |
Good to know! The UI currently uses It's totally understandable if you don't want to drag the deprecated fields into this new endpoint variant so I can update what we're using as part of this. |
Fixes #9017 The ?resources=true query parameter includes resources in the object stub listings. Specifically: - For `/v1/nodes?resources=true` both the `NodeResources` and `ReservedResources` field are included. - For `/v1/allocations?resources=true` the `AllocatedResources` field is included.
Does #9055 seem to meet your needs? I fear
In addition or alternatively you may want to continue doing You could limit the |
This meets my needs! I just updated my data fetching and verified it all. I agree about the massiveness of the allocations payload, and both of those additional toggles would help--especially task states which can be quite large and (at least for the topo viz) I'm not even looking at. This new The other other approach, if we don't want to pollute the public API with combinatorial bells and whistles, is to make this an "internal" "ui" endpoint. There's precedence for this in Vault and Consul already. I don't like the UI getting VIP treatment, but it might be nice as a stop-gap while we figure out some API configurations we actually want to support long term. |
Altering projection (the fields like task_states) is pretty easy on top of what I've built, so I'll add that. Altering selection (which objects like terminal=false) is a new thing altogether, so I'm going to skip it for now. Feel free to open up a new issue if you think it's worth going down that path. |
Fixes #9017 The ?resources=true query parameter includes resources in the object stub listings. Specifically: - For `/v1/nodes?resources=true` both the `NodeResources` and `ReservedResources` field are included. - For `/v1/allocations?resources=true` the `AllocatedResources` field is included. The ?task_states=false query parameter removes TaskStates from /v1/allocations responses. (By default TaskStates are included.)
Fixes hashicorp#9017 The ?resources=true query parameter includes resources in the object stub listings. Specifically: - For `/v1/nodes?resources=true` both the `NodeResources` and `ReservedResources` field are included. - For `/v1/allocations?resources=true` the `AllocatedResources` field is included. The ?task_states=false query parameter removes TaskStates from /v1/allocations responses. (By default TaskStates are included.)
I'm going to lock this issue because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active issues. |
It might be better to have this place to talk generally about the requirements of the topology visualization.
The API goals are to make as few requests as possible and download as many unneeded bits as possible. I guess these are always the goals of an API, but I digress.
Currently the topology visualization does this:
/v1/nodes
to get all nodes/v1/node/:id
to get the resources data (see Add Resources, ReservedResources, and Reserved to the /v1/nodes endpoint conditionally #8995)/v1/node/:id/allocations
to get allocations including resources dataThis results in 2n + 1 requests.
This is what I would like to do:
/v1/nodes?resources=true
/v1/allocations?resources=true
This would be just the two requests.
If I'm dreaming big, there is still a lot of information here I'm not sure I need, such as task events and node events, but this is a good starting point.
The text was updated successfully, but these errors were encountered: