Skip to content

Commit ded5641

Browse files
committed
Adding download_summary method to v1/files
1 parent fb835e2 commit ded5641

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

pyclowder/api/v1/files.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
import requests
1212
from requests_toolbelt.multipart.encoder import MultipartEncoder
1313

14+
from pyclowder.client import ClowderClient
1415
from pyclowder.collections import get_datasets, get_child_collections
1516
from pyclowder.datasets import get_file_list
1617

@@ -95,6 +96,19 @@ def download_info(connector, client, fileid):
9596

9697
return result
9798

99+
def download_summary(connector, host, key, fileid):
100+
"""Download file summary from Clowder. It's the same as download_info. We have different names for the
101+
same functionality for v2. To be consistent, we are keeping this method in v1,
102+
Keyword arguments:
103+
connector -- connector information, used to get missing parameters and send status updates
104+
host -- the clowder host, including http and port, should end with a /
105+
key -- the secret key to login to clowder
106+
fileid -- the file to fetch metadata of
107+
"""
108+
client = ClowderClient(host=host, key=key)
109+
result = download_info(connector, client, fileid)
110+
return result.json()
111+
98112

99113
def download_metadata(connector, client, fileid, extractor=None):
100114
"""Download file JSON-LD metadata from Clowder.

0 commit comments

Comments
 (0)