Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apply DHCP option to network #230

Open
juanituarte opened this issue Apr 26, 2024 · 0 comments
Open

Apply DHCP option to network #230

juanituarte opened this issue Apr 26, 2024 · 0 comments

Comments

@juanituarte
Copy link

Issue description

I want to add a DHCP option using the Python library but I couldn't figure it out.
Could you give me some guidance?

Example code

from infoblox_client_master.infoblox_client.objects import DhcpOption
from infoblox_client_master.infoblox_client.connector import Connector
from infoblox_client_master.infoblox_client.object_manager import InfobloxObjectManager

from credentials import credentials
from urllib3 import disable_warnings
disable_warnings()

ib_conn = Connector(
    dict(host='xxxx', 
    wapi_version='2.11.2',
    iba_dns_view='default', 
    iba_network_view='default', 
    iba_verify_ssl=False, 
    **credentials["lab"])
    )

dhcp_option = DhcpOption()
dhcp_option.name = "option"
dhcp_option.num = 240
dhcp_option.space = "ztp_fortinet"
dhcp_option.type = "IPv4 Address"


manager = InfobloxObjectManager(ib_conn)

subnet = manager.get_network('default', "172.23.125.0/27")
subnet.dhcp_option = [dhcp_option]
subnet.update()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant