From be2316e285f4235dd43dd22d8f338528a719e0d2 Mon Sep 17 00:00:00 2001 From: yunchao Date: Fri, 9 Aug 2024 15:16:50 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=9D=83=E9=99=90=E4=B8=AD=E5=BF=83?= =?UTF-8?q?=E8=8B=B1=E6=96=87=E5=90=8D=E6=A0=87=E5=87=86=E5=8C=96=20(close?= =?UTF-8?q?d=20#2380)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../0009_bk_nodeman_202408091509.py | 26 +++++++++++++++++++ .../0009_bk_nodeman_20240809_1509_iam.json | 17 ++++++++++++ 2 files changed, 43 insertions(+) create mode 100644 apps/iam_migration/migrations/0009_bk_nodeman_202408091509.py create mode 100644 support-files/bkiam/0009_bk_nodeman_20240809_1509_iam.json diff --git a/apps/iam_migration/migrations/0009_bk_nodeman_202408091509.py b/apps/iam_migration/migrations/0009_bk_nodeman_202408091509.py new file mode 100644 index 000000000..567ebe786 --- /dev/null +++ b/apps/iam_migration/migrations/0009_bk_nodeman_202408091509.py @@ -0,0 +1,26 @@ +# -*- coding: utf-8 -*- +""" +TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-节点管理(BlueKing-BK-NODEMAN) available. +Copyright (C) 2017-2022 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.db import migrations +from iam.contrib.iam_migration.migrator import IAMMigrator + + +def forward_func(apps, schema_editor): + + migrator = IAMMigrator(Migration.migration_json) + migrator.migrate() + + +class Migration(migrations.Migration): + migration_json = "0009_bk_nodeman_20240809_1509_iam.json" + + dependencies = [("iam_migration", "0008_bk_nodeman_202305121500")] + + operations = [migrations.RunPython(forward_func)] diff --git a/support-files/bkiam/0009_bk_nodeman_20240809_1509_iam.json b/support-files/bkiam/0009_bk_nodeman_20240809_1509_iam.json new file mode 100644 index 000000000..78f1d9232 --- /dev/null +++ b/support-files/bkiam/0009_bk_nodeman_20240809_1509_iam.json @@ -0,0 +1,17 @@ +{ + "system_id":"bk_nodeman", + "operations":[ + { + "operation": "upsert_system", + "data": { + "id": "bk_nodeman", + "name": "节点管理", + "name_en": "NodeMan", + "description": "", + "description_en": "", + "clients": "bk_nodeman,bk_bknodeman", + "provider_config": {"host": "http://__BK_NODEMAN_API_ADDR__", "auth": "basic"} + } + } + ] +} \ No newline at end of file