from .volc_cloud import VolcCloudNAT


class VolcNAT:
    def __init__(self):
        self.volcano_nat = None
        self.nat_results = []

    def init_cloud_provider(self):
        try:
            self.volcano_nat = VolcCloudNAT()
        except EnvironmentError as e:
            print(f"❌ 火山云 NAT 初始化失败: {e}")

    def collect_nat_eips(self):
        if self.volcano_nat:
            volc_nats = self.volcano_nat.get_nat_eips()
            self.nat_results.extend(volc_nats)

    def print_nat_summary(self):
        for item in self.nat_results:
            print(f"[{item['cloud']}] NAT ID: {item['nat_id']}, 名称: {item['nat_name']}, EIPs: {item['eips']}")
