Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DOCS] Create open API specification for disable/enable rule and mute/unmute all alerts #148360 #148494

Merged
merged 5 commits into from
Jan 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
244 changes: 244 additions & 0 deletions docs/api-generated/rules/rule-apis-passthru.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,14 @@ Any modifications made to this file will be overwritten.
<h4><a href="#Alerting">Alerting</a></h4>
<ul>
<li><a href="#deleteRule"><code><span class="http-method">delete</span> /s/{spaceId}/api/alerting/rule/{ruleId}</code></a></li>
<li><a href="#disableRule"><code><span class="http-method">post</span> /s/{spaceId}/api/alerting/rule/{ruleId}/_disable</code></a></li>
<li><a href="#enableRule"><code><span class="http-method">post</span> /s/{spaceId}/api/alerting/rule/{ruleId}/_enable</code></a></li>
<li><a href="#findRules"><code><span class="http-method">get</span> /s/{spaceId}/api/alerting/rules/_find</code></a></li>
<li><a href="#getRule"><code><span class="http-method">get</span> /s/{spaceId}/api/alerting/rule/{ruleId}</code></a></li>
<li><a href="#muteAlert"><code><span class="http-method">post</span> /s/{spaceId}/api/alerting/rule/{ruleId}/alert/{alertId}/_mute</code></a></li>
<li><a href="#muteAllAlerts"><code><span class="http-method">post</span> /s/{spaceId}/api/alerting/rule/{ruleId}/_mute_all</code></a></li>
<li><a href="#unmuteAlert"><code><span class="http-method">post</span> /s/{spaceId}/api/alerting/rule/{ruleId}/alert/{alertId}/_unmute</code></a></li>
<li><a href="#unmuteAllAlerts"><code><span class="http-method">post</span> /s/{spaceId}/api/alerting/rule/{ruleId}/_unmute_all</code></a></li>
<li><a href="#updateRule"><code><span class="http-method">put</span> /s/{spaceId}/api/alerting/rule/{ruleId}</code></a></li>
</ul>

Expand Down Expand Up @@ -54,6 +60,84 @@ Any modifications made to this file will be overwritten.



<!--Todo: process Response Object and its headers, schema, examples -->



<h3 class="field-label">Responses</h3>
<h4 class="field-label">204</h4>
Indicates a successful call.
<a href="#"></a>
</div> <!-- method -->
<hr/>
<div class="method"><a name="disableRule"/>
<div class="method-path">
<a class="up" href="#__Methods">Up</a>
<pre class="post"><code class="huge"><span class="http-method">post</span> /s/{spaceId}/api/alerting/rule/{ruleId}/_disable</code></pre></div>
<div class="method-summary">Disable a rule. (<span class="nickname">disableRule</span>)</div>
<div class="method-notes">You must have <code>all</code> privileges for the appropriate Kibana features, depending on the <code>consumer</code> and <code>rule_type_id</code> of the rule. For example, the <strong>Management &gt; Stack Rules</strong> feature, <strong>Analytics &gt; Discover</strong> and <strong>Machine Learning</strong> features, <strong>Observability</strong>, and <strong>Security</strong> features.</div>

<h3 class="field-label">Path parameters</h3>
<div class="field-items">
<div class="param">ruleId (required)</div>

<div class="param-desc"><span class="param-type">Path Parameter</span> &mdash; An identifier for the rule. default: null </div><div class="param">spaceId (required)</div>

<div class="param-desc"><span class="param-type">Path Parameter</span> &mdash; An identifier for the space. If <code>/s/</code> and the identifier are omitted from the path, the default space is used. default: null </div>
</div> <!-- field-items -->



<h3 class="field-label">Request headers</h3>
<div class="field-items">
<div class="param">kbn-xsrf (required)</div>

<div class="param-desc"><span class="param-type">Header Parameter</span> &mdash; default: null </div>

</div> <!-- field-items -->




<!--Todo: process Response Object and its headers, schema, examples -->



<h3 class="field-label">Responses</h3>
<h4 class="field-label">204</h4>
Indicates a successful call.
<a href="#"></a>
</div> <!-- method -->
<hr/>
<div class="method"><a name="enableRule"/>
<div class="method-path">
<a class="up" href="#__Methods">Up</a>
<pre class="post"><code class="huge"><span class="http-method">post</span> /s/{spaceId}/api/alerting/rule/{ruleId}/_enable</code></pre></div>
<div class="method-summary">Enable a rule. (<span class="nickname">enableRule</span>)</div>
<div class="method-notes">This API supports token-based authentication only. You must have <code>all</code> privileges for the appropriate Kibana features, depending on the <code>consumer</code> and <code>rule_type_id</code> of the rule. For example, the <strong>Management &gt; Stack Rules</strong> feature, <strong>Analytics &gt; Discover</strong> and <strong>Machine Learning</strong> features, <strong>Observability</strong>, and <strong>Security</strong> features.</div>

<h3 class="field-label">Path parameters</h3>
<div class="field-items">
<div class="param">ruleId (required)</div>

<div class="param-desc"><span class="param-type">Path Parameter</span> &mdash; An identifier for the rule. default: null </div><div class="param">spaceId (required)</div>

<div class="param-desc"><span class="param-type">Path Parameter</span> &mdash; An identifier for the space. If <code>/s/</code> and the identifier are omitted from the path, the default space is used. default: null </div>
</div> <!-- field-items -->



<h3 class="field-label">Request headers</h3>
<div class="field-items">
<div class="param">kbn-xsrf (required)</div>

<div class="param-desc"><span class="param-type">Header Parameter</span> &mdash; default: null </div>

</div> <!-- field-items -->




<!--Todo: process Response Object and its headers, schema, examples -->


Expand Down Expand Up @@ -342,6 +426,166 @@ Any modifications made to this file will be overwritten.
<a href="#rule_response_properties">rule_response_properties</a>
</div> <!-- method -->
<hr/>
<div class="method"><a name="muteAlert"/>
<div class="method-path">
<a class="up" href="#__Methods">Up</a>
<pre class="post"><code class="huge"><span class="http-method">post</span> /s/{spaceId}/api/alerting/rule/{ruleId}/alert/{alertId}/_mute</code></pre></div>
<div class="method-summary">Mute an alert. (<span class="nickname">muteAlert</span>)</div>
<div class="method-notes">You must have <code>all</code> privileges for the appropriate Kibana features, depending on the <code>consumer</code> and <code>rule_type_id</code> of the rule. For example, the <strong>Management &gt; Stack Rules</strong> feature, <strong>Analytics &gt; Discover</strong> and <strong>Machine Learning</strong> features, <strong>Observability</strong>, and <strong>Security</strong> features. If the rule has actions, you must also have <code>read</code> privileges for the <strong>Management &gt; Actions and Connectors</strong> feature.</div>

<h3 class="field-label">Path parameters</h3>
<div class="field-items">
<div class="param">alertId (required)</div>

<div class="param-desc"><span class="param-type">Path Parameter</span> &mdash; An identifier for the alert. The identifier is generated by the rule and might be any arbitrary string. default: null </div><div class="param">ruleId (required)</div>

<div class="param-desc"><span class="param-type">Path Parameter</span> &mdash; An identifier for the rule. default: null </div><div class="param">spaceId (required)</div>

<div class="param-desc"><span class="param-type">Path Parameter</span> &mdash; An identifier for the space. If <code>/s/</code> and the identifier are omitted from the path, the default space is used. default: null </div>
</div> <!-- field-items -->



<h3 class="field-label">Request headers</h3>
<div class="field-items">
<div class="param">kbn-xsrf (required)</div>

<div class="param-desc"><span class="param-type">Header Parameter</span> &mdash; default: null </div>

</div> <!-- field-items -->




<!--Todo: process Response Object and its headers, schema, examples -->



<h3 class="field-label">Responses</h3>
<h4 class="field-label">204</h4>
Indicates a successful call.
<a href="#"></a>
</div> <!-- method -->
<hr/>
<div class="method"><a name="muteAllAlerts"/>
<div class="method-path">
<a class="up" href="#__Methods">Up</a>
<pre class="post"><code class="huge"><span class="http-method">post</span> /s/{spaceId}/api/alerting/rule/{ruleId}/_mute_all</code></pre></div>
<div class="method-summary">Mute all alerts. (<span class="nickname">muteAllAlerts</span>)</div>
<div class="method-notes">This API snoozes the notifications for the rule indefinitely. The rule checks continue to occur but alerts will not trigger any actions. You must have <code>all</code> privileges for the appropriate Kibana features, depending on the <code>consumer</code> and <code>rule_type_id</code> of the rule. For example, the <strong>Management &gt; Stack Rules</strong> feature, <strong>Analytics &gt; Discover</strong> and <strong>Machine Learning</strong> features, <strong>Observability</strong>, and <strong>Security</strong> features. If the rule has actions, you must also have <code>read</code> privileges for the <strong>Management &gt; Actions and Connectors</strong> feature.</div>

<h3 class="field-label">Path parameters</h3>
<div class="field-items">
<div class="param">ruleId (required)</div>

<div class="param-desc"><span class="param-type">Path Parameter</span> &mdash; An identifier for the rule. default: null </div><div class="param">spaceId (required)</div>

<div class="param-desc"><span class="param-type">Path Parameter</span> &mdash; An identifier for the space. If <code>/s/</code> and the identifier are omitted from the path, the default space is used. default: null </div>
</div> <!-- field-items -->



<h3 class="field-label">Request headers</h3>
<div class="field-items">
<div class="param">kbn-xsrf (required)</div>

<div class="param-desc"><span class="param-type">Header Parameter</span> &mdash; default: null </div>

</div> <!-- field-items -->




<!--Todo: process Response Object and its headers, schema, examples -->



<h3 class="field-label">Responses</h3>
<h4 class="field-label">204</h4>
Indicates a successful call.
<a href="#"></a>
</div> <!-- method -->
<hr/>
<div class="method"><a name="unmuteAlert"/>
<div class="method-path">
<a class="up" href="#__Methods">Up</a>
<pre class="post"><code class="huge"><span class="http-method">post</span> /s/{spaceId}/api/alerting/rule/{ruleId}/alert/{alertId}/_unmute</code></pre></div>
<div class="method-summary">Unmute an alert. (<span class="nickname">unmuteAlert</span>)</div>
<div class="method-notes">You must have <code>all</code> privileges for the appropriate Kibana features, depending on the <code>consumer</code> and <code>rule_type_id</code> of the rule. For example, the <strong>Management &gt; Stack Rules</strong> feature, <strong>Analytics &gt; Discover</strong> and <strong>Machine Learning</strong> features, <strong>Observability</strong>, and <strong>Security</strong> features. If the rule has actions, you must also have <code>read</code> privileges for the <strong>Management &gt; Actions and Connectors</strong> feature.</div>

<h3 class="field-label">Path parameters</h3>
<div class="field-items">
<div class="param">alertId (required)</div>

<div class="param-desc"><span class="param-type">Path Parameter</span> &mdash; An identifier for the alert. The identifier is generated by the rule and might be any arbitrary string. default: null </div><div class="param">ruleId (required)</div>

<div class="param-desc"><span class="param-type">Path Parameter</span> &mdash; An identifier for the rule. default: null </div><div class="param">spaceId (required)</div>

<div class="param-desc"><span class="param-type">Path Parameter</span> &mdash; An identifier for the space. If <code>/s/</code> and the identifier are omitted from the path, the default space is used. default: null </div>
</div> <!-- field-items -->



<h3 class="field-label">Request headers</h3>
<div class="field-items">
<div class="param">kbn-xsrf (required)</div>

<div class="param-desc"><span class="param-type">Header Parameter</span> &mdash; default: null </div>

</div> <!-- field-items -->




<!--Todo: process Response Object and its headers, schema, examples -->



<h3 class="field-label">Responses</h3>
<h4 class="field-label">204</h4>
Indicates a successful call.
<a href="#"></a>
</div> <!-- method -->
<hr/>
<div class="method"><a name="unmuteAllAlerts"/>
<div class="method-path">
<a class="up" href="#__Methods">Up</a>
<pre class="post"><code class="huge"><span class="http-method">post</span> /s/{spaceId}/api/alerting/rule/{ruleId}/_unmute_all</code></pre></div>
<div class="method-summary">Unmute all alerts. (<span class="nickname">unmuteAllAlerts</span>)</div>
<div class="method-notes">If the rule has its notifications snoozed indefinitely, this API cancels the snooze. You must have <code>all</code> privileges for the appropriate Kibana features, depending on the <code>consumer</code> and <code>rule_type_id</code> of the rule. For example, the <strong>Management &gt; Stack Rules</strong> feature, <strong>Analytics &gt; Discover</strong> and <strong>Machine Learning</strong> features, <strong>Observability</strong>, and <strong>Security</strong> features. If the rule has actions, you must also have <code>read</code> privileges for the <strong>Management &gt; Actions and Connectors</strong> feature.</div>

<h3 class="field-label">Path parameters</h3>
<div class="field-items">
<div class="param">ruleId (required)</div>

<div class="param-desc"><span class="param-type">Path Parameter</span> &mdash; An identifier for the rule. default: null </div><div class="param">spaceId (required)</div>

<div class="param-desc"><span class="param-type">Path Parameter</span> &mdash; An identifier for the space. If <code>/s/</code> and the identifier are omitted from the path, the default space is used. default: null </div>
</div> <!-- field-items -->



<h3 class="field-label">Request headers</h3>
<div class="field-items">
<div class="param">kbn-xsrf (required)</div>

<div class="param-desc"><span class="param-type">Header Parameter</span> &mdash; default: null </div>

</div> <!-- field-items -->




<!--Todo: process Response Object and its headers, schema, examples -->



<h3 class="field-label">Responses</h3>
<h4 class="field-label">204</h4>
Indicates a successful call.
<a href="#"></a>
</div> <!-- method -->
<hr/>
<div class="method"><a name="updateRule"/>
<div class="method-path">
<a class="up" href="#__Methods">Up</a>
Expand Down
10 changes: 8 additions & 2 deletions docs/api/alerting/disable_rule.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@

Disable a rule.

[NOTE]
====
For the most up-to-date API details, refer to the
{kib-repo}/tree/{branch}/x-pack/plugins/alerting/docs/openapi[open API specification]. For a preview, check out <<rule-apis>>.
====

[[disable-rule-api-request]]
=== {api-request-title}

Expand All @@ -17,7 +23,7 @@ Disable a rule.
=== {api-prereq-title}

You must have `all` privileges for the appropriate {kib} features, depending on
the `consumer` and `rule_type_id` of the rules you're disabling. For example,
the `consumer` and `rule_type_id` of the rule. For example,
the *Management* > *Stack Rules* feature, *Analytics* > *Discover* and *{ml-app}*
features, *{observability}*, and *Security* features. For more details, refer to
<<kibana-feature-privileges>>.
Expand All @@ -35,7 +41,7 @@ the URL, the default space is used.
[[disable-rule-api-response-codes]]
=== {api-response-codes-title}

`200`::
`204`::
Indicates a successful call.

=== {api-examples-title}
Expand Down
10 changes: 8 additions & 2 deletions docs/api/alerting/enable_rule.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ Enable a rule.

WARNING: This API supports <<token-api-authentication>> only.

[NOTE]
====
For the most up-to-date API details, refer to the
{kib-repo}/tree/{branch}/x-pack/plugins/alerting/docs/openapi[open API specification]. For a preview, check out <<rule-apis>>.
====

[[enable-rule-api-request]]
=== {api-request-title}

Expand All @@ -18,7 +24,7 @@ WARNING: This API supports <<token-api-authentication>> only.
=== {api-prereq-title}

You must have `all` privileges for the appropriate {kib} features, depending on
the `consumer` and `rule_type_id` of the rules you're enabling. For example, the
the `consumer` and `rule_type_id` of the rule. For example, the
*Management* > *Stack Rules* feature, *Analytics* > *Discover* and *{ml-app}*
features, *{observability}*, and *Security* features. For more details, refer to
<<kibana-feature-privileges>>.
Expand All @@ -36,7 +42,7 @@ the URL, the default space is used.
[[enable-rule-api-response-codes]]
=== {api-response-codes-title}

`200`::
`204`::
Indicates a successful call.

=== {api-examples-title}
Expand Down
10 changes: 8 additions & 2 deletions docs/api/alerting/mute_alert.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@

Mute an alert.

[NOTE]
====
For the most up-to-date API details, refer to the
{kib-repo}/tree/{branch}/x-pack/plugins/alerting/docs/openapi[open API specification]. For a preview, check out <<rule-apis>>.
====

[[mute-alert-api-request]]
=== {api-request-title}

Expand All @@ -16,7 +22,7 @@ Mute an alert.
=== {api-prereq-title}

You must have `all` privileges for the appropriate {kib} features, depending on
the `consumer` and `rule_type_id` of the rules you're creating. For example, the
the `consumer` and `rule_type_id` of the rule. For example, the
*Management* > *Stack Rules* feature, *Analytics* > *Discover* and *{ml-app}*
features, *{observability}*, and *Security* features. If the rule has `actions`,
you must also have `read` privileges for the *Management* >
Expand All @@ -38,7 +44,7 @@ you must also have `read` privileges for the *Management* >
[[mute-alert-api-response-codes]]
=== {api-response-codes-title}

`200`::
`204`::
Indicates a successful call.

=== {api-examples-title}
Expand Down
10 changes: 8 additions & 2 deletions docs/api/alerting/mute_all_alerts.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@

Mute all alerts.

[NOTE]
====
For the most up-to-date API details, refer to the
{kib-repo}/tree/{branch}/x-pack/plugins/alerting/docs/openapi[open API specification]. For a preview, check out <<rule-apis>>.
====

[[mute-all-alerts-api-request]]
=== {api-request-title}

Expand All @@ -16,7 +22,7 @@ Mute all alerts.
=== {api-prereq-title}

You must have `all` privileges for the appropriate {kib} features, depending on
the `consumer` and `rule_type_id` of the rules you're creating. For example, the
the `consumer` and `rule_type_id` of the rule. For example, the
*Management* > *Stack Rules* feature, *Analytics* > *Discover* and *{ml-app}*
features, *{observability}*, and *Security* features. If the rule has `actions`,
you must also have `read` privileges for the *Management* >
Expand All @@ -40,7 +46,7 @@ continue to occur but alerts will not trigger any actions.
[[mute-all-alerts-api-response-codes]]
=== {api-response-codes-title}

`200`::
`204`::
Indicates a successful call.

=== {api-examples-title}
Expand Down
Loading