#! /usr/bin/env python
# -*- coding: utf-8 -*-
# __author__ = "chenwei"
# Date: 2018/5/7

from talos.rpc import get_current_rpc_invoker


def get_tag_info_by_id(ids):
    r = get_current_rpc_invoker()
    try:
        result = r['api/tag/get_tag_by_ids'](ids=ids).unwrap()
    except Exception:
        return None
    return result


def get_tag_id_by_name(name):
    r = get_current_rpc_invoker()
    try:
        result = r['api/tag/get_tag_id_by_name'](name=name).unwrap()
    except Exception:
        return None
    return result
