Skip to content
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
11 changes: 7 additions & 4 deletions docs/api-generated/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,18 @@ or a similar tool that can generate HTML output from OAS.
. Generate HTML output. For example:

```
openapi-generator-cli generate -g html -i ~/kibana/x-pack/plugins/cases/docs/openapi/bundled.yaml -o ~/kibana/docs/api-generated/cases -t ~/kibana/docs/api-generated/template
openapi-generator-cli generate -g html -i $GIT_HOME/kibana/x-pack/plugins/cases/docs/openapi/bundled.yaml -o $GIT_HOME/kibana/docs/api-generated/cases -t $GIT_HOME/kibana/docs/api-generated/template

openapi-generator-cli generate -g html -i ~/kibana/x-pack/plugins/ml/common/openapi/ml_apis_v3.yaml -o ~/kibana/docs/api-generated/machine-learning -t ~/kibana/docs/api-generated/template
openapi-generator-cli generate -g html -i $GIT_HOME/kibana/x-pack/plugins/actions/docs/openapi/bundled.yaml -o $GIT_HOME/kibana/docs/api-generated/connectors -t $GIT_HOME/kibana/docs/api-generated/template

openapi-generator-cli generate -g html -i $GIT_HOME/kibana/x-pack/plugins/ml/common/openapi/ml_apis_v3.yaml -o $GIT_HOME/kibana/docs/api-generated/machine-learning -t $GIT_HOME/kibana/docs/api-generated/template
```

. Rename the output files. For example:
```
mv ~/kibana/docs/api-generated/cases/index.html case-apis-passthru.asciidoc
mv ~/kibana/docs/api-generated/machine-learning/index.html ml-apis-passthru.adoc
mv $GIT_HOME/kibana/docs/api-generated/cases/index.html $GIT_HOME/kibana/docs/api-generated/cases/case-apis-passthru.asciidoc
mv $GIT_HOME/kibana/docs/api-generated/connectors/index.html $GIT_HOME/kibana/docs/api-generated/connectors/connector-apis-passthru.asciidoc
mv $GIT_HOME/kibana/docs/api-generated/machine-learning/index.html $GIT_HOME/kibana/docs/api-generated/machine-learning/ml-apis-passthru.adoc
```

. If you're creating a new set of API output, you will need to have a page that incorporates the output by using passthrough blocks. For more information, refer to [Asciidoctor docs](https://docs.asciidoctor.org/asciidoc/latest/pass/pass-block/)
Expand Down
113 changes: 113 additions & 0 deletions docs/api-generated/connectors/connector-apis-passthru.asciidoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
////
This content is generated from the open API specification.
Any modifications made to this file will be overwritten.
////

++++
<div class="openapi">
<h2>Access</h2>
<ol>
<li>APIKey KeyParamName:ApiKey KeyInQuery:false KeyInHeader:true</li>
<li>HTTP Basic Authentication</li>
</ol>

<h2><a name="__Methods">Methods</a></h2>
[ Jump to <a href="#__Models">Models</a> ]

<h3>Table of Contents </h3>
<div class="method-summary"></div>
<h4><a href="#Cases">Cases</a></h4>
<ul>
<li><a href="#getConnectorTypes"><code><span class="http-method">get</span> /s/{spaceId}/api/actions/connector_types</code></a></li>
</ul>

<h1><a name="Cases">Cases</a></h1>
<div class="method"><a name="getConnectorTypes"/>
<div class="method-path">
<a class="up" href="#__Methods">Up</a>
<pre class="get"><code class="huge"><span class="http-method">get</span> /s/{spaceId}/api/actions/connector_types</code></pre></div>
<div class="method-summary">Retrieves a list of all connector types. (<span class="nickname">getConnectorTypes</span>)</div>
<div class="method-notes">You do not need any Kibana feature privileges to run this API.</div>

<h3 class="field-label">Path parameters</h3>
<div class="field-items">
<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">Query parameters</h3>
<div class="field-items">
<div class="param">feature_id (optional)</div>

<div class="param-desc"><span class="param-type">Query Parameter</span> &mdash; A filter to limit the retrieved connector types to those that support a specific feature (such as alerting or cases). default: null </div>
</div> <!-- field-items -->


<h3 class="field-label">Return type</h3>
<div class="return-type">
array[<a href="#getConnectorTypes_200_response_inner">getConnectorTypes_200_response_inner</a>]

</div>

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

<h3 class="field-label">Example data</h3>
<div class="example-data-content-type">Content-Type: application/json</div>
<pre class="example"><code>{
"supported_feature_ids" : [ "alerting", "uptime", "siem" ],
"name" : "Index",
"enabled_in_license" : true,
"id" : ".index",
"enabled_in_config" : true,
"minimum_license_required" : "basic",
"enabled" : true
}</code></pre>

<h3 class="field-label">Produces</h3>
This API call produces the following media types according to the <span class="header">Accept</span> request header;
the media type will be conveyed by the <span class="header">Content-Type</span> response header.
<ul>
<li><code>application/json</code></li>
</ul>

<h3 class="field-label">Responses</h3>
<h4 class="field-label">200</h4>
Indicates a successful call.

</div> <!-- method -->
<hr/>

<h2><a name="__Models">Models</a></h2>
[ Jump to <a href="#__Methods">Methods</a> ]

<h3>Table of Contents</h3>
<ol>
<li><a href="#features"><code>features</code> - </a></li>
<li><a href="#getConnectorTypes_200_response_inner"><code>getConnectorTypes_200_response_inner</code> - </a></li>
</ol>

<div class="model">
<h3><a name="features"><code>features</code> - </a> <a class="up" href="#__Models">Up</a></h3>
<div class='model-description'>The feature that uses the connector. Valid values are <code>alerting</code>, <code>cases</code>, <code>uptime</code>, and <code>siem</code>.</div>
<div class="field-items">
</div> <!-- field-items -->
</div>
<div class="model">
<h3><a name="getConnectorTypes_200_response_inner"><code>getConnectorTypes_200_response_inner</code> - </a> <a class="up" href="#__Models">Up</a></h3>
<div class='model-description'></div>
<div class="field-items">
<div class="param">enabled (optional)</div><div class="param-desc"><span class="param-type"><a href="#boolean">Boolean</a></span> Indicates whether the connector type is enabled in Kibana. </div>
<div class="param">enabled_in_config (optional)</div><div class="param-desc"><span class="param-type"><a href="#boolean">Boolean</a></span> Indicates whether the connector type is enabled in the Kibana <code>.yml</code> file. </div>
<div class="param">enabled_in_license (optional)</div><div class="param-desc"><span class="param-type"><a href="#boolean">Boolean</a></span> Indicates whether the connector is enabled in the license. </div>
<div class="param">id (optional)</div><div class="param-desc"><span class="param-type"><a href="#string">String</a></span> The unique identifier for the connector type. </div>
<div class="param">minimum_license_required (optional)</div><div class="param-desc"><span class="param-type"><a href="#string">String</a></span> The license that is required to use the connector type. </div>
<div class="param">name (optional)</div><div class="param-desc"><span class="param-type"><a href="#string">String</a></span> The name of the connector type. </div>
<div class="param">supported_feature_ids (optional)</div><div class="param-desc"><span class="param-type"><a href="#features">array[features]</a></span> The Kibana features that are supported by the connector type. </div>
</div> <!-- field-items -->
</div>
</div>
++++
10 changes: 10 additions & 0 deletions docs/api-generated/connectors/connector-apis.asciidoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[[connector-apis]]
== Connector APIs

preview::[]

////
This file includes content that has been generated from https://github.com/elastic/kibana/tree/main/x-pack/plugins/actions/docs/openapi. Any modifications required must be done in that open API specification.
////

include::connector-apis-passthru.asciidoc[]
2 changes: 1 addition & 1 deletion docs/api/actions-and-connectors.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ include::actions-and-connectors/create.asciidoc[leveloffset=+1]
include::actions-and-connectors/delete.asciidoc[leveloffset=+1]
include::actions-and-connectors/get.asciidoc[leveloffset=+1]
include::actions-and-connectors/get_all.asciidoc[leveloffset=+1]
include::actions-and-connectors/list.asciidoc[]
include::actions-and-connectors/list.asciidoc[leveloffset=+1]
include::actions-and-connectors/execute.asciidoc[leveloffset=+1]
include::actions-and-connectors/update.asciidoc[leveloffset=+1]
include::actions-and-connectors/legacy/index.asciidoc[]
Expand Down
16 changes: 11 additions & 5 deletions docs/api/actions-and-connectors/list.asciidoc
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
[[list-connector-types-api]]
=== List connector types API
== List connector types API
++++
<titleabbrev>List all connector types</titleabbrev>
++++

Retrieves a list of all connector types.

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

[[list-connector-types-api-request]]
==== {api-request-title}
=== {api-request-title}

`GET <kibana host>:<port>/api/actions/connector_types`

Expand All @@ -21,7 +27,7 @@ You do not need any <<kibana-feature-privileges,{kib} feature privileges>> to
run this API.

[[list-connector-types-api-path-params]]
==== {api-path-parms-title}
=== {api-path-parms-title}

`space_id`::
(Optional, string) An identifier for the space. If `space_id` is not provided in the URL, the default space is used.
Expand All @@ -33,13 +39,13 @@ run this API.
(Optional, string) Filters list of connector types to those that support the feature id.

[[list-connector-types-api-codes]]
==== {api-response-codes-title}
=== {api-response-codes-title}

`200`::
Indicates a successful call.

[[list-connector-types-api-example]]
==== {api-examples-title}
=== {api-examples-title}

[source,sh]
--------------------------------------------------
Expand Down
1 change: 1 addition & 0 deletions docs/apis.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@ version of the specification is 3.0. For more information, go to https://openapi
--

include::api-generated/cases/case-apis.asciidoc[]
include::api-generated/connectors/connector-apis.asciidoc[]
include::api-generated/machine-learning/ml-apis.asciidoc[]
34 changes: 34 additions & 0 deletions x-pack/plugins/actions/docs/openapi/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# OpenAPI (Experimental)

The current self-contained spec file is [as JSON](https://raw.githubusercontent.com/elastic/kibana/master/x-pack/plugins/cases/common/openapi/bundled.json) or [as YAML](https://raw.githubusercontent.com/elastic/kibana/master/x-pack/plugins/cases/common/openapi/bundled.yaml) and can be used for online tools like those found at https://openapi.tools/.
This spec is experimental and may be incomplete or change later.

A guide about the openApi specification can be found at [https://swagger.io/docs/specification/about/](https://swagger.io/docs/specification/about/).

## The `openapi` folder

* `entrypoint.yaml` is the overview file which pulls together all the paths and components.
* [Paths](paths/README.md): this defines each endpoint. A path can have one operation per http method.
* [Components](components/README.md): Reusable components

## Tools

It is possible to validate the docs before bundling them with the following
command in the `x-pack/plugins/actions/docs/openapi/` folder:

```
npx swagger-cli validate entrypoint.yaml
```

Then you can generate the `bundled` files by running the following commands:

```
npx @redocly/cli bundle entrypoint.yaml --output bundled.yaml --ext yaml
npx @redocly/cli bundle entrypoint.yaml --output bundled.json --ext json
```

You can run additional linting with the following command:

```
npx @redocly/cli lint bundled.json
```
Loading