Oceanex
DigitalOcean V2 API Elixir Client library (unofficial)
Installation
The package can be installed as:
-
Add
oceanexto your list of dependencies inmix.exs:
```elixir
def deps do
[{:oceanex, "~> 0.2.2"}]
end
```-
Ensure
oceanexis started before your application:
```elixir
def application do
[applications: [:oceanex]]
end
```- Add your configuration to your config/config.exs
```elixir
config :oceanex,
api_base_uri: "https://api.digitalocean.com/v2",
access_token: System.get_env("DIGITALOCEAN_ACCESS_TOKEN") || "",
decoder: :atoms # :atoms (not efficient), :string (suggested, most efficient)
```Usage
If you need only body of api response, add bang(!) end of methods. On the other hand if you need header, body and response then use normal functions without ! sign.
Oceanex.Resource.Account.info!
Oceanex.Resource.Account.infoPlease refer to hexdocs to see all modules and functions.
Contributing
Issues, Bugs, Documentation, Enhancements
Fork the project
Make your improvements and write your tests.
Make a pull request.