MCPcopy Create free account
hub / github.com/SeldonIO/seldon-server / call_js

Function call_js

python/seldon/cli/cmd_api.py:114–133  ·  view source on GitHub ↗
(gopts,command_data,opts,auth)

Source from the content-addressed store, hash-verified

112 return params
113
114def call_js(gopts,command_data,opts,auth):
115 params = {}
116 params["consumer_key"] = auth['key']
117 params["jsonpCallback"]= "j"
118 if opts.endpoint == "/js/action/new":
119 params = get_action_params(opts,params)
120 elif opts.endpoint == "/js/recommendations":
121 params = get_js_recommend_params(opts,params)
122 elif opts.endpoint == "/js/predict":
123 params = get_js_predict_params(opts,params)
124 elif opts.endpoint == '/js/event/new':
125 params = get_js_predict_params(opts,params)
126 url = command_data['conf_data']["server_endpoint"] + opts.endpoint
127 r = requests.get(url,params=params)
128 if not gopts.quiet:
129 print "response code",r.status_code
130 if r.status_code == requests.codes.ok:
131 res = re.sub(r'^j\(',"",r.text)
132 res = re.sub(r'\)$',"",res)
133 print res
134
135def call_oauth(gopts,command_data,opts,token):
136 data = {}

Callers 1

action_callFunction · 0.85

Calls 4

get_action_paramsFunction · 0.85
get_js_recommend_paramsFunction · 0.85
get_js_predict_paramsFunction · 0.85
getMethod · 0.65

Tested by

no test coverage detected