Skip to content

Commit 5a3696b

Browse files
committed
added upload for articles
1 parent 274cbfb commit 5a3696b

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

dataikuapi/dss/wiki.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,18 @@ def set(self, article_with_payload):
9999
"""
100100
return self.client._perform_json("PUT", "/projects/%s/wiki/%s" % (self.project_key, urllib.quote(self.article_id)), body=article_with_payload)
101101

102+
def upload(self, fp):
103+
"""
104+
Upload an attachment file and attaches it to the article
105+
106+
Args:
107+
A file-like object that represents the upload file
108+
109+
Returns:
110+
the updated article
111+
"""
112+
return self.client._perform_json("POST", "/projects/%s/wiki/%s/upload" % (self.project_key, urllib.quote(self.article_id)), files={"file":fp})
113+
102114
def delete(self):
103115
"""
104116
Delete the article

0 commit comments

Comments
 (0)