Skip to content

Commit 3095e7d

Browse files
committed
Merge pull request #42 from Duke-GCB/get-project
Adds methods to get/fetch project by id
2 parents f23d64f + fcbb845 commit 3095e7d

File tree

3 files changed

+18
-1
lines changed

3 files changed

+18
-1
lines changed

ddsc/core/ddsapi.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,14 @@ def get_projects(self):
226226
"""
227227
return self._get("/projects", {})
228228

229+
def get_project_by_id(self, id):
230+
"""
231+
Send GET request to /projects/{id} to get project details
232+
:param id: str uuid of the project
233+
:return: requests.Response containing the successful result
234+
"""
235+
return self._get('/projects/{}'.format(id), {})
236+
229237
def get_file_url(self, file_id):
230238
"""
231239
Send GET to /files/{}/url returning a url to download the file.

ddsc/core/remotestore.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,15 @@ def fetch_remote_project(self, project_name, must_exist=False):
3333
raise ValueError(u'There is no project with the name {}'.format(project_name).encode('utf-8'))
3434
return project
3535

36+
def fetch_remote_project_by_id(self, id):
37+
"""
38+
Retrieves project from via id
39+
:param id: str id of project from data service
40+
:return: RemoteProject we downloaded
41+
"""
42+
response = self.data_service.get_project_by_id(id).json()
43+
return RemoteProject(response)
44+
3645
def _get_my_project(self, project_name):
3746
"""
3847
Return project tree root for project_name.

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33

44
setup(name='DukeDSClient',
5-
version='0.2.2',
5+
version='0.2.3',
66
description='Command line tool(ddsclient) to upload/manage projects on the duke-data-service.',
77
url='https://github.com/Duke-GCB/DukeDSClient',
88
keywords='duke dds dukedataservice',

0 commit comments

Comments
 (0)