kmx.io/ex_ovh/docs/getting_started_basic.md

Download

Getting Started (Basic)

Installation

defp deps() do
  [{:ex_ovh, "~> 0.0.1"}]
end
def application do
 [applications: [:ex_ovh]]
end

Configuration

Note: The configuration assumes that the environment variables such as EX_OVH_CLIENT_ID are already created.

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: System.get_env("EX_OVH_ENDPOINT"),
    api_version: System.get_env("EX_OVH_API_VERSION") || "1.0"
  ]

In the example below, EX_OVH_WEBSTORAGE_CDN_NAME is added to the environment variables.

config :ex_ovh,
  ovh: [],
  swift: [
        webstorage: [
                      cdn_name: System.get_env("EX_OVH_WEBSTORAGE_CDN_NAME"),
                      type: :webstorage
                    ]
       ]

In the example below, EX_OVH_CLOUDSTORAGE_TENANT_ID and EX_OVH_CLOUDSTORAGE_USER_ID are added to the environment variables.

config :ex_ovh,
  ovh: [],
  swift: [
        cloudstorage: [
                        tenant_id: System.get_env("EX_OVH_CLOUDSTORAGE_TENANT_ID"), # mandatory, corresponds to a project id
                        user_id: System.get_env("EX_OVH_CLOUDSTORAGE_USER_ID"), # optional, if absent a user will be created using the ovh api.
                        account_temp_url_key: System.get_env("EX_OVH_CLOUDSTORAGE_TEMP_URL_KEY"), # defaults to :nil if absent and won't be added if == :nil.
                        keystone_endpoint: "https://auth.cloud.ovh.net/v2.0", # default endpoint for keystone (identity) auth
                        region: :nil, # defaults to "SBG1" if set to :nil
                        type: :cloudstorage
                      ]
       ]
config :openstex,
  httpoison: [
              connect_timeout: 30000, # 30 seconds
              receive_timeout: (60000 * 30) # 30 minutes
             ]

Source

Download