From 98142f5c0e1fcd1fbd1065289d5c8648f5634ca2 Mon Sep 17 00:00:00 2001 From: Florent Devin Date: Thu, 25 Mar 2021 16:27:59 +0100 Subject: [PATCH 1/4] feature/dss-10-API_Modification for adding date and last modification on project [ch62224](https://app.clubhouse.io/dataiku/story/62224/api-to-get-project-creation-and-last-modification-date) Two new method/routes added to reflect changes of PublicAPIProjectController (GET /projects/{projectKey}/interest, /projects/{projectKey}/timeline?itemCount) --- dataikuapi/dss/project.py | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/dataikuapi/dss/project.py b/dataikuapi/dss/project.py index 3c74d31b..e19bbf34 100644 --- a/dataikuapi/dss/project.py +++ b/dataikuapi/dss/project.py @@ -249,6 +249,29 @@ def set_permissions(self, permissions): return self.client._perform_empty( "PUT", "/projects/%s/permissions" % self.project_key, body = permissions) + def get_interest(self): + """ + Get the interest of this project. The interest means the number of watchers and the number of star. + + :return: a dict object containing the project's interest + :rtype: dict + """ + return self.client._perform_json("GET","/projects/%s/interest" % self.project_key) + + def get_timeline(self, itemCount=100): + """ + Get a timeline of this project. The timeline consists of information about the creation of this project + (by whom, and when), the last modification of this project (by whom and when), a list of contributors, + and a list of modification. This list contains "itemCount" number of element (default: 100). If itemCount + is greater than the real number of modification, itemCount is adjusted. + + :return: a dict object containing a timeline + :rtype: dict + """ + return self.client._perform_json("GET", "/projects/%s/timeline" % self.project_key, params = { + "itemCount": itemCount + }) + ######################################################## # Datasets ######################################################## From edb53678c71b15c4170fd4e278a3b4b9382aae5e Mon Sep 17 00:00:00 2001 From: Florent Devin Date: Wed, 31 Mar 2021 14:35:49 +0200 Subject: [PATCH 2/4] doc: documentation changed --- dataikuapi/dss/project.py | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/dataikuapi/dss/project.py b/dataikuapi/dss/project.py index e19bbf34..b9d54414 100644 --- a/dataikuapi/dss/project.py +++ b/dataikuapi/dss/project.py @@ -253,7 +253,9 @@ def get_interest(self): """ Get the interest of this project. The interest means the number of watchers and the number of star. - :return: a dict object containing the project's interest + :returns: a dict object containing the interest of the project with two fields: + - starCount: number of star for this project + - watchCount: number of users watching this project :rtype: dict """ return self.client._perform_json("GET","/projects/%s/interest" % self.project_key) @@ -262,10 +264,16 @@ def get_timeline(self, itemCount=100): """ Get a timeline of this project. The timeline consists of information about the creation of this project (by whom, and when), the last modification of this project (by whom and when), a list of contributors, - and a list of modification. This list contains "itemCount" number of element (default: 100). If itemCount - is greater than the real number of modification, itemCount is adjusted. - - :return: a dict object containing a timeline + and a list of modifications. This list of modifications contains a maximum of itemCount elements (default: 100). + If itemCount is greater than the real number of modification, itemCount is adjusted. + + :return: a dict object containing a timeline where the top-level fields are : + - allContributors: all contributors who have been involve in this project + - items: a history of the modifications of the project + - createdBy: who created this project + - createdOn: when the project was created + - lastModifiedBy: who modified this project for the last time + - lastModifiedBy: when this modification took place :rtype: dict """ return self.client._perform_json("GET", "/projects/%s/timeline" % self.project_key, params = { From c442715bf1f40c7bc18979358227e1745434a3cf Mon Sep 17 00:00:00 2001 From: Arnaud PICHERY Date: Fri, 9 Apr 2021 14:08:28 +0200 Subject: [PATCH 3/4] Update project.py Typo --- dataikuapi/dss/project.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dataikuapi/dss/project.py b/dataikuapi/dss/project.py index b9d54414..b604947c 100644 --- a/dataikuapi/dss/project.py +++ b/dataikuapi/dss/project.py @@ -251,10 +251,10 @@ def set_permissions(self, permissions): def get_interest(self): """ - Get the interest of this project. The interest means the number of watchers and the number of star. + Get the interest of this project. The interest means the number of watchers and the number of stars. :returns: a dict object containing the interest of the project with two fields: - - starCount: number of star for this project + - starCount: number of stars for this project - watchCount: number of users watching this project :rtype: dict """ From 834aa81be82035e54aa1c0bbe5c739634ab01c03 Mon Sep 17 00:00:00 2001 From: Arnaud PICHERY Date: Fri, 9 Apr 2021 14:10:26 +0200 Subject: [PATCH 4/4] Improve wording --- dataikuapi/dss/project.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dataikuapi/dss/project.py b/dataikuapi/dss/project.py index b604947c..b1cba81a 100644 --- a/dataikuapi/dss/project.py +++ b/dataikuapi/dss/project.py @@ -262,7 +262,7 @@ def get_interest(self): def get_timeline(self, itemCount=100): """ - Get a timeline of this project. The timeline consists of information about the creation of this project + Get the timeline of this project. The timeline consists of information about the creation of this project (by whom, and when), the last modification of this project (by whom and when), a list of contributors, and a list of modifications. This list of modifications contains a maximum of itemCount elements (default: 100). If itemCount is greater than the real number of modification, itemCount is adjusted.