from typing import Dict


def parse_node_id(node_id: str) -> Dict:
    """
    解析节点ID
    :param node_id: 节点ID "host|instance|host|123"
    :return: {
        "object_type": "HOST",
        "node_type": "INSTANCE",
        "type": "host",
        "id": 123,
    }
    """
    object_type, node_type, _type, _id = node_id.split("|")
    return {
        "object_type": object_type.upper(),
        "node_type": node_type.upper(),
        "type": _type,
        "id": _id,
    }