-
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.
# Reviewed, transaction id: 16342
- Loading branch information
Showing
17 changed files
with
254 additions
and
31 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
79 changes: 79 additions & 0 deletions
79
dbm-ui/backend/db_meta/migrations/0042_auto_20240823_1533.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,79 @@ | ||
# Generated by Django 3.2.25 on 2024-08-23 07:33 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
("db_meta", "0041_auto_20240819_1031"), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name="cluster", | ||
name="tags", | ||
field=models.ManyToManyField(blank=True, help_text="标签(外键)", to="db_meta.Tag"), | ||
), | ||
migrations.AddField( | ||
model_name="tag", | ||
name="key", | ||
field=models.CharField(default="", help_text="标签键", max_length=64), | ||
), | ||
migrations.AddField( | ||
model_name="tag", | ||
name="value", | ||
field=models.CharField(default="", help_text="标签值", max_length=64), | ||
), | ||
migrations.AlterField( | ||
model_name="spec", | ||
name="cpu", | ||
field=models.JSONField(help_text='cpu规格描述:{"min":1,"max":10}', null=True), | ||
), | ||
migrations.AlterField( | ||
model_name="spec", | ||
name="device_class", | ||
field=models.JSONField(help_text='实际机器机型: ["class1","class2"]', null=True), | ||
), | ||
migrations.AlterField( | ||
model_name="spec", | ||
name="mem", | ||
field=models.JSONField(help_text='mem规格描述:{"min":100,"max":1000}', null=True), | ||
), | ||
migrations.AlterField( | ||
model_name="spec", | ||
name="qps", | ||
field=models.JSONField(default=dict, help_text='qps规格描述:{"min": 1, "max": 100}'), | ||
), | ||
migrations.AlterField( | ||
model_name="spec", | ||
name="storage_spec", | ||
field=models.JSONField(help_text='存储磁盘需求配置:[{"mount_point":"/data","size":500,"type":"ssd"}]', null=True), | ||
), | ||
migrations.AlterField( | ||
model_name="tag", | ||
name="bk_biz_id", | ||
field=models.IntegerField(default=0, help_text="业务 ID"), | ||
), | ||
migrations.AlterField( | ||
model_name="tag", | ||
name="type", | ||
field=models.CharField( | ||
choices=[("custom", "自定义标签"), ("system", "系统标签"), ("builtin", "内置标签")], | ||
help_text="tag类型", | ||
max_length=64, | ||
), | ||
), | ||
migrations.AlterUniqueTogether( | ||
name="tag", | ||
unique_together={("bk_biz_id", "key", "value")}, | ||
), | ||
migrations.RemoveField( | ||
model_name="tag", | ||
name="cluster", | ||
), | ||
migrations.RemoveField( | ||
model_name="tag", | ||
name="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
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
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,10 @@ | ||
# -*- coding: utf-8 -*- | ||
""" | ||
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. | ||
""" |
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,42 @@ | ||
# -*- coding: utf-8 -*- | ||
""" | ||
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 typing import Dict, List | ||
|
||
|
||
class TagHandler: | ||
"""标签的操作类""" | ||
|
||
def batch_set_tags(self, tag_ids: List[int]): | ||
""" | ||
给资源批量设置标签 | ||
""" | ||
# 1. 判断标签中 key 是否允许多值 | ||
|
||
# 2. 批量设置标签 | ||
pass | ||
|
||
def delete_tags(self, tag_ids: List[int]): | ||
""" | ||
删除标签 | ||
""" | ||
# 1. 检查标签是否被引用 | ||
|
||
# 2. 批量删除标签 | ||
|
||
def create_tags(self, tags: List[Dict[str, str]]): | ||
""" | ||
批量创建标签 | ||
""" | ||
|
||
def list_tags(self): | ||
""" | ||
标签列表 | ||
""" |
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,20 @@ | ||
# -*- coding: utf-8 -*- | ||
""" | ||
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 rest_framework import serializers | ||
|
||
from backend.bk_web.serializers import AuditedSerializer | ||
|
||
|
||
class TagSerializer(AuditedSerializer, serializers.ModelSerializer): | ||
""" | ||
标签序列化器 | ||
""" |
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 @@ | ||
# -*- coding: utf-8 -*- | ||
""" | ||
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 rest_framework.routers import DefaultRouter | ||
|
||
from . import views | ||
|
||
routers = DefaultRouter(trailing_slash=True) | ||
routers.register("", views.TagViewSet, basename="tag") | ||
|
||
urlpatterns = routers.urls |
Oops, something went wrong.