Run connector API
editRun connector API
editRuns a connector by ID.
Request
editPOST <kibana host>:<port>/api/actions/connector/<id>/_execute
POST <kibana host>:<port>/s/<space_id>/api/actions/connector/<id>/_execute
Prerequisites
editYou must have read
privileges for the Actions and Connectors feature in the
Management section of the
Kibana feature privileges.
If you use an index connector, you must also have all
, create
, index
, or
write
indices privileges.
Description
editYou can use this API to test an action that involves interaction with Kibana services or integrations with third-party systems.
Path parameters
edit-
id
- (Required, string) The ID of the connector.
-
space_id
-
(Optional, string) An identifier for the space. If
space_id
is not provided in the URL, the default space is used.
Request body
edit-
params
-
(Required, object) The parameters of the connector. Parameter properties vary depending on the connector type. For information about the parameter properties, refer to Connectors.
Index connectors
-
documents
- (Required, array of objects) The documents to index in JSON format.
For more information, refer to Index connector and action.
Jira connectors
-
subAction
-
(Required, string) The action to test. Valid values include:
fieldsByIssueType
,getFields
,getIncident
,issue
,issues
,issueTypes
, andpushToService
. -
subActionParams
-
(Required*, object) The set of configuration properties, which vary depending on the
subAction
value. This object is not required whensubAction
isgetFields
orissueTypes
.Properties when
subAction
isfieldsByIssueType
-
id
-
(Required, string) The Jira issue type identifier. For example,
10024
.
Properties when
subAction
isgetIncident
-
externalId
-
(Required, string) The Jira issue identifier. For example,
71778
.
Properties when
subAction
isissue
-
id
-
(Required, string) The Jira issue identifier. For example,
71778
.
Properties when
subAction
isissues
-
title
- (Required, string) The title of the Jira issue.
Properties when
subAction
ispushToService
- comments
-
(Optional, array of objects) Additional information that is sent to Jira.
Properties of
comments
- comment
- (string) A comment related to the incident. For example, describe how to troubleshoot the issue.
- commentId
- (integer) A unique identifier for the comment.
- incident
-
(Required, object) Information necessary to create or update a Jira incident.
Properties of
incident
-
description
- (Optional, string) The details about the incident.
-
externalId
- (Optional, string) The Jira issue identifier. If present, the incident is updated. Otherwise, a new incident is created.
-
labels
-
(Optional, array of strings) The labels for the incident. For example,
["LABEL1"]
. NOTE: Labels cannot contain spaces. -
issueType
-
(Optional, integer) The type of incident. For example,
10006
. To obtain the list of valid values, setsubAction
toissueTypes
. -
parent
-
(Optional, string) The ID or key of the parent issue. Applies only to
Sub-task
types of issues. -
priority
-
(Optional, string) The incident priority level. For example,
Lowest
. -
summary
- (Required, string) A summary of the incident.
-
title
- (Optional, string) A title for the incident, used for searching the contents of the knowledge base.
-
-
For more information, refer to Jira connector and action.
Server log connectors
-
level
-
(Optional, string) The log level of the message:
trace
,debug
,info
,warn
,error
, orfatal
. Defaults toinfo
. -
message
- (Required, string) The message to log.
-
Response codes
edit-
200
- Indicates a successful call.
Examples
editRun an index connector:
POST api/actions/connector/c55b6eb0-6bad-11eb-9f3b-611eebc6c3ad/_execute { "params": { "documents": [ { "id": "test_doc_id", "name": "test_doc_name", "message": "hello, world" } ] } }
The API returns the following:
{ "status": "ok", "data": { "took": 10, "errors": false, "items": [ { "index": { "_index": "test-index", "_id": "iKyijHcBKCsmXNFrQe3T", "_version": 1, "result": "created", "_shards": { "total": 2, "successful": 1, "failed": 0 }, "_seq_no": 0, "_primary_term": 1, "status": 201 } } ] }, "connector_id": "c55b6eb0-6bad-11eb-9f3b-611eebc6c3ad" }
Run a server log connector:
POST api/actions/connector/7fc7b9a0-ecc9-11ec-8736-e7d63118c907/_execute { "params": { "level": "warn", "message": "Test warning message" } }
The API returns the following:
{"status":"ok","connector_id":"7fc7b9a0-ecc9-11ec-8736-e7d63118c907"}
Retrieve the list of issue types for a Jira connector:
POST api/actions/connector/b3aad810-edbe-11ec-82d1-11348ecbf4a6/_execute { "params": { "subAction": "issueTypes" } }
The API returns the following:
{ "status":"ok", "data":[ {"id":"10024","name":"Improvement"},{"id":"10006","name":"Task"}, {"id":"10007","name":"Sub-task"},{"id":"10025","name":"New Feature"}, {"id":"10023","name":"Bug"},{"id":"10000","name":"Epic"} ], "connector_id":"b3aad810-edbe-11ec-82d1-11348ecbf4a6" }