Class: Fog::Compute::AWS::NetworkInterface
- Inherits:
-
Model
- Object
- Model
- Fog::Compute::AWS::NetworkInterface
- Defined in:
- lib/fog/aws/models/compute/network_interface.rb
Instance Method Summary collapse
-
#destroy ⇒ Object
Removes an existing network interface.
-
#save ⇒ Object
Create a network_interface.
Instance Method Details
#destroy ⇒ Object
Removes an existing network interface
network_interface.destroy
Returns
True or false depending on the result
36 37 38 39 40 41 |
# File 'lib/fog/aws/models/compute/network_interface.rb', line 36 def destroy requires :network_interface_id service.delete_network_interface(network_interface_id) true end |
#save ⇒ Object
Create a network_interface
>> g = AWS.network_interfaces.new(:subnet_id => "subnet-someId", options)
>> g.save
options is an optional hash which may contain ‘PrivateIpAddress’, ‘Description’, ‘GroupSet’
Returns:
requestId and a networkInterface object
55 56 57 58 59 60 61 62 63 64 65 66 67 |
# File 'lib/fog/aws/models/compute/network_interface.rb', line 55 def save requires :subnet_id = { 'PrivateIpAddress' => private_ip_address, 'Description' => description, 'GroupSet' => group_set, } .delete_if {|key, value| value.nil?} data = service.create_network_interface(subnet_id, ).body['networkInterface'] new_attributes = data.reject {|key,value| key == 'requestId'} merge_attributes(new_attributes) true end |