Forum Discussion
Zdenda
Cirrus
Dec 28, 2015API Rest token-based auth problem
This is continuation of discussion here
LB: Viprion vCMP Guest, version 11.5.2 1.23.169
Problem: when I run python script using code from article mentioned above (without any changes), I get foll...
Zdenda
Cirrus
Dec 30, 2015Hi Jason, I tried to remove ['token']['token'] and got following:
{u'errorStack': [u'com.f5.rest.common.RestWorkerUriNotFoundException: http://localhost:8100/mgmt/shared/authn/login', u'at com.f5.rest.common.RestSer
ver.trySendInProcess(RestServer.java:231)', u'at com.f5.rest.common.RestRequestReceiver.dispatchToService(RestRequestReceiver.java:93)', u'at com.f5.r
est.common.RestRequestReceiver.processNext(RestRequestReceiver.java:57)', u'at com.f5.rest.common.RestHelper$2.run(RestHelper.java:1910)', u'at java.u
til.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)', u'at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor
.java:615)', u'at java.lang.Thread.run(Thread.java:722)\n'], u'message': u'http://localhost:8100/mgmt/shared/authn/login', u'code': 404, u'restOperati
onId': 4617544}
Token: {u'errorStack': [u'com.f5.rest.common.RestWorkerUriNotFoundException: http://localhost:8100/mgmt/shared/authn/login', u'at com.f5.rest.common.R
estServer.trySendInProcess(RestServer.java:231)', u'at com.f5.rest.common.RestRequestReceiver.dispatchToService(RestRequestReceiver.java:93)', u'at co
m.f5.rest.common.RestRequestReceiver.processNext(RestRequestReceiver.java:57)', u'at com.f5.rest.common.RestHelper$2.run(RestHelper.java:1910)', u'at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)', u'at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolEx
ecutor.java:615)', u'at java.lang.Thread.run(Thread.java:722)\n'], u'message': u'http://localhost:8100/mgmt/shared/authn/login', u'code': 404, u'restO
perationId': 4617544}
Traceback (most recent call last):
File "auth_test.py", line 54, in
response = create_pool(b, url_pool, poolname)
File "auth_test.py", line 5, in create_pool
pool_config = bigip.post(url, json.dumps(payload)).json()
File "C:\Python27\lib\requests\sessions.py", line 508, in post
return self.request('POST', url, data=data, json=json, **kwargs)
File "C:\Python27\lib\requests\sessions.py", line 465, in request
resp = self.send(prep, **send_kwargs)
File "C:\Python27\lib\requests\sessions.py", line 573, in send
r = adapter.send(request, **kwargs)
File "C:\Python27\lib\requests\adapters.py", line 370, in send
timeout=timeout
File "C:\Python27\lib\requests\packages\urllib3\connectionpool.py", line 544, in urlopen
body=body, headers=headers)
File "C:\Python27\lib\requests\packages\urllib3\connectionpool.py", line 349, in _make_request
conn.request(method, url, **httplib_request_kw)
File "C:\Python27\lib\httplib.py", line 946, in request
self._send_request(method, url, body, headers)
File "C:\Python27\lib\httplib.py", line 986, in _send_request
self.putheader(hdr, value)
File "C:\Python27\lib\httplib.py", line 924, in putheader
str = '%s: %s' % (header, '\r\n\t'.join(values))
TypeError: sequence item 0: expected string, dict found
I tried to get rid of some error messages and removed calling of function "create_pool", but then I got only (no output from "print token" visible):
{u'errorStack': [u'com.f5.rest.common.RestWorkerUriNotFoundException: http://localhost:8100/mgmt/shared/authn/login', u'at com.f5.rest.common.RestSer
ver.trySendInProcess(RestServer.java:231)', u'at com.f5.rest.common.RestRequestReceiver.dispatchToService(RestRequestReceiver.java:93)', u'at com.f5.r
est.common.RestRequestReceiver.processNext(RestRequestReceiver.java:57)', u'at com.f5.rest.common.RestHelper$2.run(RestHelper.java:1910)', u'at java.u
til.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)', u'at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor
.java:615)', u'at java.lang.Thread.run(Thread.java:722)\n'], u'message': u'http://localhost:8100/mgmt/shared/authn/login', u'code': 404, u'restOperati
onId': 4617823}
Token: {u'errorStack': [u'com.f5.rest.common.RestWorkerUriNotFoundException: http://localhost:8100/mgmt/shared/authn/login', u'at com.f5.rest.common.R
estServer.trySendInProcess(RestServer.java:231)', u'at com.f5.rest.common.RestRequestReceiver.dispatchToService(RestRequestReceiver.java:93)', u'at co
m.f5.rest.common.RestRequestReceiver.processNext(RestRequestReceiver.java:57)', u'at com.f5.rest.common.RestHelper$2.run(RestHelper.java:1910)', u'at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)', u'at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolEx
ecutor.java:615)', u'at java.lang.Thread.run(Thread.java:722)\n'], u'message': u'http://localhost:8100/mgmt/shared/authn/login', u'code': 404, u'restO
perationId': 4617823}
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects
