-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve error handling on availability router
- Loading branch information
Showing
10 changed files
with
2,379 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
erlang 26.2.5.6 | ||
erlang 26.2.5 | ||
elixir 1.16.3-otp-26 | ||
caddy 2.7.4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
defmodule Uplink.Availability.Requirement.Params do | ||
use Ecto.Schema | ||
import Ecto.Changeset | ||
|
||
embedded_schema do | ||
field :project, :string | ||
field :cpu, :decimal | ||
field :memory, :decimal | ||
field :disk, :decimal | ||
end | ||
|
||
def changeset(params_struct, params) do | ||
params_struct | ||
|> cast(params, [:project, :cpu, :memory, :disk]) | ||
|> validate_required([:project, :cpu, :memory, :disk]) | ||
end | ||
|
||
def parse(params) do | ||
%__MODULE__{} | ||
|> changeset(params) | ||
|> apply_action(:insert) | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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": "arrakis", | ||
"url": "https://10.130.0.3:8443", | ||
"database": true, | ||
"status": "Online", | ||
"message": "Fully operational", | ||
"architecture": "x86_64" | ||
} | ||
] | ||
} |
Oops, something went wrong.