Class: AWS::EC2::NetworkInterfaceCollection
- Inherits:
-
Collection
- Object
- Collection
- AWS::EC2::NetworkInterfaceCollection
- Includes:
- Core::Collection::Simple, TaggedCollection
- Defined in:
- lib/aws/ec2/network_interface_collection.rb
Instance Method Summary collapse
- #[](network_interface_id) ⇒ NetworkInterface
-
#create(options = {}) ⇒ NetworkInterface
Creates a network interface.
Methods included from Core::Collection
#each, #each_batch, #enum, #first, #in_groups_of, #page
Methods included from TaggedCollection
Methods included from FilteredCollection
Instance Method Details
#[](network_interface_id) ⇒ NetworkInterface
66 67 68 |
# File 'lib/aws/ec2/network_interface_collection.rb', line 66 def [] network_interface_id NetworkInterface.new(network_interface_id, :config => config) end |
#create(options = {}) ⇒ NetworkInterface
Creates a network interface.
40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 |
# File 'lib/aws/ec2/network_interface_collection.rb', line 40 def create = {} client_opts = {} client_opts[:subnet_id] = subnet_id_option() client_opts[:private_ip_address] = [:private_ip_address] if .key?(:private_ip_address) client_opts[:description] = [:description] if .key?(:description) groups = () client_opts[:groups] = groups if groups resp = client.create_network_interface(client_opts) NetworkInterface.new_from(:create_network_interface, resp.network_interface, resp.network_interface.network_interface_id, :config => config) end |