GithubHelp home page GithubHelp logo

linode-api's Introduction

Linode API Client

A client for the Linode API.

API Key

Your API key can be found here.

Installation

npm install linode-api

Usage

var my_api_key = '...';
var client = new(require('linode-api').LinodeClient)(my_api_key);
client.call('test.echo', {msg: "hello, self!"}, function (err, res) {
  if (err) throw err;
  console.log("I said '" + res.msg + "' to myself. Whee!");
});

Updating the API

Should Linode update their API, we can auto-regenerate the API methods by running 'make api'. Linode does not provide a machine-readable API specification so this resorts to scraping their HTML documentation.

Roadmap

  • Add basic validation for required parameters (already parsed)

Author

Brian Hammond [email protected] (http://fictorial.com)

License

Copyright (c) 2011 Fictorial LLC.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

linode-api's People

Contributors

bluesmoon avatar fictorial avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

linode-api's Issues

Installing cli on OSX breaks on getting linode-cli--Module::Metadata

Trying to install the cli OSX using brew and the make build step fails with the following:

curl: (22) The requested URL returned error: 404 Not Found
Error: Failed to download resource "linode-cli--Module::Metadata"
Download failed: http://www.cpan.org/authors/id/E/ET/ETHER/Module-Metadata-1.000019.tar.gz

Non JSON replys

line 19 JSON.parse(body) needs try/catch around it.

    try {
            obj = JSON.parse(body);
    } catch(ex) {
      return callback('Bad server response', void 0);
    }

batch support

querystring.stringify is used to create the URI query. When sending a batch request the array of commands is trashed by querystring.stringify. There needs to a a separate URI generation for batch request.
example
action = 'batch'
parameters: [
{action:'domain.resource.create', domainid:12345, name:'example.com', target:'10.0.42.1', type:'A'}, {action:'domain.resource.create', domainid:12345, name:'mail.example.com', target:'10.0.42.2', type:'A'}]

now it creates a URI that is ?api_key=sekrit&api_action=batch&api_requestArray=&api_requestArray=
read querystring.stringify documentation.

Not familiar with node.js - installation issue

npm install linode-api

npm http GET https://registry.npmjs.org/linode-api
npm http 200 https://registry.npmjs.org/linode-api

npm ERR! Error: No compatible version found: linode-api
npm ERR! No valid targets found.
npm ERR! Perhaps not compatible with your version of node?
npm ERR! at installTargetsError (/usr/lib/nodejs/npm/lib/cache.js:486:10)
npm ERR! at next_ (/usr/lib/nodejs/npm/lib/cache.js:436:17)
npm ERR! at next (/usr/lib/nodejs/npm/lib/cache.js:413:44)
npm ERR! at /usr/lib/nodejs/npm/lib/cache.js:406:5
npm ERR! at saved (/usr/lib/nodejs/npm/lib/utils/npm-registry-client/get.js:151:7)
npm ERR! at Object.oncomplete (/usr/lib/nodejs/graceful-fs/graceful-fs.js:230:7)
npm ERR! You may report this log at:
npm ERR! http://github.com/isaacs/npm/issues
npm ERR! or email it to:
npm ERR! [email protected]
npm ERR!
npm ERR! System Linux 3.5.2-3.fc17.x86_64
npm ERR! command "nodejs" "/bin/npm" "install" "linode-api"
npm ERR! cwd /root
npm ERR! node -v v0.6.18
npm ERR! npm -v 1.1.19
npm ERR! message No compatible version found: linode-api
npm ERR! message No valid targets found.
npm ERR! message Perhaps not compatible with your version of node?
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /root/npm-debug.log
npm not ok

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.