Bladeren bron

feat:修改监控告警

zhaohaipeng 1 dag geleden
bovenliggende
commit
e57df30590

+ 0 - 0
resource/service/FeiShuService.py → client/FeiShuClient.py


+ 12 - 0
resource/enums/resource.py

@@ -0,0 +1,12 @@
+from enum import Enum
+
+
+class Resource(Enum):
+    KV_STORE = ("KVStore", "数据库", "存储")
+    MySQL = ("MySQL", "数据库", "存储")
+    MongoDB = ("MongoDB", "数据库", "存储")
+
+    def __init__(self, produce, resource_name, resource_type):
+        self.produce = produce
+        self.resource_name = resource_name
+        self.resource_type = resource_type

+ 0 - 68
resource/kv_store_monitor.py

@@ -1,68 +0,0 @@
-from datetime import datetime
-
-from resource.enums.region import Region
-from resource.service.FeiShuService import FeiShuService
-from resource.service.KVStoreService import KVStoreService
-from resource.utils.utils import value_covert, bottom_right, convert_storage_unit
-
-kv_store_service = KVStoreService()
-fei_shu_service = FeiShuService()
-
-fei_shu_spread_sheet_token = "XzQGsheQzhk74rtknKacClASnTc"
-fei_shu_sheet_id = "25dce4"
-
-tenant_access_token = fei_shu_service.get_tenant_access_token("cli_a89702999f3c900b", "47ewnaxRqJAvHYdUR8idHgfzfeqAu0Pz")
-
-charge_type_map = {
-    "PrePaid": "预付费",
-    "PostPaid": "后付费",
-}
-
-architecture_type_map = {
-    "cluster": "集群版",
-    "standard": "标准版",
-    "rwsplit": "读写分离版"
-}
-
-status_map = {
-    "Normal": "正常",
-    "Creating": "创建中",
-    "Changing": "修改中",
-    "Inactive": "被禁用",
-    "Flushing": "清除中",
-    "Released": "已释放",
-    "Transforming": "转换中",
-    "Unavailable": "服务停止",
-    "Error": "创建失败",
-    "Migrating": "迁移中",
-    "BackupRecovering": "备份恢复中",
-    "MinorVersionUpgrading": "小版本升级中",
-    "NetworkModifying": "网络变更中",
-    "SSLModifying": "SSL 变更中",
-    "MajorVersionUpgrading": "大版本升级中,可正常访问"
-}
-
-
-def main():
-    region_list = [Region.HANG_ZHOU, Region.HONG_KONG, Region.US_WEST, Region.SOUTHEAST]
-    for region in region_list:
-        all_instances = kv_store_service.get_all_instance(region=region)
-        for instance in all_instances:
-            dt = datetime.now().strftime('%Y-%m-%d')
-            instance_id = instance.instance_id  # 实例ID
-            instance_name = instance.instance_name  # 实例名
-            instance_status = value_covert(instance.instance_status, status_map)  # 实例状态
-            instance_type = instance.instance_type  # 实例类型
-            zone_id = instance.zone_id  # 可用区ID
-            architecture_type = value_covert(instance.architecture_type, architecture_type_map)  # 架构类型
-            engine_version = instance.engine_version  # 兼容的Redis版本
-            charge_type = value_covert(instance.charge_type, charge_type_map)  # 付费类型
-            capacity = convert_storage_unit(instance.capacity, "mb", "gb")  # 容量
-            values = [[dt, region.desc, zone_id, instance_id, instance_name, instance_status, instance_type, architecture_type, engine_version, charge_type, capacity]]
-            start_col = "A2"
-            end_col = bottom_right(start_col, values)
-            fei_shu_service.spreadsheet_values_prepend(tenant_access_token, fei_shu_spread_sheet_token, f"{fei_shu_sheet_id}!{start_col}:{end_col}", values)
-
-
-if __name__ == "__main__":
-    main()

+ 4 - 0
resource/monitor/__init__.py

@@ -0,0 +1,4 @@
+from resource.monitor.kv_store_monitor import KVStoreMonitor
+from resource.monitor.mysql_monitor import MySQLMonitor
+
+__all__ = ['MySQLMonitor', 'KVStoreMonitor']

+ 33 - 0
resource/monitor/basic_monitor.py

@@ -0,0 +1,33 @@
+from abc import ABC, abstractmethod
+from typing import Optional
+
+from client.FeiShuClient import FeiShuService
+from resource.enums.resource import Resource
+
+
+class BasicMonitor(ABC):
+    resource: Optional[Resource] = None
+    _monitors = []
+
+    def __init__(self):
+        self.access_key_id = "LTAI5tRwjztCCwQNBB6nW1dY"
+        self.access_key_secret = "NaTnMxrGEJh64tLly7Kb5tr166Xpos"
+        self.fei_shu_spread_sheet_token = "XzQGsheQzhk74rtknKacClASnTc"
+        self.fei_shu_service = FeiShuService()
+
+    def __init_subclass__(cls, **kwargs):
+        super().__init_subclass__(**kwargs)
+        if cls != BasicMonitor:
+            cls._monitors.append(cls)
+
+    @classmethod
+    def get_monitors(cls):
+        return cls._monitors
+
+    def fei_shu_tenant_access_token(self, app_id: str = "cli_a89702999f3c900b", app_secret: str = "47ewnaxRqJAvHYdUR8idHgfzfeqAu0Pz") -> str:
+        tenant_access_token = self.fei_shu_service.get_tenant_access_token(app_id, app_secret)
+        return tenant_access_token
+
+    @abstractmethod
+    def run(self):
+        raise NotImplementedError("该方法没有被实现")

+ 62 - 3
resource/service/KVStoreService.py → resource/monitor/kv_store_monitor.py

@@ -7,13 +7,47 @@ from alibabacloud_r_kvstore20150101.models import *
 from alibabacloud_tea_openapi import models
 
 from resource.enums.region import Region
+from resource.enums.resource import Resource
+from resource.monitor.basic_monitor import BasicMonitor
+from resource.utils import *
 
+charge_type_map = {
+    "PrePaid": "预付费",
+    "PostPaid": "后付费",
+}
+
+architecture_type_map = {
+    "cluster": "集群版",
+    "standard": "标准版",
+    "rwsplit": "读写分离版"
+}
+
+status_map = {
+    "Normal": "正常",
+    "Creating": "创建中",
+    "Changing": "修改中",
+    "Inactive": "被禁用",
+    "Flushing": "清除中",
+    "Released": "已释放",
+    "Transforming": "转换中",
+    "Unavailable": "服务停止",
+    "Error": "创建失败",
+    "Migrating": "迁移中",
+    "BackupRecovering": "备份恢复中",
+    "MinorVersionUpgrading": "小版本升级中",
+    "NetworkModifying": "网络变更中",
+    "SSLModifying": "SSL 变更中",
+    "MajorVersionUpgrading": "大版本升级中,可正常访问"
+}
+
+
+class KVStoreMonitor(BasicMonitor):
+    resource = Resource.KV_STORE
 
-class KVStoreService(object):
     def __init__(self):
+        super().__init__()
         self.region_client_map: Dict[Region, KVStoreClient] = {}
-        self.access_key_id = "LTAI5tRwjztCCwQNBB6nW1dY"
-        self.access_key_secret = "NaTnMxrGEJh64tLly7Kb5tr166Xpos"
+        self.fei_shu_sheet_id = "25dce4"
 
     def create_client(self, region: Region) -> KVStoreClient:
         config = models.Config(
@@ -62,3 +96,28 @@ class KVStoreService(object):
         )
         response = self.get_kvstore_client(region).describe_history_monitor_values(request)
         return response.body
+
+    def run(self):
+        region_list = [Region.HANG_ZHOU, Region.HONG_KONG, Region.US_WEST, Region.SOUTHEAST]
+        for region in region_list:
+            all_instances = self.get_all_instance(region=region)
+            for instance in all_instances:
+                dt = datetime.now().strftime('%Y-%m-%d')
+                instance_id = instance.instance_id  # 实例ID
+                instance_name = instance.instance_name  # 实例名
+                instance_status = value_with_mapped_note(instance.instance_status, status_map)  # 实例状态
+                instance_type = instance.instance_type  # 实例类型
+                zone_id = instance.zone_id  # 可用区ID
+                architecture_type = value_with_mapped_note(instance.architecture_type, architecture_type_map)  # 架构类型
+                engine_version = instance.engine_version  # 兼容的Redis版本
+                charge_type = value_with_mapped_note(instance.charge_type, charge_type_map)  # 付费类型
+                capacity = convert_storage_unit(instance.capacity, "mb", "gb")  # 容量
+                values = [[dt, region.desc, zone_id, instance_id, instance_name, instance_status, instance_type, architecture_type, engine_version, charge_type, capacity]]
+                start_col = "A2"
+                end_col = calculate_excel_range_bottom_right_cell(start_col, values)
+                self.fei_shu_service.spreadsheet_values_prepend(
+                    self.fei_shu_tenant_access_token(),
+                    self.fei_shu_spread_sheet_token,
+                    f"{self.fei_shu_sheet_id}!{start_col}:{end_col}",
+                    values
+                )

+ 162 - 0
resource/monitor/mysql_monitor.py

@@ -0,0 +1,162 @@
+import uuid
+from datetime import datetime
+from typing import Dict, List, Tuple
+
+from alibabacloud_rds20140815.client import Client as RDSClient
+from alibabacloud_rds20140815.models import DescribeDBInstancesResponseBodyItemsDBInstance, DescribeDBInstancesRequest, DescribeDBInstanceAttributeRequest, \
+    DescribeDBInstanceAttributeResponseBodyItemsDBInstanceAttribute
+from alibabacloud_tea_openapi import models
+
+from resource.enums.region import Region
+from resource.enums.resource import Resource
+from resource.monitor.basic_monitor import BasicMonitor
+from resource.utils import *
+
+instance_type_map = {
+    "Primary": "主实例",
+    "Readonly": "只读实例",
+    "Guard": "灾备实例",
+    "Temp": "临时实例"
+}
+
+status_map = {
+    "Creating": "创建中",
+    "Running": "使用中",
+    "Deleting": "删除中",
+    "Rebooting": "重启中",
+    "Stopping": "暂停中",
+    "Stopped": "已暂停",
+    "DBInstanceClassChanging": "升降级中",
+    "TRANSING": "迁移中",
+    "EngineVersionUpgrading": "迁移版本中",
+    "TransingToOthers": "迁移数据到其他RDS中",
+    "GuardDBInstanceCreating": "生产灾备实例中",
+    "Restoring": "备份恢复中",
+    "Importing": "数据导入中",
+    "ImportingFromOthers": "从其他RDS实例导入数据中",
+    "DBInstanceNetTypeChanging": "内外网切换中",
+    "GuardSwitching": "容灾切换中",
+    "INS_CLONING": "实例克隆中",
+    "Released": "已释放实例"
+}
+
+storage_type_map = {
+    "local_ssd": "高性能本地盘",
+    "ephemeral_ssd": "性能本地盘",
+    "cloud_ssd": "SSD 云盘",
+    "general_essd": "高性能云盘",
+    "cloud_essd0": "ESSD PL0 云盘",
+    "cloud_essd": "ESSD PL1 云盘",
+    "cloud_essd2": "ESSD PL2 云盘",
+    "cloud_essd3": "ESSD PL3 云盘"
+}
+
+pay_type_map = {
+    "Postpaid": "按量付费",
+    "Prepaid": "包年包月",
+    "SERVERLESS": "Serverless"
+}
+
+category_map = {
+    "Basic": "基础系列",
+    "HighAvailability": "高可用系列",
+    "cluster": "MySQL 集群系列",
+    "AlwaysOn": "SQL Server 集群系列",
+    "Finance": "三节点企业系列",
+    "Serverless_basic": "Serverless 基础系列"
+}
+
+
+class MySQLMonitor(BasicMonitor):
+    resource = Resource.MySQL
+
+    def __init__(self):
+        super().__init__()
+        self.region_client_map: Dict[Region, RDSClient] = {}
+        self.fei_shu_sheet_id = "R50CB5"
+
+    def create_client(self, region: Region) -> RDSClient:
+        config = models.Config(
+            access_key_id=self.access_key_id,
+            access_key_secret=self.access_key_secret,
+            endpoint=region.rds_endpoint
+        )
+        return RDSClient(config)
+
+    def get_rds_client(self, region: Region) -> RDSClient:
+        if region in self.region_client_map:
+            return self.region_client_map[region]
+
+        client = self.create_client(region)
+        self.region_client_map[region] = client
+        return client
+
+    def get_all_instance(self, region: Region) -> List[DescribeDBInstancesResponseBodyItemsDBInstance]:
+        page_number = 0
+        all_instances: List[DescribeDBInstancesResponseBodyItemsDBInstance] = []
+        while True:
+            next_token, instances = self.get_instances(region=region, page_number=page_number)
+            if not instances:
+                break
+            all_instances.extend(instances)
+            page_number += 1
+        return all_instances
+
+    def get_instances(self, region: Region, page_size: int = 100, page_number: int = 0, next_token: str = "") -> Tuple[str, List[DescribeDBInstancesResponseBodyItemsDBInstance]]:
+        client = self.get_rds_client(region)
+        request = DescribeDBInstancesRequest(
+            client_token=self.gen_request_id(),
+            page_size=page_size,
+            page_number=page_number,
+            region_id=region.region,
+            instance_level=1,
+        )
+        response = client.describe_dbinstances(request)
+        body = response.body
+        return body.next_token, body.items.dbinstance
+
+    def get_instance_detail(self, region: Region, instance_id: str) -> List[DescribeDBInstanceAttributeResponseBodyItemsDBInstanceAttribute]:
+        client = self.get_rds_client(region)
+        request = DescribeDBInstanceAttributeRequest(
+            dbinstance_id=instance_id
+        )
+        response = client.describe_dbinstance_attribute(request)
+        return response.body.items.dbinstance_attribute
+
+    @staticmethod
+    def gen_request_id():
+        return str(uuid.uuid4()).replace("-", "")
+
+    def run(self):
+        region_list = [Region.HANG_ZHOU, Region.HONG_KONG, Region.US_WEST, Region.SOUTHEAST]
+        for region in region_list:
+            all_instances = self.get_all_instance(region=region)
+            for instance in all_instances:
+                dt = datetime.now().strftime('%Y-%m-%d')
+                instance_id = instance.dbinstance_id
+                instance_name = instance.dbinstance_description
+                category = value_with_mapped_note(instance.category, category_map)
+                memory = convert_storage_unit(instance.dbinstance_memory, "mb", "gb")
+                cpu = instance.dbinstance_cpu
+                status = value_with_mapped_note(instance.dbinstance_status, status_map)
+                instance_type = value_with_mapped_note(instance.dbinstance_type, instance_type_map)
+                engine = instance.engine
+                engine_version = instance.engine_version
+                zone_id = instance.zone_id
+
+                attributes = self.get_instance_detail(region, instance_id)
+                attribute = attributes[0]
+                disk_used = convert_storage_unit(attribute.dbinstance_disk_used, "b", "gb")
+                storage = attribute.dbinstance_storage
+                storage_type = value_with_mapped_note(attribute.dbinstance_storage_type, storage_type_map)
+                pay_type = value_with_mapped_note(attribute.pay_type, pay_type_map)
+
+                values = [[dt, region.desc, zone_id, instance_id, instance_name, category, status, instance_type, pay_type, engine, engine_version, memory, cpu, disk_used, storage, storage_type]]
+                start_col = "A2"
+                end_col = calculate_excel_range_bottom_right_cell(start_col, values)
+                self.fei_shu_service.spreadsheet_values_prepend(
+                    self.fei_shu_tenant_access_token(),
+                    self.fei_shu_spread_sheet_token,
+                    f"{self.fei_shu_sheet_id}!{start_col}:{end_col}",
+                    values
+                )

+ 0 - 102
resource/rds_monitor.py

@@ -1,102 +0,0 @@
-from datetime import datetime
-
-from resource.enums.region import Region
-from resource.service.FeiShuService import FeiShuService
-from resource.utils.utils import value_covert, bottom_right, convert_storage_unit
-from service.RDSServicee import RDSService
-
-rds_service = RDSService()
-fei_shu_service = FeiShuService()
-
-fei_shu_spread_sheet_token = "XzQGsheQzhk74rtknKacClASnTc"
-fei_shu_sheet_id = "R50CB5"
-
-tenant_access_token = fei_shu_service.get_tenant_access_token("cli_a89702999f3c900b", "47ewnaxRqJAvHYdUR8idHgfzfeqAu0Pz")
-
-instance_type_map = {
-    "Primary": "主实例",
-    "Readonly": "只读实例",
-    "Guard": "灾备实例",
-    "Temp": "临时实例"
-}
-
-status_map = {
-    "Creating": "创建中",
-    "Running": "使用中",
-    "Deleting": "删除中",
-    "Rebooting": "重启中",
-    "Stopping": "暂停中",
-    "Stopped": "已暂停",
-    "DBInstanceClassChanging": "升降级中",
-    "TRANSING": "迁移中",
-    "EngineVersionUpgrading": "迁移版本中",
-    "TransingToOthers": "迁移数据到其他RDS中",
-    "GuardDBInstanceCreating": "生产灾备实例中",
-    "Restoring": "备份恢复中",
-    "Importing": "数据导入中",
-    "ImportingFromOthers": "从其他RDS实例导入数据中",
-    "DBInstanceNetTypeChanging": "内外网切换中",
-    "GuardSwitching": "容灾切换中",
-    "INS_CLONING": "实例克隆中",
-    "Released": "已释放实例"
-}
-
-storage_type_map = {
-    "local_ssd": "高性能本地盘",
-    "ephemeral_ssd": "性能本地盘",
-    "cloud_ssd": "SSD 云盘",
-    "general_essd": "高性能云盘",
-    "cloud_essd0": "ESSD PL0 云盘",
-    "cloud_essd": "ESSD PL1 云盘",
-    "cloud_essd2": "ESSD PL2 云盘",
-    "cloud_essd3": "ESSD PL3 云盘"
-}
-
-pay_type_map = {
-    "Postpaid": "按量付费",
-    "Prepaid": "包年包月",
-    "SERVERLESS": "Serverless"
-}
-
-category_map = {
-    "Basic": "基础系列",
-    "HighAvailability": "高可用系列",
-    "cluster": "MySQL 集群系列",
-    "AlwaysOn": "SQL Server 集群系列",
-    "Finance": "三节点企业系列",
-    "Serverless_basic": "Serverless 基础系列"
-}
-
-
-def main():
-    region_list = [Region.HANG_ZHOU, Region.HONG_KONG, Region.US_WEST, Region.SOUTHEAST]
-    for region in region_list:
-        all_instances = rds_service.get_all_instance(region=region)
-        for instance in all_instances:
-            dt = datetime.now().strftime('%Y-%m-%d')
-            instance_id = instance.dbinstance_id
-            instance_name = instance.dbinstance_description
-            category = value_covert(instance.category, category_map)
-            memory = convert_storage_unit(instance.dbinstance_memory, "mb", "gb")
-            cpu = instance.dbinstance_cpu
-            status = value_covert(instance.dbinstance_status, status_map)
-            instance_type = value_covert(instance.dbinstance_type, instance_type_map)
-            engine = instance.engine
-            engine_version = instance.engine_version
-            zone_id = instance.zone_id
-
-            attributes = rds_service.get_instance_detail(region, instance_id)
-            attribute = attributes[0]
-            disk_used = convert_storage_unit(attribute.dbinstance_disk_used, "b", "gb")
-            storage = attribute.dbinstance_storage
-            storage_type = value_covert(attribute.dbinstance_storage_type, storage_type_map)
-            pay_type = value_covert(attribute.pay_type, pay_type_map)
-
-            values = [[dt, region.desc, zone_id, instance_id, instance_name, category, status, instance_type, pay_type, engine, engine_version, memory, cpu, disk_used, storage, storage_type]]
-            start_col = "A2"
-            end_col = bottom_right(start_col, values)
-            fei_shu_service.spreadsheet_values_prepend(tenant_access_token, fei_shu_spread_sheet_token, f"{fei_shu_sheet_id}!{start_col}:{end_col}", values)
-
-
-if __name__ == "__main__":
-    main()

+ 16 - 0
resource/scheduler.py

@@ -0,0 +1,16 @@
+from resource.monitor.basic_monitor import BasicMonitor
+
+
+def main():
+    monitors = BasicMonitor.get_monitors()
+    for monitor in monitors:
+        print(f"资源 {monitor.resource.produce} 监控任务开始执行")
+        try:
+            monitor().run()
+        except Exception as e:
+            print(f"资源 {monitor.resource.produce} 监控任务执行异常: {e}")
+        print(f"资源 {monitor.resource.produce} 监控任务执行完成")
+
+
+if __name__ == '__main__':
+    main()

+ 0 - 68
resource/service/RDSServicee.py

@@ -1,68 +0,0 @@
-import uuid
-from typing import Dict, List, Tuple
-
-from alibabacloud_rds20140815.client import Client as RDSClient
-from alibabacloud_rds20140815.models import DescribeDBInstancesResponseBodyItemsDBInstance, DescribeDBInstancesRequest, DescribeDBInstanceAttributeRequest, \
-    DescribeDBInstanceAttributeResponseBodyItemsDBInstanceAttribute
-from alibabacloud_tea_openapi import models
-
-from resource.enums.region import Region
-
-
-class RDSService(object):
-    def __init__(self):
-        self.access_key_id = "LTAI5tRwjztCCwQNBB6nW1dY"
-        self.access_key_secret = "NaTnMxrGEJh64tLly7Kb5tr166Xpos"
-        self.region_client_map: Dict[Region, RDSClient] = {}
-
-    def create_client(self, region: Region) -> RDSClient:
-        config = models.Config(
-            access_key_id=self.access_key_id,
-            access_key_secret=self.access_key_secret,
-            endpoint=region.rds_endpoint
-        )
-        return RDSClient(config)
-
-    def get_rds_client(self, region: Region) -> RDSClient:
-        if region in self.region_client_map:
-            return self.region_client_map[region]
-
-        client = self.create_client(region)
-        self.region_client_map[region] = client
-        return client
-
-    def get_all_instance(self, region: Region) -> List[DescribeDBInstancesResponseBodyItemsDBInstance]:
-        page_number = 0
-        all_instances: List[DescribeDBInstancesResponseBodyItemsDBInstance] = []
-        while True:
-            next_token, instances = self.get_instances(region=region, page_number=page_number)
-            if not instances:
-                break
-            all_instances.extend(instances)
-            page_number += 1
-        return all_instances
-
-    def get_instances(self, region: Region, page_size: int = 100, page_number: int = 0, next_token: str = "") -> Tuple[str, List[DescribeDBInstancesResponseBodyItemsDBInstance]]:
-        client = self.get_rds_client(region)
-        request = DescribeDBInstancesRequest(
-            client_token=self.gen_request_id(),
-            page_size=page_size,
-            page_number=page_number,
-            region_id=region.region,
-            instance_level=1,
-        )
-        response = client.describe_dbinstances(request)
-        body = response.body
-        return body.next_token, body.items.dbinstance
-
-    def get_instance_detail(self, region: Region, instance_id: str) -> List[DescribeDBInstanceAttributeResponseBodyItemsDBInstanceAttribute]:
-        client = self.get_rds_client(region)
-        request = DescribeDBInstanceAttributeRequest(
-            dbinstance_id=instance_id
-        )
-        response = client.describe_dbinstance_attribute(request)
-        return response.body.items.dbinstance_attribute
-
-    @staticmethod
-    def gen_request_id():
-        return str(uuid.uuid4()).replace("-", "")

+ 0 - 0
resource/service/__init__.py


+ 5 - 0
resource/utils/__init__.py

@@ -0,0 +1,5 @@
+from resource.utils.utils import value_with_mapped_note, convert_storage_unit, calculate_excel_range_bottom_right_cell
+
+__all__ = [
+    "value_with_mapped_note", "convert_storage_unit", "calculate_excel_range_bottom_right_cell"
+]

+ 6 - 6
resource/utils/utils.py

@@ -2,14 +2,14 @@ import re
 from typing import Dict
 
 
-def col_to_num(s):
+def excel_column_name_to_number(s):
     n = 0
     for c in s.upper():
         n = n * 26 + ord(c) - 64
     return n
 
 
-def num_to_col(n):
+def excel_column_number_to_name(n):
     s = ""
     while n:
         n, r = divmod(n - 1, 26)
@@ -17,18 +17,18 @@ def num_to_col(n):
     return s
 
 
-def bottom_right(start_cell, data):
+def calculate_excel_range_bottom_right_cell(start_cell, data):
     col, row = re.match(r"([A-Za-z]+)(\d+)", start_cell).groups()
     rows = len(data)
     cols = len(data[0]) if rows else 0
 
-    end_col = col_to_num(col) + cols - 1
+    end_col = excel_column_name_to_number(col) + cols - 1
     end_row = int(row) + rows - 1
 
-    return f"{num_to_col(end_col)}{end_row}"
+    return f"{excel_column_number_to_name(end_col)}{end_row}"
 
 
-def value_covert(value: str, map_dict: Dict[str, str]) -> str:
+def value_with_mapped_note(value: str, map_dict: Dict[str, str]) -> str:
     if not map_dict:
         return value