require 'fog/core/collection' require 'fog/aws/models/compute/network_interface' module Fog module Compute class AWS class NetworkInterfaces < Fog::Collection attribute :filters model Fog::Compute::AWS::NetworkInterface # Creates a new network interface # # AWS.network_interfaces.new # # ==== Returns # # Returns the details of the new network interface # #>> AWS.network_interfaces.new # # def initialize(attributes) self.filters ||= {} super end # Returns an array of all network interfaces that have been created # # AWS.network_interfaces.all # # ==== Returns # # Returns an array of all network interfaces # #>> AWS.network_interfaves.all # # ] # > # def all(filters_arg = filters) filters = filters_arg data = service.describe_network_interfaces(filters).body load(data['networkInterfaceSet']) end # Used to retrieve a network interface # network interface id is required to get any information # # You can run the following command to get the details: # AWS.network_interfaces.get("eni-11223344") # # ==== Returns # #>> AWS.NetworkInterface.get("eni-11223344") # # def get(nic_id) if nic_id self.class.new(:service => service).all('network-interface-id' => nic_id).first end end end end end end