You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@mesos.apache.org by John Omernik <jo...@omernik.com> on 2015/12/11 13:30:05 UTC

Dynamic Reservations - API to See them

Is there an API endpoint that allows an operator to see the current dynamic
reservations?  I keep track of what's there etc.

John

Re: Dynamic Reservations - API to See them

Posted by John Omernik <jo...@omernik.com>.
This works perfectly for me, no need to add code for API endspoints to only
return a subset of data... thanks for the tip!

On Fri, Dec 11, 2015 at 8:21 AM, Guangya Liu <gy...@gmail.com> wrote:

> I think there is no API for pure dynamic reservation but there are indeed
> API for reservations including both static and dynamic reservations.
>
> You can query the endpoint /state or /slaves on master to check the
> reservations status. You may want to file a JIRA ticket if only want to get
> dynamic reservations.
>
> An example output of slaves endpoint.
> $ curl "http://192.168.0.107:5050/slaves" 2>/dev/null| jq .
> {
>   "slaves": [
>     {
>       "active": true,
>       "attributes": {},
>       "hostname": "xxxxxxxxx",
>       "id": "faf93a46-2355-47b5-9b3c-cdf619c25109-S0",
>       "offered_resources": {
>         "cpus": 0,
>         "disk": 0,
>         "mem": 0
>       },
>       "pid": "slave(1)@192.168.0.107:5051",
>       "registered_time": 1449843036.07872,
>       "reserved_resources": {  <<<<<<<<<<<<<<<
>         "oo1": {
>           "cpus": 3,
>           "disk": 0,
>           "mem": 1000
>         }
>       },
>       "resources": {
>         "cpus": 11,
>         "disk": 470816,
>         "mem": 4000,
>         "ports": "[31000-32000]"
>       },
>       "unreserved_resources": {
>         "cpus": 8,
>         "disk": 470816,
>         "mem": 3000,
>         "ports": "[31000-32000]"
>       },
>       "used_resources": {
>         "cpus": 0,
>         "disk": 0,
>         "mem": 0
>       },
>       "version": "0.27.0"
>     }
>   ]
> }
>
> Thanks,
>
> Guangya
>
>
> On Fri, Dec 11, 2015 at 8:30 PM, John Omernik <jo...@omernik.com> wrote:
>
>> Is there an API endpoint that allows an operator to see the current
>> dynamic reservations?  I keep track of what's there etc.
>>
>> John
>>
>>
>

Re: Dynamic Reservations - API to See them

Posted by Guangya Liu <gy...@gmail.com>.
I think there is no API for pure dynamic reservation but there are indeed
API for reservations including both static and dynamic reservations.

You can query the endpoint /state or /slaves on master to check the
reservations status. You may want to file a JIRA ticket if only want to get
dynamic reservations.

An example output of slaves endpoint.
$ curl "http://192.168.0.107:5050/slaves" 2>/dev/null| jq .
{
  "slaves": [
    {
      "active": true,
      "attributes": {},
      "hostname": "xxxxxxxxx",
      "id": "faf93a46-2355-47b5-9b3c-cdf619c25109-S0",
      "offered_resources": {
        "cpus": 0,
        "disk": 0,
        "mem": 0
      },
      "pid": "slave(1)@192.168.0.107:5051",
      "registered_time": 1449843036.07872,
      "reserved_resources": {  <<<<<<<<<<<<<<<
        "oo1": {
          "cpus": 3,
          "disk": 0,
          "mem": 1000
        }
      },
      "resources": {
        "cpus": 11,
        "disk": 470816,
        "mem": 4000,
        "ports": "[31000-32000]"
      },
      "unreserved_resources": {
        "cpus": 8,
        "disk": 470816,
        "mem": 3000,
        "ports": "[31000-32000]"
      },
      "used_resources": {
        "cpus": 0,
        "disk": 0,
        "mem": 0
      },
      "version": "0.27.0"
    }
  ]
}

Thanks,

Guangya


On Fri, Dec 11, 2015 at 8:30 PM, John Omernik <jo...@omernik.com> wrote:

> Is there an API endpoint that allows an operator to see the current
> dynamic reservations?  I keep track of what's there etc.
>
> John
>
>