incubator-ambari-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mahadev konar (JIRA)" <j...@apache.org>
Subject [jira] [Resolved] (AMBARI-1769) Python REST client to invoke REST calls
Date Mon, 15 Apr 2013 07:26:17 GMT

     [ https://issues.apache.org/jira/browse/AMBARI-1769?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Mahadev konar resolved AMBARI-1769.
-----------------------------------

    Resolution: Fixed

+1 for the patch. I just committed this to trunk. Thanks Subin.

Since this is just beginning of the work we will be doing for the client I just committed
this as it is. 

Here are some improvements we need to make for this:

- Add unit tests (whcih you have a jira for).
- Make the client component part of the top level pom.xml (this will help in running unit
tests/builds from a single place)
- add some documentation on how/what of ambari-client that can be published with a release

Subin,
 Can you please open a jira for the last 2. Again thanks a lot for your patience and contribution.
                
> 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
>            Assignee: subin m
>              Labels: REST
>             Fix For: 1.3.1
>
>         Attachments: patch_review_changes1.txt, 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

Mime
View raw message