Cable Labels #11053
Replies: 5 comments 1 reply
-
You can change it using export templates. This is the template I have used in the past to get a format which is very close to the CSV import format: it makes it easier to modify cables en masse by deleting them and re-importing them.
But I haven't used it for a while, and it probably won't work with Netbox 3.3 without changes. This is because the terminations at each end of a cable are now a list, not single items. If all your cables have single endpoints then the changes may be reasonably easy. Aside: CSV doesn't really work when each cable end has multiple terminations, but I believe that JSON/YAML import/export are in the pipeline. |
Beta Was this translation helpful? Give feedback.
-
Okay, that gives me a place to start. Is there a way for me to see the ID
references so I know how to set the correct headers and then reference the
cable values? Or...do I need to log directly into the database to see
those?
…On Wed, Nov 30, 2022 at 2:25 AM Brian Candler ***@***.***> wrote:
However when I do an export, this is the info in the CSV. Is there a way
to get the info I see in the Web Interface?
You can change it using export templates. This is the template I have used
in the past to get a format which is very close to the CSV import format:
it makes it easier to modify cables en masse by deleting them and
re-importing them.
side_a_device,side_a_type,side_a_name,side_b_device,side_b_type,side_b_name,type,status,label,color,length,length_unit
{%- for c in queryset %}
{%- if c.termination_a_type.app_label != 'circuits' and c.termination_b_type.app_label != 'circuits' %}
{{ c.termination_a.device.name }},{{ c.termination_a_type.app_labeled_name|replace(" | ",".")|replace(" ","") }},{{ c.termination_a.name }},{{ c.termination_b.device.name }},{{ c.termination_b_type.app_labeled_name|replace(" | ",".")|replace(" ","") }},{{ c.termination_b.name }},{{ c.type }},{{ c.status }},"{{ c.label }}",{{c.color}},{{ c.length|replace("None","") }},{{ c.length_unit }}
{%- endif %}
{%- endfor %}
But I haven't used it for a while, and it probably won't work with Netbox
3.3 without changes. This is because the terminations at each end of a
cable are now a list, not single items. If all your cables have single
endpoints then the changes may be reasonably easy.
Aside: CSV doesn't really work when each cable end has multiple
terminations, but I believe that JSON/YAML import/export are in the
pipeline <#10941>.
—
Reply to this email directly, view it on GitHub
<#11053 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AE2YOLDWOHKJD6LTTWTDCJDWK4FPBANCNFSM6AAAAAASO7T5HM>
.
You are receiving this because you authored the thread.Message ID:
***@***.***
com>
--
Brian Clanton
Network Security Engineer / VOIP Engineer / Director of Operations
TechPro
|
Beta Was this translation helpful? Give feedback.
-
Does something exist that details the netbox configuration files/scripts and their functions? I can find alot of GUI tutorial but not a lot on the file structure and Python files that make up the application. |
Beta Was this translation helpful? Give feedback.
-
NVM...I think I found what I am looking for under netbox documentation....developement. |
Beta Was this translation helpful? Give feedback.
-
Thanks!
…On Thu, Dec 1, 2022 at 2:15 AM Brian Candler ***@***.***> wrote:
Use nbshell
<https://docs.netbox.dev/en/stable/administration/netbox-shell/> to
explore the data model. Or look in the source code for models, which in
this case would be netbox/dcim/models/cables.py
—
Reply to this email directly, view it on GitHub
<#11053 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AE2YOLG5NJEXWEMPTJ6ISA3WLBNDPANCNFSM6AAAAAASO7T5HM>
.
You are receiving this because you authored the thread.Message ID:
***@***.***
com>
--
Brian Clanton
Network Security Engineer / VOIP Engineer / Director of Operations
TechPro
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I am looking to print cable label en masse by exporting 'cables' to a csv file. I want to use the 'Side A', 'Termination A', 'Side B' and Terminal B' as it appears in the GUI and using a Brady Labeler, print the labels by feeding the csv to the labeler all at once.
However when I do an export, this is the info in the CSV. Is there a way to get the info I see in the Web Interface?
<style> </style>Beta Was this translation helpful? Give feedback.
All reactions