Method: Fog::Compute::AWS::Real#modify_network_interface_attribute

Defined in:
lib/fog/aws/requests/compute/modify_network_interface_attribute.rb

#modify_network_interface_attribute(network_interface_id, attribute, value) ⇒ Object

Modifies a network interface attribute value

Parameters

  • network_interface_id<~String> - The ID of the network interface you want to describe an attribute of

  • attribute<~String> - The attribute to modify, must be one of ‘description’, ‘groupSet’, ‘sourceDestCheck’ or ‘attachment’

  • value<~Object> - New value of attribute, the actual tyep depends on teh attribute:

    description     - a string
    groupSet        - a list of group id's
    sourceDestCheck - a boolean value
    attachment      - a hash with:
                        attachmentid - the attachment to change
                        deleteOnTermination - a boolean
    

Amazon API Reference

[View source]

22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# File 'lib/fog/aws/requests/compute/modify_network_interface_attribute.rb', line 22

def modify_network_interface_attribute(network_interface_id, attribute, value)
  params = {}
  case attribute
  when 'description'
    params['Description.Value'] = value
  when 'groupSet'
    params.merge!(Fog::AWS.indexed_param('SecurityGroupId.%d', value))
  when 'sourceDestCheck'
    params['SourceDestCheck.Value'] = value
  when 'attachment'
    params['Attachment.AttachmentId']        = value['attachmentId']
    params['Attachment.DeleteOnTermination'] = value['deleteOnTermination']
  else
    raise Fog::Compute::AWS::Error.new("Illegal attribute '#{attribute}' specified")
  end

  request({
    'Action'             => 'ModifyNetworkInterfaceAttribute',
    'NetworkInterfaceId' => network_interface_id,
    :parser              => Fog::Parsers::Compute::AWS::Basic.new
  }.merge!(params))
end