From 8ad789b03f72718153cb7aa15857750e7808ce54 Mon Sep 17 00:00:00 2001 From: Jean-Carol Forato Date: Fri, 18 Nov 2022 13:58:16 +0100 Subject: [PATCH 1/3] Add support for list_installs The Apps interface now supports the list_installs method. ref: https://api.simplemdm.com/#list-installs --- SimpleMDMpy/Apps.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/SimpleMDMpy/Apps.py b/SimpleMDMpy/Apps.py index d16bad0..469c1ba 100644 --- a/SimpleMDMpy/Apps.py +++ b/SimpleMDMpy/Apps.py @@ -48,3 +48,9 @@ def delete_app(self, app_id): url = self.url + "/" + app_id data = {} return self._delete_data(url, data) #pylint: disable=too-many-function-args + + def list_installs(self, app_id): + """Returns a listing of the devices that an app is installed on.""" + url = self.url + "/" + app_id + "/installs" + data = {} + return self._get_data(url, data) From 7a02bd2300247f032ac76b9edcc66d4bcb9b65a3 Mon Sep 17 00:00:00 2001 From: Jean-Carol Forato Date: Fri, 18 Nov 2022 14:04:13 +0100 Subject: [PATCH 2/3] Remove parameter The data parameter is already set to None by default. --- SimpleMDMpy/Apps.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/SimpleMDMpy/Apps.py b/SimpleMDMpy/Apps.py index 469c1ba..b077ad8 100644 --- a/SimpleMDMpy/Apps.py +++ b/SimpleMDMpy/Apps.py @@ -52,5 +52,4 @@ def delete_app(self, app_id): def list_installs(self, app_id): """Returns a listing of the devices that an app is installed on.""" url = self.url + "/" + app_id + "/installs" - data = {} - return self._get_data(url, data) + return self._get_data(url) From 5d6c6cb5f4a0e916696e2db983b346e409825fe2 Mon Sep 17 00:00:00 2001 From: Jean-Carol Forato Date: Fri, 18 Nov 2022 14:05:16 +0100 Subject: [PATCH 3/3] Simplify code We don't use any argument when getting data. --- SimpleMDMpy/Apps.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/SimpleMDMpy/Apps.py b/SimpleMDMpy/Apps.py index b077ad8..a9244d6 100644 --- a/SimpleMDMpy/Apps.py +++ b/SimpleMDMpy/Apps.py @@ -51,5 +51,4 @@ def delete_app(self, app_id): def list_installs(self, app_id): """Returns a listing of the devices that an app is installed on.""" - url = self.url + "/" + app_id + "/installs" - return self._get_data(url) + return self._get_data(self.url + "/" + app_id + "/installs")