Skip to content

Hyper Http layer - #198

Draft
Yummy-Yums wants to merge 3 commits into
harmont-dev:mainfrom
Yummy-Yums:hyper-rest-layer
Draft

Yummy-Yums wants to merge 3 commits into
harmont-dev:mainfrom
Yummy-Yums:hyper-rest-layer

Conversation

@Yummy-Yums

Copy link
Copy Markdown

No description provided.

@Yummy-Yums Yummy-Yums changed the title initial commit Hyper Rest Http layer Nov 25, 2026
@Yummy-Yums

Copy link
Copy Markdown
Author

#177

@Yummy-Yums Yummy-Yums changed the title Hyper Rest Http layer Hyper Http layer Nov 26, 2026

@markovejnovic markovejnovic left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Comment thread lib/hyper/http/router.ex Outdated

# TODO - create a vm router and forward all requests that come from path /vm to it

get "/v1/vms" do

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would probably stick these under /api/v0 until we release Hyper v1.

Comment thread lib/hyper/http/router.ex

plug(:dispatch)

get "/health" do

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
get "/health" do
get "/healthz" do

Comment thread lib/hyper/http/router.ex
send_json_response(conn, 200, %{status: "Hyper System is live"})
end

get "/ready" do

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
get "/ready" do
get "/readyz" do

Comment thread .vscode/launch.json
Comment on lines +2 to +4
// 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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// 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

Comment thread lib/hyper/http/server.ex
Comment on lines +15 to +31
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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants