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.

Greg

________________________________________
From: Dmitry Lysnichenko [dlysnichenko@hortonworks.com]
Sent: Friday, June 20, 2014 10:20 AM
To: dev@ambari.apache.org
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.

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 <greg.hill@rackspace.com> 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

--
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.

Mime
View raw message