Remove old API

This commit is contained in:
2024-07-03 15:33:53 -03:00
parent e618f7c9e6
commit 64778bba19
2 changed files with 2 additions and 91 deletions

View File

@ -43,34 +43,6 @@ module Funko
end
end
get "/funkos/:name/pause/" do |env|
funko = Funko.from_names([env.params.url["name"]])[0]
funko.pause
funko.wait_for("paused", 5)
end
get "/funkos/:name/unpause/" do |env|
funko = Funko.from_names([env.params.url["name"]])[0]
funko.unpause
funko.wait_for("running", 5)
end
get "/funkos/:name/start/" do |env|
funko = Funko.from_names([env.params.url["name"]])[0]
funko.start
funko.wait_for("running", 5)
end
get "/funkos/:name/stop/" do |env|
funko = Funko.from_names([env.params.url["name"]])[0]
begin
funko.stop
funko.wait_for("exited", 5)
rescue ex : Docr::Errors::DockerAPIError
halt env, status_code: 500, response: "Failed to stop container"
end
end
# Build image for funko received as "funko.tgz"
# TODO: This may take a while, consider using something like
# mosquito-cr/mosquito to make it a job queue
@ -107,20 +79,12 @@ module Funko
result = [] of Hash(String, String)
funkos.each do |funko|
state = ""
case funko
when .running?
state = "running"
when .paused?
state = "paused"
else
state = "stopped"
end
state = "FIXME"
result << {
"name" => funko.name,
"state" => state,
"status" => funko.status,
"status" => "FIXME",
}
end