You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@lampwins You may be thinking of the filters, where site takes a slug and site_id takes a primary key. The API calls @mattburgess posted are both correct.
There's a bug in the serializer validation that's preventing a VLANGroup from being created if a site is assigned.
Issue type: bug report
Python version: 2.7.5
NetBox version: 2.0.4
Adding a VLAN Group via the API works fine, so long as I don't specify a 'site':
curl -X POST -H "Authorization: Token $token" -H "Content-Type: application/json" -H "Accept: application/json; indent=4" http://$netbox_host/api/ipam/vlan-groups/ --data '{"name": "VG1", "slug": "vg1"}'
However, if I specify a site ID in the data payload, I get an HTTP 500 error back:
curl -X POST -H "Authorization: Token $token" -H "Content-Type: application/json" -H "Accept: application/json; indent=4" http://$netbox_host/api/ipam/vlan-groups/ --data '{"name": "VG1", "slug": "vg1", "site": "19"}'
The error message is:
<pre><strong><class 'django.core.exceptions.FieldError'></strong><br /> Cannot resolve keyword 'slug' into field. Choices are: created, custom_field_values, description, group, group_id, id, last_updated, name, prefixes, role, role_id, site, site_id, status, tenant, tenant_id, vid</pre>
The text was updated successfully, but these errors were encountered: