task changes
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
diff --git a/lib/mix/tasks/ovh.ex b/lib/mix/tasks/ovh.ex
index 3226216..d4bcad0 100644
--- a/lib/mix/tasks/ovh.ex
+++ b/lib/mix/tasks/ovh.ex
@@ -14,14 +14,11 @@ defmodule Mix.Tasks.Ovh do
- Then the user can create an application at `https://eu.api.ovh.com/createApp/` or
alternatively the user can use this mix task to generate the application:
- ## Examples
+ ## Example
Create an app with access to all apis:
- mix ovh \
- --login=<username-ovh> \
- --password=<password> \
- --appname='ex_ovh'
+ mix ovh --login=<username-ovh> --password=<password> --appname='ex_ovh'
Output:
@@ -34,37 +31,7 @@ defmodule Mix.Tasks.Ovh do
api_version: System.get_env("EX_OVH_API_VERSION") || "1.0"
]
-
- Create an app with access to all apis with specific app name and description:
-
- mix ovh \
- --login=<username> \
- --password=<password> \
- --appdescription='Ovh Application for my app' \
- --endpoint='ovh-eu' \
- --apiversion='1.0' \
- --redirecturi='http://localhost:4000/' \
- --accessrules='get-[/*]::put-[/me,/cdn]::post-[/me,/cdn]::delete-[]' \
- --appname='my_app'
-
- Output:
-
- config :my_app, MyApp.ExOvh,
- ovh: %{
- application_key: System.get_env("MY_APP_EX_OVH_APPLICATION_KEY"),
- application_secret: System.get_env("MY_APP_EX_OVH_APPLICATION_SECRET"),
- consumer_key: System.get_env("MY_APP_EX_OVH_CONSUMER_KEY"),
- endpoint: System.get_env("MY_APP_EX_OVH_ENDPOINT"),
- api_version: System.get_env("MY_APP_EX_OVH_API_VERSION") || "1.0",
- connect_timeout: 30000, # 30 seconds
- connect_timeout: (60000 * 30) # 30 minutes
- }
-
- ## Notes
-
- - Access rules: The default for access rules will give the ovh application access to *all* of the api calls. More
- than likely this is not a good idea. To limit the number of api endpoints available, generate access rules using
- the commandline arguments as seen in the example above.
+ See `README.md` for more advanced usage of the mix ovh task.
"""
use Mix.Task
alias ExOvh.Utils
@@ -166,12 +133,7 @@ defmodule Mix.Tasks.Ovh do
{opts, Map.merge(acc, %{ api_version: api_version }) }
end
defp parsers_redirect_uri({opts, acc}) do
- redirect_uri = Keyword.get(opts, :redirecturi, :nil)
- redirect_uri =
- case redirect_uri do
- :nil -> ""
- _ -> redirect_uri
- end
+ redirect_uri = Keyword.get(opts, :redirecturi, "")
{opts, Map.merge(acc, %{ redirect_uri: redirect_uri }) }
end
defp parsers_client_name({opts, acc}) do