ambari-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrew Onischuk (JIRA)" <>
Subject [jira] [Commented] (AMBARI-3079) Ambari-Client Create Hosts request doesn't follows api request format
Date Tue, 03 Sep 2013 19:41:51 GMT


Andrew Onischuk commented on AMBARI-3079:

There was a lot of confusement around these 2 funcs for me.
And actually an error in the code caused by the same problem. The ModelList.to_json_dict was
used for creating a request, but should be used for working with response, which caused a
wrong request formed for create_host So I added a new func to parse requestfrom the ModelList

Ran 5 tests in 0.014s

[INFO] ------------------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.893s
[INFO] Finished at: Mon Sep 02 08:15:57 PDT 2013
[INFO] Final Memory: 3M/161M
> Ambari-Client Create Hosts request doesn't follows api request format
> ---------------------------------------------------------------------
>                 Key: AMBARI-3079
>                 URL:
>             Project: Ambari
>          Issue Type: Task
>            Reporter: Andrew Onischuk
>            Assignee: Andrew Onischuk
> Here is the request which ambari-client sends now to add a host:
> {code}
> curl -i -X POST -d '{"items": [{"ip": "", "host_name": "",
"rack_info": null}]}' -u admin:admin
> {code}
> It does not get parsed successfuly by our api
> Here what we should send, and what successfully adds hosts:
> {code}
> curl -i -X POST -d '[{"Hosts":{"ip": "","host_name":"","rack_info":"/default-rack"}},{"Hosts":{"host_name":"one_more_host"}}}]'
-u admin:admin
> {code}

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:

View raw message