mesos-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Guangya Liu <gyliu...@gmail.com>
Subject Re: Review Request 46872: Updated quota.md and weights.md for set quota and update weight.
Date Fri, 17 Jun 2016 23:18:15 GMT


On 五月 2, 2016, 4:01 p.m., Guangya Liu wrote:
> > Could you check whether this is an issue also with other endpoints?
> 
> Guangya Liu wrote:
>     Thanks Joerg, others are using `JSON String` in the `curl` command and only quota
and weight need some update here.
> 
> Alexander Rukletsov wrote:
>     If others using JSON in examples, why should we update weights and quota to use files?
> 
> Adam B wrote:
>     Others have shorter JSON blobs, or there's the really long multi-line curl commands
in http://mesos.apache.org/documentation/latest/persistent-volume/ and http://mesos.apache.org/documentation/latest/reservation/
but I think most users will/should put their json into a file. In the reservation/volume case,
there are other curl flags to worry about too though.
>     I'm fine with fixing this one to be more human-followable now, and we can consider
a common recommended curl syntax (file vs inline) later.

Thanks Adam and Alex. Actully for the test, I think that a JSON file is more friendly than
using a string directly especially for some long JSON strings, such as persistent volume,
reservation etc. Even though  http://mesos.apache.org/documentation/latest/persistent-volume/
and http://mesos.apache.org/documentation/latest/reservation/ give a clear example for the
whole `curl` command, but I think that it is still make sense to update this to an JSON file
based example, it is more easier to edit and maintain, what do you think? If you agree, I
can fie a JIRA to trace this. Thanks.


- Guangya


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


On 五月 2, 2016, 10:35 p.m., Guangya Liu wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/46872/
> -----------------------------------------------------------
> 
> (Updated 五月 2, 2016, 10:35 p.m.)
> 
> 
> Review request for mesos, Adam B, Alexander Rukletsov, and haosdent huang.
> 
> 
> Bugs: MESOS-5313
>     https://issues.apache.org/jira/browse/MESOS-5313
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> There should be a @ before the json file when using "curl -d".
> 
> 
> Diffs
> -----
> 
>   docs/quota.md 797e134605381ae576d9aa93875e0314889ab047 
>   docs/weights.md 59d1579ed691524185c52ccd0bc26eadfbe167c2 
> 
> Diff: https://reviews.apache.org/r/46872/diff/
> 
> 
> Testing
> -------
> 
> root@mesos002:~/test# cat quota.json
> {
> 	"role": "role1",
> 	"guarantee": [{
> 		"name": "cpus",
> 		"type": "SCALAR",
> 		"scalar": {
> 			"value": 1
> 		}
> 	}, {
> 		"name": "mem",
> 		"type": "SCALAR",
> 		"scalar": {
> 			"value": 128
> 		}
> 	}]
> }
> 
> root@mesos002:~/test# curl -d @quota.json -X POST http://192.168.56.12:5050/quota
> 
> root@mesos002:~/test# curl -X GET http://192.168.56.12:5050/quota 2>/dev/null|python
-m json.tool
> {
>     "infos": [
>         {
>             "guarantee": [
>                 {
>                     "name": "cpus",
>                     "role": "*",
>                     "scalar": {
>                         "value": 1.0
>                     },
>                     "type": "SCALAR"
>                 },
>                 {
>                     "name": "mem",
>                     "role": "*",
>                     "scalar": {
>                         "value": 128.0
>                     },
>                     "type": "SCALAR"
>                 }
>             ],
>             "role": "role1"
>         }
>     ]
> }
> 
> 
> Thanks,
> 
> Guangya Liu
> 
>


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message