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:
parent
4412e84e9d
commit
dde87c424b
4 changed files with 78 additions and 0 deletions
32
lib/fog/aws/requests/ec2/authorize_security_group_ingress.rb
Normal file
32
lib/fog/aws/requests/ec2/authorize_security_group_ingress.rb
Normal 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
|
32
lib/fog/aws/requests/ec2/revoke_security_group_ingress.rb
Normal file
32
lib/fog/aws/requests/ec2/revoke_security_group_ingress.rb
Normal 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
|
7
spec/aws/ec2/authorize_security_group_ingress_spec.rb
Normal file
7
spec/aws/ec2/authorize_security_group_ingress_spec.rb
Normal file
|
@ -0,0 +1,7 @@
|
|||
require File.dirname(__FILE__) + '/../../spec_helper'
|
||||
|
||||
describe 'EC2.authorize_security_group_ingress' do
|
||||
|
||||
it "should return proper attributes"
|
||||
|
||||
end
|
7
spec/aws/ec2/revoke_security_group_ingress_spec.rb
Normal file
7
spec/aws/ec2/revoke_security_group_ingress_spec.rb
Normal file
|
@ -0,0 +1,7 @@
|
|||
require File.dirname(__FILE__) + '/../../spec_helper'
|
||||
|
||||
describe 'EC2.revoke_security_group_ingress' do
|
||||
|
||||
it "should return proper attributes"
|
||||
|
||||
end
|
Loading…
Reference in a new issue