Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Branch: master
Fetching contributors…

Cannot retrieve contributors at this time

66 lines (53 sloc) 1.802 kB

node-gandi

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

NPM module Gittip

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

Bitdeli Badge

Jump to Line
Something went wrong with that request. Please try again.