forked from SaltwaterC/aws2js
-
Notifications
You must be signed in to change notification settings - Fork 0
EC2 Client
SaltwaterC edited this page Nov 15, 2011
·
10 revisions
aws.load('ec2', [accessKeyId], [secretAccessKey])
ec2.request(action, [query], callback)
The 'action' argument is the action required by the EC2 query API itself.
- ec2.setCredentials(accessKeyId, secretAccessKey)
- ec2.setRegion(region)
- ec2.setMaxSockets(numberOfSockets)
- ec2.getEndPoint()
- ec2.getApiVersion()
- ec2.setApiVersion(apiVersion)
// init the client
var ec2 = require('aws2js').load('ec2', accessKeyId, secretAccessKey);
// call something of the EC2 query API
ec2.request('action', {foo: 'bar'}, function (error, response) {
if (error) {
console.error(error);
} else {
console.log(response);
}
});