• Stars
    star
    125
  • Rank 277,083 (Top 6 %)
  • Language
    JavaScript
  • License
    Other
  • Created over 9 years ago
  • Updated 7 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Node.js wrapper for the OVH APIs

Node.js Wrapper for OVH APIs

The easiest way to use the OVH.com APIs in your node.js applications.

NPM Version Build Status Coverage Status

// Create your first application tokens here: https://api.ovh.com/createToken/?GET=/me
var ovh = require('ovh')({
  appKey: process.env.APP_KEY,
  appSecret: process.env.APP_SECRET,
  consumerKey: process.env.CONSUMER_KEY
});

ovh.request('GET', '/me', function (err, me) {
  console.log(err || 'Welcome ' + me.firstname);
});

You can also use the promised version like this:

ovh.requestPromised('GET', '/me')
  .then(function (response) {
    //Do what you want
  })
  .catch(function (err) {
    //Return an error object like this {error: statusCode, message: message}
  });

Installation

The easiest way to get the latest stable release is to grab it from the npm registry.

$ npm install ovh

Alternatively, you may get latest development version directly from Git.

$ npm install git://github.com/ovh/node-ovh.git

Example Usage

Login as a user

1. Create an application

Depending the API you plan to use, you need to create an application on the below websites:

Once created, you will obtain an application key (AK) and an application secret (AS).

2. Authorize your application to access to a customer account

To allow your application to access to a customer account using an OVH API, you need a consumer key (CK).

Here is a sample code you can use to allow your application to access to a complete account.

Depending the API you want to use, you need to specify the below API endpoint:

  • OVH Europe: ovh-eu (default)
  • OVH US: ovh-us
  • OVH North-America: ovh-ca
  • SoYouStart Europe: soyoustart-eu
  • SoYouStart North-America: soyoustart-ca
  • Kimsufi Europe: kimsufi-eu
  • Kimsufi North-America: kimsufi-ca
var ovh = require('ovh')({
  endpoint: 'ovh-eu',
  appKey: 'YOUR_APP_KEY',
  appSecret: 'YOUR_APP_SECRET'
});

ovh.request('POST', '/auth/credential', {
  'accessRules': [
    { 'method': 'GET', 'path': '/*'},
    { 'method': 'POST', 'path': '/*'},
    { 'method': 'PUT', 'path': '/*'},
    { 'method': 'DELETE', 'path': '/*'}
  ]
}, function (error, credential) {
  console.log(error || credential);
});
$ node credentials.js
{ validationUrl: 'https://api.ovh.com/auth/?credentialToken=XXX',
  consumerKey: 'CK',
  state: 'pendingValidation' }

This consumer key can be scoped with a specific authorization. For example if your application will only send SMS:

ovh.request('POST', '/auth/credential', {
  'accessRules': [
    { 'method': 'POST', 'path': '/sms/*/jobs'},
  ]
}, function (error, credential) {
  console.log(error || credential);
});

Once the consumer key will be authorized on the specified URL, you'll be able to play with the API calls allowed by this key.

3. Let's play!

You are now be able to play with the API. Look at the examples available online.

You can browse the API schemas using the web consoles of the APIs:

Migration from 1.x.x to 2.x.x without Proxy support

For example if you use the OVH Europe API, you'll have to check on https://eu.api.ovh.com/console/ the endpoints available for your feature.

In order to have the informations about the bill with id "0123".

  • Before in 1.x.x with Proxy:
ovh.me.bill["0123"].$get(function (err, billInformation) {

});
  • Now in 2.x.x with promise:
ovh.requestPromised('GET', '/me/bill/0123') //This route has been found at https://eu.api.ovh.com/console/
  .then(function (billInformation) {

  })
  .catch(function (err) {

  });

Full documentation and examples

The full documentation is available online: https://ovh.github.io/node-ovh.

Hacking

Get the sources

git clone https://github.com/ovh/node-ovh.git
cd node-ovh

You've developed a new cool feature? Fixed an annoying bug? We'd be happy to hear from you!

Run the tests

Tests are based on mocha. This package includes unit and integration tests.

git clone https://github.com/ovh/node-ovh.git
cd node-ovh
npm install -d
npm test

Integration tests use the OVH /domain/zone API, the tokens can be created here.

export APP_KEY=xxxxx
export APP_SECRET=yyyyy
export CONSUMER_KEY=zzzzz
export DOMAIN_ZONE_NAME=example.com
npm run-script test-integration

Documentation

The documentation is based on Github Pages and is available in the gh-pages branch.

Supported APIs

OVH Europe

OVH US

OVH North America

SoYouStart Europe

SoYouStart North America

Kimsufi Europe

Kimsufi North America

Related links

More Repositories

1

cds

Enterprise-Grade Continuous Delivery & DevOps Automation Open Source Platform
Go
4,440
star
2

the-bastion

Authentication, authorization, traceability and auditability for SSH accesses.
Perl
1,429
star
3

utask

µTask is an automation engine that models and executes business processes declared in yaml. ✏️📋
Go
1,100
star
4

venom

🐍 Manage and run your integration tests with efficiency - Venom run executors (script, HTTP Request, web, imap, etc... ) and assertions
Go
974
star
5

debian-cis

PCI-DSS compliant Debian 10/11/12 hardening
Shell
667
star
6

celery-director

Simple and rapid framework to build workflows with Celery
Python
512
star
7

svfs

The Swift Virtual File System
Go
373
star
8

php-ovh

Lightweight PHP wrapper for OVH APIs. That's the easiest way to use OVH.com APIs in your PHP applications.
PHP
287
star
9

python-ovh

Thin wrapper around OVH's APIs. Handles all the hard work including credential creation and requests signing.
Python
266
star
10

docs

Official repository containing all docs & guides of OVH Group
HTML
214
star
11

manager

OVHcloud Control Panel
JavaScript
203
star
12

overthebox

OverTheBox - Aggregate and encrypt your multiple internet connections.
Shell
194
star
13

public-cloud-roadmap

Agile roadmap for OVHcloud Public Cloud services. Discover the features our product teams are working on, comment and influence our backlog.
183
star
14

terraform-provider-ovh

Terraform OVH provider
Go
178
star
15

metronome

Metronome is a distributed and fault-tolerant event scheduler
Go
135
star
16

go-ovh

Simple go wrapper for the OVH API
Go
124
star
17

ai-training-examples

Jupyter Notebook
121
star
18

symmecrypt

Golang symmetric encryption library
Go
108
star
19

overthebox-feeds

OverTheBox - LEDE/OpenWrt feed
HTML
106
star
20

ovh-ttyrec

Enhanced (but compatible) version of the classic ttyrec
C
105
star
21

overthebox-openwrt

OverTheBox - OpenWrt fork
C
98
star
22

sv2chisel

(System)Verilog to Chisel translator
Scala
97
star
23

celery-dyrygent

Celery extension which allows to orchestrate 100/1000/10000 tasks combined into a complex workflow
Python
94
star
24

tat

Tat Engine - Text And Tags
Go
89
star
25

beamium

Prometheus to Warp10 metrics forwarder
Rust
84
star
26

ip-reputation-monitoring

Monitor the reputation of your IP ranges
Python
82
star
27

depc

QoS Measurement & Dependency Graph Platform
Python
80
star
28

configstore

Golang configuration management library
Go
62
star
29

erlenmeyer

Erlenmeyer is a proxy used to parse common Open Source TimeSeries DataBase query endpoints like OpenTSDB, Prometheus/PromQL, InfluxQL or Graphite. Parsed queries are translated into WarpScript to produce native Warp 10 queries.
Go
60
star
30

tsl

TSL is a HTTP proxy which generate WarpScript or a PromQl script based on a TSL query.
Go
56
star
31

noderig

Export OS stats as Sensision Metrics
Go
55
star
32

ovh-ui-kit

OVHcloud UI Kit - Master UI Framework
JavaScript
53
star
33

terraform-ovh-commons

This repo contains commons resources to interact with OVH Public Cloud using Terraform.
HTML
53
star
34

php-ovh-sms

PHP for ovh sms API
PHP
49
star
35

ovh-cli

OVH Command Line Interface
Python
41
star
36

infrastructure-roadmap

34
star
37

summit2016-RankingPredict

Deprecated, No more maintained - Deprecated, no longer maintained
R
34
star
38

ovh-warp10-datasource

Grafana datasource for Warp10 platform
TypeScript
33
star
39

the-bastion-ansible-wrapper

Using Ansible through The Bastion
Python
30
star
40

csharp-ovh

Thin wrapper around OVH's APIs. Handles all the hard work including credential creation and requests signing
C#
27
star
41

order-cart-examples

Example code snippets demonstrating how to use new order with cart on api.ovh.com
PHP
25
star
42

ldp-tail

OVH Logs Data Platform - Tail CLI tooling
Go
24
star
43

haproxy-exporter

Export HAProxy stats as Sensision Metrics
Go
21
star
44

fossil

Fossil is a proxy for securing unencrypted Graphite metrics collection
Go
20
star
45

java-ovh

Thin wrapper around OVH's APIs. Handles all the hard work including credential creation and requests signing
Java
19
star
46

tatwebui

Tat Web UI - Text And Tags
JavaScript
19
star
47

terraform-ovh-publiccloud-network

HCL
19
star
48

python-apispec-fromfile

APISpec plugin to import OpenAPI specifications from a file
Python
18
star
49

design-system

A collection of assets, guidelines and UI components for building consistent user experiences across OVHcloud products.
TypeScript
18
star
50

public-cloud-examples

Jupyter Notebook
18
star
51

cerberus-ux

HTML
15
star
52

lxd-puppet-module

Ruby
14
star
53

website-evidence-collector-batch

A tool to launch website-evidence-collector on several URLs or Sitemaps and generate a full report.
JavaScript
14
star
54

osarchiver

OpenStack databases archiver
Python
14
star
55

jerem

Jerem is a golang bot that scrap JIRA project to extract Metrics. Those Metrics can then be send to a Warp 10 Backend.
Go
14
star
56

cerberus-core

Cerberus is a toolkit to receive, parse, process and automate abuse reports handling received by ISP or hosting providers.
Python
14
star
57

ovh-ui-kit-bs

A bootstrap theme for the OVH managers, based on ovh-ui-kit
Less
13
star
58

prescience-client

Desktop python client for using OVH Prescience service
Jupyter Notebook
13
star
59

gulp-drupal-stack

OVH Gulp tasks for Drupal themes and modules
JavaScript
12
star
60

public-cloud-databases-examples

OVHcloud Public Cloud Databases Training examples
HCL
12
star
61

distronaut

Find distribution installers all across the web !
Go
12
star
62

serving-runtime

Exposes a serialized machine learning model through a HTTP API.
Java
12
star
63

metronome-ui

User interface for Metronome
JavaScript
11
star
64

private-cloud-roadmap

11
star
65

swift-ovh

This Swift package is a lightweight wrapper for OVH APIs. That's the easiest way to use OVH.com APIs in your Swift applications. Apple platforms supported: iOS, OSX, tvOS, watchOS.
Swift
11
star
66

rtm

RTM (OVH Real Time Monitoring)
Perl
11
star
67

pulumi-ovh

Pulumi provider for OVHcloud
Python
11
star
68

telephony-example-cti-dashboard

Shows signaling events provided by OVH France telephony services CTI
CSS
11
star
69

drucker

Drucker is a lightweight Drupal Developer Environment.
Shell
10
star
70

phishing-mitigation

Tilera-based phishing mitigation layer
JavaScript
10
star
71

lhasa

List and map micro-services-based information system and observe how they interact. Track their activities, then gamify their continuous improvement.
Go
10
star
72

overthebox-lede

OverTheBox - LEDE fork
C
8
star
73

owstats-ui

JavaScript
8
star
74

python-logging-gelf

A python logging bundle to send logs using GELF
Python
8
star
75

webpaas-cli

PHP
7
star
76

vbridge

X11 cloud desktop software
C
7
star
77

djehouty

Djehouty intends to be a set of logging formatters and handlers to easily send log entries.
Python
7
star
78

crystal-ovh

Lightweight Crystal wrapper around OVH's APIs.
Crystal
7
star
79

ovhdata-cli

Rust
7
star
80

python-warp10client

Python
7
star
81

data-processing-spark-submit

Spark CLI wrapper to run your jobs on OVHcloud Data Processing
Go
7
star
82

interpretability-engine

Interpret Machine Learning black-box models deployed on Serving Engine
Python
6
star
83

terraform-provider-mimirtool

Terraform provider for Grafana Mimir
Go
6
star
84

webhosting-ssh-bashrc

Shell
6
star
85

tat-contrib

Go
6
star
86

puppet-thebastion

Puppet module for Thebastion management.
Ruby
6
star
87

public-cloud-databases-operator

This operator allow you to automaticaly authorize your Kubernetes cluster IP on your OVHcloud cloud databases service.
Go
6
star
88

docs-developer-env

Easy to deploy developer environment, for writing/testing guides & documentations for docs.ovh.com
Shell
6
star
89

docs-rendering

[DEPRECATED] Official rendering engine for static generation of OVH Docs platform
HTML
6
star
90

terraform-ovh-publiccloud-docker-swarm

HCL
5
star
91

terraform-ovh-publiccloud-spark

HCL
5
star
92

summit2016-webhosting-example-rondcoin

PHP
5
star
93

collectd-write-warp10

Python
5
star
94

fiowebviewer

Python
5
star
95

yubico-piv-checker

Go
4
star
96

puppet-mimir

Ruby
4
star
97

pingdom-to-graphite

A tool for copying metrics from Pingdom to Graphite.
JavaScript
4
star
98

ovh-winston-ldp

A graylog2 TCP/TLS transport for winston library
JavaScript
4
star
99

bringyourownlinux

Shell
4
star
100

.github

Community health files for the @ovh organization
3
star