Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request fog#2571 from TranscendComputing/master
Added OpenStack support for add/remove_security_group functionality
- Loading branch information
Showing
5 changed files
with
66 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,24 @@ | ||
module Fog | ||
module Compute | ||
class OpenStack | ||
class Real | ||
|
||
def add_security_group(server_id, group_name) | ||
body = {'addSecurityGroup' => { "name" => group_name } } | ||
server_action(server_id, body) | ||
end | ||
|
||
end | ||
|
||
class Mock | ||
|
||
def add_security_group(server_id, group_name) | ||
response = Excon::Response.new | ||
response.status = 200 | ||
response | ||
end | ||
|
||
end | ||
end | ||
end | ||
end |
24 changes: 24 additions & 0 deletions
24
lib/fog/openstack/requests/compute/remove_security_group.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,24 @@ | ||
module Fog | ||
module Compute | ||
class OpenStack | ||
class Real | ||
|
||
def remove_security_group(server_id, group_name) | ||
body = {'removeSecurityGroup' => { "name" => group_name } } | ||
server_action(server_id, body) | ||
end | ||
|
||
end | ||
|
||
class Mock | ||
|
||
def remove_security_group(server_id, group_name) | ||
response = Excon::Response.new | ||
response.status = 200 | ||
response | ||
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
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