Deadline REST API error


#1

Hi there:

I am trying to understand the Deadline REST API and getting the following error

ython 3.6.9 (default, Jul 20 2019, 13:49:55)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-23)] on linux
Type “help”, “copyright”, “credits” or “license” for more information.

from Deadline.DeadlineConnect import DeadlineCon as Connect
Traceback (most recent call last):
File “”, line 1, in
File “/home/bramachandran/.pyenv/versions/deadline/lib/python3.6/site-packages/Deadline/DeadlineConnect.py”, line 4, in
import Jobs
File “/home/bramachandran/.pyenv/versions/3.6.9/envs/deadline/lib/python3.6/site-packages/Deadline/Jobs.py”, line 3, in
from ConnectionProperty import ConnectionProperty
File “/home/bramachandran/.pyenv/versions/3.6.9/envs/deadline/lib/python3.6/site-packages/Deadline/ConnectionProperty.py”, line 4, in
import DeadlineSend
File “/home/bramachandran/.pyenv/versions/3.6.9/envs/deadline/lib/python3.6/site-packages/Deadline/DeadlineSend.py”, line 41
except urllib2.HTTPError, err:
^
SyntaxError: invalid syntax

The web services are enabled Deadline.

thanks
/Biju


#2

I dont think the deadline standalone / rest api is python 3.0 safe yet.
think its only compatible with python2.7.*


#3

Hi Kwatts:

Tried in pyhton2.7 and get the following error - how do I check this connection refused error - my IT guys are saying the port 8080 is open ?

con = Connect(‘mk01.vit.lan’,8080)
con.Groups.GetGroupNames()
Traceback (most recent call last):
File “”, line 1, in
File “Deadline/Groups.py”, line 17, in GetGroupNames
return self.connectionProperties.get("/api/groups")
File “Deadline/ConnectionProperty.py”, line 35, in get
return DeadlineSend.send(self.address,commandString, “GET”, self.useAuth, self.user, self.password)
File “Deadline/DeadlineSend.py”, line 35, in send
response = opener.open(request)
File “/usr/local/lib/python2.7/urllib2.py”, line 429, in open
response = self._open(req, data)
File “/usr/local/lib/python2.7/urllib2.py”, line 447, in _open
‘_open’, req)
File “/usr/local/lib/python2.7/urllib2.py”, line 407, in _call_chain
result = func(*args)
File “/usr/local/lib/python2.7/urllib2.py”, line 1228, in http_open
return self.do_open(httplib.HTTPConnection, req)
File “/usr/local/lib/python2.7/urllib2.py”, line 1198, in do_open
raise URLError(err)
urllib2.URLError: <urlopen error [Errno 111] Connection refused>

Thanks
/Biju


#4

simple check, does http://mk01.vit.lan:8080 exist in the browser?
If not, it means there is no webservice running on the machine, which is required to use the rest / python standalone api.

the webservice if running, is most likely running on a different port, you can find it here in the repo options:

image

use that port in the url i posted above, if that still doesnt work, then it means there is most likely no webservice running on the machine, in the thinkbox/deadline10/ log folder will have a seperate log for the webservice, it will also have the port that it is listening on.

example we get when we look up one of our webservice nodes in a browser:
image

this tells you the webservice is running.

hope that helps