Skip to content

Commit 18cd64a

Browse files
Added deactivateuser.py program to examples
1 parent 58f05cd commit 18cd64a

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

blackduck/HubRestApi.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -358,6 +358,14 @@ def reset_user_password(self, user_id, new_password):
358358
headers = {'Content-Type':'application/vnd.blackducksoftware.user-1+json', 'Accept': 'application/json'}
359359
data = {'password': new_password}
360360
return self.execute_put(url, data, headers)
361+
362+
def get_last_login(self,sinceDays=60):
363+
url = self.config['baseurl'] + "/api/dormant-users"
364+
param_string = self._get_parameter_string({'sinceDays': sinceDays})
365+
url = "{}{}".format(url, param_string)
366+
headers = {'Accept': 'application/vnd.blackducksoftware.user-4+json'}
367+
response = self.execute_get(url, custom_headers=headers)
368+
return response.json()
361369

362370
###
363371
#

0 commit comments

Comments
 (0)