Skip to content

Commit

Permalink
Merge branch 'release/1.0.5'
Browse files Browse the repository at this point in the history
  • Loading branch information
zacksiri committed Feb 4, 2022
2 parents 23ec401 + e1dc5a3 commit 37bc035
Show file tree
Hide file tree
Showing 6 changed files with 59 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ by adding `lexdee` to your list of dependencies in `mix.exs`:
```elixir
def deps do
[
{:lexdee, "~> 0.1.0"}
{:lexdee, "~> 1.0.0"}
]
end
```
Expand Down
2 changes: 1 addition & 1 deletion lib/lexdee.ex
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ defmodule Lexdee do

alias Cluster.Members

defdelegate get_cluster_members(client), to: Members, as: :index
defdelegate list_cluster_members(client, opts \\ []), to: Members, as: :index
defdelegate get_cluster_member(client, id), to: Members, as: :show

alias Lexdee.Instances
Expand Down
2 changes: 1 addition & 1 deletion lib/lexdee/cluster/members.ex
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ defmodule Lexdee.Cluster.Members do

use Lexdee.Utils

def index(client), do: Tesla.get(client, @path)
def index(client, options \\ []), do: Tesla.get(client, @path, options)
def show(client, id), do: Tesla.get(client, get_id(id))
end
2 changes: 1 addition & 1 deletion mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ defmodule Lexdee.MixProject do
def project do
[
app: :lexdee,
version: "1.0.4",
version: "1.0.5",
elixir: "~> 1.9",
start_permanent: Mix.env() == :prod,
package: package(),
Expand Down
31 changes: 31 additions & 0 deletions test/lexdee/cluster/members_test.exs
Original file line number Diff line number Diff line change
@@ -1,6 +1,37 @@
defmodule Lexdee.Cluster.MembersTest do
use ExUnit.Case

describe "index recursive 1" do
setup do
response =
File.read!(
"test/support/fixtures/responses/cluster/member/index_recursive_one.json"
)

bypass = Bypass.open()
client = Lexdee.create_client("http://localhost:#{bypass.port}")

{:ok, client: client, bypass: bypass, response: response}
end

test "return success list cluster members", %{
bypass: bypass,
client: client,
response: response
} do
Bypass.expect(bypass, "GET", "/1.0/cluster/members", fn conn ->
%{"recursion" => "1"} = conn.query_params

conn
|> Plug.Conn.put_resp_header("content-type", "application/json")
|> Plug.Conn.resp(200, response)
end)

assert {:ok, _data} =
Lexdee.list_cluster_members(client, query: [recursion: 1])
end
end

describe "show member" do
setup do
response =
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"type": "sync",
"status": "Success",
"status_code": 200,
"operation": "",
"error_code": 0,
"error": "",
"metadata": [
{
"roles": [
"database"
],
"failure_domain": "",
"description": "",
"config": null,
"server_name": "ubuntu-s-1vcpu-1gb-sgp1-01",
"url": "https://10.130.0.3:8443",
"database": true,
"status": "Online",
"message": "Fully operational",
"architecture": "x86_64"
}
]
}

0 comments on commit 37bc035

Please sign in to comment.