ambari-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Greg Hill <greg.h...@RACKSPACE.COM>
Subject RE: problems with python client
Date Fri, 20 Jun 2014 15:30:18 GMT
Thanks Dmitry.  Adding that header does indeed get past the problem.  If nobody else gets to
it, I'll get a pull request together for the change.


From: Dmitry Lysnichenko []
Sent: Friday, June 20, 2014 10:20 AM
Subject: Re: problems with python client

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.


/usr/bin/curl -X DELETE -H "X-Requested-By:anything" -u admin:admin

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 <> 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("", 8080, "admin", "admin",
> version=1)
> mycluster = client.create_cluster("testcluster", "HDP-2.1")
> Any ideas?
> Greg


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.

View raw message