DOKK / manpages / debian 12 / libvm-ec2-perl / VM::EC2::REST::dhcp.3pm.en
VM::EC2::REST::dhcp(3pm) User Contributed Perl Documentation VM::EC2::REST::dhcp(3pm)

 use VM::EC2 qw(:vpn);

These methods manage DHCP Option objects, which can then be applied to a VPC to configure the DHCP options applied to running instances. You get these methods when you import the tag ":vpn".

Implemented:
AssociateDhcpOptions
CreateDhcpOptions
DeleteDhcpOptions
DescribeDhcpOptions

Unimplemented;
(none)

This method creates a DhcpOption object, The single required argument is a configuration list hash (which can be passed either as a hashref or a flattened hash) with one or more of the following keys:

 -domain_name            Domain name for instances running in this VPC.
 -domain_name_servers    Scalar or arrayref containing up to 4 IP addresses of
                         domain name servers for this VPC.
 -ntp_servers            Scalar or arrayref containing up to 4 IP addresses
                         of network time protocol servers
 -netbios_name_servers   Scalar or arrayref containing up to 4 IP addresses for
                         NetBIOS name servers.
 -netbios_node_type      The NetBios node type (1,2,4 or 8). Amazon recommends
                         using "2" at this time.

On successful completion, a VM::EC2::VPC::DhcpOptions object will be returned. This can be associated with a VPC using the VPC object's set_dhcp_options() method:

 $vpc     = $ec2->create_vpc(...);
 $options = $ec2->create_dhcp_options(-domain_name=>'test.com',
                                      -domain_name_servers=>['204.16.255.55','216.239.34.10']);
 $vpc->set_dhcp_options($options);

$success = $ec2->delete_dhcp_options($dhcp_id)

Delete the indicated DHCPOptions, returning true if successful. You may also use the named argument -dhcp_options_id..

@options = $ec2->describe_dhcp_options(@option_ids)

@options = $ec2->describe_dhcp_options(\%filters)

@options = $ec2->describe_dhcp_options(-dhcp_options_id=>$id, -filter => \%filters)

This method returns a list of VM::EC2::VPC::DhcpOptions objects, which describe a set of DHCP options that can be assigned to a VPC. Called with no arguments, it returns all DhcpOptions. Pass a list of option IDs or a filter hashref in order to restrict the search.

Optional arguments:

 -dhcp_options_id     Scalar or arrayref of DhcpOption IDs.
 -filter              Hashref of filters.

Available filters are described at http://docs.amazonwebservices.com/AWSEC2/latest/APIReference/ApiReference-query-DescribeDhcpOptions.html.

$success = $ec2->associate_dhcp_options($vpc_id => $dhcp_id)

$success = $ec2->associate_dhcp_options(-vpc_id => $vpc_id,-dhcp_options_id => $dhcp_id)

Associate a VPC ID with a DHCP option set. Pass an ID of 'default' to restore the default DHCP options for the VPC.

VM::EC2

Lincoln Stein <lincoln.stein@gmail.com>.

Copyright (c) 2011 Ontario Institute for Cancer Research

This package and its accompanying libraries is free software; you can redistribute it and/or modify it under the terms of the GPL (either version 1, or at your option, any later version) or the Artistic License 2.0. Refer to LICENSE for the full license text. In addition, please see DISCLAIMER.txt for disclaimers of warranty.

2022-10-14 perl v5.34.0