-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
94 changed files
with
1,765 additions
and
669 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
""" | ||
TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-DB管理系统(BlueKing-BK-DBM) available. | ||
Copyright (C) 2017-2023 THL A29 Limited, a Tencent company. All rights reserved. | ||
Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at https://opensource.org/licenses/MIT | ||
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on | ||
an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the | ||
specific language governing permissions and limitations under the License. | ||
""" | ||
|
||
from django.utils.translation import ugettext_lazy as _ | ||
|
||
from backend.exceptions import AppBaseException, ErrorCode | ||
|
||
|
||
class DBDirtyPoolBaseException(AppBaseException): | ||
MODULE_CODE = ErrorCode.DB_DIRTY_POOL_CODE | ||
MESSAGE = _("主机池异常") | ||
|
||
|
||
class PoolTransferException(DBDirtyPoolBaseException): | ||
ERROR_CODE = "001" | ||
MESSAGE = _("主机池转移异常") | ||
MESSAGE_TPL = _("主机池转移异常") |
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
126 changes: 126 additions & 0 deletions
126
dbm-ui/backend/db_dirty/migrations/0003_auto_20240925_1526.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,126 @@ | ||
# Generated by Django 3.2.25 on 2024-09-25 07:26 | ||
|
||
import django.db.models.deletion | ||
from django.db import migrations, models | ||
|
||
from backend.db_dirty.constants import MachineEventType, PoolType | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
("ticket", "0012_alter_ticket_remark"), | ||
("db_dirty", "0002_alter_dirtymachine_options"), | ||
] | ||
|
||
operations = [ | ||
migrations.RemoveField( | ||
model_name="dirtymachine", | ||
name="flow", | ||
), | ||
migrations.AddField( | ||
model_name="dirtymachine", | ||
name="bk_cpu", | ||
field=models.IntegerField(default=0, help_text="cpu"), | ||
), | ||
migrations.AddField( | ||
model_name="dirtymachine", | ||
name="bk_disk", | ||
field=models.IntegerField(default=0, help_text="磁盘"), | ||
), | ||
migrations.AddField( | ||
model_name="dirtymachine", | ||
name="bk_mem", | ||
field=models.IntegerField(default=0, help_text="内存"), | ||
), | ||
migrations.AddField( | ||
model_name="dirtymachine", | ||
name="city", | ||
field=models.CharField(blank=True, default="", help_text="城市", max_length=128, null=True), | ||
), | ||
migrations.AddField( | ||
model_name="dirtymachine", | ||
name="device_class", | ||
field=models.CharField(blank=True, default="", help_text="机架", max_length=128, null=True), | ||
), | ||
migrations.AddField( | ||
model_name="dirtymachine", | ||
name="os_name", | ||
field=models.CharField(blank=True, default="", help_text="操作系统", max_length=128, null=True), | ||
), | ||
migrations.AddField( | ||
model_name="dirtymachine", | ||
name="pool", | ||
field=models.CharField( | ||
choices=PoolType.get_choices(), | ||
default="dirty", | ||
help_text="池类型", | ||
max_length=128, | ||
), | ||
preserve_default=False, | ||
), | ||
migrations.AddField( | ||
model_name="dirtymachine", | ||
name="rack_id", | ||
field=models.CharField(blank=True, default="", help_text="机架", max_length=128, null=True), | ||
), | ||
migrations.AddField( | ||
model_name="dirtymachine", | ||
name="sub_zone", | ||
field=models.CharField(blank=True, default="", help_text="园区", max_length=128, null=True), | ||
), | ||
migrations.AlterField( | ||
model_name="dirtymachine", | ||
name="ticket", | ||
field=models.ForeignKey( | ||
blank=True, | ||
help_text="关联单据", | ||
null=True, | ||
on_delete=django.db.models.deletion.CASCADE, | ||
to="ticket.ticket", | ||
), | ||
), | ||
migrations.CreateModel( | ||
name="MachineEvent", | ||
fields=[ | ||
("id", models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID")), | ||
("creator", models.CharField(max_length=64, verbose_name="创建人")), | ||
("create_at", models.DateTimeField(auto_now_add=True, verbose_name="创建时间")), | ||
("updater", models.CharField(max_length=64, verbose_name="修改人")), | ||
("update_at", models.DateTimeField(auto_now=True, verbose_name="更新时间")), | ||
("bk_biz_id", models.IntegerField(default=0, help_text="业务ID")), | ||
("ip", models.CharField(help_text="主机IP", max_length=128)), | ||
("bk_host_id", models.PositiveBigIntegerField(help_text="主机ID")), | ||
( | ||
"event", | ||
models.CharField( | ||
choices=MachineEventType.get_choices(), | ||
help_text="事件类型", | ||
max_length=128, | ||
), | ||
), | ||
( | ||
"to", | ||
models.CharField( | ||
choices=PoolType.get_choices(), | ||
help_text="资源流向", | ||
max_length=128, | ||
), | ||
), | ||
( | ||
"ticket", | ||
models.ForeignKey( | ||
blank=True, | ||
help_text="关联单据", | ||
null=True, | ||
on_delete=django.db.models.deletion.CASCADE, | ||
to="ticket.ticket", | ||
), | ||
), | ||
], | ||
options={ | ||
"verbose_name": "机器事件记录", | ||
"verbose_name_plural": "机器事件记录", | ||
}, | ||
), | ||
] |
Oops, something went wrong.