MLaaS.tfaas_client
¶
File : tfaas_client.py
Author : Valentin Kuznetsov
Module Contents¶
Classes¶
Simple HTTPS client authentication class based on provided key/ca information |
|
Accumulate the data to be used when posting a form. |
Functions¶
Helper function to get x509 either from env or tmp file |
|
Check if user runs das_client with key/cert and warn users to switch |
|
Expand path to full path |
|
Helper function to replace deprecated mimetools.choose_boundary https://stackoverflow.com/questions/27099290/where-is-mimetools-choose-boundary-function-in-python3 https://docs.python.org/2.7/library/mimetools.html?highlight=choose_boundary#mimetools.choose_boundary |
|
models API shows models from TFaaS server |
|
delete API deletes given model in TFaaS server |
|
bundle API uploads given bundle model files to TFaaS server |
|
upload API uploads given model to TFaaS server |
|
predict API get predictions from TFaaS server |
|
predict API get predictions from TFaaS server |
|
helper function to use in predict/upload APIs, it place given URL call to the server |
|
Main function |
Data¶
API¶
- MLaaS.tfaas_client.TFAAS_CLIENT¶
None
- class MLaaS.tfaas_client.OptionParser¶
Initialization
User based option parser
- class MLaaS.tfaas_client.HTTPSClientAuthHandler(key=None, cert=None, capath=None, level=0)¶
Bases:
urllib.request.HTTPSHandler
Simple HTTPS client authentication class based on provided key/ca information
Initialization
- https_open(req)¶
Open request method
- get_connection(host, timeout=300)¶
Connection method
- MLaaS.tfaas_client.x509()¶
Helper function to get x509 either from env or tmp file
- MLaaS.tfaas_client.check_auth(key)¶
Check if user runs das_client with key/cert and warn users to switch
- MLaaS.tfaas_client.fullpath(path)¶
Expand path to full path
- MLaaS.tfaas_client.choose_boundary()¶
Helper function to replace deprecated mimetools.choose_boundary https://stackoverflow.com/questions/27099290/where-is-mimetools-choose-boundary-function-in-python3 https://docs.python.org/2.7/library/mimetools.html?highlight=choose_boundary#mimetools.choose_boundary
mimetools.choose_boundary() ‘192.168.1.191.502.42035.1678979116.376.1’
- class MLaaS.tfaas_client.MultiPartForm¶
Bases:
object
Accumulate the data to be used when posting a form.
Initialization
- get_content_type()¶
- add_field(name, value)¶
Add a simple field to the form data.
- add_file(fieldname, filename, fileHandle, mimetype=None)¶
Add a file to be uploaded.
- __str__()¶
Return a string representing the form data, including attached files.
- MLaaS.tfaas_client.models(host, verbose=None, ckey=None, cert=None, capath=None)¶
models API shows models from TFaaS server
- MLaaS.tfaas_client.delete(host, model, verbose=None, ckey=None, cert=None, capath=None)¶
delete API deletes given model in TFaaS server
- MLaaS.tfaas_client.bundle(host, ifile, verbose=None, ckey=None, cert=None, capath=None)¶
bundle API uploads given bundle model files to TFaaS server
- MLaaS.tfaas_client.upload(host, ifile, verbose=None, ckey=None, cert=None, capath=None)¶
upload API uploads given model to TFaaS server
- MLaaS.tfaas_client.predict(host, ifile, model, verbose=None, ckey=None, cert=None, capath=None)¶
predict API get predictions from TFaaS server
- MLaaS.tfaas_client.predictImage(host, ifile, model, verbose=None, ckey=None, cert=None, capath=None)¶
predict API get predictions from TFaaS server
- MLaaS.tfaas_client.getdata(url, headers, encoded_data, ckey, cert, capath, verbose=None, method='POST')¶
helper function to use in predict/upload APIs, it place given URL call to the server
- MLaaS.tfaas_client.main()¶
Main function