Or you may try adding http_header parameter during AmbariClient construction.
On Fri, Jun 20, 2014 at 6:20 PM, Dmitry Lysnichenko < [email protected]> wrote: > A quick search through python ambari-client sources did not find any > usages of X-Requested-By header that is used for CSRF protection in Ambari. > > e.g. > > /usr/bin/curl -X DELETE -H "X-Requested-By:anything" -u admin:admin > http://dev01.hortonworks.com:8080/api/v1/clusters/c1/services/MAPREDUCE > > > At the same time, groovy client contains references of this header. So maybe > python client needs update. > > > > On Fri, Jun 20, 2014 at 6:10 PM, Greg Hill <[email protected]> > wrote: > >> I'm trying to use the python client to do a POC with Ambari, but >> following the examples in the docs has led me to a problem that I can't >> figure out. I set it up with the "Quick Start Guide" and the Ambari UI >> works perfectly on the 3-node cluster I have running on my machine. I'm >> just attempting a basic create server call, but the server gives me a 400: >> Bad Request response no matter what I try. Can anyone shed light on this? >> I turned on DEBUG logging on the server, but there was still no actual >> details as to the problem in the logs. >> >> This is my code: >> >> from ambari_client.ambari_api import AmbariClient >> client = AmbariClient("c6401.ambari.apache.org", 8080, "admin", "admin", >> version=1) >> >> mycluster = client.create_cluster("testcluster", "HDP-2.1") >> >> >> Any ideas? >> >> Greg >> > > > > -- > Thanks, > Dmitry > -- Thanks, Dmitry -- CONFIDENTIALITY NOTICE NOTICE: This message is intended for the use of the individual or entity to which it is addressed and may contain information that is confidential, privileged and exempt from disclosure under applicable law. If the reader of this message is not the intended recipient, you are hereby notified that any printing, copying, dissemination, distribution, disclosure or forwarding of this communication is strictly prohibited. If you have received this communication in error, please contact the sender immediately and delete it from your system. Thank You.
