search.py 文件源码

python
阅读 40 收藏 0 点赞 0 评论 0

项目:globus-cli 作者: globus 项目源码 文件源码
def endpoint_search(filter_fulltext, filter_owner_id, filter_scope):
    """
    Executor for `globus endpoint search`
    """
    if filter_scope == 'all' and not filter_fulltext:
        raise click.UsageError(
            'When searching all endpoints (--filter-scope=all, the default), '
            'a full-text search filter is required. Other scopes (e.g. '
            '--filter-scope=recently-used) may be used without specifying '
            'an additional filter.')

    client = get_client()

    owner_id = filter_owner_id
    if owner_id:
        owner_id = maybe_lookup_identity_id(owner_id)

    search_iterator = client.endpoint_search(
        filter_fulltext=filter_fulltext, filter_scope=filter_scope,
        filter_owner_id=owner_id)

    formatted_print(search_iterator, fields=ENDPOINT_LIST_FIELDS,
                    json_converter=iterable_response_to_dict)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号