Replies: 2 comments 6 replies
-
Hi Jeremy, As you moved this issue to discussion, can you confirm this is the intended change, and if so, what is the intention?. This set of values for unassigned IP: Igor |
Beta Was this translation helpful? Give feedback.
-
Sorry for the delay, |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
NetBox version
v3.2.2
Python version
3.8
Steps to Reproduce
Clean install NetBox 3.2.1 or NetBox 3.2.2
Dump NetBox 3.1.1 database
Run upgrade.sh to migrate from NetBox 3.1.11
Expected Behavior
For IPs not assigned to the object API to return / keep "assigned_object_type" null value
Example (before migration / NetBox 3.1.11):
{
"id": 5631,
"url": "http://localhost:8002/api/ipam/ip-addresses/5631/",
"display": "10.200.0.5/32",
"family": {
"value": 4,
"label": "IPv4"
},
"address": "10.200.0.5/32",
"vrf": {
"id": 28,
"url": "http://localhost:8002/api/ipam/vrfs/28/",
"display": "TNX",
"name": "TNX",
"rd": null
},
"tenant": {
"id": 20,
"url": "http://localhost:8002/api/tenancy/tenants/20/",
"display": "TNX",
"name": "TNX",
"slug": "tnx"
},
"status": {
"value": "active",
"label": "Active"
},
"role": null,
"assigned_object_type": null,
"assigned_object_id": null,
"assigned_object": null,
"nat_inside": null,
"nat_outside": null,
"dns_name": "aws-dc1",
"description": "",
"tags": [
{
"id": 5,
"url": "http://localhost:8002/api/extras/tags/5/",
"display": "MSR-AVL-INT",
"name": "MSR-AVL-INT",
"slug": "msr-avl-int",
"color": "ffeb3b"
}
],
"custom_fields": {},
"created": "2020-09-06",
"last_updated": "2020-09-06T18:04:42.114987Z"
}
Observed Behavior
For IPs not assigned to the object receive API response with "assigned_object_type" set to "dcim.interface"
Example (after migration / NetBox 3.2.2):
{
"id": 5631,
"url": "http://localhost:8003/api/ipam/ip-addresses/5631/",
"display": "10.200.0.5/32",
"family": {
"value": 4,
"label": "IPv4"
},
"address": "10.200.0.5/32",
"vrf": {
"id": 28,
"url": "http://localhost:8003/api/ipam/vrfs/28/",
"display": "TNX",
"name": "TNX",
"rd": null
},
"tenant": {
"id": 20,
"url": "http://localhost:8003/api/tenancy/tenants/20/",
"display": "TNX",
"name": "TNX",
"slug": "tnx"
},
"status": {
"value": "active",
"label": "Active"
},
"role": null,
"assigned_object_type": "dcim.interface",
"assigned_object_id": null,
"assigned_object": null,
"nat_inside": null,
"nat_outside": null,
"dns_name": "aws-dc1",
"description": "",
"tags": [
{
"id": 5,
"url": "http://localhost:8003/api/extras/tags/5/",
"display": "MSR-AVL-INT",
"name": "MSR-AVL-INT",
"slug": "msr-avl-int",
"color": "ffeb3b"
}
],
"custom_fields": {},
"created": "2020-09-06T00:00:00Z",
"last_updated": "2020-09-06T18:04:42.114987Z"
}
Beta Was this translation helpful? Give feedback.
All reactions