Skip to content

Commit

Permalink
[Alerting] adds Connectors APIs and deprecates old Actions APIs as pe…
Browse files Browse the repository at this point in the history
…r the new Alerting terminology (elastic#92451)

* moved legacy actions api to legacy folder

* introduced connector create api

* added new delete route

* added new execute and get_all

* introduced all connector APIs

* renamed action to connector in Apis

* comment on camel case type

* fixed va

* updated docs

* legacy title

* corrected APIs

* legacy links

* added linik to deprecatred APIs

* added linik to deprecatred APIs from index

* moved legacy apis down one level

* Apply suggestions from code review

Co-authored-by: ymao1 <[email protected]>

* renamed route file for connectorTypesRoute

* define legacy route

* Update docs/api/actions-and-connectors/legacy/index.asciidoc

Co-authored-by: Mike Côté <[email protected]>

* api docs

Co-authored-by: ymao1 <[email protected]>
Co-authored-by: Mike Côté <[email protected]>
Co-authored-by: Kibana Machine <[email protected]>
# Conflicts:
#	api_docs/actions.json
  • Loading branch information
gmmorris authored and mikecote committed Mar 5, 2021
1 parent 70d6856 commit 1b3bee0
Show file tree
Hide file tree
Showing 80 changed files with 3,373 additions and 864 deletions.
106 changes: 50 additions & 56 deletions api_docs/actions.json
Original file line number Diff line number Diff line change
Expand Up @@ -647,31 +647,25 @@
"section": "def-server.ActionResult",
"text": "ActionResult"
},
"<Record<string, unknown>>>; delete: ({ id }: { id: string; }) => Promise<{}>; create: ({ action: { actionTypeId, name, config, secrets }, }: CreateOptions) => Promise<",
"<Record<string, unknown>>>; delete: ({ id }: { id: string; }) => Promise<{}>; create: ({ action: { actionTypeId, name, config, secrets }, }: ",
"CreateOptions",
") => Promise<",
{
"pluginId": "actions",
"scope": "server",
"docId": "kibActionsPluginApi",
"section": "def-server.ActionResult",
"text": "ActionResult"
},
"<Record<string, unknown>>>; update: ({ id, action }: UpdateOptions) => Promise<",
"<Record<string, unknown>>>; update: ({ id, action }: ",
"UpdateOptions",
") => Promise<",
{
"pluginId": "actions",
"scope": "server",
"docId": "kibActionsPluginApi",
"section": "def-server.ActionResult",
"text": "ActionResult"
},
"<Record<string, unknown>>>; execute: ({ actionId, params, source, }: Pick<",
"ExecuteOptions",
"<unknown>, \"source\" | \"params\" | \"actionId\">) => Promise<",
{
"pluginId": "actions",
"scope": "common",
"docId": "kibActionsPluginApi",
"section": "def-common.ActionTypeExecutorResult",
"text": "ActionTypeExecutorResult"
}
],
"initialIsOpen": false
Expand Down Expand Up @@ -1071,24 +1065,24 @@
"description": [],
"source": {
"path": "x-pack/plugins/actions/server/plugin.ts",
"lineNumber": 94,
"link": "https://github.com/elastic/kibana/tree/7.xx-pack/plugins/actions/server/plugin.ts#L94"
"lineNumber": 86,
"link": "https://github.com/elastic/kibana/tree/7.xx-pack/plugins/actions/server/plugin.ts#L86"
}
}
],
"tags": [],
"returnComment": [],
"source": {
"path": "x-pack/plugins/actions/server/plugin.ts",
"lineNumber": 88,
"link": "https://github.com/elastic/kibana/tree/7.xx-pack/plugins/actions/server/plugin.ts#L88"
"lineNumber": 80,
"link": "https://github.com/elastic/kibana/tree/7.xx-pack/plugins/actions/server/plugin.ts#L80"
}
}
],
"source": {
"path": "x-pack/plugins/actions/server/plugin.ts",
"lineNumber": 87,
"link": "https://github.com/elastic/kibana/tree/7.xx-pack/plugins/actions/server/plugin.ts#L87"
"lineNumber": 79,
"link": "https://github.com/elastic/kibana/tree/7.xx-pack/plugins/actions/server/plugin.ts#L79"
},
"lifecycle": "setup",
"initialIsOpen": true
Expand Down Expand Up @@ -1119,8 +1113,8 @@
"description": [],
"source": {
"path": "x-pack/plugins/actions/server/plugin.ts",
"lineNumber": 99,
"link": "https://github.com/elastic/kibana/tree/7.xx-pack/plugins/actions/server/plugin.ts#L99"
"lineNumber": 91,
"link": "https://github.com/elastic/kibana/tree/7.xx-pack/plugins/actions/server/plugin.ts#L91"
}
},
{
Expand All @@ -1138,24 +1132,24 @@
"description": [],
"source": {
"path": "x-pack/plugins/actions/server/plugin.ts",
"lineNumber": 99,
"link": "https://github.com/elastic/kibana/tree/7.xx-pack/plugins/actions/server/plugin.ts#L99"
"lineNumber": 91,
"link": "https://github.com/elastic/kibana/tree/7.xx-pack/plugins/actions/server/plugin.ts#L91"
}
}
],
"source": {
"path": "x-pack/plugins/actions/server/plugin.ts",
"lineNumber": 99,
"link": "https://github.com/elastic/kibana/tree/7.xx-pack/plugins/actions/server/plugin.ts#L99"
"lineNumber": 91,
"link": "https://github.com/elastic/kibana/tree/7.xx-pack/plugins/actions/server/plugin.ts#L91"
}
}
],
"tags": [],
"returnComment": [],
"source": {
"path": "x-pack/plugins/actions/server/plugin.ts",
"lineNumber": 99,
"link": "https://github.com/elastic/kibana/tree/7.xx-pack/plugins/actions/server/plugin.ts#L99"
"lineNumber": 91,
"link": "https://github.com/elastic/kibana/tree/7.xx-pack/plugins/actions/server/plugin.ts#L91"
}
},
{
Expand All @@ -1177,8 +1171,8 @@
"description": [],
"source": {
"path": "x-pack/plugins/actions/server/plugin.ts",
"lineNumber": 101,
"link": "https://github.com/elastic/kibana/tree/7.xx-pack/plugins/actions/server/plugin.ts#L101"
"lineNumber": 93,
"link": "https://github.com/elastic/kibana/tree/7.xx-pack/plugins/actions/server/plugin.ts#L93"
}
},
{
Expand All @@ -1191,8 +1185,8 @@
"description": [],
"source": {
"path": "x-pack/plugins/actions/server/plugin.ts",
"lineNumber": 102,
"link": "https://github.com/elastic/kibana/tree/7.xx-pack/plugins/actions/server/plugin.ts#L102"
"lineNumber": 94,
"link": "https://github.com/elastic/kibana/tree/7.xx-pack/plugins/actions/server/plugin.ts#L94"
}
},
{
Expand All @@ -1210,24 +1204,24 @@
"description": [],
"source": {
"path": "x-pack/plugins/actions/server/plugin.ts",
"lineNumber": 103,
"link": "https://github.com/elastic/kibana/tree/7.xx-pack/plugins/actions/server/plugin.ts#L103"
"lineNumber": 95,
"link": "https://github.com/elastic/kibana/tree/7.xx-pack/plugins/actions/server/plugin.ts#L95"
}
}
],
"source": {
"path": "x-pack/plugins/actions/server/plugin.ts",
"lineNumber": 103,
"link": "https://github.com/elastic/kibana/tree/7.xx-pack/plugins/actions/server/plugin.ts#L103"
"lineNumber": 95,
"link": "https://github.com/elastic/kibana/tree/7.xx-pack/plugins/actions/server/plugin.ts#L95"
}
}
],
"tags": [],
"returnComment": [],
"source": {
"path": "x-pack/plugins/actions/server/plugin.ts",
"lineNumber": 100,
"link": "https://github.com/elastic/kibana/tree/7.xx-pack/plugins/actions/server/plugin.ts#L100"
"lineNumber": 92,
"link": "https://github.com/elastic/kibana/tree/7.xx-pack/plugins/actions/server/plugin.ts#L92"
}
},
{
Expand Down Expand Up @@ -1272,17 +1266,17 @@
"description": [],
"source": {
"path": "x-pack/plugins/actions/server/plugin.ts",
"lineNumber": 105,
"link": "https://github.com/elastic/kibana/tree/7.xx-pack/plugins/actions/server/plugin.ts#L105"
"lineNumber": 97,
"link": "https://github.com/elastic/kibana/tree/7.xx-pack/plugins/actions/server/plugin.ts#L97"
}
}
],
"tags": [],
"returnComment": [],
"source": {
"path": "x-pack/plugins/actions/server/plugin.ts",
"lineNumber": 105,
"link": "https://github.com/elastic/kibana/tree/7.xx-pack/plugins/actions/server/plugin.ts#L105"
"lineNumber": 97,
"link": "https://github.com/elastic/kibana/tree/7.xx-pack/plugins/actions/server/plugin.ts#L97"
}
},
{
Expand Down Expand Up @@ -1327,17 +1321,17 @@
"description": [],
"source": {
"path": "x-pack/plugins/actions/server/plugin.ts",
"lineNumber": 106,
"link": "https://github.com/elastic/kibana/tree/7.xx-pack/plugins/actions/server/plugin.ts#L106"
"lineNumber": 98,
"link": "https://github.com/elastic/kibana/tree/7.xx-pack/plugins/actions/server/plugin.ts#L98"
}
}
],
"tags": [],
"returnComment": [],
"source": {
"path": "x-pack/plugins/actions/server/plugin.ts",
"lineNumber": 106,
"link": "https://github.com/elastic/kibana/tree/7.xx-pack/plugins/actions/server/plugin.ts#L106"
"lineNumber": 98,
"link": "https://github.com/elastic/kibana/tree/7.xx-pack/plugins/actions/server/plugin.ts#L98"
}
},
{
Expand All @@ -1348,8 +1342,8 @@
"description": [],
"source": {
"path": "x-pack/plugins/actions/server/plugin.ts",
"lineNumber": 107,
"link": "https://github.com/elastic/kibana/tree/7.xx-pack/plugins/actions/server/plugin.ts#L107"
"lineNumber": 99,
"link": "https://github.com/elastic/kibana/tree/7.xx-pack/plugins/actions/server/plugin.ts#L99"
},
"signature": [
{
Expand Down Expand Up @@ -1381,8 +1375,8 @@
"description": [],
"source": {
"path": "x-pack/plugins/actions/server/plugin.ts",
"lineNumber": 109,
"link": "https://github.com/elastic/kibana/tree/7.xx-pack/plugins/actions/server/plugin.ts#L109"
"lineNumber": 101,
"link": "https://github.com/elastic/kibana/tree/7.xx-pack/plugins/actions/server/plugin.ts#L101"
}
},
{
Expand All @@ -1395,8 +1389,8 @@
"description": [],
"source": {
"path": "x-pack/plugins/actions/server/plugin.ts",
"lineNumber": 110,
"link": "https://github.com/elastic/kibana/tree/7.xx-pack/plugins/actions/server/plugin.ts#L110"
"lineNumber": 102,
"link": "https://github.com/elastic/kibana/tree/7.xx-pack/plugins/actions/server/plugin.ts#L102"
}
},
{
Expand All @@ -1409,24 +1403,24 @@
"description": [],
"source": {
"path": "x-pack/plugins/actions/server/plugin.ts",
"lineNumber": 111,
"link": "https://github.com/elastic/kibana/tree/7.xx-pack/plugins/actions/server/plugin.ts#L111"
"lineNumber": 103,
"link": "https://github.com/elastic/kibana/tree/7.xx-pack/plugins/actions/server/plugin.ts#L103"
}
}
],
"tags": [],
"returnComment": [],
"source": {
"path": "x-pack/plugins/actions/server/plugin.ts",
"lineNumber": 108,
"link": "https://github.com/elastic/kibana/tree/7.xx-pack/plugins/actions/server/plugin.ts#L108"
"lineNumber": 100,
"link": "https://github.com/elastic/kibana/tree/7.xx-pack/plugins/actions/server/plugin.ts#L100"
}
}
],
"source": {
"path": "x-pack/plugins/actions/server/plugin.ts",
"lineNumber": 98,
"link": "https://github.com/elastic/kibana/tree/7.xx-pack/plugins/actions/server/plugin.ts#L98"
"lineNumber": 90,
"link": "https://github.com/elastic/kibana/tree/7.xx-pack/plugins/actions/server/plugin.ts#L90"
},
"lifecycle": "start",
"initialIsOpen": true
Expand Down
26 changes: 18 additions & 8 deletions docs/api/actions-and-connectors.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,23 @@

Manage Actions and Connectors.

The following action APIs are available:
The following connector APIs are available:

* <<actions-and-connectors-api-get, Get action API>> to retrieve a single action by ID
* <<actions-and-connectors-api-get, Get connector API>> to retrieve a single connector by ID

* <<actions-and-connectors-api-get-all, Get all actions API>> to retrieve all actions
* <<actions-and-connectors-api-get-all, Get all connectors API>> to retrieve all connectors

* <<actions-and-connectors-api-list, List all action types API>> to retrieve a list of all action types
* <<actions-and-connectors-api-list, List all connector types API>> to retrieve a list of all connector types

* <<actions-and-connectors-api-create, Create action API>> to create actions
* <<actions-and-connectors-api-create, Create connector API>> to create connectors

* <<actions-and-connectors-api-update, Update action API>> to update the attributes for an existing action
* <<actions-and-connectors-api-update, Update connector API>> to update the attributes for an existing connector

* <<actions-and-connectors-api-execute, Execute action API>> to execute an action by ID
* <<actions-and-connectors-api-execute, Execute connector API>> to execute a connector by ID

* <<actions-and-connectors-api-delete, Delete action API>> to delete an action by ID
* <<actions-and-connectors-api-delete, Delete connector API>> to delete a connector by ID

For deprecated APIs, refer to <<actions-and-connectors-legacy-apis>>.

For information about the actions and connectors that {kib} supports, refer to <<action-types,Action and connector types>>.

Expand All @@ -28,3 +30,11 @@ include::actions-and-connectors/create.asciidoc[]
include::actions-and-connectors/update.asciidoc[]
include::actions-and-connectors/execute.asciidoc[]
include::actions-and-connectors/delete.asciidoc[]
include::actions-and-connectors/legacy/index.asciidoc[]
include::actions-and-connectors/legacy/get.asciidoc[]
include::actions-and-connectors/legacy/get_all.asciidoc[]
include::actions-and-connectors/legacy/list.asciidoc[]
include::actions-and-connectors/legacy/create.asciidoc[]
include::actions-and-connectors/legacy/update.asciidoc[]
include::actions-and-connectors/legacy/execute.asciidoc[]
include::actions-and-connectors/legacy/delete.asciidoc[]
36 changes: 18 additions & 18 deletions docs/api/actions-and-connectors/create.asciidoc
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
[[actions-and-connectors-api-create]]
=== Create action API
=== Create connector API
++++
<titleabbrev>Create action API</titleabbrev>
<titleabbrev>Create connector API</titleabbrev>
++++

Creates an action.
Creates a connector.

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

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

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

[[actions-and-connectors-api-create-path-params]]
==== Path parameters
Expand All @@ -23,18 +23,18 @@ Creates an action.
==== Request body

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

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

`config`::
(Required, object) The configuration for the action. Configuration properties vary depending on
the action type. For information about the configuration properties, refer to <<action-types,Action and connector types>>.
(Required, object) The configuration for the connector. Configuration properties vary depending on
the connector type. For information about the configuration properties, refer to <<action-types,Action and connector types>>.

`secrets`::
(Required, object) The secrets configuration for the action. Secrets configuration properties vary
depending on the action type. For information about the secrets configuration properties, refer to <<action-types,Action and connector types>>.
(Required, object) The secrets configuration for the connector. Secrets configuration properties vary
depending on the connector type. For information about the secrets configuration properties, refer to <<action-types,Action and connector types>>.
+
WARNING: Remember these values. You must provide them each time you call the <<actions-and-connectors-api-update, update>> API.

Expand All @@ -49,10 +49,10 @@ WARNING: Remember these values. You must provide them each time you call the <<a

[source,sh]
--------------------------------------------------
$ curl -X POST api/actions/action -H 'kbn-xsrf: true' -H 'Content-Type: application/json' -d '
$ curl -X POST api/actions/connector -H 'kbn-xsrf: true' -H 'Content-Type: application/json' -d '
{
"name": "my-action",
"actionTypeId": ".index",
"name": "my-connector",
"connector_type_id": ".index",
"config": {
"index": "test-index"
}
Expand All @@ -66,13 +66,13 @@ The API returns the following:
--------------------------------------------------
{
"id": "c55b6eb0-6bad-11eb-9f3b-611eebc6c3ad",
"actionTypeId": ".index",
"name": "my-action",
"connector_type_id": ".index",
"name": "my-connector",
"config": {
"index": "test-index",
"refresh": false,
"executionTimeField": null
},
"isPreconfigured": false
"is_preconfigured": false
}
--------------------------------------------------
Loading

0 comments on commit 1b3bee0

Please sign in to comment.