update docs and version
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327
diff --git a/.gitignore b/.gitignore
index 0be0846..7249abc 100644
--- a/.gitignore
+++ b/.gitignore
@@ -7,6 +7,7 @@
/.deprecated
/.notes
/.backup
+/priv
*.ez
erl_crash.dump
diff --git a/config/dev.exs b/config/dev.exs
index 7f69967..d0bfc00 100644
--- a/config/dev.exs
+++ b/config/dev.exs
@@ -8,9 +8,7 @@ config :ex_ovh,
ovh: [
application_key: System.get_env("EX_OVH_APPLICATION_KEY"),
application_secret: System.get_env("EX_OVH_APPLICATION_SECRET"),
- consumer_key: System.get_env("EX_OVH_CONSUMER_KEY"),
- endpoint: "ovh-eu",
- api_version: "1.0"
+ consumer_key: System.get_env("EX_OVH_CONSUMER_KEY")
],
httpoison: [
connect_timeout: 20000,
diff --git a/docs/getting_started_advanced.md b/docs/getting_started_advanced.md
index 5c57816..3ba78c9 100644
--- a/docs/getting_started_advanced.md
+++ b/docs/getting_started_advanced.md
@@ -9,19 +9,6 @@ defp deps() do
[{:ex_ovh, "~> 0.0.1"}]
end
```
-
-- Add the client as a supervisor directly to the supervision tree of your application.
-
-```elixir
-def start(_type, _args) do
- import Supervisor.Spec, warn: false
- spec1 = [supervisor(MyApp.Endpoint, [])]
- spec2 = [supervisor(MyApp.OvhClient, [])]
- opts = [strategy: :one_for_one, name: MyApp.Supervisor]
- Supervisor.start_link(spec1 ++ spec2, opts)
-end
-```
-
## Configuration
@@ -50,11 +37,31 @@ config :my_app, MyApp.OvhClient,
]
```
+- Start the `ExOvh` application.
+
+```elixir
+def application do
+ [applications: [:ex_ovh]]
+end
+```
+
- Add the client to your project.
```elixir
defmodule MyApp.OvhClient do
@moduledoc :false
- use ExOvh.Client, otp_app: :my_app
+ use ExOvh.Client, otp_app: :my_app, client: __MODULE__
+end
+```
+
+- Add the client as a supervisor directly to the supervision tree of your application.
+
+```elixir
+def start(_type, _args) do
+ import Supervisor.Spec, warn: false
+ spec1 = [supervisor(MyApp.Endpoint, [])]
+ spec2 = [supervisor(MyApp.OvhClient, [])]
+ opts = [strategy: :one_for_one, name: MyApp.Supervisor]
+ Supervisor.start_link(spec1 ++ spec2, opts)
end
```
\ No newline at end of file
diff --git a/docs/getting_started_basic.md b/docs/getting_started_basic.md
index 66c946b..8c8bb76 100644
--- a/docs/getting_started_basic.md
+++ b/docs/getting_started_basic.md
@@ -1,5 +1,8 @@
# Getting Started (Basic)
+The basic installation is intended for use cases where only a single client is required
+on a given server.
+
## Installation
- Add `:ex_ovh` to the dependencies.
@@ -9,9 +12,6 @@ defp deps() do
[{:ex_ovh, "~> 0.0.1"}]
end
```
-
-
-
## Configuration
@@ -40,10 +40,32 @@ config :ex_ovh,
]
```
-- Start `ExOvh` application which in makes `ExOvh` client ready for use.
+- Start the `ExOvh` application.
```elixir
def application do
[applications: [:ex_ovh]]
end
-```
\ No newline at end of file
+```
+
+- Add the client to your project.
+
+```elixir
+defmodule ExOvh do
+ @moduledoc :false
+ use ExOvh.Client, otp_app: :my_app, client: __MODULE__
+end
+```
+
+- Add the `ExOvh` client to the supervision tree of your application.
+
+```elixir
+def start(_type, _args) do
+ import Supervisor.Spec, warn: false
+ spec1 = [supervisor(MyApp.Endpoint, [])]
+ spec2 = [supervisor(ExOvh, [])]
+ opts = [strategy: :one_for_one, name: MyApp.Supervisor]
+ Supervisor.start_link(spec1 ++ spec2, opts)
+end
+```
+
diff --git a/lib/ex_ovh/docs/client.ex b/lib/ex_ovh/docs/client.ex
index 21253bf..5514b25 100644
--- a/lib/ex_ovh/docs/client.ex
+++ b/lib/ex_ovh/docs/client.ex
@@ -12,7 +12,7 @@ defmodule ExOvh.Client.Docs do
defmodule ExOvh do
@moduledoc :false
- use ExOvh.Client, otp_app: :ex_ovh
+ use ExOvh.Client, otp_app: :ex_ovh, client: __MODULE__
end
Configuring a client:
@@ -32,10 +32,10 @@ defmodule ExOvh.Client.Docs do
## Example using the `ExOvh` client
- %ExOvh.Query{ method: :get, uri: "/me", params: :nil} |> ExOvh.request!()
- %ExOvh.Query{ method: :get, uri: "/cloud/project", params: :nil} |> ExOvh.request!()
+ %ExOvh.Query{ method: :get, uri: "/me", params: %{}} |> ExOvh.request!()
+ %ExOvh.Query{ method: :get, uri: "/cloud/project", params: %{}} |> ExOvh.request!()
- ## Example (2): Setting up an additional MyApp.MyClient.Ovh` client.
+ ## Example (2): Setting up an additional `MyApp.MyClient` client.
Defining the `MyApp.MyClient`
@@ -50,9 +50,9 @@ defmodule ExOvh.Client.Docs do
ovh: [
application_key: System.get_env("MY_APP_MY_CLIENT_APPLICATION_KEY"),
application_secret: System.get_env("MY_APP_MY_CLIENT_APPLICATION_SECRET"),
- consumer_key: System.get_env("MY_APP_MY_CLIENT_CONSUMER_KEY"),
- endpoint: "ovh-eu",
- api_version: "1.0"
+ consumer_key: System.get_env("MY_APP_MY_CLIENT_CONSUMER_KEY")
+ # if left out, :endpoint will default to "ovh-eu"
+ # if left out, :api_version will default to "1.0"
],
httpoison: [ # optional
connect_timeout: 20000,
@@ -61,8 +61,8 @@ defmodule ExOvh.Client.Docs do
## Example using the `MyApp.MyClient` client
- %ExOvh.Query{ method: :get, uri: "/me", params: :nil} |> MyApp.MyClient.request!()
- %ExOvh.Query{ method: :get, uri: "/cloud/project", params: :nil} |> MyApp.MyClient.request!()
+ %ExOvh.Query{ method: :get, uri: "/me", params: %{}} |> MyApp.MyClient.request!()
+ %ExOvh.Query{ method: :get, uri: "/cloud/project", params: %{}} |> MyApp.MyClient.request!()
"""
end
@@ -72,7 +72,7 @@ defmodule ExOvh.Client.Docs do
~s"""
A default client for sending requests to the [OVH API](https://api.ovh.com/console/).
- `ExOvh` is the default client. Additional clients such as `MyApp.MyClient.Ovh` can be created - see docs.
+ `ExOvh` is the default client. Additional clients such as `MyApp.MyClient.Ovh` can be created - see `PAGES`.
"""
end
diff --git a/lib/ex_ovh/docs/cloud_query.ex b/lib/ex_ovh/docs/cloud_query.ex
index 2e1d2b3..9cf4ecd 100644
--- a/lib/ex_ovh/docs/cloud_query.ex
+++ b/lib/ex_ovh/docs/cloud_query.ex
@@ -4,7 +4,7 @@ defmodule ExOvh.Services.V1.Cloud.Query.Docs do
@doc :false
def moduledoc() do
~s"""
- Helper functions for building queries directed at the `/cloud` part of the ovh api.
+ Helper functions for building queries directed at the `/cloud` part of the [OVH API](https://api.ovh.com/console/).
## Functions Summary
@@ -42,6 +42,10 @@ defmodule ExOvh.Services.V1.Cloud.Query.Docs do
GET /cloud/project/{serviceName}/acl/{accountId}
DELETE /cloud/project/{serviceName}/acl/{accountId}
+ ## Notes
+
+ - `service_name` or `serviceName` corresponds to the Openstack `tenant_id`
+
## Example
diff --git a/lib/ex_ovh/docs/cloudstorage_query.ex b/lib/ex_ovh/docs/cloudstorage_query.ex
index 2af193a..7acfaf8 100644
--- a/lib/ex_ovh/docs/cloudstorage_query.ex
+++ b/lib/ex_ovh/docs/cloudstorage_query.ex
@@ -4,7 +4,7 @@ defmodule ExOvh.Services.V1.Cloud.Cloudstorage.Query.Docs do
@doc :false
def moduledoc() do
~s"""
- Helper functions for building queries directed at the cloudstorage related parts of the `/cloud` requests.
+ Helper functions for building queries directed at the cloudstorage related parts of the `/cloud` part of the [OVH API](https://api.ovh.com/console/).
See `ExOvh.Services.V1.Cloud.Query` for generic cloud requests.
@@ -20,6 +20,9 @@ defmodule ExOvh.Services.V1.Cloud.Cloudstorage.Query.Docs do
| `modify_container_cors/3` | <small>Modify the CORS settings for a container. See [swift docs](http://docs.openstack.org/developer/swift/cors.html)</small> | <sub><sup>POST /cloud/project/{serviceName}/storage/{containerId}/cors Add CORS support on your container</sup></sub> |
| `deploy_container_as_static_website/2` | <small>Deploy the container files as a static web site.</small> | <sub><sup>POST /cloud/project/{serviceName}/storage/{containerId}/static</sup></sub> |
+ ## Notes
+
+ - `service_name` or `serviceName` corresponds to the Openstack `tenant_id`
## Example
diff --git a/lib/ex_ovh/docs/mix_task.ex b/lib/ex_ovh/docs/mix_task.ex
index d465a00..fac40fe 100644
--- a/lib/ex_ovh/docs/mix_task.ex
+++ b/lib/ex_ovh/docs/mix_task.ex
@@ -1,4 +1,5 @@
defmodule Mix.Tasks.Ovh.Docs do
+ @moduledoc :false
@doc :false
def moduledoc() do
diff --git a/lib/ex_ovh/docs/webstorage_query.ex b/lib/ex_ovh/docs/webstorage_query.ex
index ee79756..cfdb118 100644
--- a/lib/ex_ovh/docs/webstorage_query.ex
+++ b/lib/ex_ovh/docs/webstorage_query.ex
@@ -4,7 +4,7 @@ defmodule ExOvh.Services.V1.Webstorage.Query.Docs do
@doc :false
def moduledoc() do
~s"""
- Helper functions for building `queries directed at the `/cdn/webstorage` part of the custom ovh api.
+ Helper functions for building queries directed at the `/cdn/webstorage` part of the [OVH API](https://api.ovh.com/console/).
## Functions Summary
@@ -19,7 +19,7 @@ defmodule ExOvh.Services.V1.Webstorage.Query.Docs do
## Example
- ExOvh.Services.V1.Webstorage.Query.get_all_webstorage() |> ExOvh.request()
+ ExOvh.Services.V1.Webstorage.Query.get_services() |> ExOvh.request()
"""
end
diff --git a/lib/ex_ovh/services/v1/webstorage/query.ex b/lib/ex_ovh/services/v1/webstorage/query.ex
index 78476cc..67999f2 100644
--- a/lib/ex_ovh/services/v1/webstorage/query.ex
+++ b/lib/ex_ovh/services/v1/webstorage/query.ex
@@ -13,7 +13,7 @@ defmodule ExOvh.Services.V1.Webstorage.Query do
## Example
- ExOvh.Services.V1.Webstorage.Query.get_services() |> ExOvh.Ovh.request()
+ ExOvh.Services.V1.Webstorage.Query.get_services() |> ExOvh.request()
"""
@spec get_services() :: Query.t
def get_services() do
diff --git a/mix.exs b/mix.exs
index 678b81d..6220bbc 100644
--- a/mix.exs
+++ b/mix.exs
@@ -5,7 +5,7 @@ defmodule ExOvh.Mixfile do
[
app: :ex_ovh,
name: "ExOvh",
- version: "0.0.1",
+ version: "0.0.2",
source_url: "https://github.com/stephenmoloney/ex_ovh",
elixir: "~> 1.2",
build_embedded: Mix.env == :prod,
@@ -30,7 +30,7 @@ defmodule ExOvh.Mixfile do
{:calendar, "~> 0.13.2"},
{:og, "~> 0.1"},
{:morph, "~> 0.1.0"},
- {:poison, "~> 1.5 or ~> 2.0"},
+ {:poison, "~> 1.5 or ~> 2.0"},
{:httpoison, "~> 0.8.0"},
{:markdown, github: "devinus/markdown", only: :dev},
@@ -40,7 +40,7 @@ defmodule ExOvh.Mixfile do
defp description() do
~s"""
- An elixir client library for easier use of the Ovh api.
+ An elixir client library for easier use of the [OVH API](https://api.ovh.com/console/).
"""
end