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

Help need: Add DHCP options to network #378

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

Help need: Add DHCP options to network #378

juanituarte opened this issue Apr 26, 2024 · 0 comments

Comments

@juanituarte
Copy link

Hello guys, I need to add a DHCP options to a network, I wasnt able to achieve it.
Could you help me?

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()

ERROR

Traceback (most recent call last):
File "c:\Users\jsituar\CODE\infoblox\main.py", line 54, in
network.update()
File "c:\Users\jsituar\CODE\infoblox\infoblox_client_master\infoblox_client\objects.py", line 460, in update
ib_obj = self.connector.update_object(self.ref,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "c:\Users\jsituar\CODE\infoblox\infoblox_client_master\infoblox_client\connector.py", line 55, in callee
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "c:\Users\jsituar\CODE\infoblox\infoblox_client_master\infoblox_client\connector.py", line 511, in update_object
url = self._construct_url(ref, query_params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "c:\Users\jsituar\CODE\infoblox\infoblox_client_master\infoblox_client\connector.py", line 171, in _construct_url
raise ValueError('Path in request must be relative.')
ValueError: Path in request must be relative.

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