fnetpepAPI.py 文件源码

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

项目:FileNetPEAPI 作者: wandss 项目源码 文件源码
def getUser(self, search_string):
        """Receives a string and looks for it in directory service. If the
        string search isn't found, the message "User not Found" will be
        returned, otherwise a list with all matching cases, limited to 50
        results will be returned.
        Usage:
        >>> users = pe.getUser('user_name')
        """

        users = []
        user = requests.get(self.client.baseurl+'users',
                            auth=self.client.cred,
                            params={'searchPattern':search_string,
                                    'searchType':4, 'limit':50})
        if user.json().get('users'):            
            for usr in user.json()['users']:
                users.append(usr['displayName'])
        else:
            return "User not Found"
        return users
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号