This commit is contained in:
Alex Dadgar 2016-01-13 10:47:22 -08:00
parent 80dd30b03d
commit 999db4cd0f
3 changed files with 56 additions and 3 deletions

View file

@ -0,0 +1,48 @@
---
layout: "http"
page_title: "HTTP API: /v1/periodic"
sidebar_current: "docs-http-periodic"
description: >
The '/v1/periodic' endpoint is used to interact with periodic jobs.
---
# /v1/periodic
The `periodic` endpoint is used to interact with a single periodic job. By
default, the agent's local region is used; another region can be specified using
the `?region=` query parameter.
## PUT / POST
<dl>
<dt>Description</dt>
<dd>
Forces a new instance of the periodic job. A new instance will be created
even if it violates the job's
[`prohibit_overlap`](/docs/jobspec/index.html#prohibit_overlap) settings. As
such, this should be only used to immediately run a periodic job.
</dd>
<dt>Method</dt>
<dd>PUT or POST</dd>
<dt>URL</dt>
<dd>`/v1/periodic/<ID>/force`</dd>
<dt>Parameters</dt>
<dd>
None
</dd>
<dt>Returns</dt>
<dd>
```javascript
{
"EvalCreateIndex": 7,
"EvalID": "57983ddd-7fcf-3e3a-fd24-f699ccfb36f4"
}
```
</dd>
</dl>

View file

@ -184,9 +184,10 @@ The `job` object supports the following keys:
[here](https://github.com/gorhill/cronexpr#implementation) for full
documentation of supported cron specs and the predefined expressions.
* `prohibit_overlap` - `prohibit_overlap` can be set to true to enforce that
the periodic job doesn't spawn a new instance of the job if any of the
previous jobs are still running. It is defaulted to false.
* <a id="prohibit_overlap">`prohibit_overlap`</a> - `prohibit_overlap` can
be set to true to enforce that the periodic job doesn't spawn a new
instance of the job if any of the previous jobs are still running. It is
defaulted to false.
An example `periodic` block:

View file

@ -97,6 +97,10 @@
<a href="/docs/http/status.html">Status</a>
</li>
<li<%= sidebar_current("docs-http-periodic") %>>
<a href="/docs/http/periodic.html">Periodic Jobs</a>
</li>
</ul>
</div>
<% end %>