forked from SaltwaterC/aws2js
-
Notifications
You must be signed in to change notification settings - Fork 0
RDS Client
SaltwaterC edited this page Jul 11, 2011
·
8 revisions
var rds = require('aws2js').rds;
// it is mandatory to set the AWS credentials
rds.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
rds.setRegion('us-east-1');
// call something of the rds query API
rds.call('action', query, function (error, response) {
if (error) {
console.error(error);
console.error(response);
} else {
console.log(response);
}
});
- The 'action' parameter is the action required by the RDS 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 RDS API.