aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlice Ferrazzi <alicef@gentoo.org>2017-06-22 05:50:53 +0900
committerAlice Ferrazzi <alicef@gentoo.org>2017-06-22 05:50:53 +0900
commitbd710bd451495d276f4efea7f28c1173ef84df40 (patch)
tree8c3bea8d7c27367b2656adb5cd4388bb3176816d /elivepatch_client/client/restful.py
parentadded build livepatch option after sending config file and patch file (diff)
downloadelivepatch-bd710bd451495d276f4efea7f28c1173ef84df40.tar.gz
elivepatch-bd710bd451495d276f4efea7f28c1173ef84df40.tar.bz2
elivepatch-bd710bd451495d276f4efea7f28c1173ef84df40.zip
Added build livepatch client caller
Diffstat (limited to 'elivepatch_client/client/restful.py')
-rw-r--r--elivepatch_client/client/restful.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/elivepatch_client/client/restful.py b/elivepatch_client/client/restful.py
index b233144..0323e46 100644
--- a/elivepatch_client/client/restful.py
+++ b/elivepatch_client/client/restful.py
@@ -15,8 +15,13 @@ class ManaGer(object):
print(r.text)
print(r.json())
- def send_config(self, send_file, name_file):
- url = self.server_url+'/elivepatch/api/v1.0/config'
+ def send_file(self, send_file, name_file, api):
+ url = self.server_url+ api
files = {'file': (name_file, open(send_file, 'rb'), 'multipart/form-data', {'Expires': '0'})}
r = requests.post(url, files=files)
+ def build_livepatch(self):
+ url = self.server_url+'/elivepatch/api/v1.0/livepatch'
+ r = requests.post(url)
+ print(r.text)
+ print(r.json()) \ No newline at end of file