You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
returnResult(status=SERVER_ERROR, msg="{status_code} - Error while connecting to Deepviz: {errmsg}".format(status_code=r.status_code, errmsg=data['errmsg']))
67
+
else:
68
+
returnResult(status=CLIENT_ERROR, msg="{status_code} - Error while connecting to Deepviz: {errmsg}".format(status_code=r.status_code, errmsg=data['errmsg']))
69
+
70
+
defsample_result(self, md5=None, api_key=None):
71
+
ifnotapi_key:
72
+
returnResult(status=INPUT_ERROR, msg="API key cannot be null or empty String")
73
+
74
+
ifnotmd5:
75
+
returnResult(status=INPUT_ERROR, msg="MD5 cannot be null or empty String")
returnResult(status=SERVER_ERROR, msg="{status_code} - Error while connecting to Deepviz: {errmsg}".format(status_code=r.status_code, errmsg=data['errmsg']))
59
+
else:
60
+
returnResult(status=CLIENT_ERROR, msg="{status_code} - Error while connecting to Deepviz: {errmsg}".format(status_code=r.status_code, errmsg=data['errmsg']))
61
+
62
+
22
63
defupload_sample(self, path=None, api_key=None):
23
64
ifnotpath:
24
65
returnResult(status=INPUT_ERROR, msg="File path cannot be null or empty String")
returnResult(status=CLIENT_ERROR, msg="{status_code} - Error while connecting to Deepviz: {errmsg}".format(status_code=r.status_code, errmsg=data['errmsg']))
151
192
152
193
153
-
defsample_result(self, md5=None, api_key=None):
154
-
ifnotapi_key:
155
-
returnResult(status=INPUT_ERROR, msg="API key cannot be null or empty String")
156
-
157
-
ifnotmd5:
158
-
returnResult(status=INPUT_ERROR, msg="MD5 cannot be null or empty String")
159
-
160
-
body=json.dumps(
161
-
{
162
-
"api_key": api_key,
163
-
"md5": md5,
164
-
"output_filters": ["classification"]
165
-
}
166
-
)
167
-
try:
168
-
r=requests.post(URL_DOWNLOAD_REPORT, data=body)
169
-
exceptExceptionase:
170
-
returnResult(status=NETWORK_ERROR, msg="Error while connecting to Deepviz: %s"%e)
171
-
172
-
ifr.status_code==428:
173
-
returnResult(status=PROCESSING, msg="Analysis is running")
returnResult(status=SERVER_ERROR, msg="{status_code} - Error while connecting to Deepviz: {errmsg}".format(status_code=r.status_code, errmsg=data['errmsg']))
185
-
else:
186
-
returnResult(status=CLIENT_ERROR, msg="{status_code} - Error while connecting to Deepviz: {errmsg}".format(status_code=r.status_code, errmsg=data['errmsg']))
returnResult(status=SERVER_ERROR, msg="{status_code} - Error while connecting to Deepviz: {errmsg}".format(status_code=r.status_code, errmsg=data['errmsg']))
230
-
else:
231
-
returnResult(status=CLIENT_ERROR, msg="{status_code} - Error while connecting to Deepviz: {errmsg}".format(status_code=r.status_code, errmsg=data['errmsg']))
0 commit comments