Skip to content

Commit

Permalink
[DOCS] Fix optional create connector id (#157031)
Browse files Browse the repository at this point in the history
  • Loading branch information
lcawl authored May 9, 2023
1 parent 0743600 commit f7a3462
Show file tree
Hide file tree
Showing 5 changed files with 320 additions and 29 deletions.
71 changes: 69 additions & 2 deletions docs/api-generated/connectors/connector-apis-passthru.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ Any modifications made to this file will be overwritten.
<h4><a href="#Connectors">Connectors</a></h4>
<ul>
<li><a href="#createConnector"><code><span class="http-method">post</span> /s/{spaceId}/api/actions/connector</code></a></li>
<li><a href="#createConnectorId"><code><span class="http-method">post</span> /s/{spaceId}/api/actions/connector/{connectorId}</code></a></li>
<li><a href="#deleteConnector"><code><span class="http-method">delete</span> /s/{spaceId}/api/actions/connector/{connectorId}</code></a></li>
<li><a href="#getConnector"><code><span class="http-method">get</span> /s/{spaceId}/api/actions/connector/{connectorId}</code></a></li>
<li><a href="#getConnectorTypes"><code><span class="http-method">get</span> /s/{spaceId}/api/actions/connector_types</code></a></li>
Expand Down Expand Up @@ -46,9 +47,75 @@ Any modifications made to this file will be overwritten.
<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 class="param">id (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">Consumes</h3>
This API call consumes the following media types via the <span class="header">Content-Type</span> request header:
<ul>
<li><code>application/json</code></li>
</ul>
<h3 class="field-label">Request body</h3>
<div class="field-items">
<div class="param">Create_connector_request_body_properties <a href="#Create_connector_request_body_properties">Create_connector_request_body_properties</a> (required)</div>
<div class="param-desc"><span class="param-type">Body Parameter</span> &mdash; </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; Cross-site request forgery protection default: null </div>
</div> <!-- field-items -->
<h3 class="field-label">Return type</h3>
<div class="return-type">
<a href="#connector_response_properties">connector_response_properties</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>null</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="#connector_response_properties">connector_response_properties</a>
<h4 class="field-label">401</h4>
Authorization information is missing or invalid.
<a href="#Unauthorized_response">Unauthorized_response</a>
</div> <!-- method -->
<hr/>
<div class="method"><a name="createConnectorId"/>
<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/actions/connector/{connectorId}</code></pre></div>
<div class="method-summary">Creates a connector. (<span class="nickname">createConnectorId</span>)</div>
<div class="method-notes">You must have <code>all</code> privileges for the <strong>Actions and Connectors</strong> feature in the <strong>Management</strong> section of the Kibana feature privileges.</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 class="param">connectorId (required)</div>
<div class="param-desc"><span class="param-type">Path Parameter</span> &mdash; An UUID v1 or v4 identifier for the connector. If you omit this parameter, an identifier is randomly generated. default: null </div>
<div class="param-desc"><span class="param-type">Path Parameter</span> &mdash; A UUID v1 or v4 identifier for the connector. If you omit this parameter, an identifier is randomly generated. default: null </div>
</div> <!-- field-items -->
<h3 class="field-label">Consumes</h3>
Expand Down
136 changes: 126 additions & 10 deletions x-pack/plugins/actions/docs/openapi/bundled.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,6 @@
},
{
"$ref": "#/components/parameters/space_id"
},
{
"in": "path",
"name": "id",
"description": "An UUID v1 or v4 identifier for the connector. If you omit this parameter, an identifier is randomly generated.\n",
"required": true,
"schema": {
"type": "string",
"example": "ac4e6b90-6be7-11eb-ba0d-9b1c1f912d74"
}
}
],
"requestBody": {
Expand Down Expand Up @@ -280,6 +270,132 @@
}
]
},
"post": {
"summary": "Creates a connector.",
"operationId": "createConnectorId",
"description": "You must have `all` privileges for the **Actions and Connectors** feature in the **Management** section of the Kibana feature privileges.\n",
"tags": [
"connectors"
],
"parameters": [
{
"$ref": "#/components/parameters/kbn_xsrf"
},
{
"$ref": "#/components/parameters/space_id"
},
{
"in": "path",
"name": "connectorId",
"description": "A UUID v1 or v4 identifier for the connector. If you omit this parameter, an identifier is randomly generated.",
"required": true,
"schema": {
"type": "string",
"example": "ac4e6b90-6be7-11eb-ba0d-9b1c1f912d74"
}
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"title": "Create connector request body properties",
"description": "The properties vary depending on the connector type.",
"oneOf": [
{
"$ref": "#/components/schemas/create_connector_request_cases_webhook"
},
{
"$ref": "#/components/schemas/create_connector_request_email"
},
{
"$ref": "#/components/schemas/create_connector_request_index"
},
{
"$ref": "#/components/schemas/create_connector_request_jira"
},
{
"$ref": "#/components/schemas/create_connector_request_opsgenie"
},
{
"$ref": "#/components/schemas/create_connector_request_pagerduty"
},
{
"$ref": "#/components/schemas/create_connector_request_resilient"
},
{
"$ref": "#/components/schemas/create_connector_request_serverlog"
},
{
"$ref": "#/components/schemas/create_connector_request_servicenow"
},
{
"$ref": "#/components/schemas/create_connector_request_servicenow_itom"
},
{
"$ref": "#/components/schemas/create_connector_request_servicenow_sir"
},
{
"$ref": "#/components/schemas/create_connector_request_slack_api"
},
{
"$ref": "#/components/schemas/create_connector_request_slack_webhook"
},
{
"$ref": "#/components/schemas/create_connector_request_swimlane"
},
{
"$ref": "#/components/schemas/create_connector_request_teams"
},
{
"$ref": "#/components/schemas/create_connector_request_tines"
},
{
"$ref": "#/components/schemas/create_connector_request_webhook"
},
{
"$ref": "#/components/schemas/create_connector_request_xmatters"
}
],
"discriminator": {
"propertyName": "connector_type_id"
}
},
"examples": {
"createIndexConnectorRequest": {
"$ref": "#/components/examples/create_index_connector_request"
}
}
}
}
},
"responses": {
"200": {
"description": "Indicates a successful call.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/connector_response_properties"
},
"examples": {
"createIndexConnectorResponse": {
"$ref": "#/components/examples/create_index_connector_response"
}
}
}
}
},
"401": {
"$ref": "#/components/responses/401"
}
},
"servers": [
{
"url": "https://localhost:5601"
}
]
},
"put": {
"summary": "Updates the attributes for a connector.",
"operationId": "updateConnector",
Expand Down
70 changes: 62 additions & 8 deletions x-pack/plugins/actions/docs/openapi/bundled.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,6 @@ paths:
parameters:
- $ref: '#/components/parameters/kbn_xsrf'
- $ref: '#/components/parameters/space_id'
- in: path
name: id
description: |
An UUID v1 or v4 identifier for the connector. If you omit this parameter, an identifier is randomly generated.
required: true
schema:
type: string
example: ac4e6b90-6be7-11eb-ba0d-9b1c1f912d74
requestBody:
required: true
content:
Expand Down Expand Up @@ -156,6 +148,68 @@ paths:
example: 404
servers:
- url: https://localhost:5601
post:
summary: Creates a connector.
operationId: createConnectorId
description: |
You must have `all` privileges for the **Actions and Connectors** feature in the **Management** section of the Kibana feature privileges.
tags:
- connectors
parameters:
- $ref: '#/components/parameters/kbn_xsrf'
- $ref: '#/components/parameters/space_id'
- in: path
name: connectorId
description: A UUID v1 or v4 identifier for the connector. If you omit this parameter, an identifier is randomly generated.
required: true
schema:
type: string
example: ac4e6b90-6be7-11eb-ba0d-9b1c1f912d74
requestBody:
required: true
content:
application/json:
schema:
title: Create connector request body properties
description: The properties vary depending on the connector type.
oneOf:
- $ref: '#/components/schemas/create_connector_request_cases_webhook'
- $ref: '#/components/schemas/create_connector_request_email'
- $ref: '#/components/schemas/create_connector_request_index'
- $ref: '#/components/schemas/create_connector_request_jira'
- $ref: '#/components/schemas/create_connector_request_opsgenie'
- $ref: '#/components/schemas/create_connector_request_pagerduty'
- $ref: '#/components/schemas/create_connector_request_resilient'
- $ref: '#/components/schemas/create_connector_request_serverlog'
- $ref: '#/components/schemas/create_connector_request_servicenow'
- $ref: '#/components/schemas/create_connector_request_servicenow_itom'
- $ref: '#/components/schemas/create_connector_request_servicenow_sir'
- $ref: '#/components/schemas/create_connector_request_slack_api'
- $ref: '#/components/schemas/create_connector_request_slack_webhook'
- $ref: '#/components/schemas/create_connector_request_swimlane'
- $ref: '#/components/schemas/create_connector_request_teams'
- $ref: '#/components/schemas/create_connector_request_tines'
- $ref: '#/components/schemas/create_connector_request_webhook'
- $ref: '#/components/schemas/create_connector_request_xmatters'
discriminator:
propertyName: connector_type_id
examples:
createIndexConnectorRequest:
$ref: '#/components/examples/create_index_connector_request'
responses:
'200':
description: Indicates a successful call.
content:
application/json:
schema:
$ref: '#/components/schemas/connector_response_properties'
examples:
createIndexConnectorResponse:
$ref: '#/components/examples/create_index_connector_response'
'401':
$ref: '#/components/responses/401'
servers:
- url: https://localhost:5601
put:
summary: Updates the attributes for a connector.
operationId: updateConnector
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,6 @@ post:
parameters:
- $ref: '../components/headers/kbn_xsrf.yaml'
- $ref: '../components/parameters/space_id.yaml'
- in: path
name: id
description: >
An UUID v1 or v4 identifier for the connector. If you omit this parameter,
an identifier is randomly generated.
required: true
schema:
type: string
example: ac4e6b90-6be7-11eb-ba0d-9b1c1f912d74
requestBody:
required: true
content:
Expand Down
Loading

0 comments on commit f7a3462

Please sign in to comment.