defunct / node-ec2 Goto Github PK
View Code? Open in Web Editor NEWEvented Node.js bindings to the EC2 Query API.
Home Page: http://bigeasy.github.com/node-ec2
License: MIT License
Evented Node.js bindings to the EC2 Query API.
Home Page: http://bigeasy.github.com/node-ec2
License: MIT License
No longer need to bother of a lib
directory move it to the root.
Hi,
How about being able to specify the host when calling the createClient() factory function?
Specifying the host should allow folks to use this library for other AWS services besides EC2. As an example, I'd like to use this library for the new Simple Email Service (SES).
Do you know of any other roadblocks I might run into here? Well, I'm gonna fork this and try it out...
Cheers,
Zach
I'll forgive you if you don't weed through your sad commit logs and recreate earlier "releases".
This library no longer requires compilation. The older version of Twinkie is causing errors at Travis CI. Remove from .gitmodules
and .travis.yml. Remove CoffeeScript from
package.json`.
How does one do a filter on DescribeInstances?
ec2("DescribeInstances", { F: 'tag-key=Env' } ?
If I don't create an issue, I'm going to forget.
Would it be possible to use a custom API key that has severely limited permissions to test the API against Amazon itself? I could query key pairs, or something, to get a list of key pairs.
It can happen that the http request to the EC2 web service times out. When that occurs, there is no way for the caller to trap the event.
Specifically, I have obtained an unexpected error 10006 (timeout) several times, and this is causing the node process to crash. Please add code to trap a request error and expose it via the existing error event.
This test fails. README indicates that node-ec2 should allow overriding of the configuration endpoint. With this test, it shows that us-east-1 is still requested instead of intended us-west-2 override.
I believe I see the resolution in the amazon.js file. I will submit pull to resolve issue #31, before discussing this issue further.
var fs = require('fs');
var configurationPath = './.aws';
// Read in the configuration above.
var configuration = JSON.parse(fs.readFileSync(configurationPath, 'utf8'));
configuration.endpoint = "us-east-1";
var ec2 = require("ec2")(configuration)
var parameters = {};
ec2({ endpoint: "us-west-2" }, "DescribeAvailabilityZones",
parameters, function (error, result) {
if (error) throw error;
console.log(result)
});
Some are h2
while others are h3
.
Tidy the CoffeeScript generated JavaScript.
Some commands take no parameters.
i have this:
$ node app.js ""
node.js:201
throw e; // process.nextTick error, or 'error' event on first tick
^
Error: getaddrinfo ENOENT
at errnoException (dns.js:31:11)
at Object.onanswer [as oncomplete] (dns.js:140:16)
here is the code:
var ec2 = require("ec2")
, fs = require("fs");
// Read in the configuration above.
var configuration = JSON.parse(fs.readFileSync("configuration.json", "utf8"));
// Create an ec2 function that uses your configuration.
ec2 = ec2(configuration)
// Run an instance and wait for it to become ready.
ec2("RunInstances", {
ImageId: "ami-5d704b29", KeyName: "micros-ie", InstanceType: "t1.micro"
}, function (error, response) {
if (error) {
throw error
}
reservationId = response.reservationId;
instanceId = response.instancesSet[0].instanceId;
ready = function () {
ec2("DescribeInstances", function (error, struct) {
if (error) {
throw error;
}
var reservation = struct.reservationSet.filter(function (reservation) {
return reservation.reservationId == reservationId;
})[0];
var instance = reservation.instancesSet.filter(function (instance) {
return instance.instanceId == instanceId;
})[0];
return instance.instanceState.name == "running";
if (instance.instanceState.name == "running") {
console.log("Instance created with id: " + instanceId);
} else {
setTimeout(ready, 500);
}
});
};
ready();
});
Please use this issue for general discussion of Node EC2.
Convert library to JavaScript.
Allow the user to specify an alternate endpoint to the defined endpoints. See #3.
The README.md
should say something about the new API, instead of saying nothing about the new API.
node-ec2 has the wsdl version hard coded to an old version when you send the query string request. Noticed when DescribeSpotInstanceRequests API Action was not returning what was documented by aws.
This will have to do for now. Documentation updates are urgent.
Add the .js
suffix to the test file names in accordance with the new Proof conventions.
When you get output from the ec2
program as JSON. Save it. Then echo it back through ec2
to get the fields.
Create the issue labels that are now common to all GitHub projects.
I see this error on Lion, but it's fine on ubuntu
$ sudo npm install ec2
npm http GET https://registry.npmjs.org/ec2
npm http 304 https://registry.npmjs.org/ec2
npm http GET https://registry.npmjs.org/ec2/-/ec2-0.1.0.tgz
npm http 200 https://registry.npmjs.org/ec2/-/ec2-0.1.0.tgz
npm ERR! error reading /tmp/npm-1335796170160/1335796170160-0.39644423476420343/package
npm ERR! couldn't pack /tmp/npm-1335796170160/1335796170160-0.39644423476420343/package to /Users/auser/.npm/ec2/0.1.0/package.tgz
npm ERR! SyntaxError: Unexpected token
npm ERR! at Object.parse (native)
npm ERR! at Packer.readRules (/usr/local/lib/node_modules/npm/node_modules/fstream-npm/fstream-npm.js:179:33)
npm ERR! at Packer. (/usr/local/lib/node_modules/npm/node_modules/fstream-npm/node_modules/fstream-ignore/ignore.js:132:22)
npm ERR! at [object Object]. (fs.js:115:5)
npm ERR! at [object Object].emit (events.js:64:17)
npm ERR! at afterRead (fs.js:1117:12)
npm ERR! at Object.wrapper as oncomplete
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 Darwin 11.3.0
npm ERR! command "node" "/usr/local/bin/npm" "install" "ec2"
npm ERR! cwd /Users/auser/dev/myapp
npm ERR! node -v v0.6.12
npm ERR! npm -v 1.1.18
npm ERR! file /tmp/npm-1335796170160/1335796170160-0.39644423476420343/package/.AppleDouble/package.json
npm ERR! path /tmp/npm-1335796170160/1335796170160-0.39644423476420343/package/.AppleDouble
npm ERR! type unexpected_token
npm ERR! fstream_path /tmp/npm-1335796170160/1335796170160-0.39644423476420343/package/.AppleDouble
npm ERR! fstream_type Directory
npm ERR! fstream_class Packer
npm ERR! arguments [ '\u0000' ]
npm ERR! message Unexpected token
npm ERR! fstream_stack Packer.readRules (/usr/local/lib/node_modules/npm/node_modules/fstream-npm/fstream-npm.js:182:10)
npm ERR! fstream_stack Packer. (/usr/local/lib/node_modules/npm/node_modules/fstream-npm/node_modules/fstream-ignore/ignore.js:132:22)
npm ERR! fstream_stack [object Object]. (fs.js:115:5)
npm ERR! fstream_stack [object Object].emit (events.js:64:17)
npm ERR! fstream_stack afterRead (fs.js:1117:12)
npm ERR! fstream_stack Object.wrapper as oncomplete
Does this module still work? I am asking because I can't get it to authenticate. I am always getting:
{ Errors:
[ { Code: 'SignatureDoesNotMatch'
, Message: 'The request signature we calculated does not match the signature you provided. Check your AWS Secret Access Key and signing method. Consult the service documentation for details.'
}
]
, RequestID: 'b1f6c04a-e249-4ca1-967b-bcb1915ec1e0'
}
Any ideas what might cause it to fail? I tried creating a new key and it still didn't work.
Here is the code that I have:
var ec2 = require('ec2');
var client = ec2.createClient({
key : '... my key ...',
secret : '... my secret ..'
});
client.call("StartInstances", { InstanceId : "i-b6ab03db" }, function (resp) {
console.log(resp);
});
client.on("end", function () {
console.log('end');
});
client.on("error", function (err, code) {
console.dir(err);
console.log(code);
console.log('----')
});
client.poll("DescribeInstances", function (struct) {
console.log(struct);
return true;
});
client.execute();
Thank you!
Convert the library to XML DOM library XMLDOM. It is being maintained actively.
For those of you watching this repo, it is going to be deleted soon and from NPM as well.
Hi,
Not sure what this error is being caused by, I run "node amazon-test.js":
var stack = require('../lib/long-stack-traces');
var ec2 = require('ec2');
var client = ec2.createClient({
key: process.env['key'],
secret: process.env['secret']
});
client.poll("DescribeInstances", function (struct) {
console.log(struct);
return true;
});
client.execute();
This returns an error at line 40, which is really "client.execute()" after cleaning up some code:
node.js:134
throw e; // process.nextTick error, or 'error' event on first tick
^
TypeError: Not a string or buffer
at Object.createHmac (crypto.js:103:21)
at /node_modules/ec2/lib/request.js:53:19
at AmazonEC2Client. (/node_modules/ec2/lib/amazon.js:53:16)
at AmazonEC2Client.execute (/node_modules/ec2/lib/amazon.js:3:63)
at Object. (amazon-test.js:40:8)
at Module._compile (module.js:404:26)
at Object..js (module.js:410:10)
at Module.load (module.js:336:31)
at Function._load (module.js:297:12)
at Array. (module.js:423:10)
This addresses an issue with the 0.1.0
release where .AppleDouble
directories where added to the NPM tarball.
It would be simple to determine an endpoint, especially if it the first argument.
Hi,
I created a CloudWatch library yesterday based on node-ec2 library and simple-rest-client, https://github.com/franklovecchio/node-cloudwatch, but I see an interesting error with a particular newer version of CentOS on EC2 with the same dependencies installed. I created a ticket for myself here:
https://github.com/franklovecchio/node-cloudwatch/issues/1
I'm not sure what dependency is different - maybe you have experienced this with node-ec2?
Thanks!
hello,
i got this to work, but have some questions.
basically, it checks if a site is running
var http = require('http')
, url = require('url')
, util = require('util')
, exec = require('child_process').exec;
var site = http.createClient(80, "www.domain.tld", false);
var req = site.request("GET", "/");
req.end();
req.on('response', function(res){
if(res.statusCode !== 200){
// launch a new instance
var ec2 = require("ec2")
, fs = require("fs");
// Read in the configuration above.
var configuration = JSON.parse(fs.readFileSync("configuration.json", "utf8"));
// Create an ec2 function that uses your configuration.
ec2 = ec2(configuration)
// Run an instance and wait for it to become ready.
ec2("RunInstances", {
ImageId: "ami-XXXXXX"
, KeyName: "micros-ie"
, InstanceType: "t1.micro"
, MinCount: 1
, MaxCount: 1
}, function (error, response) {
if (error) {
throw error
}
});
} else {
res.on('data', function(chunk){
function puts(error, stdout, stderr) { util.puts(stdout) }
exec("my command", puts);
});
}
});
basically, i want to start my first instance from my local computer and then chain the second, third ... etc so for example, when the 'site' returns a non 200 OK status code, i want to fire up a new EC2 instance, thus i don't have to have my local machine connected
is there a better way to do this?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.