-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added new EC2 methods: allocateAddress and releaseAddress.
- Loading branch information
Jordan Ryan Moore
committed
May 4, 2011
1 parent
ea55647
commit 7d1402a
Showing
3 changed files
with
76 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
var | ||
util = require('util'), | ||
ec2 = require('../ec2'), | ||
aws = require('../aws'), | ||
_ = require('../util'); | ||
|
||
/** | ||
* GET AllocateAddress | ||
*/ | ||
var Request = module.exports.Request = function(args) { | ||
ec2.Request.call(this, args, 'AllocateAddress'); | ||
|
||
var self = this; | ||
|
||
if (null != args.domain) { | ||
self._query['Domain'] = _.asString(args.domain); | ||
} | ||
} | ||
|
||
util.inherits(Request, ec2.Request); | ||
|
||
/** | ||
* AllocateAddressResponse | ||
*/ | ||
var Response = module.exports.Response = function(response) { | ||
ec2.Response.call(this, response); | ||
|
||
var self = this; | ||
var response = _.xmlToJson(self._xml.get('/AllocateAddressResponse')); | ||
self.publicIp = response.publicIp; | ||
self.domain = response.domain; | ||
self.allocationId = response.allocationId; | ||
|
||
} | ||
|
||
util.inherits(Response, ec2.Response); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
var | ||
util = require('util'), | ||
ec2 = require('../ec2'), | ||
aws = require('../aws'), | ||
_ = require('../util'); | ||
|
||
/** | ||
* GET ReleaseAddress | ||
*/ | ||
var Request = module.exports.Request = function(args) { | ||
ec2.Request.call(this, args, 'ReleaseAddress'); | ||
|
||
var self = this; | ||
|
||
if (null != args.publicIp) { | ||
self._query['PublicIp'] = _.asString(args.publicIp); | ||
} | ||
|
||
if (null != args.allocationId) { | ||
self._query['AllocationId'] = _.asString(args.allocationId); | ||
} | ||
} | ||
|
||
util.inherits(Request, ec2.Request); | ||
|
||
/** | ||
* ReleaseAddressResponse | ||
*/ | ||
var Response = module.exports.Response = function(response) { | ||
ec2.Response.call(this, response); | ||
|
||
var self = this; | ||
var response = _.xmlToJson(self._xml.get('/ReleaseAddressResponse')); | ||
self.return = _.asBoolean(response.return); | ||
|
||
} | ||
|
||
util.inherits(Response, ec2.Response); |