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

[Actions][Docs] Actions and Connectors API Docs #90974

Merged
merged 12 commits into from
Feb 17, 2021
83 changes: 83 additions & 0 deletions docs/api/actions-and-connectors.asciidoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
[[actions-and-connectors-api]]
== Actions and Connectors APIs
ymao1 marked this conversation as resolved.
Show resolved Hide resolved

Manage your {kib} actions and connectors.
ymao1 marked this conversation as resolved.
Show resolved Hide resolved

The following {kib} actions APIs are available:
ymao1 marked this conversation as resolved.
Show resolved Hide resolved

* <<actions-and-connectors-api-get, Get action API>> to retrieve a single {kib} action by ID
ymao1 marked this conversation as resolved.
Show resolved Hide resolved

* <<actions-and-connectors-api-get-all, Get all actions API>> to retrieve all {kib} actions
ymao1 marked this conversation as resolved.
Show resolved Hide resolved

* <<actions-and-connectors-api-list, List all action types API>> to retrieve a list of all {kib} action types
ymao1 marked this conversation as resolved.
Show resolved Hide resolved

* <<actions-and-connectors-api-create, Create action API>> to create {kib} actions
ymao1 marked this conversation as resolved.
Show resolved Hide resolved

* <<actions-and-connectors-api-update, Update action API>> to update the attributes for an existing {kib} action
ymao1 marked this conversation as resolved.
Show resolved Hide resolved

* <<actions-and-connectors-api-execute, Execute action API>> to execute a {kib} action by ID
ymao1 marked this conversation as resolved.
Show resolved Hide resolved

* <<actions-and-connectors-api-delete, Delete action API>> to remove a {kib} action by ID
ymao1 marked this conversation as resolved.
Show resolved Hide resolved

=== Action types
ymao1 marked this conversation as resolved.
Show resolved Hide resolved

{kib} ships with a set of built-in action types:

[options="header"]
|===

| Type | Id | Description

| Server log
| `.server-log`
| Logs messages to the {kib} log using {kib}'s logger

| Email
| `.email`
| Sends an email using SMTP

| Slack
| `.slack`
| Posts a message to a Slack channel

| Microsoft Teams
| `.teams`
| Posts a message to a Microsoft Teams channel

| Index
| `.index`
| Indexes document(s) into Elasticsearch

| Webhook
| `.webhook`
| Sends a payload to a web service using `HTTP POST` or `PUT`

| PagerDuty
| `.pagerduty`
| Triggers, resolves or acknowledges an incident to a PagerDuty service

| ServiceNow ITSM
| `.servicenow`
| Creates or updates an incident to a ServiceNow ITSM instance

| ServiceNow SIR
| `.servicenow-sir`
| Creates or updates an incident to a ServiceNow SIR instance

| Jira
| `.jira`
| Creates or updates an issue to a Jira instance

| IBM Resilient
| `.resilient`
| Creates or updates an incident to an IBM Resilient instance

|===

include::actions-and-connectors/get.asciidoc[]
include::actions-and-connectors/get_all.asciidoc[]
include::actions-and-connectors/list.asciidoc[]
include::actions-and-connectors/create.asciidoc[]
include::actions-and-connectors/update.asciidoc[]
include::actions-and-connectors/execute.asciidoc[]
include::actions-and-connectors/delete.asciidoc[]
117 changes: 117 additions & 0 deletions docs/api/actions-and-connectors/create.asciidoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
[[actions-and-connectors-api-create]]
=== Create action API
++++
<titleabbrev>Create action API</titleabbrev>
++++

Create {kib} actions.
ymao1 marked this conversation as resolved.
Show resolved Hide resolved

[[actions-and-connectors-api-create-request]]
==== Request

`POST <kibana host>:<port>/api/actions/action`

[[actions-and-connectors-api-create-request-body]]
==== Request body

`name`::
(Required, string) The display name for the action.

`actionTypeId`::
(Required, string) The action type ID for the action.

`config`::
(Required, object) The action configuration. Configuration properties vary depending on
ymao1 marked this conversation as resolved.
Show resolved Hide resolved
the action type. Some action types will have no configuration properties. See the specific action type to determine required fields.
ymao1 marked this conversation as resolved.
Show resolved Hide resolved

`secrets`::
(Required, object) The secrets configuration for the action. Secrets properties vary
ymao1 marked this conversation as resolved.
Show resolved Hide resolved
depending on the action type. Some action types will have no secrets properties. See the specific ation type to determine required fields.
ymao1 marked this conversation as resolved.
Show resolved Hide resolved

[[actions-and-connectors-api-create-request-codes]]
==== Response code

`200`::
Indicates a successful call.

[[actions-and-connectors-api-create-example]]
==== Example

[source,sh]
--------------------------------------------------
$ curl -X POST api/actions/action -H 'kbn-xsrf: true' -H 'Content-Type: application/json' -d '
{
"name": "my-action",
"actionTypeId": ".index",
"config": {
"index": "test-index"
}
}'
--------------------------------------------------
// KIBANA

The API returns the following:

[source,sh]
--------------------------------------------------
{
"id": "c55b6eb0-6bad-11eb-9f3b-611eebc6c3ad",
"actionTypeId": ".index",
"name": "my-action",
"config": {
"index": "test-index",
"refresh": false,
"executionTimeField": null
},
"isPreconfigured": false
}
--------------------------------------------------

==== Action type configuration and secrets
ymao1 marked this conversation as resolved.
Show resolved Hide resolved

[options="header"]
|===

| Type | Id | Config

| Email
| `.email`
| <<email-connector-config-properties, Email config and secrets properties>>

| Index
| `.index`
| <<index-connector-config-properties, Index config and secrets properties>>

| Jira
| `.jira`
| <<jira-connector-config-properties, Jira config and secrets properties>>

| PagerDuty
| `.pagerduty`
| <<pagerduty-connector-config-properties, PagerDuty config and secrets properties>>

| IBM Resilient
| `.resilient`
| <<resilient-connector-config-properties, IBM Resilient config and secrets properties>>

| Server log
| `.server-log`
| <<server-log-connector-configuration, Server log config and secrets properties>>

| ServiceNow ITSM
| `.servicenow`
| <<servicenow-connector-config-properties, ServiceNow ITSM config and secrets properties>>

| Slack
| `.slack`
| <<slack-connector-config-properties, Slack config and secrets properties>>

| Microsoft Teams
| `.teams`
| <<teams-connector-config-properties, Microsoft Teams config and secrets properties>>

| Webhook
| `.webhook`
| <<webhook-connector-config-properties, Webhook config and secrets properties>>

|===
35 changes: 35 additions & 0 deletions docs/api/actions-and-connectors/delete.asciidoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
[[actions-and-connectors-api-delete]]
=== Delete action API
++++
<titleabbrev>Delete action API</titleabbrev>
++++

Remove a {kib} action by ID
ymao1 marked this conversation as resolved.
Show resolved Hide resolved

WARNING: Once you delete an action, _it cannot be recovered_.
ymao1 marked this conversation as resolved.
Show resolved Hide resolved

[[actions-and-connectors-api-delete-request]]
==== Request

`DELETE <kibana host>:<port>/api/actions/action/<id>`

[[actions-and-connectors-api-delete-path-params]]
==== Path parameters

`id`::
(Required, string) The ID of the action to remove.
ymao1 marked this conversation as resolved.
Show resolved Hide resolved

[[actions-and-connectors-api-delete-response-codes]]
==== Response code

`200`::
Indicates a successful call.

==== Example

[source,sh]
--------------------------------------------------
$ curl -X DELETE api/actions/action/c55b6eb0-6bad-11eb-9f3b-611eebc6c3ad
--------------------------------------------------
// KIBANA

132 changes: 132 additions & 0 deletions docs/api/actions-and-connectors/execute.asciidoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
[[actions-and-connectors-api-execute]]
=== Execute action API
++++
<titleabbrev>Execute action API</titleabbrev>
++++

Execute a {kib} action by ID
ymao1 marked this conversation as resolved.
Show resolved Hide resolved

[[actions-and-connectors-api-execute-request]]
==== Request

`POST <kibana host>:<port>/api/actions/action/<id>/_execute`

[[actions-and-connectors-api-execute-params]]
==== Path parameters

`id`::
(Required, string) The ID of the action to execute.
ymao1 marked this conversation as resolved.
Show resolved Hide resolved

[[actions-and-connectors-api-execute-request-body]]
==== Request body

`params`::
(Required, object) The action parameters. Parameter properties vary depending on
ymao1 marked this conversation as resolved.
Show resolved Hide resolved
the action type. See the specific action type to determine required fields.
ymao1 marked this conversation as resolved.
Show resolved Hide resolved

[[actions-and-connectors-api-execute-codes]]
==== Response code

`200`::
Indicates a successful call.

[[actions-and-connectors-api-execute-example]]
==== Example

[source,sh]
--------------------------------------------------
$ curl -X POST api/actions/action/c55b6eb0-6bad-11eb-9f3b-611eebc6c3ad/_execute -H 'kbn-xsrf: true' -H 'Content-Type: application/json' -d '
{
"params": {
"documents": [
{
"id": "test_doc_id",
"name": "test_doc_name",
"message": "hello, world"
}
]
}
}'
--------------------------------------------------
// KIBANA

The API returns the following:

[source,sh]
--------------------------------------------------
{
"status": "ok",
"data": {
"took": 197,
"errors": false,
"items": [
{
"index": {
"_index": "updated-index",
"_id": "iKyijHcBKCsmXNFrQe3T",
"_version": 1,
"result": "created",
"_shards": {
"total": 2,
"successful": 1,
"failed": 0
},
"_seq_no": 0,
"_primary_term": 1,
"status": 201
}
}
]
},
"actionId": "c55b6eb0-6bad-11eb-9f3b-611eebc6c3ad"
}
--------------------------------------------------

==== Action type execution parameters
ymao1 marked this conversation as resolved.
Show resolved Hide resolved

[options="header"]
|===

| Type | Id | Params

| Email
| `.email`
| <<email-action-configuration, Email action parameters>>

| Index
| `.index`
| <<index-action-configuration, Index action parameters>>

| Jira
| `.jira`
| <<jira-action-configuration, Jira action parameters>>

| PagerDuty
| `.pagerduty`
| <<pagerduty-action-configuration, PagerDuty action parameters>>

| IBM Resilient
| `.resilient`
| <<resilient-action-configuration, IBM Resilient action parameters>>

| Server log
| `.server-log`
| <<server-log-action-configuration, Server log action parameters>>

| ServiceNow ITSM
| `.servicenow`
| <<servicenow-action-configuration, ServiceNow ITSM action parameters>>

| Slack
| `.slack`
| <<slack-action-configuration, Slack action parameters>>

| Microsoft Teams
| `.teams`
| <<teams-action-configuration, Microsoft Teams action parameters>>

| Webhook
| `.webhook`
| <<webhook-action-configuration, Webhook action parameters>>

|===
Loading