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

Custom Choices tries wrong URL. #487

Open
jkugler opened this issue Aug 17, 2022 · 3 comments
Open

Custom Choices tries wrong URL. #487

jkugler opened this issue Aug 17, 2022 · 3 comments
Labels
status: needs owner This issue is tentatively accepted pending a volunteer committed to its implementation type: documentation A change or addition to the documentation

Comments

@jkugler
Copy link

jkugler commented Aug 17, 2022

I am using version 6.6.2 of pynetbox against version 3.2.7 of NetBox. I'm getting errors trying these api calls:

api = pynetbox.api(self.url)
api.create_token(self.user, self.password)
list(api.dcim.custom_choices())
pynetbox.core.query.RequestError: The requested url: http://192.168.108.56/api/dcim/_custom_field_choices/ could not be found.

likewise:

list(api.extras.custom_choices())
pynetbox.core.query.RequestError: The requested url: http://192.168.108.56/api/extras/_custom_field_choices/ could not be found.

BUT! This url works on my server: http://192.168.108.56/api/extras/custom-fields/ So, as a work-around, I can hit that URL with my token and Requests, but I'd like to be able to get that information from within pynetbox.

@jkugler
Copy link
Author

jkugler commented Aug 17, 2022

I found the note in the method's doc strings about api.extras.custom_fields, but this command: api.extras.custom_fields.choices() doesn't return /api/extras/custom-fields/. It does not return any of my custom fields, and it does not return the field types.

@jkugler
Copy link
Author

jkugler commented Aug 17, 2022

api.extras.custom_fields.all() just returns the field names of the custom fields, and nothing about them. I still haven't found a way to get the information contained in /api/extras/custom-fields/

@jkugler
Copy link
Author

jkugler commented Aug 17, 2022

Finally figured out api.extras.custom_fields.all() is return object for each field. Didn't initially click when I saw:

>>> list(api.extras.custom_fields.all())
[irm_set_BIOS_biosbootsettings_biosbootmode, irm_set_BIOS_procsettings_x2apic_onoff, irm_set_BIOS_slotbibur_dellauto_discovery_onoff, irm_set_BIOS_sysprofile_settings_cstates_onoff, irm_set_BIOS_sysprofile_settings_custom_onoff, irm_set_BIOS_sysprofile_settings_proc1e_onoff, irm_set_BIOS_sysprofile_settings_procpwrperf_onoff, irm_set_BIOS_sysprofile_settings_uncorefreq, irm_set_BIOS_syssecurity_tpm2_hierarchy_onoff, irm_set_BIOS_syssecurity_tpm_onoff, irm_set_BIOS_Version, irm_set_iDRAC_IPV6_address, irm_set_IDRAC_IPV6_gateway, irm_set_IDRAC_IPV6_prefix_64, irm_set_iDRAC_name, irm_set_iDRAC_version, irm_set_power_supply_hs_spare_onoff, irm_set_power_supply_redundant_pol_onoff]

Leaving open for now as a "doc bug" since this is not doc'ed at https://pynetbox.readthedocs.io/en/latest/ which has a copyright of 2017.

@abhi1693 abhi1693 added status: needs owner This issue is tentatively accepted pending a volunteer committed to its implementation type: documentation A change or addition to the documentation labels Aug 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: needs owner This issue is tentatively accepted pending a volunteer committed to its implementation type: documentation A change or addition to the documentation
Projects
None yet
Development

No branches or pull requests

2 participants