node-gandi

Node.js client for Gandi.net XML-RPC API, written in CoffeeScript

npm install node-gandi
1 downloads in the last week
5 downloads in the last month

node-gandi

Node.js client for Gandi.net XML-RPC API, written in CoffeeScript.

Usage

This module is available on npm, and it's versionned 1.0 on January 2013.

Simple example

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 series

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
npm loves you