-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from rasulkireev/check-status
Add status checking
- Loading branch information
Showing
13 changed files
with
525 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
core/migrations/0003_alter_project_name_alter_project_slug_service.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# Generated by Django 5.0.4 on 2024-10-17 06:57 | ||
|
||
import django.db.models.deletion | ||
import uuid | ||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('core', '0002_project'), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterField( | ||
model_name='project', | ||
name='name', | ||
field=models.CharField(max_length=250, unique=True), | ||
), | ||
migrations.AlterField( | ||
model_name='project', | ||
name='slug', | ||
field=models.SlugField(max_length=250, unique=True), | ||
), | ||
migrations.CreateModel( | ||
name='Service', | ||
fields=[ | ||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), | ||
('uuid', models.UUIDField(default=uuid.uuid4, editable=False)), | ||
('created_at', models.DateTimeField(auto_now_add=True)), | ||
('updated_at', models.DateTimeField(auto_now=True)), | ||
('name', models.CharField(max_length=250)), | ||
('type', models.CharField(choices=[('WEBSITE', 'Website'), ('API', 'API')], default='WEBSITE', max_length=20)), | ||
('url', models.URLField(blank=True, max_length=500)), | ||
('check_interval', models.PositiveIntegerField(default=5, help_text='Check interval in minutes')), | ||
('additional_data', models.JSONField(blank=True, help_text='Additional data for service checks (e.g., auth headers, connection strings)', null=True)), | ||
('is_public', models.BooleanField(default=False)), | ||
('is_active', models.BooleanField(default=True)), | ||
('project', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='services', to='core.project')), | ||
], | ||
options={ | ||
'unique_together': {('project', 'name')}, | ||
}, | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# Generated by Django 5.0.4 on 2024-10-17 07:04 | ||
|
||
import django.db.models.deletion | ||
import django.utils.timezone | ||
import uuid | ||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('core', '0003_alter_project_name_alter_project_slug_service'), | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name='ServiceStatus', | ||
fields=[ | ||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), | ||
('uuid', models.UUIDField(default=uuid.uuid4, editable=False)), | ||
('created_at', models.DateTimeField(auto_now_add=True)), | ||
('updated_at', models.DateTimeField(auto_now=True)), | ||
('status', models.CharField(choices=[('UP', 'Up'), ('DOWN', 'Down'), ('DEGRADED', 'Degraded'), ('UNKNOWN', 'Unknown')], default='UNKNOWN', max_length=20)), | ||
('response_time', models.FloatField(blank=True, help_text='Response time in milliseconds', null=True)), | ||
('status_code', models.IntegerField(blank=True, null=True)), | ||
('error_message', models.TextField(blank=True)), | ||
('checked_at', models.DateTimeField(default=django.utils.timezone.now)), | ||
('service', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='statuses', to='core.service')), | ||
], | ||
options={ | ||
'ordering': ['-checked_at'], | ||
'get_latest_by': 'checked_at', | ||
}, | ||
), | ||
] |
19 changes: 19 additions & 0 deletions
19
core/migrations/0005_alter_profilestatetransition_profile.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# Generated by Django 5.0.4 on 2024-10-17 08:28 | ||
|
||
import django.db.models.deletion | ||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('core', '0004_servicestatus'), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterField( | ||
model_name='profilestatetransition', | ||
name='profile', | ||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='state_transitions', to='core.profile'), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.