Commit 4c709165d12c416e499f1a235787d484b1d3a004

Stephen Moloney 2016-06-08T14:55:11

update docs and version

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