Skip to content

Commit

Permalink
Add pre-configured endpoints aliases
Browse files Browse the repository at this point in the history
Signed-off-by: Vincent Giersch <vincent.giersch@ovh.net>
  • Loading branch information
gierschv committed Dec 5, 2014
1 parent e3dd351 commit 43b439c
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 10 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 1.1.2

* Add aliases soyoustart-eu, soyoustart-ca, kimsufi-eu, kimsufi-ca to sys-eu, sys-ca, ks-eu and ks-ca.

## 1.1.1

* Add Kimsufi and SoYouStart APIs
Expand Down
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,10 @@ Depending the API you want to use, you need to specify the below API endpoint:
* OVH Europe: ```ovh-eu``` (default)
* OVH North-America: ```ovh-ca```
* RunAbove: ```runabove-ca```
* SoYouStart Europe: ```sys-eu```
* SoYouStart North-America: ```sys-ca```
* Kimsufi Europe: ```ks-eu```
* Kimsufi North-America: ```ks-ca```
* SoYouStart Europe: ```soyoustart-eu```
* SoYouStart North-America: ```soyoustart-ca```
* Kimsufi Europe: ```kimsufi-eu```
* Kimsufi North-America: ```kimsufi-ca```

```js
var ovh = require('ovh')({
Expand Down Expand Up @@ -99,7 +99,7 @@ $ node credentials.js
```
This consumer key can be scoped with a **specific authorization**.
For example if your application will only send SMS:
For example if your application will only send SMS:
```javascript
ovh.request('POST', '/auth/credential', {
Expand All @@ -112,7 +112,7 @@ ovh.request('POST', '/auth/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.
you'll be able to play with the API calls allowed by this key.
#### 3. Let's play!
Expand Down
12 changes: 12 additions & 0 deletions lib/endpoints.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,22 @@ module.exports = {
'sys-ca': {
'host': 'ca.api.soyoustart.com'
},
'soyoustart-eu': {
'host': 'eu.api.soyoustart.com'
},
'soyoustart-ca': {
'host': 'ca.api.soyoustart.com'
},
'ks-eu': {
'host': 'eu.api.kimsufi.com'
},
'ks-ca': {
'host': 'ca.api.kimsufi.com'
},
'kimsufi-eu': {
'host': 'eu.api.kimsufi.com'
},
'kimsufi-ca': {
'host': 'ca.api.kimsufi.com'
},
};
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ovh",
"version": "1.1.1",
"version": "1.1.2",
"description": "Official Node.js wrapper for the OVH APIs",
"homepage": "http://ovh.github.io/node-ovh",
"author": "Vincent Giersch <vincent.giersch@ovh.net>",
Expand Down
14 changes: 11 additions & 3 deletions tests/01_REST_construct.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,19 @@ exports.REST_construct = {

var rest = ovh({
appKey: 'XXX', appSecret: 'XXX',
endpoint: 'runabove-ca'
endpoint: 'sys-ca'
});

assert.equal(rest.host, 'api.runabove.com');
assert.equal(rest.host, 'ca.api.soyoustart.com');
assert.equal(rest.port, 443);
assert.equal(rest.basePath, '/1.0');

rest = ovh({
appKey: 'XXX', appSecret: 'XXX',
endpoint: 'soyoustart-ca'
});

assert.equal(rest.host, 'ca.api.soyoustart.com');
assert.equal(rest.port, 443);
assert.equal(rest.basePath, '/1.0');

Expand All @@ -98,4 +107,3 @@ exports.REST_construct = {
);
}
};

0 comments on commit 43b439c

Please sign in to comment.