Replies: 2 comments 1 reply
-
Yeah there are a bunch of different ways you can do this
* Write a small REST client to the API to fetch all the data for the data models you want to back up and write JSON. Query with jq in an emergency
* Write an Ansible playbook using netbox.nb_lookup API client to query all the data and write out using | to_json or | to_yaml to files, query with jq
* Write a Netbox Script to do all the queries in Python using the Django ORM and return the result as the output, trigger the Script over REST and write the output to JSON, query with jq
* Export Templates can be attached to the data model, written in Jinja2, and triggered over the API ?export=TemplateName so you can get the data in whatever form you want, CSV, JSON, HTML, Markdown, man pages, etc.
* The Django manage.py may have some generic export function
* ?? other options
—
Mark Tinberg ***@***.***>
Division of Information Technology-Network Services
University of Wisconsin-Madison
…________________________________
From: adparis99 ***@***.***>
Sent: Friday, December 2, 2022 4:11 PM
To: netbox-community/netbox ***@***.***>
Cc: Subscribed ***@***.***>
Subject: [netbox-community/netbox] Automatically Export CSV/YAML - How? (Discussion #11098)
Hey there,
One of our biggest concerns is that the NetBox server might be be unavailable at some point for any number of reasons, and as such we'd like to automatically export certain models such as IP addresses on a regular basis to separate location. Is this doable via custom scripts? Can it be done through the API? I know the sample custom script exemplifies creating a CSV in a more manual way, but we'd like the export to perfectly mirror the All Data option if possible. Thanks in advance for your help!
—
Reply to this email directly, view it on GitHub<#11098>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AAS7UMY7YTOY5P4N3OCPNSTWLJXY3ANCNFSM6AAAAAASSK4FFQ>.
You are receiving this because you are subscribed to this thread.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
adparis99
-
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hey there,
One of our biggest concerns is that the NetBox server might be be unavailable at some point for any number of reasons, and as such we'd like to automatically export certain models such as IP addresses on a regular basis to a separate location. Is this doable via custom scripts? Can it be done through the API? I know the sample custom script exemplifies creating a CSV in a more manual way, but we'd like the export to perfectly mirror the All Data option if possible. Thanks in advance for your help!
Beta Was this translation helpful? Give feedback.
All reactions