Skip to content

Commit

Permalink
[DOCS] Add open API output to appendix
Browse files Browse the repository at this point in the history
  • Loading branch information
lcawl committed Sep 23, 2022
1 parent ca75f7a commit 4d79213
Show file tree
Hide file tree
Showing 6 changed files with 373 additions and 5 deletions.
186 changes: 186 additions & 0 deletions docs/api/generated/ml-apis-passthru.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,186 @@
++++
<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="#Ml">Ml</a></h4>
<ul>
<li><a href="#mlSync"><code><span class="http-method">get</span> /s/{spaceId}/api/ml/saved_objects/sync</code></a></li>
</ul>
<h1><a name="Ml">Ml</a></h1>
<div class="method"><a name="mlSync"/>
<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/ml/saved_objects/sync</code></pre></div>
<div class="method-summary">Synchronizes Kibana saved objects for machine learning jobs and trained models. (<span class="nickname">mlSync</span>)</div>
<div class="method-notes">You must have <code>all</code> privileges for the <strong>Machine Learning</strong> feature in the <strong>Analytics</strong> section of the Kibana feature privileges. This API runs automatically when you start Kibana and periodically thereafter.</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">simulate (optional)</div>
<div class="param-desc"><span class="param-type">Query Parameter</span> &mdash; When true, simulates the synchronization by returning only the list actions that would be performed. default: null </div>
</div> <!-- field-items -->
<h3 class="field-label">Return type</h3>
<div class="return-type">
<a href="#mlSyncResponse">mlSyncResponse</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>{
"datafeedsAdded" : {
"key" : {
"success" : true
}
},
"savedObjectsCreated" : {
"anomaly-detector" : {
"key" : {
"success" : true
}
},
"data-frame-analytics" : {
"key" : {
"success" : true
}
},
"trained-model" : {
"key" : {
"success" : true
}
}
},
"savedObjectsDeleted" : {
"anomaly-detector" : {
"key" : {
"success" : true
}
},
"data-frame-analytics" : {
"key" : {
"success" : true
}
},
"trained-model" : {
"key" : {
"success" : true
}
}
},
"datafeedsRemoved" : {
"key" : {
"success" : 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
<a href="#mlSyncResponse">mlSyncResponse</a>
</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="#mlSyncResponse"><code>mlSyncResponse</code> - Sync API response</a></li>
<li><a href="#mlSyncResponseAnomalyDetectors"><code>mlSyncResponseAnomalyDetectors</code> - Sync API response for anomaly detection jobs</a></li>
<li><a href="#mlSyncResponseDataFrameAnalytics"><code>mlSyncResponseDataFrameAnalytics</code> - Sync API response for data frame analytics jobs</a></li>
<li><a href="#mlSyncResponseDatafeeds"><code>mlSyncResponseDatafeeds</code> - Sync API response for datafeeds</a></li>
<li><a href="#mlSyncResponseSavedObjectsCreated"><code>mlSyncResponseSavedObjectsCreated</code> - Sync API response for created saved objects</a></li>
<li><a href="#mlSyncResponseSavedObjectsDeleted"><code>mlSyncResponseSavedObjectsDeleted</code> - Sync API response for deleted saved objects</a></li>
<li><a href="#mlSyncResponseTrainedModels"><code>mlSyncResponseTrainedModels</code> - Sync API response for trained models</a></li>
</ol>
<div class="model">
<h3><a name="mlSyncResponse"><code>mlSyncResponse</code> - Sync API response</a> <a class="up" href="#__Models">Up</a></h3>
<div class='model-description'></div>
<div class="field-items">
<div class="param">datafeedsAdded (optional)</div><div class="param-desc"><span class="param-type"><a href="#mlSyncResponseDatafeeds">map[String, mlSyncResponseDatafeeds]</a></span> If a saved object for an anomaly detection job is missing a datafeed identifier, it is added when you run the sync machine learning saved objects API. </div>
<div class="param">datafeedsRemoved (optional)</div><div class="param-desc"><span class="param-type"><a href="#mlSyncResponseDatafeeds">map[String, mlSyncResponseDatafeeds]</a></span> If a saved object for an anomaly detection job references a datafeed that no longer exists, it is deleted when you run the sync machine learning saved objects API. </div>
<div class="param">savedObjectsCreated (optional)</div><div class="param-desc"><span class="param-type"><a href="#mlSyncResponseSavedObjectsCreated">mlSyncResponseSavedObjectsCreated</a></span> </div>
<div class="param">savedObjectsDeleted (optional)</div><div class="param-desc"><span class="param-type"><a href="#mlSyncResponseSavedObjectsDeleted">mlSyncResponseSavedObjectsDeleted</a></span> </div>
</div> <!-- field-items -->
</div>
<div class="model">
<h3><a name="mlSyncResponseAnomalyDetectors"><code>mlSyncResponseAnomalyDetectors</code> - Sync API response for anomaly detection jobs</a> <a class="up" href="#__Models">Up</a></h3>
<div class='model-description'>The sync machine learning saved objects API response contains this object when there are anomaly detection jobs affected by the synchronization. There is an object for each relevant job, which contains the synchronization status.</div>
<div class="field-items">
<div class="param">success (optional)</div><div class="param-desc"><span class="param-type"><a href="#boolean">Boolean</a></span> The success or failure of the synchronization. </div>
</div> <!-- field-items -->
</div>
<div class="model">
<h3><a name="mlSyncResponseDataFrameAnalytics"><code>mlSyncResponseDataFrameAnalytics</code> - Sync API response for data frame analytics jobs</a> <a class="up" href="#__Models">Up</a></h3>
<div class='model-description'>The sync machine learning saved objects API response contains this object when there are data frame analytics jobs affected by the synchronization. There is an object for each relevant job, which contains the synchronization status.</div>
<div class="field-items">
<div class="param">success (optional)</div><div class="param-desc"><span class="param-type"><a href="#boolean">Boolean</a></span> The success or failure of the synchronization. </div>
</div> <!-- field-items -->
</div>
<div class="model">
<h3><a name="mlSyncResponseDatafeeds"><code>mlSyncResponseDatafeeds</code> - Sync API response for datafeeds</a> <a class="up" href="#__Models">Up</a></h3>
<div class='model-description'>The sync machine learning saved objects API response contains this object when there are datafeeds affected by the synchronization. There is an object for each relevant datafeed, which contains the synchronization status.</div>
<div class="field-items">
<div class="param">success (optional)</div><div class="param-desc"><span class="param-type"><a href="#boolean">Boolean</a></span> The success or failure of the synchronization. </div>
</div> <!-- field-items -->
</div>
<div class="model">
<h3><a name="mlSyncResponseSavedObjectsCreated"><code>mlSyncResponseSavedObjectsCreated</code> - Sync API response for created saved objects</a> <a class="up" href="#__Models">Up</a></h3>
<div class='model-description'>If saved objects are missing for machine learning jobs or trained models, they are created when you run the sync machine learning saved objects API.</div>
<div class="field-items">
<div class="param">anomalyMinusdetector (optional)</div><div class="param-desc"><span class="param-type"><a href="#mlSyncResponseAnomalyDetectors">map[String, mlSyncResponseAnomalyDetectors]</a></span> If saved objects are missing for anomaly detection jobs, they are created. </div>
<div class="param">dataMinusframeMinusanalytics (optional)</div><div class="param-desc"><span class="param-type"><a href="#mlSyncResponseDataFrameAnalytics">map[String, mlSyncResponseDataFrameAnalytics]</a></span> If saved objects are missing for data frame analytics jobs, they are created. </div>
<div class="param">trainedMinusmodel (optional)</div><div class="param-desc"><span class="param-type"><a href="#mlSyncResponseTrainedModels">map[String, mlSyncResponseTrainedModels]</a></span> If saved objects are missing for trained models, they are created. </div>
</div> <!-- field-items -->
</div>
<div class="model">
<h3><a name="mlSyncResponseSavedObjectsDeleted"><code>mlSyncResponseSavedObjectsDeleted</code> - Sync API response for deleted saved objects</a> <a class="up" href="#__Models">Up</a></h3>
<div class='model-description'>If saved objects exist for machine learning jobs or trained models that no longer exist, they are deleted when you run the sync machine learning saved objects API.</div>
<div class="field-items">
<div class="param">anomalyMinusdetector (optional)</div><div class="param-desc"><span class="param-type"><a href="#mlSyncResponseAnomalyDetectors">map[String, mlSyncResponseAnomalyDetectors]</a></span> If there are saved objects exist for nonexistent anomaly detection jobs, they are deleted. </div>
<div class="param">dataMinusframeMinusanalytics (optional)</div><div class="param-desc"><span class="param-type"><a href="#mlSyncResponseDataFrameAnalytics">map[String, mlSyncResponseDataFrameAnalytics]</a></span> If there are saved objects exist for nonexistent data frame analytics jobs, they are deleted. </div>
<div class="param">trainedMinusmodel (optional)</div><div class="param-desc"><span class="param-type"><a href="#mlSyncResponseTrainedModels">map[String, mlSyncResponseTrainedModels]</a></span> If there are saved objects exist for nonexistent trained models, they are deleted. </div>
</div> <!-- field-items -->
</div>
<div class="model">
<h3><a name="mlSyncResponseTrainedModels"><code>mlSyncResponseTrainedModels</code> - Sync API response for trained models</a> <a class="up" href="#__Models">Up</a></h3>
<div class='model-description'>The sync machine learning saved objects API response contains this object when there are trained models affected by the synchronization. There is an object for each relevant trained model, which contains the synchronization status.</div>
<div class="field-items">
<div class="param">success (optional)</div><div class="param-desc"><span class="param-type"><a href="#boolean">Boolean</a></span> The success or failure of the synchronization. </div>
</div> <!-- field-items -->
</div>
</body>
++++
164 changes: 164 additions & 0 deletions docs/api/generated/template/index.mustache
Original file line number Diff line number Diff line change
@@ -0,0 +1,164 @@
++++
<h2>Access</h2>
{{#hasAuthMethods}}
<ol>
{{#authMethods}}
<li>{{#isBasic}}HTTP Basic Authentication{{/isBasic}}{{#isOAuth}}OAuth AuthorizationUrl:{{authorizationUrl}}TokenUrl:{{tokenUrl}}{{/isOAuth}}{{#isApiKey}}APIKey KeyParamName:{{keyParamName}} KeyInQuery:{{isKeyInQuery}} KeyInHeader:{{isKeyInHeader}}{{/isApiKey}}</li>
{{/authMethods}}
</ol>
{{/hasAuthMethods}}

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

{{! for the tables of content, I cheat and don't use CSS styles.... }}
<h3>Table of Contents </h3>
<div class="method-summary">{{access}}</div>
{{#apiInfo}}
{{#apis}}
{{#operations}}
<h4><a href="#{{baseName}}">{{baseName}}</a></h4>
<ul>
{{#operation}}
<li><a href="#{{nickname}}"><code><span class="http-method">{{httpMethod}}</span> {{path}}</code></a></li>
{{/operation}}
</ul>
{{/operations}}
{{/apis}}
{{/apiInfo}}
{{#apiInfo}}
{{#apis}}
{{#operations}}
<h1><a name="{{baseName}}">{{baseName}}</a></h1>
{{#operation}}
<div class="method"><a name="{{nickname}}"/>
<div class="method-path">
<a class="up" href="#__Methods">Up</a>
<pre class="{{httpMethod}}"><code class="huge"><span class="http-method">{{httpMethod}}</span> {{path}}</code></pre></div>
<div class="method-summary">{{summary}} (<span class="nickname">{{nickname}}</span>)</div>
{{! notes is operation.description. So why rename it and make it super confusing???? }}
<div class="method-notes">{{notes}}</div>
{{#hasPathParams}}
<h3 class="field-label">Path parameters</h3>
<div class="field-items">
{{#pathParams}}{{>pathParam}}{{/pathParams}}
</div> <!-- field-items -->
{{/hasPathParams}}
{{#hasConsumes}}
<h3 class="field-label">Consumes</h3>
This API call consumes the following media types via the <span class="header">Content-Type</span> request header:
<ul>
{{#consumes}}
<li><code>{{{mediaType}}}</code></li>
{{/consumes}}
</ul>
{{/hasConsumes}}
{{#hasBodyParam}}
<h3 class="field-label">Request body</h3>
<div class="field-items">
{{#bodyParams}}{{>bodyParam}}{{/bodyParams}}
</div> <!-- field-items -->
{{/hasBodyParam}}
{{#hasHeaderParams}}
<h3 class="field-label">Request headers</h3>
<div class="field-items">
{{#headerParams}}{{>headerParam}}{{/headerParams}}
</div> <!-- field-items -->
{{/hasHeaderParams}}
{{#hasQueryParams}}
<h3 class="field-label">Query parameters</h3>
<div class="field-items">
{{#queryParams}}{{>queryParam}}{{/queryParams}}
</div> <!-- field-items -->
{{/hasQueryParams}}
{{#hasFormParams}}
<h3 class="field-label">Form parameters</h3>
<div class="field-items">
{{#formParams}}{{>formParam}}{{/formParams}}
</div> <!-- field-items -->
{{/hasFormParams}}
{{#returnType}}
<h3 class="field-label">Return type</h3>
<div class="return-type">
{{#hasReference}}{{^returnSimpleType}}{{returnContainer}}[{{/returnSimpleType}}<a href="#{{returnBaseType}}">{{returnBaseType}}</a>{{^returnSimpleType}}]{{/returnSimpleType}}{{/hasReference}}
{{^hasReference}}{{returnType}}{{/hasReference}}
</div>
{{/returnType}}
<!--Todo: process Response Object and its headers, schema, examples -->
{{#hasExamples}}
{{#examples}}
<h3 class="field-label">Example data</h3>
<div class="example-data-content-type">Content-Type: {{{contentType}}}</div>
<pre class="example"><code>{{{example}}}</code></pre>
{{/examples}}
{{/hasExamples}}
{{#hasProduces}}
<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>
{{#produces}}
<li><code>{{{mediaType}}}</code></li>
{{/produces}}
</ul>
{{/hasProduces}}
<h3 class="field-label">Responses</h3>
{{#responses}}
<h4 class="field-label">{{code}}</h4>
{{message}}
{{^containerType}}<a href="#{{dataType}}">{{dataType}}</a>{{/containerType}}
{{#examples}}
<h3 class="field-label">Example data</h3>
<div class="example-data-content-type">Content-Type: {{{contentType}}}</div>
<pre class="example"><code>{{example}}</code></pre>
{{/examples}}
{{/responses}}
</div> <!-- method -->
<hr/>
{{/operation}}
{{/operations}}
{{/apis}}
{{/apiInfo}}
<h2><a name="__Models">Models</a></h2>
[ Jump to <a href="#__Methods">Methods</a> ]
<h3>Table of Contents</h3>
<ol>
{{#models}}
{{#model}}
<li><a href="#{{name}}"><code>{{name}}</code>{{#title}} - {{.}}{{/title}}</a></li>
{{/model}}
{{/models}}
</ol>
{{#models}}
{{#model}}
<div class="model">
<h3><a name="{{name}}"><code>{{name}}</code>{{#title}} - {{.}}{{/title}}</a> <a class="up" href="#__Models">Up</a></h3>
{{#unescapedDescription}}<div class='model-description'>{{.}}</div>{{/unescapedDescription}}
<div class="field-items">
{{#vars}}<div class="param">{{name}} {{^required}}(optional){{/required}}</div><div class="param-desc"><span class="param-type">{{^isPrimitiveType}}<a href="#{{complexType}}">{{dataType}}</a>{{/isPrimitiveType}}</span> {{unescapedDescription}} {{#dataFormat}}format: {{{.}}}{{/dataFormat}}</div>
{{#isEnum}}
<div class="param-enum-header">Enum:</div>
{{#_enum}}<div class="param-enum">{{this}}</div>{{/_enum}}
{{/isEnum}}
{{/vars}}
</div> <!-- field-items -->
</div>
{{/model}}
{{/models}}
</body>
++++
6 changes: 6 additions & 0 deletions docs/api/machine-learning/ml_apis_v3.asciidoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[[machine-learning-api]]
== Machine learning APIs

preview::[]

include::{kib-repo-dir}/api/generated/ml-apis-passthru.adoc[]
14 changes: 14 additions & 0 deletions docs/apis.asciidoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[role="exclude",id="apis"]
= APIs

[partintro]
--

preview::[]

These APIs are documented using the OpenAPI specification. The current supported
version of the specification is 3.0.

--

include::api/machine-learning/ml_apis_v3.asciidoc[]
3 changes: 3 additions & 0 deletions docs/index.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,7 @@ include::CHANGELOG.asciidoc[]

include::developer/index.asciidoc[]

include::apis.asciidoc[]

include::redirects.asciidoc[]

5 changes: 0 additions & 5 deletions docs/redirects.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -420,8 +420,3 @@ This page has been deleted. Refer to <<osquery>>.
== Sync machine learning saved objects API

This page has been deleted. Refer to <<ml-sync>>.

[role="exclude",id="machine-learning-api"]
== Machine learning APIs

This page has been deleted. Refer to <<Machine_learning_APIs>>.

0 comments on commit 4d79213

Please sign in to comment.