38 def __init__(self, msg=None, persistent=True, timeout=None,
39 address=
None, port=
None,
40 protocol=
None, **kwargs):
44 @param **kwargs - Keyword arguments. Apply values to the request attributes.
51 if address
is not None:
55 if protocol
is not None:
75 """! Service persistent connection value getter """
80 """! Service persistent connection value setter """
86 """! Service timeout value getter """
92 """! Service timeout value setter """
98 """! Service request object getter """
99 return self.__cloudObj.req
if self.
__cloudObj is not None else None
104 """! Service response object getter """
105 return self.__cloudObj.resp
if self.
__cloudObj is not None else None
110 """! Service response object setter """
111 self.__cloudObj.resp = val
115 """! Craft patform service full url path.
117 @param svcUrlName string - The service urlname, i.e 'face_detection'
119 @returns string - The full service url path.
128 """! Call the RAPP Platform Service """
132 raise AttributeError(
'Missing Cloud Message object!')
138 cloudResponseDic = self.__controller.run_job(msg, urlpath)
139 for key, val
in cloudResponseDic.iteritems():
140 msg.resp.set(key, val)
145 """! Call the RAPP Platform Service """
149 _future = self.__controllerAsync.run_job(msg, _url, clb=clb)
154 _filepath = path.expanduser(
155 '~/.config/rapp_platform/python_platform_api/config')
158 f = open(_filepath,
'r')
159 _params = yaml.load(f)
160 except (IOError, yaml.YAMLError)
as exc:
162 print "Using default parameters:"
163 print " * address: 'localhost'"
164 print " * port: '9001'"
165 print " * protocol: 'http'"
169 'address':
'localhost',