Hi, below is the Netbox API return from /api/dcim/devices/?name=router-01.example.com
and I would like to know if you could implement in your API a filter on the model
or model slug
(using the model__iregex) that will return all devices matching this model as well as an option to return all custom_fields
as labels, please.
{
"count": 1,
"next": null,
"previous": null,
"results": [
{
"id": 8,
"url": "https://netbox.example.com/api/dcim/devices/8/",
"display": "router-01.example.com",
"name": "router-01.example.com",
"device_type": {
"id": 61,
"url": "https://netbox.example.com/api/dcim/device-types/61/",
"display": "Dlink xSeries",
"manufacturer": {
"id": 12,
"url": "https://netbox.example.com/api/dcim/manufacturers/12/",
"display": "DLINK",
"name": "DLINK",
"slug": "dlink"
},
"model": "Dlink xSeries",
"slug": "dlink-xseries"
},
"device_role": {
"id": 5,
"url": "https://netbox.example.com/api/dcim/device-roles/5/",
"display": "ROUTER",
"name": "ROUTER",
"slug": "ROUTER"
},
"tenant": {
"id": 1,
"url": "https://netbox.example.com/api/tenancy/tenants/1/",
"display": "HOME",
"name": "HOME",
"slug": "home"
},
"platform": null,
"serial": "01234567890",
"asset_tag": null,
"site": {
"id": 1,
"url": "https://netbox.example.com/api/dcim/sites/1/",
"display": "Malakoff",
"name": "Paris",
"slug": "paris"
},
"location": null,
"rack": {
"id": 8,
"url": "https://netbox.example.com/api/dcim/racks/8/",
"display": "RACK 11",
"name": "RACK 11"
},
"position": 6,
"face": {
"value": "front",
"label": "Front"
},
"parent_device": null,
"status": {
"value": "active",
"label": "Active"
},
"airflow": {
"value": "side-to-rear",
"label": "Side to rear"
},
"primary_ip": null,
"primary_ip4": null,
"primary_ip6": null,
"cluster": null,
"virtual_chassis": null,
"vc_position": null,
"vc_priority": null,
"comments": "",
"local_context_data": null,
"tags": [],
"custom_fields": {
"IP": "10.1.1.10",
"snmp_communaute": "read",
"snmp_communaute_alternate": null,
"snmp_version": "2c",
"snmp_port": "161",
"ping_frequence": "60",
"snmp_frequence": "60",
"client": null,
"exploitant": "Operator",
"partenaire": null
},
"config_context": {},
"created": "2022-07-12T12:21:22.461170Z",
"last_updated": "2022-07-12T12:23:18.688284Z"
}
]
}
Thank you in advance.