Export Module-Type #1343
Answered
by
danner26
ciroiriarte
asked this question in
Q&A
Export Module-Type
#1343
-
Hello!, anybody can confirm if there's a "module-type export to yaml" feature somewhere?. In order to model yaml files to collaborate, I would like to confirm how should some things be modeled in a yaml file. |
Beta Was this translation helpful? Give feedback.
Answered by
danner26
May 16, 2023
Replies: 1 comment 1 reply
-
Hey @ciroiriarte there is not currently a way to export these via the UI, but I am looking into if it is possible to do so via pynetbox or similar |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Alright so I have done some digging. Using pynetbox you can pull the module type/device type like so:
netbox.dcim.module_types.filter(model='<MODULE_MODEL>)
whereMODULE_MODEL
is the slug of the module/device. Let save that to a variable such asmodule
mod_var = list(module)
wheremod_var
is an arbitrary variable namemod_var[0].__dict__
This will give you a JSON dataset. You can then either use this or convert it to YAML and it should be importable.
**WARNING**: The import part is not tested. You are …