Packages
lexdee
2.6.2
2.6.4
2.6.3
2.6.2
2.6.1
2.6.0
2.5.1
2.5.0
2.4.5
2.4.4
2.4.3
2.4.2
2.4.1
2.4.0
2.3.11
2.3.10
2.3.9
2.3.8
2.3.7
2.3.6
2.3.5
2.3.4
2.3.3
2.3.2
2.3.0
2.2.7
2.2.6
2.2.5
2.2.3
2.2.2
2.2.1
2.2.0
2.1.1
2.0.2
2.0.1
2.0.0
1.0.6
1.0.4
1.0.3
1.0.2
1.0.1
1.0.0
0.3.3
0.3.2
0.3.1
0.3.0
0.2.5
0.2.4
0.2.3
0.2.2
0.2.1
0.2.0
0.1.10
0.1.9
0.1.8
0.1.7
0.1.6
0.1.5
0.1.4
0.1.3
Client library for LXD
Current section
Files
Jump to
Current section
Files
lib/lexdee/instances.ex
defmodule Lexdee.Instances do
use Tesla
@path "/1.0/instances"
@spec base_path :: binary()
def base_path, do: @path
@spec index(Tesla.Client.t(), Keyword.t()) ::
{:error, any} | {:ok, Tesla.Env.t()}
def index(client, options \\ []), do: Tesla.get(client, @path, options)
@spec show(Tesla.Client.t(), binary(), Keyword.t()) ::
{:error, any} | {:ok, Tesla.Env.t()}
def show(client, id, options \\ []),
do: Tesla.get(client, Path.join(@path, id), options)
@spec create(Tesla.Client.t(), map, Keyword.t()) ::
{:error, any} | {:ok, Tesla.Env.t()}
def create(client, params, opts \\ []),
do: post(client, @path, params, opts)
@spec update(Tesla.Client.t(), binary(), map, Keyword.t()) ::
{:error, any} | {:ok, Tesla.Env.t()}
def update(client, id, params, options \\ []),
do: patch(client, Path.join(@path, id), params, options)
@spec remove(Tesla.Client.t(), binary(), Keyword.t()) ::
{:ok, Tesla.Env.t()} | {:error, any()}
def remove(client, id, options \\ []),
do: delete(client, Path.join(@path, id), options)
end