Models¶
Persisted models for the netbox-ceph plugin.
__all__ = ['CephCluster', 'CephCrushRule', 'CephDaemon', 'CephFilesystem', 'CephFlag', 'CephHealthCheck', 'CephOSD', 'CephPluginSettings', 'CephPool']
module-attribute
¶
CephCluster
¶
Bases: NetBoxModel
Ceph cluster state discovered from a Proxmox endpoint.
endpoint = models.ForeignKey(to='netbox_proxbox.ProxmoxEndpoint', on_delete=(models.CASCADE), related_name='ceph_clusters', verbose_name=(_('Proxmox endpoint')))
class-attribute
instance-attribute
¶
fsid = models.CharField(max_length=64, blank=True, verbose_name=(_('FSID')))
class-attribute
instance-attribute
¶
health = models.CharField(max_length=32, choices=CephHealthChoices, default=(CephHealthChoices.HEALTH_UNKNOWN))
class-attribute
instance-attribute
¶
last_seen_at = models.DateTimeField(null=True, blank=True)
class-attribute
instance-attribute
¶
name = models.CharField(max_length=255, verbose_name=(_('Cluster name')))
class-attribute
instance-attribute
¶
proxmox_cluster = models.ForeignKey(to='netbox_proxbox.ProxmoxCluster', on_delete=(models.SET_NULL), related_name='ceph_clusters', null=True, blank=True, verbose_name=(_('Proxmox cluster')))
class-attribute
instance-attribute
¶
quorum_names = models.JSONField(blank=True, default=list, encoder=CustomFieldJSONEncoder, verbose_name=(_('Quorum members')))
class-attribute
instance-attribute
¶
status = models.JSONField(blank=True, default=dict, encoder=CustomFieldJSONEncoder)
class-attribute
instance-attribute
¶
Meta
¶
constraints = [models.UniqueConstraint(fields=('endpoint', 'name'), name='netbox_ceph_cluster_identity')]
class-attribute
instance-attribute
¶
ordering = ('endpoint', 'name')
class-attribute
instance-attribute
¶
verbose_name = _('Ceph cluster')
class-attribute
instance-attribute
¶
verbose_name_plural = _('Ceph clusters')
class-attribute
instance-attribute
¶
__str__()
¶
get_absolute_url()
¶
CephCrushRule
¶
Bases: NetBoxModel
CRUSH rule reflected from Ceph.
cluster = models.ForeignKey(to='netbox_ceph.CephCluster', on_delete=(models.CASCADE), related_name='crush_rules', null=True, blank=True)
class-attribute
instance-attribute
¶
device_class = models.CharField(max_length=64, blank=True)
class-attribute
instance-attribute
¶
endpoint = models.ForeignKey(to='netbox_proxbox.ProxmoxEndpoint', on_delete=(models.CASCADE), related_name='ceph_crush_rules')
class-attribute
instance-attribute
¶
last_seen_at = models.DateTimeField(null=True, blank=True)
class-attribute
instance-attribute
¶
name = models.CharField(max_length=255)
class-attribute
instance-attribute
¶
raw = models.JSONField(blank=True, default=dict, encoder=CustomFieldJSONEncoder)
class-attribute
instance-attribute
¶
rule_id = models.IntegerField(null=True, blank=True)
class-attribute
instance-attribute
¶
rule_type = models.CharField(max_length=64, blank=True)
class-attribute
instance-attribute
¶
steps = models.JSONField(blank=True, default=list, encoder=CustomFieldJSONEncoder)
class-attribute
instance-attribute
¶
Meta
¶
constraints = [models.UniqueConstraint(fields=('endpoint', 'name'), name='netbox_ceph_crush_rule_identity')]
class-attribute
instance-attribute
¶
ordering = ('endpoint', 'name')
class-attribute
instance-attribute
¶
verbose_name = _('Ceph CRUSH rule')
class-attribute
instance-attribute
¶
verbose_name_plural = _('Ceph CRUSH rules')
class-attribute
instance-attribute
¶
__str__()
¶
get_absolute_url()
¶
CephDaemon
¶
Bases: NetBoxModel
MON/MGR/MDS daemon record reflected from Ceph.
cluster = models.ForeignKey(to='netbox_ceph.CephCluster', on_delete=(models.CASCADE), related_name='daemons', null=True, blank=True)
class-attribute
instance-attribute
¶
daemon_id = models.CharField(max_length=255, blank=True)
class-attribute
instance-attribute
¶
daemon_type = models.CharField(max_length=16, choices=CephDaemonTypeChoices, default=(CephDaemonTypeChoices.TYPE_UNKNOWN))
class-attribute
instance-attribute
¶
endpoint = models.ForeignKey(to='netbox_proxbox.ProxmoxEndpoint', on_delete=(models.CASCADE), related_name='ceph_daemons')
class-attribute
instance-attribute
¶
host = models.CharField(max_length=255, blank=True)
class-attribute
instance-attribute
¶
last_seen_at = models.DateTimeField(null=True, blank=True)
class-attribute
instance-attribute
¶
metadata = models.JSONField(blank=True, default=dict, encoder=CustomFieldJSONEncoder)
class-attribute
instance-attribute
¶
name = models.CharField(max_length=255)
class-attribute
instance-attribute
¶
proxmox_node = models.ForeignKey(to='netbox_proxbox.ProxmoxNode', on_delete=(models.SET_NULL), related_name='ceph_daemons', null=True, blank=True)
class-attribute
instance-attribute
¶
state = models.CharField(max_length=32, choices=CephDaemonStateChoices, default=(CephDaemonStateChoices.STATE_UNKNOWN))
class-attribute
instance-attribute
¶
status = models.CharField(max_length=255, blank=True)
class-attribute
instance-attribute
¶
version = models.CharField(max_length=128, blank=True)
class-attribute
instance-attribute
¶
Meta
¶
constraints = [models.UniqueConstraint(fields=('endpoint', 'daemon_type', 'name'), name='netbox_ceph_daemon_identity')]
class-attribute
instance-attribute
¶
ordering = ('endpoint', 'daemon_type', 'name')
class-attribute
instance-attribute
¶
verbose_name = _('Ceph daemon')
class-attribute
instance-attribute
¶
verbose_name_plural = _('Ceph daemons')
class-attribute
instance-attribute
¶
__str__()
¶
get_absolute_url()
¶
CephFilesystem
¶
Bases: NetBoxModel
CephFS state.
cluster = models.ForeignKey(to='netbox_ceph.CephCluster', on_delete=(models.CASCADE), related_name='filesystems', null=True, blank=True)
class-attribute
instance-attribute
¶
data_pools = models.JSONField(blank=True, default=list, encoder=CustomFieldJSONEncoder)
class-attribute
instance-attribute
¶
endpoint = models.ForeignKey(to='netbox_proxbox.ProxmoxEndpoint', on_delete=(models.CASCADE), related_name='ceph_filesystems')
class-attribute
instance-attribute
¶
last_seen_at = models.DateTimeField(null=True, blank=True)
class-attribute
instance-attribute
¶
metadata_pool = models.ForeignKey(to='netbox_ceph.CephPool', on_delete=(models.SET_NULL), related_name='metadata_filesystems', null=True, blank=True)
class-attribute
instance-attribute
¶
name = models.CharField(max_length=255)
class-attribute
instance-attribute
¶
standby_count_wanted = models.PositiveIntegerField(null=True, blank=True)
class-attribute
instance-attribute
¶
status = models.JSONField(blank=True, default=dict, encoder=CustomFieldJSONEncoder)
class-attribute
instance-attribute
¶
Meta
¶
constraints = [models.UniqueConstraint(fields=('endpoint', 'name'), name='netbox_ceph_filesystem_identity')]
class-attribute
instance-attribute
¶
ordering = ('endpoint', 'name')
class-attribute
instance-attribute
¶
verbose_name = _('Ceph filesystem')
class-attribute
instance-attribute
¶
verbose_name_plural = _('Ceph filesystems')
class-attribute
instance-attribute
¶
__str__()
¶
get_absolute_url()
¶
CephFlag
¶
Bases: NetBoxModel
Cluster-level Ceph flag state.
cluster = models.ForeignKey(to='netbox_ceph.CephCluster', on_delete=(models.CASCADE), related_name='flags', null=True, blank=True)
class-attribute
instance-attribute
¶
enabled = models.BooleanField(null=True, blank=True)
class-attribute
instance-attribute
¶
endpoint = models.ForeignKey(to='netbox_proxbox.ProxmoxEndpoint', on_delete=(models.CASCADE), related_name='ceph_flags')
class-attribute
instance-attribute
¶
last_seen_at = models.DateTimeField(null=True, blank=True)
class-attribute
instance-attribute
¶
name = models.CharField(max_length=64)
class-attribute
instance-attribute
¶
raw = models.JSONField(blank=True, default=dict, encoder=CustomFieldJSONEncoder)
class-attribute
instance-attribute
¶
value = models.CharField(max_length=255, blank=True)
class-attribute
instance-attribute
¶
Meta
¶
constraints = [models.UniqueConstraint(fields=('endpoint', 'name'), name='netbox_ceph_flag_identity')]
class-attribute
instance-attribute
¶
ordering = ('endpoint', 'name')
class-attribute
instance-attribute
¶
verbose_name = _('Ceph flag')
class-attribute
instance-attribute
¶
verbose_name_plural = _('Ceph flags')
class-attribute
instance-attribute
¶
__str__()
¶
get_absolute_url()
¶
CephHealthCheck
¶
Bases: NetBoxModel
Health check entry parsed from Ceph status payloads.
cluster = models.ForeignKey(to='netbox_ceph.CephCluster', on_delete=(models.CASCADE), related_name='health_checks', null=True, blank=True)
class-attribute
instance-attribute
¶
detail = models.JSONField(blank=True, default=list, encoder=CustomFieldJSONEncoder)
class-attribute
instance-attribute
¶
endpoint = models.ForeignKey(to='netbox_proxbox.ProxmoxEndpoint', on_delete=(models.CASCADE), related_name='ceph_health_checks')
class-attribute
instance-attribute
¶
first_seen_at = models.DateTimeField(null=True, blank=True)
class-attribute
instance-attribute
¶
last_seen_at = models.DateTimeField(null=True, blank=True)
class-attribute
instance-attribute
¶
name = models.CharField(max_length=255)
class-attribute
instance-attribute
¶
severity = models.CharField(max_length=32, choices=CephHealthChoices, default=(CephHealthChoices.HEALTH_UNKNOWN))
class-attribute
instance-attribute
¶
source = models.CharField(max_length=64, blank=True)
class-attribute
instance-attribute
¶
summary = models.CharField(max_length=512, blank=True)
class-attribute
instance-attribute
¶
Meta
¶
constraints = [models.UniqueConstraint(fields=('endpoint', 'name'), name='netbox_ceph_health_check_identity')]
class-attribute
instance-attribute
¶
ordering = ('endpoint', 'severity', 'name')
class-attribute
instance-attribute
¶
verbose_name = _('Ceph health check')
class-attribute
instance-attribute
¶
verbose_name_plural = _('Ceph health checks')
class-attribute
instance-attribute
¶
__str__()
¶
get_absolute_url()
¶
CephOSD
¶
Bases: NetBoxModel
Ceph OSD capacity and status.
available_bytes = models.BigIntegerField(null=True, blank=True)
class-attribute
instance-attribute
¶
cluster = models.ForeignKey(to='netbox_ceph.CephCluster', on_delete=(models.CASCADE), related_name='osds', null=True, blank=True)
class-attribute
instance-attribute
¶
device_class = models.CharField(max_length=64, blank=True)
class-attribute
instance-attribute
¶
endpoint = models.ForeignKey(to='netbox_proxbox.ProxmoxEndpoint', on_delete=(models.CASCADE), related_name='ceph_osds')
class-attribute
instance-attribute
¶
host = models.CharField(max_length=255, blank=True)
class-attribute
instance-attribute
¶
in_cluster = models.BooleanField(default=False, verbose_name=(_('In cluster')))
class-attribute
instance-attribute
¶
last_seen_at = models.DateTimeField(null=True, blank=True)
class-attribute
instance-attribute
¶
metadata = models.JSONField(blank=True, default=dict, encoder=CustomFieldJSONEncoder)
class-attribute
instance-attribute
¶
name = models.CharField(max_length=255, blank=True)
class-attribute
instance-attribute
¶
osd_id = models.PositiveIntegerField(verbose_name=(_('OSD ID')))
class-attribute
instance-attribute
¶
pgs = models.PositiveIntegerField(null=True, blank=True)
class-attribute
instance-attribute
¶
proxmox_node = models.ForeignKey(to='netbox_proxbox.ProxmoxNode', on_delete=(models.SET_NULL), related_name='ceph_osds', null=True, blank=True)
class-attribute
instance-attribute
¶
reweight = models.FloatField(null=True, blank=True)
class-attribute
instance-attribute
¶
status = models.CharField(max_length=255, blank=True)
class-attribute
instance-attribute
¶
total_bytes = models.BigIntegerField(null=True, blank=True)
class-attribute
instance-attribute
¶
up = models.BooleanField(default=False)
class-attribute
instance-attribute
¶
used_bytes = models.BigIntegerField(null=True, blank=True)
class-attribute
instance-attribute
¶
weight = models.FloatField(null=True, blank=True)
class-attribute
instance-attribute
¶
Meta
¶
constraints = [models.UniqueConstraint(fields=('endpoint', 'osd_id'), name='netbox_ceph_osd_identity')]
class-attribute
instance-attribute
¶
ordering = ('endpoint', 'osd_id')
class-attribute
instance-attribute
¶
verbose_name = _('Ceph OSD')
class-attribute
instance-attribute
¶
verbose_name_plural = _('Ceph OSDs')
class-attribute
instance-attribute
¶
__str__()
¶
get_absolute_url()
¶
CephPluginSettings
¶
Bases: NetBoxModel
Singleton-style settings row for netbox-ceph sync behavior.
branch_name_prefix = models.CharField(max_length=64, default='ceph-sync', verbose_name=(_('Branch name prefix')))
class-attribute
instance-attribute
¶
branch_on_conflict = models.CharField(max_length=16, choices=BRANCH_ON_CONFLICT_CHOICES, default='fail', verbose_name=(_('Branch merge conflict policy')))
class-attribute
instance-attribute
¶
branching_enabled = models.BooleanField(default=False, verbose_name=(_('Branching-enabled sync (Ceph -> NetBox)')), help_text=(_('When enabled, every Ceph sync job creates a fresh netbox-branching branch, runs the sync on that branch, and merges it back into main on success.')))
class-attribute
instance-attribute
¶
singleton_key = models.CharField(max_length=32, unique=True, default='default', editable=False)
class-attribute
instance-attribute
¶
Meta
¶
__str__()
¶
get_solo()
classmethod
¶
save(*args, **kwargs)
¶
CephPool
¶
Bases: NetBoxModel
Ceph pool state.