diff options
author | Alice Ferrazzi <alicef@gentoo.org> | 2017-06-22 05:50:53 +0900 |
---|---|---|
committer | Alice Ferrazzi <alicef@gentoo.org> | 2017-06-22 05:50:53 +0900 |
commit | bd710bd451495d276f4efea7f28c1173ef84df40 (patch) | |
tree | 8c3bea8d7c27367b2656adb5cd4388bb3176816d /elivepatch_client/client/restful.py | |
parent | added build livepatch option after sending config file and patch file (diff) | |
download | elivepatch-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.py | 9 |
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 |