Device Model
Bases: CenturionModel
Attributes
config
config = JSONField(
blank=True,
help_text="Configuration for this device",
null=True,
validators=[validate_config_keys_not_reserved],
verbose_name="Host Configuration",
)
device_model
device_model = ForeignKey(
DeviceModel,
blank=True,
help_text="Model of the device.",
null=True,
on_delete=PROTECT,
verbose_name="Model",
)
device_type
device_type = ForeignKey(
DeviceType,
blank=True,
help_text="Type of device.",
null=True,
on_delete=PROTECT,
verbose_name="Type",
)
inventorydate
inventorydate = DateTimeField(
blank=True,
help_text="Date and time of the last inventory",
null=True,
verbose_name="Last Inventory Date",
)
is_virtual
is_virtual = BooleanField(
blank=True,
default=False,
help_text="Is this device a virtual machine",
null=False,
verbose_name="Is Virtual",
)
name
name = CharField(
blank=False,
help_text="Hostname of this device",
max_length=50,
unique=True,
validators=[validate_hostname_format],
verbose_name="Name",
)
page_layout
page_layout: dict = [
{
"name": "Details",
"slug": "details",
"sections": [
{
"layout": "double",
"left": [
"organization",
"device_type",
"device_model",
"name",
"serial_number",
"uuid",
"inventorydate",
"created",
"modified",
],
"right": ["model_notes", "is_virtual"],
},
{
"layout": "table",
"name": "Operating System",
"field": "operating_system",
},
{
"layout": "table",
"name": "Dependent Services",
"field": "service",
},
{"layout": "single", "fields": ["config"]},
],
},
{
"name": "Software",
"slug": "software",
"sections": [
{"layout": "table", "field": "software"}
],
},
{
"name": "Tickets",
"slug": "tickets",
"sections": [
{"layout": "table", "field": "tickets"}
],
},
{
"name": "Knowledge Base",
"slug": "kb_articles",
"sections": [
{"layout": "table", "field": "knowledge_base"}
],
},
{"name": "Notes", "slug": "notes", "sections": []},
{
"name": "Config Management",
"slug": "config_management",
"sections": [
{
"layout": "single",
"fields": ["rendered_config"],
}
],
},
]
serial_number
serial_number = CharField(
blank=True,
help_text="Serial number of the device.",
max_length=50,
null=True,
unique=True,
verbose_name="Serial Number",
)
status
Fetch Device status
Returns:
Name | Type | Description |
---|---|---|
str |
str
|
Current status of the item |
table_fields
table_fields: list = [
"status_icon",
"name",
"device_model",
"device_type",
"organization",
"created",
"modified",
"model",
"nbsp",
]
uuid
uuid = UUIDField(
blank=True,
help_text="System GUID/UUID.",
max_length=50,
null=True,
unique=True,
validators=[validate_uuid_format],
verbose_name="UUID",
)
Classes
Meta
Functions
save
Save Device Model
After saving the device update the related items so that they are a part of the same organization as the device.
About:
This page forms part of our Project Centurion ERP.
Page Metadata
Version: ToDo: place files short git commit hereDate Created: 2024-06-16
Date Edited: 2024-07-13
Contribution:
Would You like to contribute to our Centurion ERP project? You can assist in the following ways:
- Edit This Page If there is a mistake or a way you can improve it.
- Add a Page to the Manual if you would like to add an item to our manual
- Raise an Issue if there is something about this page you would like to improve, and git is unfamiliar to you.
ToDo: Add the page list of contributors