FAQ
Greetings,

This used to work for me, but I've had a heck of a time with it recently. I
am trying to kick off a batch job through the salt api, but it doesn't seem
to be batching.

Here's the json I'm working with:
[{"arg": ["sleep 4; echo
testing"],"batch":"1","client":"local_batch","expr_form":"glob","fun":"cmd.run","tgt":"*"}]

and here's the post:
curl -k https://localhost:8000/minions -H 'Accept: application/json' -H
"X-Auth-Token: $TOKEN" -H 'Content-Type: application/json' -d "$JSON"

It looks like that command comes back for two hosts in ~5 seconds. Since it
should be running with a batch size of 1, and each host should sleep for 4
seconds, it doesn't appear to be working.

I can run salt '*' -b 1 cmd.run 'sleep 4; echo done' which takes about 9
seconds, so I know it is capable of working. Additionally, I seem to be
able to post that json to localhost:8000/ (without the minions endpoint)
and it comes back in just over 8 seconds. That's expected, but I would also
think that /minions should queue up the job and return a jid.

Might this be a bug, or am I doing something wacky?

Thanks all!

--
You received this message because you are subscribed to the Google Groups "Salt-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to salt-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Search Discussions

  • Seth House at Jul 8, 2015 at 4:23 am
    The `/minions` end-point is hard-coded to use the `local_async` client
    [1]. Sending the HTTP call to the root end-point is correct for using
    the `local_batch` client since batch runs _must_ be performed
    synchronously.

    [1] http://docs.saltstack.com/en/latest/ref/netapi/all/salt.netapi.rest_cherrypy.html#post--minions

    On Sun, Jul 5, 2015 at 1:32 AM, Christian McHugh
    wrote:
    Greetings,

    This used to work for me, but I've had a heck of a time with it recently. I
    am trying to kick off a batch job through the salt api, but it doesn't seem
    to be batching.

    Here's the json I'm working with:
    [{"arg": ["sleep 4; echo
    testing"],"batch":"1","client":"local_batch","expr_form":"glob","fun":"cmd.run","tgt":"*"}]

    and here's the post:
    curl -k https://localhost:8000/minions -H 'Accept: application/json' -H
    "X-Auth-Token: $TOKEN" -H 'Content-Type: application/json' -d "$JSON"

    It looks like that command comes back for two hosts in ~5 seconds. Since it
    should be running with a batch size of 1, and each host should sleep for 4
    seconds, it doesn't appear to be working.

    I can run salt '*' -b 1 cmd.run 'sleep 4; echo done' which takes about 9
    seconds, so I know it is capable of working. Additionally, I seem to be able
    to post that json to localhost:8000/ (without the minions endpoint) and it
    comes back in just over 8 seconds. That's expected, but I would also think
    that /minions should queue up the job and return a jid.

    Might this be a bug, or am I doing something wacky?
    --
    You received this message because you are subscribed to the Google Groups "Salt-users" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to salt-users+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupsalt-users @
postedJul 5, '15 at 7:32a
activeJul 8, '15 at 4:23a
posts2
users2

2 users in discussion

Christian McHugh: 1 post Seth House: 1 post

People

Translate

site design / logo © 2022 Grokbase