def METHOD_NAME(params):
    """
    Get the nbd image uri:
      tcp: nbd://<server-ip>[:<port>]/[<export>]
      unix domain socket: nbd+unix:///[<export>]?socket=<domain-socket>
    :param params: image specified params
    :return: nbd image uri string
    """
    server = params.get('nbd_server')
    unix_socket = params.get('nbd_unix_socket')
    export_name = '/%s' % params['nbd_export_name'] if params.get(
        'nbd_export_name') else ''
    if server:
        port = ':%s' % params['nbd_port'] if params.get('nbd_port') else ''
        return 'nbd://{server}{port}{export}'.format(server=server,
                                                     port=port,
                                                     export=export_name)
    elif unix_socket:
        return 'nbd+unix://{export}?socket={sock}'.format(export=export_name,
                                                          sock=unix_socket)
    raise ValueError('Either nbd_server or nbd_unix_socket is required.')