mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
Create parser for AWS assign private ip addresses
This commit is contained in:
parent
c5e6e2ae86
commit
67351bb795
1 changed files with 45 additions and 0 deletions
45
lib/fog/aws/requests/compute/assign_private_ip_addresses.rb
Normal file
45
lib/fog/aws/requests/compute/assign_private_ip_addresses.rb
Normal file
|
@ -0,0 +1,45 @@
|
|||
module Fog
|
||||
module Compute
|
||||
class AWS
|
||||
class Real
|
||||
|
||||
require 'fog/aws/parsers/compute/assign_private_ip_addresses'
|
||||
|
||||
# Assigns one or more secondary private IP addresses to the specified network interface.
|
||||
#
|
||||
# ==== Parameters
|
||||
# * network_interface_id<~String> - The ID of the network interface
|
||||
# * private_ip_address<~String> - One or more IP addresses to be assigned as a secondary private IP address (conditional)
|
||||
# * secondary_private_ip_address_count<~String> - The number of secondary IP addresses to assign (conditional)
|
||||
# * allow_reassignment<~Boolean> - Whether to reassign an IP address
|
||||
# ==== Returns
|
||||
# * response<~Excon::Response>:
|
||||
# * body<~Hash>:
|
||||
# * 'requestId'<~String> - The ID of the request.
|
||||
# * 'return'<~Boolean> - success?
|
||||
#
|
||||
# {Amazon API Reference}[http://docs.aws.amazon.com/AWSEC2/latest/APIReference/ApiReference-query-AssignPrivateIpAddresses.html]
|
||||
def assign_private_ip_addresses(network_interface_id, private_ip_address=nil, secondary_private_ip_address_count=nil, allow_reassignment=false)
|
||||
domain = domain == 'vpc' ? 'vpc' : 'standard'
|
||||
request(
|
||||
'Action' => 'AssignPrivateIpAddresses',
|
||||
'NetworkInterfaceId' => network_interface_id,
|
||||
'PrivateIpAddress.n' => private_ip_address,
|
||||
'SecondaryPrivateIpAddressCount' => secondary_private_ip_address_count,
|
||||
'AllowReassignment' => allow_reassignment,
|
||||
:parser => Fog::Parsers::Compute::AWS::AssignPrivateIpAddresses.new
|
||||
)
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
class Mock
|
||||
|
||||
def assign_private_ip_addresses(network_interface_id, private_ip_address=nil, secondary_private_ip_address_count=nil, allow_reassignment=false)
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Reference in a new issue