Closed Kani999 closed 1 year ago
We need it for Objects and Multiple Objects custom fields (although it needs to be adapted too)
Okay, so it should return something like.
Object: inventory-item
Custom Fileds:
test_json_custom_field
{'x': 1, 'y': 2}
- JSONtest_list_custom_field
['x', 'y']
- MultipleSelectiontest_multiple_objects_custom_field
[Dev1, Dev2] - MultipleObjects (Device) abra_discovered
False
- Boolean asset_numbers
T5060
- Stringinventarizace
{'x': 1, 'y': 2}
- JSON
inventory_monitor_last_probe
2022-11-23
- Date
inventory_monitor_probe
- Probe
- Object (from plugin) Response
{
"id":5023,
"url":"https://NETBOX-INSTANCE/api/dcim/inventory-items/5023/",
"display":"0/6/1",
"device":61,
"parent":"None",
"name":"0/6/1",
"label":"",
"role":5,
"manufacturer":"None",
"part_id":"",
"asset_tag":"None",
"discovered":true,
"description":"",
"component_type":"None",
"component_id":"None",
"component":"None",
"tags":[
],
"custom_fields":{
"test_json_custom_field":{
"x":1,
"y":2
},
"test_list_custom_field":[
"x",
"y"
],
"test_multiple_objects_custom_field":[
{
"id":1,
"url":"https://NETBOX-INSTANCE/api/dcim/devices/1/",
"display":"DEV1",
"name":"DEV1"
},
{
"id":119,
"url":"https://NETBOX-INSTANCE/api/dcim/devices/119/",
"display":"DEV2",
"name":"DEV2"
},
],
"abra_discovered":false,
"asset_numbers":"T5060",
"inventarizace":{
"x":1,
"y":2
},
"inventory_monitor_active":true,
"inventory_monitor_last_probe":"2022-11-23",
"inventory_monitor_probe":{
"id":1648,
"url":"https://NETBOX-INSTANCE/api/plugins/inventory-monitor/probes/1648/",
"display":"Object",
"name":"0/6/1",
"time":"2022-11-23T01:16:47.492262Z"
},
"inventory_monitor_probed":true
},
"created":"2022-09-06T10:03:36.248425Z",
"last_updated":"2022-11-23T08:46:57.907296Z",
"_depth":0
}
Or it just should return the ids
{
"id":5023,
"url":"https://NETBOX_URL/api/dcim/inventory-items/5023/",
"display":"0/6/1",
"device":61,
"parent":"None",
"tags":[
],
"custom_fields":{
"test_json_custom_field":{
"x":1,
"y":2
},
"test_list_custom_field":[
"x",
"y"
],
"test_multiple_objects_custom_field":[
1,
119,
252
],
"abra_discovered":false,
"asset_numbers":"T5060",
"inventarizace":{
"x":1,
"y":2
},
"inventory_monitor_active":true,
"inventory_monitor_last_probe":"2022-11-23",
"inventory_monitor_probe":1648,
"inventory_monitor_probed":true
},
"created":"2022-09-06T10:03:36.248425Z",
"last_updated":"2022-11-23T08:46:57.907296Z",
"_depth":0
}
Uploaded version
Is there any chance this pull request can be reviewed and merged into an upstream version of pynetbox? We're hitting the same bug when trying to create netbox_prefix via ansible with custom_fields.
Will take a look into it, probably Wed or Thursday before I can get to it.