Use code to build applications from the OVH APIs.
Tested on OSX 10.11, but *nix systems should be ok.
Docker engine must be installed.
-
Create a
.yamlfile containing metadata about the API and the routes to merge. See into the directoryExamplesto get the yaml structure: you only need to edit the propertiesapi/pathandapi/routes. -
Build the docker images used to generate the code
$ make all- Run the script
ovhapi2code.shto generate the code to a language supported by this script (see the list below).
$ ovhapi2code.sh ~/ovhapi.yaml ~/output swiftThe first argument is the path of the
.yamlfile containing metadata, the second argument is the output directory and the third argument is the language of the generated code.
Here the directory ~/output will contain the file
openapi.yamland a directoryswiftcontaining the code source inSwiftbased on the OVH API.
OpenAPI provides generators for many languages, but for now only swift is supporting the OVH authentication.
Into your .yaml file you can provide one of these URLs to the property api/path:
-
OVH Europe: https://eu.api.ovh.com/1.0
-
OVH North America: https://ca.api.ovh.com/1.0
-
So you Start Europe: https://eu.api.soyoustart.com/1.0
-
So you Start North America: https://ca.api.soyoustart.com/1.0
-
Kimsufi Europe: https://eu.api.kimsufi.com/1.0
-
Kimsufi North America: https://ca.api.kimsufi.com/1.0
-
Runabove: https://api.runabove.com/1.0
OVH APIs are heavy so you must provide only the routes that you need to the property api/routes.
If no route is provided, all the routes of the API will be merged.
You can find the available routes at:
-
OVH Europe: https://eu.api.ovh.com/console
-
OVH North America: https://ca.api.ovh.com/console
-
So you Start Europe: https://eu.api.soyoustart.com/console
-
So you Start North America: https://ca.api.soyoustart.com/console
-
Kimsufi Europe: https://eu.api.kimsufi.com/console
-
Kimsufi North America: https://ca.api.kimsufi.com/console
-
Runabove: https://api.runabove.com/console
In order to use the OVH APIs you must create credentials for your application.
-
OVH Europe: https://eu.api.ovh.com/createApp/
-
OVH North America: https://ca.api.ovh.com/createApp/
-
So you Start Europe: https://eu.api.soyoustart.com/createApp/
-
So you Start North America: https://ca.api.soyoustart.com/createApp/
-
Kimsufi Europe: https://eu.api.kimsufi.com/createApp/
-
Kimsufi North America: https://ca.api.kimsufi.com/createApp/
-
Runabove: https://api.runabove.com/createApp/
To get or update informations about an OVH/SYS/KS/RunAbove product/account, you must ask a consumer key.
You are responsible to ask this consumer key and to present the validation page into your application, so do not forget to include the route /auth to the property api/routes of your .yaml file.
Read more at the OVH API documentation.