1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00

first pass at security group editing stuff

This commit is contained in:
Wesley Beary 2009-07-14 15:02:56 -07:00
parent 4412e84e9d
commit dde87c424b
4 changed files with 78 additions and 0 deletions

View file

@ -0,0 +1,32 @@
module Fog
module AWS
class EC2
# Add permissions to a security group
#
# ==== Parameters
# * cidr_ip - CIDR range
# * from_port - Start of port range (or -1 for ICMP wildcard)
# * group_name - Name of group to modify
# * ip_protocol - Ip protocol, must be in ['tcp', 'udp', 'icmp']
# * to_port - End of port range (or -1 for ICMP wildcard)
# * user_id - AWS Access Key ID
#
# === Returns
# FIXME: docs
def authorize_security_group_ingress(cidr_ip, from_port, group_name,
ip_protocol, to_port, user_id)
request({
'Action' => 'AuthorizeSecurityGroupIngress',
'CidrIp' => cidr_ip,
'FromPort' => from_port,
'GroupName' => group_name,
'IpProtocol' => ip_protocol,
'ToPort' => to_port,
'UserId' => user_id
}, Fog::Parsers::AWS::EC2::Basic.new)
end
end
end
end

View file

@ -0,0 +1,32 @@
module Fog
module AWS
class EC2
# Remove permissions from a security group
#
# ==== Parameters
# * cidr_ip - CIDR range
# * from_port - Start of port range (or -1 for ICMP wildcard)
# * group_name - Name of group to modify
# * ip_protocol - Ip protocol, must be in ['tcp', 'udp', 'icmp']
# * to_port - End of port range (or -1 for ICMP wildcard)
# * user_id - AWS Access Key ID
#
# === Returns
# FIXME: docs
def revoke_security_group_ingress(cidr_ip, from_port, group_name,
ip_protocol, to_port, user_id)
request({
'Action' => 'RevokeSecurityGroupIngress',
'CidrIp' => cidr_ip,
'FromPort' => from_port,
'GroupName' => group_name,
'IpProtocol' => ip_protocol,
'ToPort' => to_port,
'UserId' => user_id
}, Fog::Parsers::AWS::EC2::Basic.new)
end
end
end
end

View file

@ -0,0 +1,7 @@
require File.dirname(__FILE__) + '/../../spec_helper'
describe 'EC2.authorize_security_group_ingress' do
it "should return proper attributes"
end

View file

@ -0,0 +1,7 @@
require File.dirname(__FILE__) + '/../../spec_helper'
describe 'EC2.revoke_security_group_ingress' do
it "should return proper attributes"
end