You've already forked oncall
mirror of
https://github.com/linkedin/oncall.git
synced 2025-11-29 23:38:17 +02:00
Merge:0aef53e273a1d0Author: Fellyn Silliman <fellyns@users.noreply.github.com> Merge pull request #36 from houqp/docs
1097 lines
60 KiB
HTML
1097 lines
60 KiB
HTML
|
|
|
|
<!DOCTYPE html>
|
|
<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
|
|
<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
|
|
<head>
|
|
<meta charset="utf-8">
|
|
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
|
|
<title>REST API — Oncall 1.0.0 documentation</title>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
|
|
|
|
|
|
|
|
|
|
|
|
<link rel="index" title="Index"
|
|
href="genindex.html"/>
|
|
<link rel="search" title="Search" href="search.html"/>
|
|
<link rel="top" title="Oncall 1.0.0 documentation" href="index.html"/>
|
|
<link rel="prev" title="User guide" href="user_guide.html"/>
|
|
|
|
|
|
<script src="_static/js/modernizr.min.js"></script>
|
|
|
|
</head>
|
|
|
|
<body class="wy-body-for-nav" role="document">
|
|
|
|
|
|
<div class="wy-grid-for-nav">
|
|
|
|
|
|
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
|
|
<div class="wy-side-scroll">
|
|
<div class="wy-side-nav-search">
|
|
|
|
|
|
|
|
<a href="index.html" class="icon icon-home"> Oncall
|
|
|
|
|
|
|
|
</a>
|
|
|
|
|
|
|
|
|
|
<div class="version">
|
|
1.0.0
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div role="search">
|
|
<form id="rtd-search-form" class="wy-form" action="search.html" method="get">
|
|
<input type="text" name="q" placeholder="Search docs" />
|
|
<input type="hidden" name="check_keywords" value="yes" />
|
|
<input type="hidden" name="area" value="default" />
|
|
</form>
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<p class="caption"><span class="caption-text">Table of contents</span></p>
|
|
<ul class="current">
|
|
<li class="toctree-l1"><a class="reference internal" href="user_guide.html">User guide</a></li>
|
|
<li class="toctree-l1 current"><a class="current reference internal" href="#">REST API</a><ul>
|
|
<li class="toctree-l2"><a class="reference internal" href="#api-v0-teams">/api/v0/teams</a></li>
|
|
<li class="toctree-l2"><a class="reference internal" href="#api-v0-schedules">/api/v0/schedules</a></li>
|
|
<li class="toctree-l2"><a class="reference internal" href="#api-v0-services">/api/v0/services</a></li>
|
|
<li class="toctree-l2"><a class="reference internal" href="#api-v0-roles">/api/v0/roles</a></li>
|
|
<li class="toctree-l2"><a class="reference internal" href="#api-v0-events">/api/v0/events</a></li>
|
|
<li class="toctree-l2"><a class="reference internal" href="#api-v0-users">/api/v0/users</a></li>
|
|
<li class="toctree-l2"><a class="reference internal" href="#api-v0-notification-types">/api/v0/notification_types</a></li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
|
|
|
|
|
|
</div>
|
|
</div>
|
|
</nav>
|
|
|
|
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
|
|
|
|
|
|
<nav class="wy-nav-top" role="navigation" aria-label="top navigation">
|
|
|
|
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
|
|
<a href="index.html">Oncall</a>
|
|
|
|
</nav>
|
|
|
|
|
|
|
|
<div class="wy-nav-content">
|
|
<div class="rst-content">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div role="navigation" aria-label="breadcrumbs navigation">
|
|
|
|
<ul class="wy-breadcrumbs">
|
|
|
|
<li><a href="index.html">Docs</a> »</li>
|
|
|
|
<li>REST API</li>
|
|
|
|
|
|
<li class="wy-breadcrumbs-aside">
|
|
|
|
|
|
<a href="_sources/api.rst.txt" rel="nofollow"> View page source</a>
|
|
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
|
|
<hr/>
|
|
</div>
|
|
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
|
|
<div itemprop="articleBody">
|
|
|
|
<div class="section" id="rest-api">
|
|
<h1>REST API<a class="headerlink" href="#rest-api" title="Permalink to this headline">¶</a></h1>
|
|
<div class="section" id="api-v0-teams">
|
|
<h2>/api/v0/teams<a class="headerlink" href="#api-v0-teams" title="Permalink to this headline">¶</a></h2>
|
|
<dl class="get">
|
|
<dt id="get--api-v0-teams-team-oncall-role">
|
|
<code class="descname">GET </code><code class="descname">/api/v0/teams/{team}/oncall/{role}</code><a class="headerlink" href="#get--api-v0-teams-team-oncall-role" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p><a class="reference external" href="http:get">http:get</a>:: /api/v0/teams/(str:team_name)/oncall/(str:role)</p>
|
|
<p>Get current active event for team based on given role.</p>
|
|
<p><strong>Example request</strong>:</p>
|
|
<div class="highlight-http"><div class="highlight"><pre><span></span><span class="nf">GET</span> <span class="nn">/api/v0/teams/team_ops/oncall/primary</span> <span class="kr">HTTP</span><span class="o">/</span><span class="m">1.1</span>
|
|
<span class="na">Host</span><span class="o">:</span> <span class="l">example.com</span>
|
|
</pre></div>
|
|
</div>
|
|
<p><strong>Example response</strong>:</p>
|
|
<div class="highlight-http"><div class="highlight"><pre><span></span><span class="kr">HTTP</span><span class="o">/</span><span class="m">1.1</span> <span class="m">200</span> <span class="ne">OK</span>
|
|
<span class="na">Content-Type</span><span class="o">:</span> <span class="l">application/json</span>
|
|
|
|
<span class="p">[</span>
|
|
<span class="p">{</span>
|
|
<span class="nt">"user"</span><span class="p">:</span> <span class="s2">"foo"</span><span class="p">,</span>
|
|
<span class="nt">"start"</span><span class="p">:</span> <span class="mi">1487426400</span><span class="p">,</span>
|
|
<span class="nt">"end"</span><span class="p">:</span> <span class="mi">1487469600</span><span class="p">,</span>
|
|
<span class="nt">"full_name"</span><span class="p">:</span> <span class="s2">"Foo Icecream"</span><span class="p">,</span>
|
|
<span class="nt">"contacts"</span><span class="p">:</span> <span class="p">{</span>
|
|
<span class="nt">"im"</span><span class="p">:</span> <span class="s2">"foo"</span><span class="p">,</span>
|
|
<span class="nt">"sms"</span><span class="p">:</span> <span class="s2">"+1 123-456-7890"</span><span class="p">,</span>
|
|
<span class="nt">"email"</span><span class="p">:</span> <span class="s2">"foo@example.com"</span><span class="p">,</span>
|
|
<span class="nt">"call"</span><span class="p">:</span> <span class="s2">"+1 123-456-7890"</span>
|
|
<span class="p">}</span>
|
|
<span class="p">},</span>
|
|
<span class="p">{</span>
|
|
<span class="nt">"user"</span><span class="p">:</span> <span class="s2">"bar"</span><span class="p">,</span>
|
|
<span class="nt">"start"</span><span class="p">:</span> <span class="mi">1487426400</span><span class="p">,</span>
|
|
<span class="nt">"end"</span><span class="p">:</span> <span class="mi">1487469600</span><span class="p">,</span>
|
|
<span class="nt">"full_name"</span><span class="p">:</span> <span class="s2">"Bar Dog"</span><span class="p">,</span>
|
|
<span class="nt">"contacts"</span><span class="p">:</span> <span class="p">{</span>
|
|
<span class="nt">"im"</span><span class="p">:</span> <span class="s2">"bar"</span><span class="p">,</span>
|
|
<span class="nt">"sms"</span><span class="p">:</span> <span class="s2">"+1 123-456-7890"</span><span class="p">,</span>
|
|
<span class="nt">"email"</span><span class="p">:</span> <span class="s2">"bar@example.com"</span><span class="p">,</span>
|
|
<span class="nt">"call"</span><span class="p">:</span> <span class="s2">"+1 123-456-7890"</span>
|
|
<span class="p">}</span>
|
|
<span class="p">}</span>
|
|
<span class="p">]</span>
|
|
</pre></div>
|
|
</div>
|
|
<table class="docutils field-list" frame="void" rules="none">
|
|
<col class="field-name" />
|
|
<col class="field-body" />
|
|
<tbody valign="top">
|
|
<tr class="field-odd field"><th class="field-name">Status Codes:</th><td class="field-body"><ul class="first last simple">
|
|
<li><a class="reference external" href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.2.1">200 OK</a> – no error</li>
|
|
</ul>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</dd></dl>
|
|
|
|
<dl class="get">
|
|
<dt id="get--api-v0-teams-team-admins">
|
|
<code class="descname">GET </code><code class="descname">/api/v0/teams/{team}/admins</code><a class="headerlink" href="#get--api-v0-teams-team-admins" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Get list of admin users for a team</p>
|
|
</dd></dl>
|
|
|
|
<dl class="post">
|
|
<dt id="post--api-v0-teams-team-admins">
|
|
<code class="descname">POST </code><code class="descname">/api/v0/teams/{team}/admins</code><a class="headerlink" href="#post--api-v0-teams-team-admins" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Add user as team admin</p>
|
|
</dd></dl>
|
|
|
|
<dl class="delete">
|
|
<dt id="delete--api-v0-teams-team-admins-user">
|
|
<code class="descname">DELETE </code><code class="descname">/api/v0/teams/{team}/admins/{user}</code><a class="headerlink" href="#delete--api-v0-teams-team-admins-user" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Delete team admin user</p>
|
|
</dd></dl>
|
|
|
|
<dl class="get">
|
|
<dt id="get--api-v0-teams-team-users">
|
|
<code class="descname">GET </code><code class="descname">/api/v0/teams/{team}/users</code><a class="headerlink" href="#get--api-v0-teams-team-users" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Get list of users for a team</p>
|
|
</dd></dl>
|
|
|
|
<dl class="post">
|
|
<dt id="post--api-v0-teams-team-users">
|
|
<code class="descname">POST </code><code class="descname">/api/v0/teams/{team}/users</code><a class="headerlink" href="#post--api-v0-teams-team-users" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Add user to a team</p>
|
|
</dd></dl>
|
|
|
|
<dl class="delete">
|
|
<dt id="delete--api-v0-teams-team-users-user">
|
|
<code class="descname">DELETE </code><code class="descname">/api/v0/teams/{team}/users/{user}</code><a class="headerlink" href="#delete--api-v0-teams-team-users-user" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Delete user from a team</p>
|
|
</dd></dl>
|
|
|
|
<dl class="get">
|
|
<dt id="get--api-v0-teams-team-rosters">
|
|
<code class="descname">GET </code><code class="descname">/api/v0/teams/{team}/rosters</code><a class="headerlink" href="#get--api-v0-teams-team-rosters" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Get roster info(including schedules) for a team</p>
|
|
</dd></dl>
|
|
|
|
<dl class="post">
|
|
<dt id="post--api-v0-teams-team-rosters">
|
|
<code class="descname">POST </code><code class="descname">/api/v0/teams/{team}/rosters</code><a class="headerlink" href="#post--api-v0-teams-team-rosters" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Create a roster for a team</p>
|
|
</dd></dl>
|
|
|
|
<dl class="get">
|
|
<dt id="get--api-v0-teams-team-rosters-roster">
|
|
<code class="descname">GET </code><code class="descname">/api/v0/teams/{team}/rosters/{roster}</code><a class="headerlink" href="#get--api-v0-teams-team-rosters-roster" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p><a class="reference external" href="http:get">http:get</a>:: /api/v0/teams/(str:team_name)/rosters</p>
|
|
<p>Get user and schedule info for a roster</p>
|
|
<p><strong>Example request</strong>:</p>
|
|
<div class="highlight-http"><div class="highlight"><pre><span></span><span class="nf">GET</span> <span class="nn">/api/v0/teams/foo-sre/rosters</span> <span class="kr">HTTP</span><span class="o">/</span><span class="m">1.1</span>
|
|
<span class="na">Host</span><span class="o">:</span> <span class="l">example.com</span>
|
|
</pre></div>
|
|
</div>
|
|
<p><strong>Example response</strong>:</p>
|
|
<div class="highlight-http"><div class="highlight"><pre><span></span><span class="kr">HTTP</span><span class="o">/</span><span class="m">1.1</span> <span class="m">200</span> <span class="ne">OK</span>
|
|
<span class="na">Content-Type</span><span class="o">:</span> <span class="l">application/json</span>
|
|
|
|
<span class="p">{</span>
|
|
<span class="nt">"Managers"</span><span class="p">:</span> <span class="p">{</span>
|
|
<span class="nt">"id"</span><span class="p">:</span> <span class="mi">2730</span><span class="p">,</span>
|
|
<span class="nt">"users"</span><span class="p">:</span> <span class="p">[</span>
|
|
<span class="p">{</span>
|
|
<span class="nt">"in_rotation"</span><span class="p">:</span> <span class="kc">true</span><span class="p">,</span>
|
|
<span class="nt">"name"</span><span class="p">:</span> <span class="s2">"foo"</span>
|
|
<span class="p">}</span>
|
|
<span class="p">],</span>
|
|
<span class="nt">"schedules"</span><span class="p">:</span> <span class="p">[</span>
|
|
<span class="p">{</span>
|
|
<span class="nt">"auto_populate_threshold"</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span>
|
|
<span class="nt">"roster"</span><span class="p">:</span> <span class="s2">"Managers"</span><span class="p">,</span>
|
|
<span class="nt">"advanced_mode"</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span>
|
|
<span class="nt">"role"</span><span class="p">:</span> <span class="s2">"manager"</span><span class="p">,</span>
|
|
<span class="nt">"team"</span><span class="p">:</span> <span class="s2">"foo-sre"</span><span class="p">,</span>
|
|
<span class="nt">"events"</span><span class="p">:</span> <span class="p">[</span>
|
|
<span class="p">{</span>
|
|
<span class="nt">"duration"</span><span class="p">:</span> <span class="mi">604800</span><span class="p">,</span>
|
|
<span class="nt">"start"</span><span class="p">:</span> <span class="mi">367200</span>
|
|
<span class="p">}</span>
|
|
<span class="p">],</span>
|
|
<span class="nt">"id"</span><span class="p">:</span> <span class="mi">1704</span>
|
|
<span class="p">}</span>
|
|
<span class="p">]</span>
|
|
<span class="p">}</span>
|
|
<span class="p">}</span>
|
|
</pre></div>
|
|
</div>
|
|
<table class="docutils field-list" frame="void" rules="none">
|
|
<col class="field-name" />
|
|
<col class="field-body" />
|
|
<tbody valign="top">
|
|
<tr class="field-odd field"><th class="field-name">Status Codes:</th><td class="field-body"><ul class="first last simple">
|
|
<li><a class="reference external" href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.2.1">200 OK</a> – no error</li>
|
|
</ul>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</dd></dl>
|
|
|
|
<dl class="put">
|
|
<dt id="put--api-v0-teams-team-rosters-roster">
|
|
<code class="descname">PUT </code><code class="descname">/api/v0/teams/{team}/rosters/{roster}</code><a class="headerlink" href="#put--api-v0-teams-team-rosters-roster" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Change roster name. Must have team admin privileges.</p>
|
|
<blockquote>
|
|
<div><strong>Example request:</strong></div></blockquote>
|
|
<div class="highlight-http"><div class="highlight"><pre><span></span><span class="nf">PUT</span> <span class="nn">/api/v0/teams/team-foo/rosters/roster-foo</span> <span class="kr">HTTP</span><span class="o">/</span><span class="m">1.1</span>
|
|
<span class="na">Content-Type</span><span class="o">:</span> <span class="l">application/json</span>
|
|
|
|
<span class="p">{</span>
|
|
<span class="nt">"name"</span><span class="p">:</span> <span class="s2">"roster-bar"</span><span class="p">,</span>
|
|
<span class="p">}</span>
|
|
</pre></div>
|
|
</div>
|
|
<table class="docutils field-list" frame="void" rules="none">
|
|
<col class="field-name" />
|
|
<col class="field-body" />
|
|
<tbody valign="top">
|
|
<tr class="field-odd field"><th class="field-name">Status Codes:</th><td class="field-body"><ul class="first last simple">
|
|
<li><a class="reference external" href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.1">400 Bad Request</a> – Invalid roster name, disallowed characters</li>
|
|
<li><a class="reference external" href="http://tools.ietf.org/html/rfc4918#section-11.2">422 Unprocessable Entity</a> – Duplicate roster name for team</li>
|
|
</ul>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</dd></dl>
|
|
|
|
<dl class="delete">
|
|
<dt id="delete--api-v0-teams-team-rosters-roster">
|
|
<code class="descname">DELETE </code><code class="descname">/api/v0/teams/{team}/rosters/{roster}</code><a class="headerlink" href="#delete--api-v0-teams-team-rosters-roster" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Delete roster</p>
|
|
</dd></dl>
|
|
|
|
<dl class="get">
|
|
<dt id="get--api-v0-teams-team-rosters-roster-users">
|
|
<code class="descname">GET </code><code class="descname">/api/v0/teams/{team}/rosters/{roster}/users</code><a class="headerlink" href="#get--api-v0-teams-team-rosters-roster-users" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Get all users for a team roster</p>
|
|
</dd></dl>
|
|
|
|
<dl class="post">
|
|
<dt id="post--api-v0-teams-team-rosters-roster-users">
|
|
<code class="descname">POST </code><code class="descname">/api/v0/teams/{team}/rosters/{roster}/users</code><a class="headerlink" href="#post--api-v0-teams-team-rosters-roster-users" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Add user to a roster for a team</p>
|
|
</dd></dl>
|
|
|
|
<dl class="put">
|
|
<dt id="put--api-v0-teams-team-rosters-roster-users-user">
|
|
<code class="descname">PUT </code><code class="descname">/api/v0/teams/{team}/rosters/{roster}/users/{user}</code><a class="headerlink" href="#put--api-v0-teams-team-rosters-roster-users-user" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Put a user into/out of rotation within a given roster</p>
|
|
<p><strong>Example request</strong>:</p>
|
|
<div class="highlight-http"><div class="highlight"><pre><span></span><span class="nf">PUT</span> <span class="nn">/v0/api/teams/team_foo/rosters/best_coast/users/user1</span> <span class="kr">HTTP</span><span class="o">/</span><span class="m">1.1</span>
|
|
<span class="na">Content-Type</span><span class="o">:</span> <span class="l">application/json</span>
|
|
|
|
<span class="p">{</span><span class="nt">"in_rotation"</span><span class="p">:</span> <span class="kc">false</span><span class="p">}</span>
|
|
</pre></div>
|
|
</div>
|
|
<p><strong>Example response</strong>:</p>
|
|
<div class="highlight-http"><div class="highlight"><pre><span></span><span class="kr">HTTP</span><span class="o">/</span><span class="m">1.1</span> <span class="m">200</span> <span class="ne">OK</span>
|
|
<span class="na">Content-Type</span><span class="o">:</span> <span class="l">application/json</span>
|
|
|
|
<span class="p">[]</span>
|
|
</pre></div>
|
|
</div>
|
|
<table class="docutils field-list" frame="void" rules="none">
|
|
<col class="field-name" />
|
|
<col class="field-body" />
|
|
<tbody valign="top">
|
|
<tr class="field-odd field"><th class="field-name">Status Codes:</th><td class="field-body"><ul class="first last simple">
|
|
<li><a class="reference external" href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.2.1">200 OK</a> – no error, user status udpated.</li>
|
|
<li><a class="reference external" href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.1">400 Bad Request</a> – invalid request, missing field “in_rotation”.</li>
|
|
</ul>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</dd></dl>
|
|
|
|
<dl class="delete">
|
|
<dt id="delete--api-v0-teams-team-rosters-roster-users-user">
|
|
<code class="descname">DELETE </code><code class="descname">/api/v0/teams/{team}/rosters/{roster}/users/{user}</code><a class="headerlink" href="#delete--api-v0-teams-team-rosters-roster-users-user" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Delete user from roster</p>
|
|
<p><strong>Example request</strong>:</p>
|
|
<div class="highlight-http"><div class="highlight"><pre><span></span><span class="nf">DELETE</span> <span class="nn">/v0/api/teams/team_foo/rosters/best_coast/users/user1</span> <span class="kr">HTTP</span><span class="o">/</span><span class="m">1.1</span>
|
|
</pre></div>
|
|
</div>
|
|
<p><strong>Example response</strong>:</p>
|
|
<div class="highlight-http"><div class="highlight"><pre><span></span><span class="kr">HTTP</span><span class="o">/</span><span class="m">1.1</span> <span class="m">200</span> <span class="ne">OK</span>
|
|
<span class="na">Content-Type</span><span class="o">:</span> <span class="l">application/json</span>
|
|
|
|
<span class="p">[]</span>
|
|
</pre></div>
|
|
</div>
|
|
<table class="docutils field-list" frame="void" rules="none">
|
|
<col class="field-name" />
|
|
<col class="field-body" />
|
|
<tbody valign="top">
|
|
<tr class="field-odd field"><th class="field-name">Status Codes:</th><td class="field-body"><ul class="first last simple">
|
|
<li><a class="reference external" href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.2.1">200 OK</a> – no error, user deleted from roster.</li>
|
|
<li><a class="reference external" href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.5">404 Not Found</a> – roster not found.</li>
|
|
</ul>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</dd></dl>
|
|
|
|
<dl class="post">
|
|
<dt id="post--api-v0-teams-team-rosters-roster-schedules">
|
|
<code class="descname">POST </code><code class="descname">/api/v0/teams/{team}/rosters/{roster}/schedules</code><a class="headerlink" href="#post--api-v0-teams-team-rosters-roster-schedules" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>See below for sample JSON requests.</p>
|
|
<p>Weekly 7*24 shift that starts at Monday 6PM PST:</p>
|
|
<div class="highlight-javascript"><div class="highlight"><pre><span></span><span class="p">{</span>
|
|
<span class="s1">'role'</span><span class="o">:</span> <span class="s1">'primary'</span>
|
|
<span class="s1">'auto_populate_threshold'</span><span class="o">:</span> <span class="mi">21</span><span class="p">,</span>
|
|
<span class="s1">'events'</span><span class="o">:</span><span class="p">[</span>
|
|
<span class="p">{</span><span class="s1">'start'</span><span class="o">:</span> <span class="nx">SECONDS_IN_A_DAY</span> <span class="o">+</span> <span class="mi">18</span> <span class="o">*</span> <span class="nx">SECONDS_IN_AN_HOUR</span><span class="p">,</span>
|
|
<span class="s1">'duration'</span><span class="o">:</span> <span class="nx">SECONDS_IN_A_WEEK</span><span class="p">}</span>
|
|
<span class="p">],</span>
|
|
<span class="s1">'advanced_mode'</span><span class="o">:</span> <span class="mi">0</span>
|
|
<span class="p">}</span>
|
|
</pre></div>
|
|
</div>
|
|
<p>Weekly 7*12 shift that starts at Monday 8AM PST:</p>
|
|
<div class="highlight-javascript"><div class="highlight"><pre><span></span><span class="p">{</span>
|
|
<span class="s1">'role'</span><span class="o">:</span> <span class="s1">'oncall'</span><span class="p">,</span>
|
|
<span class="s1">'events'</span><span class="o">:</span><span class="p">[</span>
|
|
<span class="p">{</span><span class="s1">'start'</span><span class="o">:</span> <span class="nx">SECONDS_IN_A_DAY</span> <span class="o">+</span> <span class="mi">8</span> <span class="o">*</span> <span class="nx">SECONDS_IN_AN_HOUR</span><span class="p">,</span>
|
|
<span class="s1">'duration'</span><span class="o">:</span> <span class="mi">12</span> <span class="o">*</span> <span class="nx">SECONDS_IN_AN_HOUR</span><span class="p">},</span>
|
|
<span class="p">{</span><span class="s1">'start'</span><span class="o">:</span> <span class="mi">2</span> <span class="o">*</span> <span class="nx">SECONDS_IN_A_DAY</span> <span class="o">+</span> <span class="mi">8</span> <span class="o">*</span> <span class="nx">SECONDS_IN_AN_HOUR</span><span class="p">,</span>
|
|
<span class="s1">'duration'</span><span class="o">:</span> <span class="mi">12</span> <span class="o">*</span> <span class="nx">SECONDS_IN_AN_HOUR</span><span class="p">}</span> <span class="p">...</span> <span class="o">*</span><span class="mi">5</span> <span class="nx">more</span><span class="o">*</span>
|
|
<span class="p">],</span>
|
|
<span class="s1">'advanced_mode'</span><span class="o">:</span> <span class="mi">1</span>
|
|
<span class="p">}</span>
|
|
</pre></div>
|
|
</div>
|
|
</dd></dl>
|
|
|
|
<dl class="get">
|
|
<dt id="get--api-v0-teams-team-services">
|
|
<code class="descname">GET </code><code class="descname">/api/v0/teams/{team}/services</code><a class="headerlink" href="#get--api-v0-teams-team-services" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Get list of services mapped to a team</p>
|
|
</dd></dl>
|
|
|
|
<dl class="post">
|
|
<dt id="post--api-v0-teams-team-services">
|
|
<code class="descname">POST </code><code class="descname">/api/v0/teams/{team}/services</code><a class="headerlink" href="#post--api-v0-teams-team-services" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Create team to service mapping</p>
|
|
</dd></dl>
|
|
|
|
<dl class="delete">
|
|
<dt id="delete--api-v0-teams-team-services-service">
|
|
<code class="descname">DELETE </code><code class="descname">/api/v0/teams/{team}/services/{service}</code><a class="headerlink" href="#delete--api-v0-teams-team-services-service" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Delete service team mapping</p>
|
|
</dd></dl>
|
|
|
|
</div>
|
|
<div class="section" id="api-v0-schedules">
|
|
<h2>/api/v0/schedules<a class="headerlink" href="#api-v0-schedules" title="Permalink to this headline">¶</a></h2>
|
|
<dl class="put">
|
|
<dt id="put--api-v0-schedules-schedule_id">
|
|
<code class="descname">PUT </code><code class="descname">/api/v0/schedules/{schedule_id}</code><a class="headerlink" href="#put--api-v0-schedules-schedule_id" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Update a schedule</p>
|
|
</dd></dl>
|
|
|
|
<dl class="delete">
|
|
<dt id="delete--api-v0-schedules-schedule_id">
|
|
<code class="descname">DELETE </code><code class="descname">/api/v0/schedules/{schedule_id}</code><a class="headerlink" href="#delete--api-v0-schedules-schedule_id" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Delete a schedule</p>
|
|
</dd></dl>
|
|
|
|
<dl class="post">
|
|
<dt id="post--api-v0-schedules-schedule_id-populate">
|
|
<code class="descname">POST </code><code class="descname">/api/v0/schedules/{schedule_id}/populate</code><a class="headerlink" href="#post--api-v0-schedules-schedule_id-populate" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Run the scheduler on demand from a given point in time. Deletes existing schedule events if applicable.
|
|
Given the <cite>start</cite> param, this will find the first schedule start time after <cite>start</cite>, then populate out
|
|
to the schedule’s auto_populate_threshold. It will also clear the calendar of any events associated
|
|
with the chosen schedule from the start of the first event it created onward. For example, if <cite>start</cite>
|
|
is Monday, May 1 and the chosen schedule starts on Wednesday, this will create events starting from
|
|
Wednesday, May 3, and delete any events that start after May 3 that are associated with the schedule.</p>
|
|
<p><strong>Example request:</strong></p>
|
|
<div class="highlight-http"><div class="highlight"><pre><span></span><span class="nf">POST</span> <span class="nn">api/v0/</span> <span class="kr">HTTP</span><span class="o">/</span><span class="m">1.1</span>
|
|
<span class="na">Content-Type</span><span class="o">:</span> <span class="l">application/json</span>
|
|
</pre></div>
|
|
</div>
|
|
<table class="docutils field-list" frame="void" rules="none">
|
|
<col class="field-name" />
|
|
<col class="field-body" />
|
|
<tbody valign="top">
|
|
<tr class="field-odd field"><th class="field-name">Status Codes:</th><td class="field-body"><ul class="first last simple">
|
|
<li><a class="reference external" href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.2.1">200 OK</a> – Successful populate</li>
|
|
<li><a class="reference external" href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.1">400 Bad Request</a> – Validation checks failed</li>
|
|
</ul>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</dd></dl>
|
|
|
|
</div>
|
|
<div class="section" id="api-v0-services">
|
|
<h2>/api/v0/services<a class="headerlink" href="#api-v0-services" title="Permalink to this headline">¶</a></h2>
|
|
<dl class="get">
|
|
<dt id="get--api-v0-services">
|
|
<code class="descname">GET </code><code class="descname">/api/v0/services</code><a class="headerlink" href="#get--api-v0-services" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Search for services</p>
|
|
</dd></dl>
|
|
|
|
<dl class="get">
|
|
<dt id="get--api-v0-services-service">
|
|
<code class="descname">GET </code><code class="descname">/api/v0/services/{service}</code><a class="headerlink" href="#get--api-v0-services-service" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Get service id by name</p>
|
|
</dd></dl>
|
|
|
|
<dl class="put">
|
|
<dt id="put--api-v0-services-service">
|
|
<code class="descname">PUT </code><code class="descname">/api/v0/services/{service}</code><a class="headerlink" href="#put--api-v0-services-service" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Change name for a service</p>
|
|
</dd></dl>
|
|
|
|
<dl class="delete">
|
|
<dt id="delete--api-v0-services-service">
|
|
<code class="descname">DELETE </code><code class="descname">/api/v0/services/{service}</code><a class="headerlink" href="#delete--api-v0-services-service" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Delete a service</p>
|
|
</dd></dl>
|
|
|
|
<dl class="get">
|
|
<dt id="get--api-v0-services-service-teams">
|
|
<code class="descname">GET </code><code class="descname">/api/v0/services/{service}/teams</code><a class="headerlink" href="#get--api-v0-services-service-teams" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Get list of team mapped to a service</p>
|
|
</dd></dl>
|
|
|
|
</div>
|
|
<div class="section" id="api-v0-roles">
|
|
<h2>/api/v0/roles<a class="headerlink" href="#api-v0-roles" title="Permalink to this headline">¶</a></h2>
|
|
<dl class="get">
|
|
<dt id="get--api-v0-roles">
|
|
<code class="descname">GET </code><code class="descname">/api/v0/roles</code><a class="headerlink" href="#get--api-v0-roles" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Role search.</p>
|
|
<p><strong>Example request</strong>:</p>
|
|
<div class="highlight-http"><div class="highlight"><pre><span></span><span class="nf">GET</span> <span class="nn">/api/v0/roles?name__startswith=pri</span> <span class="kr">HTTP</span><span class="o">/</span><span class="m">1.1</span>
|
|
<span class="na">Host</span><span class="o">:</span> <span class="l">example.com</span>
|
|
</pre></div>
|
|
</div>
|
|
<p><strong>Example response:</strong></p>
|
|
<div class="highlight-http"><div class="highlight"><pre><span></span><span class="kr">HTTP</span><span class="o">/</span><span class="m">1.1</span> <span class="m">200</span> <span class="ne">OK</span>
|
|
<span class="na">Content-Type</span><span class="o">:</span> <span class="l">application/json</span>
|
|
|
|
<span class="p">[</span>
|
|
<span class="p">{</span>
|
|
<span class="nt">"id"</span><span class="p">:</span> <span class="mi">1</span><span class="p">,</span>
|
|
<span class="nt">"name"</span><span class="p">:</span> <span class="s2">"primary"</span><span class="p">,</span>
|
|
<span class="nt">"display_order"</span><span class="p">:</span> <span class="mi">1</span>
|
|
<span class="p">}</span>
|
|
<span class="p">]</span>
|
|
</pre></div>
|
|
</div>
|
|
<table class="docutils field-list" frame="void" rules="none">
|
|
<col class="field-name" />
|
|
<col class="field-body" />
|
|
<tbody valign="top">
|
|
<tr class="field-odd field"><th class="field-name" colspan="2">Query Parameters:</th></tr>
|
|
<tr class="field-odd field"><td> </td><td class="field-body"><ul class="first last simple">
|
|
<li><strong>id</strong> – id of the role</li>
|
|
<li><strong>id__eq</strong> – id of the role</li>
|
|
<li><strong>id__gt</strong> – id greater than</li>
|
|
<li><strong>id__ge</strong> – id greater than or equal</li>
|
|
<li><strong>id__lt</strong> – id less than</li>
|
|
<li><strong>id__le</strong> – id less than or equal</li>
|
|
<li><strong>name</strong> – role name</li>
|
|
<li><strong>name__eq</strong> – role name</li>
|
|
<li><strong>name__contains</strong> – role name contains param</li>
|
|
<li><strong>name__startswith</strong> – role name starts with param</li>
|
|
<li><strong>name__endswith</strong> – role name ends with param</li>
|
|
</ul>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</dd></dl>
|
|
|
|
</div>
|
|
<div class="section" id="api-v0-events">
|
|
<h2>/api/v0/events<a class="headerlink" href="#api-v0-events" title="Permalink to this headline">¶</a></h2>
|
|
<dl class="get">
|
|
<dt id="get--api-v0-events">
|
|
<code class="descname">GET </code><code class="descname">/api/v0/events</code><a class="headerlink" href="#get--api-v0-events" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p><a class="reference external" href="http:get">http:get</a>:: /api/v0/events</p>
|
|
<p>Search for events.</p>
|
|
<p><strong>Example request</strong>:</p>
|
|
<div class="highlight-http"><div class="highlight"><pre><span></span><span class="nf">GET</span> <span class="nn">/api/v0/events?team=foo-sre&end__gt=1487466146&role=primary</span> <span class="kr">HTTP</span><span class="o">/</span><span class="m">1.1</span>
|
|
<span class="na">Host</span><span class="o">:</span> <span class="l">example.com</span>
|
|
</pre></div>
|
|
</div>
|
|
<p><strong>Example response</strong>:</p>
|
|
<div class="highlight-http"><div class="highlight"><pre><span></span><span class="kr">HTTP</span><span class="o">/</span><span class="m">1.1</span> <span class="m">200</span> <span class="ne">OK</span>
|
|
<span class="na">Content-Type</span><span class="o">:</span> <span class="l">application/json</span>
|
|
|
|
<span class="p">[</span>
|
|
<span class="p">{</span>
|
|
<span class="nt">"start"</span><span class="p">:</span> <span class="mi">1488441600</span><span class="p">,</span>
|
|
<span class="nt">"end"</span><span class="p">:</span> <span class="mi">1489132800</span><span class="p">,</span>
|
|
<span class="nt">"team"</span><span class="p">:</span> <span class="s2">"foo-sre"</span><span class="p">,</span>
|
|
<span class="nt">"link_id"</span><span class="p">:</span> <span class="kc">null</span><span class="p">,</span>
|
|
<span class="nt">"schedule_id"</span><span class="p">:</span> <span class="kc">null</span><span class="p">,</span>
|
|
<span class="nt">"role"</span><span class="p">:</span> <span class="s2">"primary"</span><span class="p">,</span>
|
|
<span class="nt">"user"</span><span class="p">:</span> <span class="s2">"foo"</span><span class="p">,</span>
|
|
<span class="nt">"full_name"</span><span class="p">:</span> <span class="s2">"Foo Icecream"</span><span class="p">,</span>
|
|
<span class="nt">"id"</span><span class="p">:</span> <span class="mi">187795</span>
|
|
<span class="p">},</span>
|
|
<span class="p">{</span>
|
|
<span class="nt">"start"</span><span class="p">:</span> <span class="mi">1488441600</span><span class="p">,</span>
|
|
<span class="nt">"end"</span><span class="p">:</span> <span class="mi">1489132800</span><span class="p">,</span>
|
|
<span class="nt">"team"</span><span class="p">:</span> <span class="s2">"foo-sre"</span><span class="p">,</span>
|
|
<span class="nt">"link_id"</span><span class="p">:</span> <span class="s2">"8a8ae77b8c52448db60c8a701e7bffc2"</span><span class="p">,</span>
|
|
<span class="nt">"schedule_id"</span><span class="p">:</span> <span class="mi">123</span><span class="p">,</span>
|
|
<span class="nt">"role"</span><span class="p">:</span> <span class="s2">"primary"</span><span class="p">,</span>
|
|
<span class="nt">"user"</span><span class="p">:</span> <span class="s2">"bar"</span><span class="p">,</span>
|
|
<span class="nt">"full_name"</span><span class="p">:</span> <span class="s2">"Bar Apple"</span><span class="p">,</span>
|
|
<span class="nt">"id"</span><span class="p">:</span> <span class="mi">187795</span>
|
|
<span class="p">}</span>
|
|
<span class="p">]</span>
|
|
</pre></div>
|
|
</div>
|
|
<table class="docutils field-list" frame="void" rules="none">
|
|
<col class="field-name" />
|
|
<col class="field-body" />
|
|
<tbody valign="top">
|
|
<tr class="field-odd field"><th class="field-name" colspan="2">Query Parameters:</th></tr>
|
|
<tr class="field-odd field"><td> </td><td class="field-body"><ul class="first simple">
|
|
<li><strong>team</strong> – team name</li>
|
|
<li><strong>user</strong> – user name</li>
|
|
<li><strong>role</strong> – role name</li>
|
|
<li><strong>id</strong> – id of the event</li>
|
|
<li><strong>start__gt</strong> – start time (unix timestamp) greater than</li>
|
|
<li><strong>start__ge</strong> – start time (unix timestamp) greater than or equal</li>
|
|
<li><strong>start__lt</strong> – start time (unix timestamp) less than</li>
|
|
<li><strong>start__le</strong> – start time (unix timestamp) less than or equal</li>
|
|
<li><strong>end__gt</strong> – end time (unix timestamp) greater than</li>
|
|
<li><strong>end__ge</strong> – end time (unix timestamp) greater than or equal</li>
|
|
<li><strong>end__lt</strong> – end time (unix timestamp) less than</li>
|
|
<li><strong>end__le</strong> – end time (unix timestamp) less than or equal</li>
|
|
</ul>
|
|
</td>
|
|
</tr>
|
|
<tr class="field-even field"><th class="field-name">Status Codes:</th><td class="field-body"><ul class="first last simple">
|
|
<li><a class="reference external" href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.2.1">200 OK</a> – no error</li>
|
|
<li><a class="reference external" href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.1">400 Bad Request</a> – bad request</li>
|
|
</ul>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</dd></dl>
|
|
|
|
<dl class="post">
|
|
<dt id="post--api-v0-events">
|
|
<code class="descname">POST </code><code class="descname">/api/v0/events</code><a class="headerlink" href="#post--api-v0-events" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Endpoint for creating event. Responds with event id for created event</p>
|
|
<p><strong>Example request:</strong></p>
|
|
<div class="highlight-http"><div class="highlight"><pre><span></span><span class="nf">POST</span> <span class="nn">/v0/events</span> <span class="kr">HTTP</span><span class="o">/</span><span class="m">1.1</span>
|
|
<span class="na">Content-Type</span><span class="o">:</span> <span class="l">application/json</span>
|
|
|
|
<span class="p">{</span>
|
|
<span class="nt">"start"</span><span class="p">:</span> <span class="mi">1493667700</span><span class="p">,</span>
|
|
<span class="nt">"end"</span><span class="p">:</span> <span class="mi">149368700</span><span class="p">,</span>
|
|
<span class="nt">"user"</span><span class="p">:</span> <span class="s2">"jdoe"</span><span class="p">,</span>
|
|
<span class="nt">"team"</span><span class="p">:</span> <span class="s2">"team-foo"</span><span class="p">,</span>
|
|
<span class="nt">"role"</span><span class="p">:</span> <span class="s2">"primary"</span><span class="p">,</span>
|
|
<span class="p">}</span>
|
|
</pre></div>
|
|
</div>
|
|
<p><strong>Example response:</strong></p>
|
|
<div class="highlight-http"><div class="highlight"><pre><span></span><span class="kr">HTTP</span><span class="o">/</span><span class="m">1.1</span> <span class="m">201</span> <span class="ne">Created</span>
|
|
<span class="na">Content-Type</span><span class="o">:</span> <span class="l">application/json</span>
|
|
|
|
<span class="mi">1</span>
|
|
</pre></div>
|
|
</div>
|
|
<table class="docutils field-list" frame="void" rules="none">
|
|
<col class="field-name" />
|
|
<col class="field-body" />
|
|
<tbody valign="top">
|
|
<tr class="field-odd field"><th class="field-name">Status Codes:</th><td class="field-body"><ul class="first last simple">
|
|
<li><a class="reference external" href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.2.2">201 Created</a> – Event created</li>
|
|
<li><a class="reference external" href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.1">400 Bad Request</a> – Event validation checks failed</li>
|
|
<li><a class="reference external" href="http://tools.ietf.org/html/rfc4918#section-11.2">422 Unprocessable Entity</a> – Event creation failed: nonexistent role/event/team</li>
|
|
</ul>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</dd></dl>
|
|
|
|
<dl class="get">
|
|
<dt id="get--api-v0-events-event_id">
|
|
<code class="descname">GET </code><code class="descname">/api/v0/events/{event_id}</code><a class="headerlink" href="#get--api-v0-events-event_id" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Get event by id.</p>
|
|
<p><strong>Example request:</strong></p>
|
|
<div class="highlight-http"><div class="highlight"><pre><span></span><span class="nf">GET</span> <span class="nn">/api/v0/events/1234</span> <span class="kr">HTTP</span><span class="o">/</span><span class="m">1.1</span>
|
|
<span class="na">Host</span><span class="o">:</span> <span class="l">example.com</span>
|
|
</pre></div>
|
|
</div>
|
|
<p><strong>Example response:</strong></p>
|
|
<div class="highlight-http"><div class="highlight"><pre><span></span><span class="kr">HTTP</span><span class="o">/</span><span class="m">1.1</span> <span class="m">200</span> <span class="ne">OK</span>
|
|
<span class="na">Content-Type</span><span class="o">:</span> <span class="l">application/json</span>
|
|
|
|
<span class="p">{</span>
|
|
<span class="nt">"end"</span><span class="p">:</span> <span class="mi">1428336000</span><span class="p">,</span>
|
|
<span class="nt">"full_name"</span><span class="p">:</span> <span class="s2">"John Doe"</span><span class="p">,</span>
|
|
<span class="nt">"id"</span><span class="p">:</span> <span class="mi">1234</span><span class="p">,</span>
|
|
<span class="nt">"link_id"</span><span class="p">:</span> <span class="kc">null</span><span class="p">,</span>
|
|
<span class="nt">"role"</span><span class="p">:</span> <span class="s2">"primary"</span><span class="p">,</span>
|
|
<span class="nt">"schedule_id"</span><span class="p">:</span> <span class="mi">4321</span><span class="p">,</span>
|
|
<span class="nt">"start"</span><span class="p">:</span> <span class="mi">1427731200</span><span class="p">,</span>
|
|
<span class="nt">"team"</span><span class="p">:</span> <span class="s2">"team-foo"</span><span class="p">,</span>
|
|
<span class="nt">"user"</span><span class="p">:</span> <span class="s2">"jdoe"</span>
|
|
<span class="p">}</span>
|
|
</pre></div>
|
|
</div>
|
|
<table class="docutils field-list" frame="void" rules="none">
|
|
<col class="field-name" />
|
|
<col class="field-body" />
|
|
<tbody valign="top">
|
|
<tr class="field-odd field"><th class="field-name">Status Codes:</th><td class="field-body"><ul class="first last simple">
|
|
<li><a class="reference external" href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.2.1">200 OK</a> – no error</li>
|
|
<li><a class="reference external" href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.5">404 Not Found</a> – Event not found</li>
|
|
</ul>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</dd></dl>
|
|
|
|
<dl class="put">
|
|
<dt id="put--api-v0-events-event_id">
|
|
<code class="descname">PUT </code><code class="descname">/api/v0/events/{event_id}</code><a class="headerlink" href="#put--api-v0-events-event_id" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Update an event by id; anyone can update any event within the team</p>
|
|
<p><strong>Example request:</strong></p>
|
|
<div class="highlight-http"><div class="highlight"><pre><span></span><span class="nf">PUT</span> <span class="nn">/api/v0/events/1234</span> <span class="kr">HTTP</span><span class="o">/</span><span class="m">1.1</span>
|
|
<span class="na">Content-Type</span><span class="o">:</span> <span class="l">application/json</span>
|
|
|
|
<span class="p">{</span>
|
|
<span class="nt">"start"</span><span class="p">:</span> <span class="mi">1428336000</span><span class="p">,</span>
|
|
<span class="nt">"end"</span><span class="p">:</span> <span class="mi">1428338000</span><span class="p">,</span>
|
|
<span class="nt">"user"</span><span class="p">:</span> <span class="s2">"asmith"</span><span class="p">,</span>
|
|
<span class="nt">"role"</span><span class="p">:</span> <span class="s2">"secondary"</span>
|
|
<span class="p">}</span>
|
|
</pre></div>
|
|
</div>
|
|
<table class="docutils field-list" frame="void" rules="none">
|
|
<col class="field-name" />
|
|
<col class="field-body" />
|
|
<tbody valign="top">
|
|
<tr class="field-odd field"><th class="field-name">Status Codes:</th><td class="field-body"><ul class="first last simple">
|
|
<li><a class="reference external" href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.2.1">200 OK</a> – Successful update</li>
|
|
</ul>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</dd></dl>
|
|
|
|
<dl class="delete">
|
|
<dt id="delete--api-v0-events-event_id">
|
|
<code class="descname">DELETE </code><code class="descname">/api/v0/events/{event_id}</code><a class="headerlink" href="#delete--api-v0-events-event_id" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Delete an event by id, anyone on the team can delete that team’s events
|
|
<strong>Example request:</strong></p>
|
|
<div class="highlight-http"><div class="highlight"><pre><span></span><span class="nf">DELETE</span> <span class="nn">/api/v0/events/1234</span> <span class="kr">HTTP</span><span class="o">/</span><span class="m">1.1</span>
|
|
</pre></div>
|
|
</div>
|
|
<table class="docutils field-list" frame="void" rules="none">
|
|
<col class="field-name" />
|
|
<col class="field-body" />
|
|
<tbody valign="top">
|
|
<tr class="field-odd field"><th class="field-name">Status Codes:</th><td class="field-body"><ul class="first last simple">
|
|
<li><a class="reference external" href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.2.1">200 OK</a> – Successful delete</li>
|
|
<li><a class="reference external" href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.4">403 Forbidden</a> – Delete not allowed; logged in user is not a team member</li>
|
|
<li><a class="reference external" href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.5">404 Not Found</a> – Event not found</li>
|
|
</ul>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</dd></dl>
|
|
|
|
<dl class="post">
|
|
<dt id="post--api-v0-events-swap">
|
|
<code class="descname">POST </code><code class="descname">/api/v0/events/swap</code><a class="headerlink" href="#post--api-v0-events-swap" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Swap events. Takes an object specifying the 2 events to be swapped. Swap can
|
|
take either single events or event sets, depending on the value of the
|
|
“linked” attribute. If “linked” is True, the API interprets the “id”
|
|
attribute as a link_id. Otherwise, it’s assumed to be an event_id. Note
|
|
that this allows swapping a single event with a linked event.</p>
|
|
<p><strong>Example request</strong>:</p>
|
|
<div class="highlight-http"><div class="highlight"><pre><span></span><span class="nf">POST</span> <span class="nn">api/v0/events/swap</span> <span class="kr">HTTP</span><span class="o">/</span><span class="m">1.1</span>
|
|
<span class="na">Content-Type</span><span class="o">:</span> <span class="l">application/json</span>
|
|
|
|
<span class="p">{</span>
|
|
<span class="nt">"events"</span><span class="p">:</span>
|
|
<span class="p">[</span>
|
|
<span class="p">{</span>
|
|
<span class="nt">"id"</span><span class="p">:</span> <span class="mi">1</span><span class="p">,</span>
|
|
<span class="nt">"linked"</span><span class="p">:</span> <span class="kc">false</span>
|
|
<span class="p">},</span>
|
|
<span class="p">{</span>
|
|
<span class="nt">"id"</span><span class="p">:</span> <span class="s2">"da515a45e2b2467bbdc9ea3bc7826d36"</span><span class="p">,</span>
|
|
<span class="nt">"linked"</span><span class="p">:</span> <span class="kc">true</span>
|
|
<span class="p">}</span>
|
|
<span class="p">]</span>
|
|
<span class="p">}</span>
|
|
</pre></div>
|
|
</div>
|
|
<table class="docutils field-list" frame="void" rules="none">
|
|
<col class="field-name" />
|
|
<col class="field-body" />
|
|
<tbody valign="top">
|
|
<tr class="field-odd field"><th class="field-name">Status Codes:</th><td class="field-body"><ul class="first last simple">
|
|
<li><a class="reference external" href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.2.1">200 OK</a> – Successful swap</li>
|
|
<li><a class="reference external" href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.1">400 Bad Request</a> – Validation checks failed</li>
|
|
</ul>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</dd></dl>
|
|
|
|
<dl class="post">
|
|
<dt id="post--api-v0-events-override">
|
|
<code class="descname">POST </code><code class="descname">/api/v0/events/override</code><a class="headerlink" href="#post--api-v0-events-override" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Override/substitute existing events. For example, if the current on-call is unexpectedly busy from 3-4, another
|
|
user can override that event for that time period and take over the shift. Override may delete or edit
|
|
existing events, and may create new events. The API’s response contains the information for all undeleted
|
|
events that were passed in the event_ids param, along with the events created by the override.</p>
|
|
<dl class="docutils">
|
|
<dt>Params:</dt>
|
|
<dd><ul class="first last simple">
|
|
<li><strong>start</strong>: Start time for the event substitution</li>
|
|
<li><strong>end</strong>: End time for event substitution</li>
|
|
<li><strong>event_ids</strong>: List of event ids to override</li>
|
|
<li><strong>user</strong>: User who will be taking over</li>
|
|
</ul>
|
|
</dd>
|
|
</dl>
|
|
<p><strong>Example request:</strong></p>
|
|
<div class="highlight-http"><div class="highlight"><pre><span></span><span class="nf">POST</span> <span class="nn">api/v0/events/override</span> <span class="kr">HTTP</span><span class="o">/</span><span class="m">1.1</span>
|
|
<span class="na">Content-Type</span><span class="o">:</span> <span class="l">application/json</span>
|
|
|
|
<span class="p">{</span>
|
|
<span class="nt">"start"</span><span class="p">:</span> <span class="mi">1493677400</span><span class="p">,</span>
|
|
<span class="nt">"end"</span><span class="p">:</span> <span class="mi">1493678400</span><span class="p">,</span>
|
|
<span class="nt">"event_ids"</span><span class="p">:</span> <span class="p">[</span><span class="mi">1</span><span class="p">],</span>
|
|
<span class="nt">"user"</span><span class="p">:</span> <span class="s2">"jdoe"</span>
|
|
<span class="p">}</span>
|
|
</pre></div>
|
|
</div>
|
|
<p><strong>Example response:</strong></p>
|
|
<div class="highlight-http"><div class="highlight"><pre><span></span><span class="kr">HTTP</span><span class="o">/</span><span class="m">1.1</span> <span class="m">200</span> <span class="ne">OK</span>
|
|
<span class="na">Content-Type</span><span class="o">:</span> <span class="l">application/json</span>
|
|
|
|
<span class="p">[</span>
|
|
<span class="p">{</span>
|
|
<span class="nt">"end"</span><span class="p">:</span> <span class="mi">1493678400</span><span class="p">,</span>
|
|
<span class="nt">"full_name"</span><span class="p">:</span> <span class="s2">"John Doe"</span><span class="p">,</span>
|
|
<span class="nt">"id"</span><span class="p">:</span> <span class="mi">3</span><span class="p">,</span>
|
|
<span class="nt">"role"</span><span class="p">:</span> <span class="s2">"primary"</span><span class="p">,</span>
|
|
<span class="nt">"start"</span><span class="p">:</span> <span class="mi">1493677400</span><span class="p">,</span>
|
|
<span class="nt">"team"</span><span class="p">:</span> <span class="s2">"team-foo"</span><span class="p">,</span>
|
|
<span class="nt">"user"</span><span class="p">:</span> <span class="s2">"jdoe"</span>
|
|
<span class="p">}</span>
|
|
<span class="p">]</span>
|
|
</pre></div>
|
|
</div>
|
|
</dd></dl>
|
|
|
|
<dl class="post">
|
|
<dt id="post--api-v0-events-link">
|
|
<code class="descname">POST </code><code class="descname">/api/v0/events/link</code><a class="headerlink" href="#post--api-v0-events-link" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Endpoint for creating linked events. Responds with event ids for created events.
|
|
Linked events can be swapped in a group, and users are reminded only on the first event of a
|
|
linked series. Linked events have a link_id attribute containing a uuid. All events
|
|
with an equivalent link_id are considered “linked together” in a single set. Editing any single event
|
|
in the set will break the link for that event, clearing the link_id field. Otherwise, linked events behave
|
|
the same as any non-linked event.</p>
|
|
<p><strong>Example request:</strong></p>
|
|
<div class="highlight-http"><div class="highlight"><pre><span></span><span class="nf">POST</span> <span class="nn">/api/v0/events/link</span> <span class="kr">HTTP</span><span class="o">/</span><span class="m">1.1</span>
|
|
<span class="na">Content-Type</span><span class="o">:</span> <span class="l">application/json</span>
|
|
|
|
<span class="p">[</span>
|
|
<span class="p">{</span>
|
|
<span class="nt">"start"</span><span class="p">:</span> <span class="mi">1493667700</span><span class="p">,</span>
|
|
<span class="nt">"end"</span><span class="p">:</span> <span class="mi">149368700</span><span class="p">,</span>
|
|
<span class="nt">"user"</span><span class="p">:</span> <span class="s2">"jdoe"</span><span class="p">,</span>
|
|
<span class="nt">"team"</span><span class="p">:</span> <span class="s2">"team-foo"</span><span class="p">,</span>
|
|
<span class="nt">"role"</span><span class="p">:</span> <span class="s2">"primary"</span><span class="p">,</span>
|
|
<span class="p">},</span>
|
|
<span class="p">{</span>
|
|
<span class="nt">"start"</span><span class="p">:</span> <span class="mi">1493677700</span><span class="p">,</span>
|
|
<span class="nt">"end"</span><span class="p">:</span> <span class="mi">149387700</span><span class="p">,</span>
|
|
<span class="nt">"user"</span><span class="p">:</span> <span class="s2">"jdoe"</span><span class="p">,</span>
|
|
<span class="nt">"team"</span><span class="p">:</span> <span class="s2">"team-foo"</span><span class="p">,</span>
|
|
<span class="nt">"role"</span><span class="p">:</span> <span class="s2">"primary"</span><span class="p">,</span>
|
|
<span class="p">}</span>
|
|
<span class="p">]</span>
|
|
</pre></div>
|
|
</div>
|
|
<p><strong>Example response:</strong></p>
|
|
<div class="highlight-http"><div class="highlight"><pre><span></span><span class="kr">HTTP</span><span class="o">/</span><span class="m">1.1</span> <span class="m">201</span> <span class="ne">Created</span>
|
|
<span class="na">Content-Type</span><span class="o">:</span> <span class="l">application/json</span>
|
|
|
|
<span class="p">[</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">]</span>
|
|
</pre></div>
|
|
</div>
|
|
<table class="docutils field-list" frame="void" rules="none">
|
|
<col class="field-name" />
|
|
<col class="field-body" />
|
|
<tbody valign="top">
|
|
<tr class="field-odd field"><th class="field-name">Status Codes:</th><td class="field-body"><ul class="first last simple">
|
|
<li><a class="reference external" href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.2.2">201 Created</a> – Event created</li>
|
|
<li><a class="reference external" href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.1">400 Bad Request</a> – Event validation checks failed</li>
|
|
<li><a class="reference external" href="http://tools.ietf.org/html/rfc4918#section-11.2">422 Unprocessable Entity</a> – Event creation failed: nonexistent role/event/team</li>
|
|
</ul>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</dd></dl>
|
|
|
|
</div>
|
|
<div class="section" id="api-v0-users">
|
|
<h2>/api/v0/users<a class="headerlink" href="#api-v0-users" title="Permalink to this headline">¶</a></h2>
|
|
<dl class="get">
|
|
<dt id="get--api-v0-users">
|
|
<code class="descname">GET </code><code class="descname">/api/v0/users</code><a class="headerlink" href="#get--api-v0-users" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Search users</p>
|
|
</dd></dl>
|
|
|
|
<dl class="post">
|
|
<dt id="post--api-v0-users">
|
|
<code class="descname">POST </code><code class="descname">/api/v0/users</code><a class="headerlink" href="#post--api-v0-users" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Create user</p>
|
|
</dd></dl>
|
|
|
|
<dl class="get">
|
|
<dt id="get--api-v0-users-user_name">
|
|
<code class="descname">GET </code><code class="descname">/api/v0/users/{user_name}</code><a class="headerlink" href="#get--api-v0-users-user_name" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Get user info by name</p>
|
|
</dd></dl>
|
|
|
|
<dl class="put">
|
|
<dt id="put--api-v0-users-user_name">
|
|
<code class="descname">PUT </code><code class="descname">/api/v0/users/{user_name}</code><a class="headerlink" href="#put--api-v0-users-user_name" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Update user info</p>
|
|
</dd></dl>
|
|
|
|
<dl class="delete">
|
|
<dt id="delete--api-v0-users-user_name">
|
|
<code class="descname">DELETE </code><code class="descname">/api/v0/users/{user_name}</code><a class="headerlink" href="#delete--api-v0-users-user_name" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Delete user by name</p>
|
|
</dd></dl>
|
|
|
|
<dl class="get">
|
|
<dt id="get--api-v0-users-user_name-teams">
|
|
<code class="descname">GET </code><code class="descname">/api/v0/users/{user_name}/teams</code><a class="headerlink" href="#get--api-v0-users-user_name-teams" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Get active teams by user name</p>
|
|
</dd></dl>
|
|
|
|
</div>
|
|
<div class="section" id="api-v0-notification-types">
|
|
<h2>/api/v0/notification_types<a class="headerlink" href="#api-v0-notification-types" title="Permalink to this headline">¶</a></h2>
|
|
<dl class="get">
|
|
<dt id="get--api-v0-notification_types">
|
|
<code class="descname">GET </code><code class="descname">/api/v0/notification_types</code><a class="headerlink" href="#get--api-v0-notification_types" title="Permalink to this definition">¶</a></dt>
|
|
<dd><p>Returns all notification types and whether they are reminder notifications.</p>
|
|
<p><strong>Example request:</strong></p>
|
|
<div class="highlight-http"><div class="highlight"><pre><span></span><span class="nf">GET</span> <span class="nn">/api/v0/notification_types</span> <span class="kr">HTTP</span><span class="o">/</span><span class="m">1.1</span>
|
|
<span class="na">Host</span><span class="o">:</span> <span class="l">example.com</span>
|
|
</pre></div>
|
|
</div>
|
|
<p><strong>Example response:</strong></p>
|
|
<div class="highlight-http"><div class="highlight"><pre><span></span><span class="kr">HTTP</span><span class="o">/</span><span class="m">1.1</span> <span class="m">200</span> <span class="ne">OK</span>
|
|
<span class="na">Content-Type</span><span class="o">:</span> <span class="l">application/json</span>
|
|
|
|
<span class="p">[</span>
|
|
<span class="p">{</span>
|
|
<span class="nt">"name"</span><span class="p">:</span> <span class="s2">"oncall_reminder"</span><span class="p">,</span>
|
|
<span class="nt">"is_reminder"</span><span class="p">:</span> <span class="mi">1</span>
|
|
<span class="p">}</span>
|
|
<span class="p">]</span>
|
|
</pre></div>
|
|
</div>
|
|
</dd></dl>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
</div>
|
|
<div class="articleComments">
|
|
|
|
</div>
|
|
</div>
|
|
<footer>
|
|
|
|
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
|
|
|
|
|
|
<a href="user_guide.html" class="btn btn-neutral" title="User guide" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left"></span> Previous</a>
|
|
|
|
</div>
|
|
|
|
|
|
<hr/>
|
|
|
|
<div role="contentinfo">
|
|
<p>
|
|
© Copyright 2017, The Iris team.
|
|
|
|
</p>
|
|
</div>
|
|
Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>.
|
|
|
|
</footer>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
</section>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<script type="text/javascript">
|
|
var DOCUMENTATION_OPTIONS = {
|
|
URL_ROOT:'./',
|
|
VERSION:'1.0.0',
|
|
COLLAPSE_INDEX:false,
|
|
FILE_SUFFIX:'.html',
|
|
HAS_SOURCE: true,
|
|
SOURCELINK_SUFFIX: '.txt'
|
|
};
|
|
</script>
|
|
<script type="text/javascript" src="_static/jquery.js"></script>
|
|
<script type="text/javascript" src="_static/underscore.js"></script>
|
|
<script type="text/javascript" src="_static/doctools.js"></script>
|
|
|
|
|
|
|
|
|
|
|
|
<script type="text/javascript" src="_static/js/theme.js"></script>
|
|
|
|
|
|
|
|
|
|
<script type="text/javascript">
|
|
jQuery(function () {
|
|
SphinxRtdTheme.StickyNav.enable();
|
|
});
|
|
</script>
|
|
|
|
|
|
</body>
|
|
</html> |