kmx.io/ex_ovh/docs/mix_task_advanced.md

Download

Mix Task (Advanced)

Generate client config

The ovh mix task makes requests to the OVH API on the user’s behalf to generate an OVH application.

The environment variables generated by the task are automatically save to a .env file. It is best to ensure that this file is outside version control.

Shell Input:

mix ovh \
--login=<username-ovh> \
--password=<password> \
--appdescription='Ovh Application for my app' \
--endpoint='ovh-eu' \
--apiversion='1.0' \
--redirecturi='http://localhost:4000/' \
--accessrules='get-[/*]::put-[/me,/me/*,/cdn/webstorage,/cdn/webstorage/*]::post-[/me,/cdn/webstorage,/cdn/webstorage/*]::delete-[/cdn/webstorage,/cdn/webstorage/*]' \
--appname='my_app' \
--clientname='OvhClient'

Shell Output:

config :my_app, MyApp.OvhClient,
    ovh: [
      application_key: System.get_env("MY_APP_OVH_CLIENT_APPLICATION_KEY"),
      application_secret: System.get_env("MY_APP_OVH_CLIENT_APPLICATION_SECRET"),
      consumer_key: System.get_env("MY_APP_OVH_CLIENT_CONSUMER_KEY"),
      endpoint: "ovh-eu",
      api_version: "1.0"
    ]

Terms explained:

source .env

Source

Download