mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
[ec2] make things that shouldn't cost money idempotent
This commit is contained in:
parent
43d5f27b78
commit
014a0ac314
23 changed files with 49 additions and 26 deletions
|
@ -19,6 +19,7 @@ module Fog
|
|||
'Action' => 'AssociateAddress',
|
||||
'InstanceId' => instance_id,
|
||||
'PublicIp' => public_ip,
|
||||
:idempotent => true,
|
||||
:parser => Fog::Parsers::AWS::EC2::Basic.new
|
||||
)
|
||||
end
|
||||
|
|
|
@ -25,6 +25,7 @@ module Fog
|
|||
'VolumeId' => volume_id,
|
||||
'InstanceId' => instance_id,
|
||||
'Device' => device,
|
||||
:idempotent => true,
|
||||
:parser => Fog::Parsers::AWS::EC2::AttachVolume.new
|
||||
)
|
||||
end
|
||||
|
|
|
@ -24,8 +24,9 @@ module Fog
|
|||
# * 'return'<~Boolean> - success?
|
||||
def authorize_security_group_ingress(options = {})
|
||||
request({
|
||||
'Action' => 'AuthorizeSecurityGroupIngress',
|
||||
:parser => Fog::Parsers::AWS::EC2::Basic.new
|
||||
'Action' => 'AuthorizeSecurityGroupIngress',
|
||||
:idempotent => true,
|
||||
:parser => Fog::Parsers::AWS::EC2::Basic.new
|
||||
}.merge!(options))
|
||||
end
|
||||
|
||||
|
|
|
@ -17,6 +17,7 @@ module Fog
|
|||
request(
|
||||
'Action' => 'DeleteSecurityGroup',
|
||||
'GroupName' => name,
|
||||
:idempotent => true,
|
||||
:parser => Fog::Parsers::AWS::EC2::Basic.new
|
||||
)
|
||||
end
|
||||
|
|
|
@ -17,6 +17,7 @@ module Fog
|
|||
request(
|
||||
'Action' => 'DeleteSnapshot',
|
||||
'SnapshotId' => snapshot_id,
|
||||
:idempotent => true,
|
||||
:parser => Fog::Parsers::AWS::EC2::Basic.new
|
||||
)
|
||||
end
|
||||
|
|
|
@ -17,6 +17,7 @@ module Fog
|
|||
request(
|
||||
'Action' => 'DeleteVolume',
|
||||
'VolumeId' => volume_id,
|
||||
:idempotent => true,
|
||||
:parser => Fog::Parsers::AWS::EC2::Basic.new
|
||||
)
|
||||
end
|
||||
|
|
|
@ -18,8 +18,9 @@ module Fog
|
|||
def describe_addresses(public_ip = [])
|
||||
params = AWS.indexed_param('PublicIp', public_ip)
|
||||
request({
|
||||
'Action' => 'DescribeAddresses',
|
||||
:parser => Fog::Parsers::AWS::EC2::DescribeAddresses.new
|
||||
'Action' => 'DescribeAddresses',
|
||||
:idempotent => true,
|
||||
:parser => Fog::Parsers::AWS::EC2::DescribeAddresses.new
|
||||
}.merge!(params))
|
||||
end
|
||||
|
||||
|
|
|
@ -19,8 +19,9 @@ module Fog
|
|||
def describe_availability_zones(zone_name = [])
|
||||
params = AWS.indexed_param('ZoneName', zone_name)
|
||||
request({
|
||||
'Action' => 'DescribeAvailabilityZones',
|
||||
:parser => Fog::Parsers::AWS::EC2::DescribeAvailabilityZones.new
|
||||
'Action' => 'DescribeAvailabilityZones',
|
||||
:idempotent => true,
|
||||
:parser => Fog::Parsers::AWS::EC2::DescribeAvailabilityZones.new
|
||||
}.merge!(params))
|
||||
end
|
||||
|
||||
|
|
|
@ -33,8 +33,9 @@ module Fog
|
|||
options.merge!(AWS.indexed_param('ImageId', image_id))
|
||||
end
|
||||
request({
|
||||
'Action' => 'DescribeImages',
|
||||
:parser => Fog::Parsers::AWS::EC2::DescribeImages.new
|
||||
'Action' => 'DescribeImages',
|
||||
:idempotent => true,
|
||||
:parser => Fog::Parsers::AWS::EC2::DescribeImages.new
|
||||
}.merge!(options))
|
||||
end
|
||||
|
||||
|
|
|
@ -18,8 +18,9 @@ module Fog
|
|||
def describe_key_pairs(key_name = [])
|
||||
params = AWS.indexed_param('KeyName', key_name)
|
||||
request({
|
||||
'Action' => 'DescribeKeyPairs',
|
||||
:parser => Fog::Parsers::AWS::EC2::DescribeKeyPairs.new
|
||||
'Action' => 'DescribeKeyPairs',
|
||||
:idempotent => true,
|
||||
:parser => Fog::Parsers::AWS::EC2::DescribeKeyPairs.new
|
||||
}.merge!(params))
|
||||
end
|
||||
|
||||
|
|
|
@ -18,8 +18,9 @@ module Fog
|
|||
def describe_regions(region_name = [])
|
||||
params = AWS.indexed_param('RegionName', region_name)
|
||||
request({
|
||||
'Action' => 'DescribeRegions',
|
||||
:parser => Fog::Parsers::AWS::EC2::DescribeRegions.new
|
||||
'Action' => 'DescribeRegions',
|
||||
:idempotent => true,
|
||||
:parser => Fog::Parsers::AWS::EC2::DescribeRegions.new
|
||||
}.merge!(params))
|
||||
end
|
||||
|
||||
|
|
|
@ -26,8 +26,9 @@ module Fog
|
|||
def describe_reserved_instances(reserved_instances_id = [])
|
||||
params = AWS.indexed_param('ReservedInstancesId', reserved_instances_id)
|
||||
request({
|
||||
'Action' => 'DescribeReservedInstances',
|
||||
:parser => Fog::Parsers::AWS::EC2::DescribeReservedInstances.new
|
||||
'Action' => 'DescribeReservedInstances',
|
||||
:idempotent => true,
|
||||
:parser => Fog::Parsers::AWS::EC2::DescribeReservedInstances.new
|
||||
}.merge!(params))
|
||||
end
|
||||
|
||||
|
|
|
@ -28,8 +28,9 @@ module Fog
|
|||
def describe_security_groups(group_name = [])
|
||||
params = AWS.indexed_param('GroupName', group_name)
|
||||
request({
|
||||
'Action' => 'DescribeSecurityGroups',
|
||||
:parser => Fog::Parsers::AWS::EC2::DescribeSecurityGroups.new
|
||||
'Action' => 'DescribeSecurityGroups',
|
||||
:idempotent => true,
|
||||
:parser => Fog::Parsers::AWS::EC2::DescribeSecurityGroups.new
|
||||
}.merge!(params))
|
||||
end
|
||||
|
||||
|
|
|
@ -25,8 +25,9 @@ module Fog
|
|||
options['Owner'] ||= 'self'
|
||||
options.merge!(AWS.indexed_param('SnapshotId', snapshot_id))
|
||||
request({
|
||||
'Action' => 'DescribeSnapshots',
|
||||
:parser => Fog::Parsers::AWS::EC2::DescribeSnapshots.new
|
||||
'Action' => 'DescribeSnapshots',
|
||||
:idempotent => true,
|
||||
:parser => Fog::Parsers::AWS::EC2::DescribeSnapshots.new
|
||||
}.merge!(options))
|
||||
end
|
||||
|
||||
|
|
|
@ -27,8 +27,9 @@ module Fog
|
|||
def describe_volumes(volume_id = [])
|
||||
params = AWS.indexed_param('VolumeId', volume_id)
|
||||
request({
|
||||
'Action' => 'DescribeVolumes',
|
||||
:parser => Fog::Parsers::AWS::EC2::DescribeVolumes.new
|
||||
'Action' => 'DescribeVolumes',
|
||||
:idempotent => true,
|
||||
:parser => Fog::Parsers::AWS::EC2::DescribeVolumes.new
|
||||
}.merge!(params))
|
||||
end
|
||||
|
||||
|
|
|
@ -25,6 +25,7 @@ module Fog
|
|||
request({
|
||||
'Action' => 'DetachVolume',
|
||||
'VolumeId' => volume_id,
|
||||
:idempotent => true,
|
||||
:parser => Fog::Parsers::AWS::EC2::DetachVolume.new
|
||||
}.merge!(options))
|
||||
end
|
||||
|
|
|
@ -17,6 +17,7 @@ module Fog
|
|||
request(
|
||||
'Action' => 'DisassociateAddress',
|
||||
'PublicIp' => public_ip,
|
||||
:idempotent => true,
|
||||
:parser => Fog::Parsers::AWS::EC2::Basic.new
|
||||
)
|
||||
end
|
||||
|
|
|
@ -19,6 +19,7 @@ module Fog
|
|||
request(
|
||||
'Action' => 'GetConsoleOutput',
|
||||
'InstanceId' => instance_id,
|
||||
:idempotent => true,
|
||||
:parser => Fog::Parsers::AWS::EC2::GetConsoleOutput.new
|
||||
)
|
||||
end
|
||||
|
|
|
@ -20,6 +20,7 @@ module Fog
|
|||
'Attribute' => attribute,
|
||||
'ImageId' => image_id,
|
||||
'OperationType' => operation_type,
|
||||
:idempotent => true,
|
||||
:parser => Fog::Parsers::AWS::EC2::Basic.new
|
||||
}.merge!(params))
|
||||
end
|
||||
|
|
|
@ -16,8 +16,9 @@ module Fog
|
|||
def reboot_instances(instance_id = [])
|
||||
params = AWS.indexed_param('InstanceId', instance_id)
|
||||
request({
|
||||
'Action' => 'RebootInstances',
|
||||
:parser => Fog::Parsers::AWS::EC2::Basic.new
|
||||
'Action' => 'RebootInstances',
|
||||
:idempotent => true,
|
||||
:parser => Fog::Parsers::AWS::EC2::Basic.new
|
||||
}.merge!(params))
|
||||
end
|
||||
|
||||
|
|
|
@ -14,6 +14,7 @@ module Fog
|
|||
request(
|
||||
'Action' => 'ReleaseAddress',
|
||||
'PublicIp' => public_ip,
|
||||
:idempotent => true,
|
||||
:parser => Fog::Parsers::AWS::EC2::Basic.new
|
||||
)
|
||||
end
|
||||
|
|
|
@ -24,8 +24,9 @@ module Fog
|
|||
# * 'return'<~Boolean> - success?
|
||||
def revoke_security_group_ingress(options = {})
|
||||
request({
|
||||
'Action' => 'RevokeSecurityGroupIngress',
|
||||
:parser => Fog::Parsers::AWS::EC2::Basic.new
|
||||
'Action' => 'RevokeSecurityGroupIngress',
|
||||
:idempotent => true,
|
||||
:parser => Fog::Parsers::AWS::EC2::Basic.new
|
||||
}.merge!(options))
|
||||
end
|
||||
|
||||
|
|
|
@ -23,8 +23,9 @@ module Fog
|
|||
def terminate_instances(instance_id)
|
||||
params = AWS.indexed_param('InstanceId', instance_id)
|
||||
request({
|
||||
'Action' => 'TerminateInstances',
|
||||
:parser => Fog::Parsers::AWS::EC2::TerminateInstances.new
|
||||
'Action' => 'TerminateInstances',
|
||||
:idempotent => true,
|
||||
:parser => Fog::Parsers::AWS::EC2::TerminateInstances.new
|
||||
}.merge!(params))
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue