Splitted hostgroup generation logic into its seperate module. Changed hostgroup "dev_role" to "role" for VM role prepration. Started work on basic VM class.

This commit is contained in:
TheNetworkGuy
2024-10-25 16:02:08 +02:00
parent 2e867d1129
commit 053028b283
5 changed files with 179 additions and 56 deletions

View File

@@ -76,7 +76,7 @@ def main(arguments):
netbox = api(netbox_host, token=netbox_token, threading=True)
# Check if the provided Hostgroup layout is valid
hg_objects = hostgroup_format.split("/")
allowed_objects = ["dev_location", "dev_role", "manufacturer", "region",
allowed_objects = ["dev_location", "role", "manufacturer", "region",
"site", "site_group", "tenant", "tenant_group"]
# Create API call to get all custom fields which are on the device objects
device_cfs = netbox.extras.custom_fields.filter(type="text", content_type_id=23)