Return-Path: X-Original-To: apmail-incubator-ambari-dev-archive@minotaur.apache.org Delivered-To: apmail-incubator-ambari-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id AB731F4BA for ; Mon, 8 Apr 2013 04:03:19 +0000 (UTC) Received: (qmail 56858 invoked by uid 500); 8 Apr 2013 04:03:19 -0000 Delivered-To: apmail-incubator-ambari-dev-archive@incubator.apache.org Received: (qmail 56726 invoked by uid 500); 8 Apr 2013 04:03:18 -0000 Mailing-List: contact ambari-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: ambari-dev@incubator.apache.org Delivered-To: mailing list ambari-dev@incubator.apache.org Received: (qmail 56692 invoked by uid 99); 8 Apr 2013 04:03:16 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 08 Apr 2013 04:03:16 +0000 Date: Mon, 8 Apr 2013 04:03:16 +0000 (UTC) From: "Mahadev konar (JIRA)" To: ambari-dev@incubator.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (AMBARI-1769) Python REST client to invoke REST calls MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/AMBARI-1769?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13625114#comment-13625114 ] Mahadev konar commented on AMBARI-1769: --------------------------------------- Subin, Just got the time to take a look at your patch. Nice work (specifically on the py docs)! The patch looks good. Some minor nits: - as metioned earlier the @ author tags and the created tags should be removed - http_utils.py has ^M characters in the file, not sure why (might want to do dos2unix on the files you have) - http_utils does not have an apache header and also says method copied from Django. If you copied the method, do you know what license/copyright it is? - main.py has ^M characters as well, same with init.py, cluster.py, paths.py, utils.py - the main.py does ganglia.stop() - i think that might be an oversight on having that in the main.py - the most important one is that to make it part of the main codebase (am sure lot of people will want to use this), we really need to make sure its maintained, which means unit tests (atleast testing main features of the client library). Can you please add some? You can also use the mock libary in ambari-common for python. - Also what about adding some help/examples into the codebase as well which will help folks who want to use the library? > Python REST client to invoke REST calls > --------------------------------------- > > Key: AMBARI-1769 > URL: https://issues.apache.org/jira/browse/AMBARI-1769 > Project: Ambari > Issue Type: New Feature > Components: controller > Affects Versions: 1.3.0 > Environment: RHEL > Reporter: subin m > Labels: REST > Fix For: 1.3.1 > > Attachments: patch.txt > > Original Estimate: 504h > Remaining Estimate: 504h > > Ambari doesnt have a python REST client to invoke REST calls .Currently users have to depend upon curl command. > I have created the Ambari python client and attached as a zip.Please review and give your feedbacks > The zip contains a skeleton code with few of the resources supported.The features are : > Supported feature > =================== > 1)get_all_clusters > 2)get cluster by name > 3)get service by nmae > 4)start/stop service > Once this skeleton code is reviewed i will checkin the rest of the resources/features > I currently support creation of cluster via this python client. > install python client on linux box > ==============================' > 1)unzip the attachment > 2)execute 'python setup.py install --record installation.txt' > example: > ========== > from ambari_client.ambari_api import AmbariClient > client = AmbariClient("localhost", 8080, "admin","admin",version=1) > all_clusters = client.get_all_clusters() > > cluster = client.get_cluster('test1') > > serviceList = cluster.get_all_services() > > > for service in serviceList: > print str(service.service_name)+" = "+str(service.state) > > to start/stop service > ----------------------- > ganglia = cluster.get_service("GANGLIA") > ganglia.stop() > ganglia.start() > -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira