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
评论列表
文章目录