Packages

A utility for interfacing with the Balena Supervisor API's, either remotely, or from within a container host.

Current section

Files

Jump to
ex_balena lib ex_balena api v1.ex
Raw

lib/ex_balena/api/v1.ex

defmodule ExBalena.API.V1 do
alias ExBalena.Client
def get(path) when is_binary(path),
do: Client.new() |> Tesla.get("/v1" <> path)
def post(path, body) when is_binary(path) and is_map(body),
do: Client.new() |> Tesla.post("/v1" <> path, body)
@spec handle_response(Tesla.Env.t()) :: any()
def handle_response(%{status: 200} = res) do
res
end
end