Hash :
37f045e3
Author :
Date :
2016-05-01T21:07:31
restructure supervision tree and genserver naming
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
defmodule ExOvh.Ovh.Defaults do
@moduledoc :false
@doc "Returns ovh default configuration settings"
@spec ovh() :: map
def ovh() do
[
endpoint: endpoints()["ovh-eu"],
api_version: "1.0"
]
end
@doc "Returns a map of ovh endpoints"
@spec endpoints() :: map
def endpoints() do
%{
"ovh-eu" => "https://api.ovh.com/",
"ovh-ca" => "https://ca.api.ovh.com/",
"kimsufi-eu" => "https://eu.api.kimsufi.com/",
"kimsufi-ca" => "https://ca.api.kimsufi.com/",
"soyoustart-eu" => "https://eu.api.soyoustart.com/",
"soyoustart-ca" => "https://ca.api.soyoustart.com/",
"runabove-ca" => "https://api.runabove.com/"
}
end
@doc "Returns the default suffix for creating a new application in ovh"
@spec create_app_uri_suffix() :: String.t
def create_app_uri_suffix(), do: "createApp/"
@doc "Returns the default suffix for getting the consumer key in ovh"
@spec consumer_key_suffix() :: String.t
def consumer_key_suffix(), do: "/auth/credential/"
@doc "Returns the default access rules (all methods and paths by default)"
@spec access_rules() :: [map]
def access_rules() do
[
%{
method: "GET",
path: "/*"
},
%{
method: "POST",
path: "/*"
},
%{
method: "PUT",
path: "/*"
},
%{
method: "DELETE",
path: "/*"
}
]
end
end