From 8e7146cd06711b519d9ddd5a18a5e374cd0db0f4 Mon Sep 17 00:00:00 2001 From: Jeremy Stretch Date: Tue, 28 Nov 2023 13:11:30 -0500 Subject: [PATCH] v3.7 documentation updates --- docs/models/virtualization/virtualdisk.md | 13 +++++++++++++ docs/plugins/development/models.md | 4 ++++ 2 files changed, 17 insertions(+) create mode 100644 docs/models/virtualization/virtualdisk.md diff --git a/docs/models/virtualization/virtualdisk.md b/docs/models/virtualization/virtualdisk.md new file mode 100644 index 000000000..9d256bb66 --- /dev/null +++ b/docs/models/virtualization/virtualdisk.md @@ -0,0 +1,13 @@ +# Virtual Disks + +A virtual disk is used to model discrete virtual hard disks assigned to [virtual machines](./virtualmachine.md). + +## Fields + +### Name + +A human-friendly name that is unique to the assigned virtual machine. + +### Size + +The allocated disk size, in gigabytes. diff --git a/docs/plugins/development/models.md b/docs/plugins/development/models.md index 8394813f8..46af135e1 100644 --- a/docs/plugins/development/models.md +++ b/docs/plugins/development/models.md @@ -60,6 +60,10 @@ class MyModel(NetBoxModel): This attribute specifies the URL at which the documentation for this model can be reached. By default, it will return `/static/docs/models///`. Plugin models can override this to return a custom URL. For example, you might direct the user to your plugin's documentation hosted on [ReadTheDocs](https://readthedocs.org/). +#### `_netbox_private` + +By default, any model introduced by a plugin will appear in the list of available object types e.g. when creating a custom field or certain dashboard widgets. If your model is intended only for "behind the scenes use" and should not be exposed to end users, set `_netbox_private` to True. This will omit it from the list of general-purpose object types. + ### Enabling Features Individually If you prefer instead to enable only a subset of these features for a plugin model, NetBox provides a discrete "mix-in" class for each feature. You can subclass each of these individually when defining your model. (Your model will also need to inherit from Django's built-in `Model` class.)