-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/44512/#review124512
-----------------------------------------------------------



Good start, but you're missing a few things. Are these coming in subsequent 
patches?
- Authentication for GET requests
- Tests for GETs
- Documentation updates


src/master/http.cpp (lines 1175 - 1176)
<https://reviews.apache.org/r/44512/#comment187111>

    s/consider to erase/consider erasing/



src/master/http.cpp (line 1178)
<https://reviews.apache.org/r/44512/#comment187112>

    Will you be adding authentication to GETs in a separate patch?



src/master/weights_handler.cpp (line 55)
<https://reviews.apache.org/r/44512/#comment187116>

    Couldn't you use a vector<WeightInfo> or a RepeatedPtrField, so we don't 
need a new protobuf message type, and we don't get the unnecessarily verbose 
"infos" field in the `GET /weights` output?


- Adam B


On March 8, 2016, 10:36 p.m., Yongqiao Wang wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/44512/
> -----------------------------------------------------------
> 
> (Updated March 8, 2016, 10:36 p.m.)
> 
> 
> Review request for mesos and Adam B.
> 
> 
> Bugs: MESOS-4316
>     https://issues.apache.org/jira/browse/MESOS-4316
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> Support to get weights info by /weights.
> 
> 
> Diffs
> -----
> 
>   include/mesos/mesos.proto 3d22ec32655dca741169e1f0e382303e061c38b7 
>   src/master/http.cpp a3ad57a1c3f8a01aa609b28c12825670bb243387 
>   src/master/master.hpp ea26670e6c6c67314406fded510e8fdd46053dc8 
>   src/master/weights_handler.cpp PRE-CREATION 
> 
> Diff: https://reviews.apache.org/r/44512/diff/
> 
> 
> Testing
> -------
> 
> make && make check.
> 
> $ (./mesos-master.sh --ip=127.0.0.1 --work_dir=/tmp/mesos-master  
> --authenticate_http --credentials=/opt/credentials.json  >> 
> /tmp/mesos-master.log 2>&1 &)
> 
> $ curl --user framework1:secret_string1 http://localhost:5050/weights | 
> python -mjson.tool
> {}
> 
> $ curl --user framework1:secret_string1 --data 
> "[{\"weight\":1.8,\"role\":\"role1\"},{\"weight\":1.0,\"role\":\"role2\"},{\"weight\":3.4,\"role\":\"role3\"}]"
>  -X PUT http://127.0.0.1:5050/weights
> 
> $ curl --user framework1:secret_string1 http://localhost:5050/weights | 
> python -mjson.tool
> {
>     "infos": [
>         {
>             "role": "role3",
>             "weight": 3.4
>         },
>         {
>             "role": "role2",
>             "weight": 1.0
>         },
>         {
>             "role": "role1",
>             "weight": 1.8
>         }
>     ]
> }
> 
> Has updated all tests of /weights endpoint to check the update results with 
> /weights GET request.
> 
> 
> Thanks,
> 
> Yongqiao Wang
> 
>

Reply via email to