Skip to content

Auto Scaling Client

SaltwaterC edited this page Jul 20, 2011 · 4 revisions

Usage mode

var autoscaling = require('aws2js').load('autoscaling');

// it is mandatory to set the AWS credentials
autoscaling.setCredentials('accessKeyId', 'secretAccessKey'); 

// optional call to set the region
// the default entry point is in us-east-1
// if defined, it must be one of the follwing:
// us-east-1, us-west-1, eu-west-1, ap-southeast-1, ap-northeast-1
autoscaling.setRegion('us-east-1');

// call something of the autoscaling query API
autoscaling.call('action', query, function (error, response) {
	if (error) {
		console.error(error);
		console.error(response);
	} else {
		console.log(response);
	}
});

autoscaling.call reference

  • The 'action' parameter is the action required by the Auto Scaling query API itself.
  • The query parameter is an object containing the query parameters of the API.
  • The callback arguments, error + response:
  • If there's an error, it is returned as the error argument of the callback. For more details follow: HTTP Errors, XML Parser.
  • The response argument contains a JavaScript object containing the details about the request. In case of error, the response argument contains the parsed XML of the error returned by the Auto Scaling API.
Clone this wiki locally