Code Monkey home page Code Monkey logo

ex_ovh's Introduction

ExOvh Build Status Hex Version Hex docs Deps Status

ExOvh is an helper library for the elixir language for the Ovh Api. To use the Openstack components of the OVH API, see Openstex

Project Features

  • A Supervised agent running in the background which stores frequently accessed authentication information.
  • Helper modules for making building requests to the Ovh Api.
  • Request functions to send requests to the Ovh Api.

Getting started - Step 1: Generating the OVH application key, application secret and consumer key.

  • This may be done manually by going to https://eu.api.ovh.com/createApp/ and following the directions outlined by OVH at their first steps guide.

  • Alternatively, this may be achieved by running a mix task. This saves me a lot of time when generating a new application.

  • Documentation here

Getting Started - Step 2: Generating the OVH client module for your elixir application

  • The client module (eg AwesomeApp.OvhClient) is the interface for accessing the functions of the ex_ovh API.

  • Documentation here

Usage

Examples - Method 1 - Building the queries manually and send the request (my preferred way)

  • GET /me/api/application/#{app_id}
app_id = "0"
req = %HTTPipe.Request{
  method: :get,
  url: "/me/api/application/#{app_id}"
}
MyApp.OvhClient.request!(req)
  • GET /cloud/project/{serviceName}/storage
service_name = "service_name"
req = %HTTPipe.Request{
  method: :get,
  url: "/cloud/project/#{service_name}/storage"
}
|> MyApp.OvhClient.request!()

Examples - Method 2 - Build the request using provided helper functions and send the request

Note: Helper functions are only available currently for the /Cloud portion of the OVH API. Eventually, I would like to write a macro to create the queries.

  • GET /cloud/project/{serviceName}/storage
ExOvh.V1.Cloud.get_containers(service_name) |> ExOvh.request!()

Contributing

  • Pull requests welcome.

Tests

  • Tests have not been written yet.

TODO

  • Tests for OVH portion of library
  • Option to set the application ttl when running ovh mix task.
  • Basic examples to be added to readme of usage of the api.
  • Add macro for building queries.
  • Write the usage guide - more examples of using the API.
  • Remove dependency on :calendar if tz info is not required.

Note

This is an unofficial client to the OVH api and is not maintained by OVH.

Licence

MIT Licence

ex_ovh's People

Contributors

eirenauts-infra avatar stephenmoloney avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

ex_ovh's Issues

refactoring required

Some refactoring is needed

  • Simplify the Query module - no need for more than one type of query.

  • Remove any protocols based on more than one query - will not be needed.

  • Enhance docs to show more examples.

  • Consider merits of using httpipe

    • Seems plausible
    • Could fallback to hackney where there are functions lacking
    • httpipe development is quite inactive lately
    • httpoison works fine for now.

OVH library

Hello,

I Work for OVH and maintain github.com/ovh/python-ovh. I love the idea of building a wrapper for Elixir ! If you need any help with the API, feel free to contact me.

Regards,

compilation warning

Warning:

lib/ex_ovh.ex:3: warning: this clause cannot match because a previous clause at line 3 always matches

Seems to come from

use Openstex.Swift.V1.Helpers, client: __MODULE__ in lib/client.ex

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.