Repository navigation
Hyper Http layer - #198
Hyper Http layer#198Yummy-Yums wants to merge 3 commits into
Conversation
markovejnovic
left a comment
There was a problem hiding this comment.
some rough feedback before you further proceed
thank you very much for this addition. i know i was quite hesitant on it, but i do now think this is an awesome addition to the orchestrator
|
|
||
| # TODO - create a vm router and forward all requests that come from path /vm to it | ||
|
|
||
| get "/v1/vms" do |
There was a problem hiding this comment.
I would probably stick these under /api/v0 until we release Hyper v1.
|
|
||
| plug(:dispatch) | ||
|
|
||
| get "/health" do |
There was a problem hiding this comment.
| get "/health" do | |
| get "/healthz" do |
| send_json_response(conn, 200, %{status: "Hyper System is live"}) | ||
| end | ||
|
|
||
| get "/ready" do |
There was a problem hiding this comment.
| get "/ready" do | |
| get "/readyz" do |
| // Use IntelliSense to learn about possible attributes. | ||
| // Hover to view descriptions of existing attributes. | ||
| // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 |
There was a problem hiding this comment.
| // Use IntelliSense to learn about possible attributes. | |
| // Hover to view descriptions of existing attributes. | |
| // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 |
| def list_vms(page_size, page_token \\ "") do | ||
| case Hyper.Grpc.Page.paginate( | ||
| Hyper.Cluster.Routing.all(), | ||
| page_size, | ||
| page_token, | ||
| Hyper.Grpc.Pageable.Vm | ||
| ) do | ||
| {:ok, {page, next}} -> | ||
| {:ok, | ||
| Enum.map( | ||
| page, | ||
| fn {vm_id, node} -> %{vm_id: vm_id, node: to_string(node)} end | ||
| ), next} | ||
|
|
||
| {:error, _bad_page_token} -> :error | ||
| end | ||
| end |
There was a problem hiding this comment.
a) I don't think we should leak the node to the caller, necessarily. generally, i am thinking the nodes should be opaque to the user
b) I dislike that pagination here is coupled to the grpc module. i think it would be much better if we moved Hyper.Grpc.Page to Hyper.Page (same for Pageable)
No description provided.