constants.py 581 B

1234567891011121314151617181920212223
  1. from django.db import models
  2. from django.utils.translation import gettext_lazy as _
  3. class MonitorType(models.TextChoices):
  4. PING = "Ping"
  5. GET = "GET"
  6. POST = "POST"
  7. PORT = "TCP Port"
  8. SSL = "SSL"
  9. HEARTBEAT = "Heartbeat"
  10. HTTP_MONITOR_TYPES = (MonitorType.PING, MonitorType.GET, MonitorType.POST)
  11. class MonitorCheckReason(models.IntegerChoices):
  12. UNKNOWN = 0, _("Unknown")
  13. TIMEOUT = 1, _("Timeout")
  14. STATUS = 2, _("Wrong status code")
  15. BODY = 3, _("Expected response not found")
  16. SSL = 4, _("SSL error")
  17. NETWORK = 5, _("Network error")