def METHOD_NAME(self, version_inst_ids, category=None):
    """获取实例"""
    all_insts = InstanceConfig.objects.filter(instance_id__in=version_inst_ids, is_deleted=False)
    if category:
        all_insts.filter(category__in=category)
    ret_data = []
    for info in all_insts:
        conf = json.loads(info.config)
        metadata = conf.get("metadata") or {}
        labels = metadata.get("labels") or {}
        cluster_id = labels.get("io.tencent.bcs.clusterid")
        if not cluster_id:
            continue
        ret_data.append(
            {"id": info.id, "version_inst_id": info.instance_id, "cluster_id": cluster_id, "name": info.name}
        )
    return ret_data