Skip to content

remove constants, use the _choices api instead.. #67

@ThomasADavis

Description

@ThomasADavis
ISSUE TYPE
  • Feature Idea
SUMMARY

Replace the pre-defined constants in netbox_utils.py, for example:

IP_ADDRESS_STATUS
IP_ADDRESS_ROLE
RACK_TYPE
INTF_FORM_FACTOR
INTF_MODE

by using the _choices api.

ie, to get all the choices from dcim, you an do:

http://api-url/api/dcim/_choices (or using pynetbox - dcim_choicse = nb.dcim.choices())

and it will give all the choices.

This is need because netbox-2.7 replaces many of the numeric constants with "slugs"/human readable values, and in netbox-2.8, the numeric constants will no longer be honored..

If you use the _choices api, you will also maintain compatibility with netbox-2.6 (since it also supports the choices api)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions