-
Notifications
You must be signed in to change notification settings - Fork 222
api tutorial isn't working #233
Comments
OK, I fixed it under linux. Not sure if this will work in windows as windows is broken. The tutorial needs to be updated. Also should note this uses unencrypted. Had issues with the self signed cert. `import argparse class APITutorial:
def main():
if name == "main": |
Thanks for taking a look at that. That tutorial will eventually be replaced with one that will make use of the client libraries we generate with OpenAPI Generator. An initial version of the Python client package is in the common directory with a brief example. Hopefully these will make it easier to use Walkoff's REST API, but there are customizations we need to iron out and OpenAPI spec discrepancies to fix before I'm confident in recommending its usage. |
I copy and pasted the api tutorial stuff in to a python file and get this output when run
PS C:\Users\aoighost\Desktop\motokodev> python .\walkoffapitest.py
Authenticating...
Enter password for WALKOFF user admin@http://127.0.0.1:5000:
Traceback (most recent call last):
File ".\walkoffapitest.py", line 200, in
main()
File ".\walkoffapitest.py", line 190, in main
i.authenticate()
File ".\walkoffapitest.py", line 25, in authenticate
timeout=2)
File "C:\Python27\lib\site-packages\requests\api.py", line 116, in post
return request('post', url, data=data, json=json, **kwargs)
File "C:\Python27\lib\site-packages\requests\api.py", line 60, in request
return session.request(method=method, url=url, **kwargs)
File "C:\Python27\lib\site-packages\requests\sessions.py", line 533, in request
resp = self.send(prep, **send_kwargs)
File "C:\Python27\lib\site-packages\requests\sessions.py", line 646, in send
r = adapter.send(request, **kwargs)
File "C:\Python27\lib\site-packages\requests\adapters.py", line 516, in send
raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPConnectionPool(host='127.0.0.1', port=5000): Max retries exceeded with url: /api/auth (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x0000000003A502E8>: Failed to establish a new connection: [Errno 10061] No connection could be made because the target machine actively refused it',))
PS C:\Users\aoighost\Desktop\motokodev>
The text was updated successfully, but these errors were encountered: