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
If the type is `object` or `multiobject`, the content type of the field is designated using the `app_label` and `model` attributes:
100
+
101
+
```json
102
+
{
103
+
"custom_object_type": 9,
104
+
"name": "primary_device",
105
+
"label": "Primary Device",
55
106
"type": "object",
56
107
"app_label": "dcim",
57
108
"model": "device"
@@ -69,27 +120,54 @@ as shown here:
69
120
}
70
121
```
71
122
72
-
!!! note
73
-
An `object` or `multiobject` field can point to any Custom Object, as well as any other existing object internal to NetBox.
74
-
Use an `app_label` of `netbox_custom_objects` and a `model` of `customobject`.
123
+
> [!NOTE]
124
+
> An `object` or `multiobject` field can point to any Custom Object, as well as any other existing object internal to NetBox.
125
+
> Use an `app_label` of `custom-objects` and a `model` of the Custom Object name to reference other custom objects.
126
+
75
127
76
128
### Custom Objects
77
129
78
130
Once the schema of a Custom Object Type is defined through its list of fields, you can create Custom Objects,
79
131
which are instances of Custom Object Types with specific values populated into the fields defined in the schema.
80
-
Create a Custom Object with a POST to `/api/plugins/custom-objects/custom-objects/`:
132
+
133
+
Create a Custom Object with a POST to `/api/plugins/custom-objects/<custom-object-type>/` where `<custom-object-type>` is the name of your Custom Object Type:
81
134
82
135
```json
83
136
{
84
-
"custom_object_type": 9,
85
-
"name": "My Object",
86
-
"data": {
87
-
"internal_id": 102,
88
-
"device_list": [34, 1],
89
-
"single_device": 16
90
-
}
137
+
"internal_id": 102,
138
+
"hostname": "server-001",
139
+
"cpu_cores": 8,
140
+
"environment": "production",
141
+
"device_list": [34, 1],
142
+
"primary_device": 16
143
+
}
144
+
```
145
+
146
+
The response will include the created object with its assigned ID and additional metadata:
0 commit comments