Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[terremark_ecloud] add get_ip_address
- Loading branch information
Showing
3 changed files
with
43 additions
and
0 deletions.
There are no files selected for viewing
23 changes: 23 additions & 0 deletions
23
lib/fog/compute/parsers/terremark_ecloud/get_ip_address.rb
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,23 @@ | ||
module Fog | ||
module Parsers | ||
module TerremarkEcloud | ||
module Compute | ||
|
||
class GetIpAddress < Fog::Parsers::Base | ||
|
||
def reset | ||
@response = {} | ||
end | ||
|
||
def end_element(name) | ||
case name | ||
when 'Id', 'Href', 'Name', 'RnatAddress', 'Server', 'Status' | ||
@response[name] = @value | ||
end | ||
end | ||
|
||
end | ||
end | ||
end | ||
end | ||
end |
19 changes: 19 additions & 0 deletions
19
lib/fog/compute/requests/terremark_ecloud/get_ip_address.rb
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,19 @@ | ||
module Fog | ||
module TerremarkEcloud | ||
class Compute | ||
class Real | ||
|
||
require 'fog/compute/parsers/terremark_ecloud/get_ip_address' | ||
|
||
def get_ip_address(href) | ||
request({ | ||
:href => href, | ||
:idempotent => true, | ||
:parser => Fog::Parsers::TerremarkEcloud::Compute::GetIpAddress.new | ||
}) | ||
end | ||
|
||
end | ||
end | ||
end | ||
end |
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