Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
2 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,62 +1,12 @@ | ||
node-gandi | ||
========== | ||
|
||
### [Node.js](http://nodejs.org/) client for Gandi.net XML-RPC [API](http://doc.rpc.gandi.net/), written in [CoffeeScript](http://coffeescript.org/). | ||
### [Node.js](http://nodejs.org/) client for Gandi.net XML-RPC [API](http://doc.rpc.gandi.net/). | ||
|
||
[![NPM module](https://img.shields.io/npm/v/node-gandi.png?style=flat-square)](https://www.npmjs.org/package/node-gandi) | ||
[![Build Status](https://img.shields.io/travis/Pegase745/node-gandi.svg?style=flat-square)](https://travis-ci.org/Pegase745/node-gandi) | ||
[![Gittip](https://img.shields.io/gittip/Pegase745.svg)](https://www.gittip.com/Pegase745/) | ||
|
||
Usage | ||
----- | ||
|
||
This module is available on [npm](https://npmjs.org/package/node-gandi), and it's versionned __1.0__ on January 2013. | ||
|
||
#### Simple example | ||
|
||
``` javascript | ||
var gandi = require('node-gandi'), | ||
apikey = 'Your-OT&E-API-Key'; | ||
|
||
// For mesures of security, always do the first tests on the OT&E system | ||
gandi.createOTEClient(apikey, function(client){ | ||
client.version_info(function(error, value){ | ||
if(error) { | ||
console.log('ERR: ' + error); | ||
}else { | ||
console.log('Result: %j', value); | ||
} | ||
}); | ||
}); | ||
``` | ||
#### Workflow execution using [async](https://github.com/caolan/async) series | ||
``` javascript | ||
var async = require('async'), | ||
gandi = require('node-gandi'), | ||
apikey = 'Your-OT&E-API-Key'; | ||
|
||
gandi.createOTEClient(apikey, function(client){ | ||
// Ask for version info, then ask for domain_info | ||
async.series({ | ||
version: function(callback){ | ||
client.version_info(function(error,value){ | ||
callback(error,value); | ||
}); | ||
}, | ||
info: function(callback){ | ||
client.domain_info('bm-jp.fr', function(error,value){ | ||
callback(error,value); | ||
}); | ||
}, | ||
}, | ||
function(err, results){ | ||
console.log('Domain id: %j' + results.info); | ||
}); | ||
}); | ||
``` | ||
|
||
Dependencies | ||
------------ | ||
|
||
* Gandi API ~3.2.3 | ||
* Coffee-Script ~1.4.0 | ||
* xmlrpc ~1.1.0 |