Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into no-bootstrap-ts-refs
Browse files Browse the repository at this point in the history
  • Loading branch information
mistic committed Feb 17, 2021
2 parents fcf781b + 9ca4143 commit 7e4520e
Show file tree
Hide file tree
Showing 2,245 changed files with 66,139 additions and 28,482 deletions.
4 changes: 3 additions & 1 deletion .backportrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,7 @@
"^v8.0.0$": "master",
"^v7.12.0$": "7.x",
"^v(\\d+).(\\d+).\\d+$": "$1.$2"
}
},
"autoMerge": true,
"autoMergeMethod": "squash"
}
12 changes: 11 additions & 1 deletion .ci/Jenkinsfile_baseline_capture
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,17 @@ kibanaPipeline(timeoutMinutes: 120) {
]) {
parallel([
'oss-baseline': {
workers.ci(name: 'oss-baseline', size: 'l', ramDisk: true, runErrorReporter: false) {
workers.ci(name: 'oss-baseline', size: 'l', ramDisk: true, runErrorReporter: false, bootstrapped: false) {
// bootstrap ourselves, but with the env needed to upload the ts refs cache
withGcpServiceAccount.fromVaultSecret('secret/kibana-issues/dev/ci-artifacts-key', 'value') {
withEnv([
'BUILD_TS_REFS_CACHE_ENABLE=true',
'BUILD_TS_REFS_CACHE_CAPTURE=true'
]) {
kibanaPipeline.doSetup()
}
}

kibanaPipeline.functionalTestProcess('oss-baseline', './test/scripts/jenkins_baseline.sh')()
}
},
Expand Down
4 changes: 2 additions & 2 deletions .ci/Jenkinsfile_coverage
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
library 'kibana-pipeline-library'
kibanaLibrary.load() // load from the Jenkins instance

kibanaPipeline(timeoutMinutes: 240) {
kibanaPipeline(timeoutMinutes: 300) {
catchErrors {
def timestamp = new Date(currentBuild.startTimeInMillis).format("yyyy-MM-dd'T'HH:mm:ss'Z'", TimeZone.getTimeZone("UTC"))
withEnv([
"TIME_STAMP=${timestamp}",
'CODE_COVERAGE=1', // Enables coverage. Needed for multiple ci scripts, such as remote.ts, test/scripts/*.sh, schema.js, etc.
]) {
workers.base(name: 'coverage-worker', size: 'l', ramDisk: false, bootstrapped: false) {
workers.base(name: 'coverage-worker', size: 'xl', ramDisk: false, bootstrapped: false) {
catchError {

kibanaPipeline.bash("""
Expand Down
2 changes: 1 addition & 1 deletion .ci/es-snapshots/Jenkinsfile_verify_es
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ currentBuild.description = "ES: ${SNAPSHOT_VERSION}<br />Kibana: ${params.branch

def SNAPSHOT_MANIFEST = "https://storage.googleapis.com/kibana-ci-es-snapshots-daily/${SNAPSHOT_VERSION}/archives/${SNAPSHOT_ID}/manifest.json"

kibanaPipeline(timeoutMinutes: 150) {
kibanaPipeline(timeoutMinutes: 210) {
catchErrors {
slackNotifications.onFailure(
title: "*<${env.BUILD_URL}|[${SNAPSHOT_VERSION}] ES Snapshot Verification Failure>*",
Expand Down
9 changes: 7 additions & 2 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,13 @@
#CC# /src/plugins/apm_oss/ @elastic/apm-ui
#CC# /x-pack/plugins/observability/ @elastic/apm-ui

# Client Side Monitoring (lives in APM directories but owned by Uptime)
# Uptime
/x-pack/plugins/uptime @elastic/uptime
/x-pack/test/functional_with_es_ssl/apps/uptime @elastic/uptime
/x-pack/test/functional/apps/uptime @elastic/uptime
/x-pack/test/api_integration/apis/uptime @elastic/uptime

# Client Side Monitoring / Uptime (lives in APM directories but owned by Uptime)
/x-pack/plugins/apm/e2e/cypress/support/step_definitions/csm @elastic/uptime
/x-pack/plugins/apm/e2e/cypress/integration/csm_dashboard.feature @elastic/uptime
/x-pack/plugins/apm/public/application/csmApp.tsx @elastic/uptime
Expand Down Expand Up @@ -106,7 +112,6 @@
/x-pack/plugins/fleet/ @elastic/fleet
/x-pack/plugins/observability/ @elastic/observability-ui
/x-pack/plugins/monitoring/ @elastic/stack-monitoring-ui
/x-pack/plugins/uptime @elastic/uptime

# Machine Learning
/x-pack/plugins/ml/ @elastic/ml-ui
Expand Down
42 changes: 14 additions & 28 deletions .github/workflows/backport.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,34 +18,20 @@ jobs:
)
runs-on: ubuntu-latest
steps:
- name: 'Get backport config'
run: |
curl 'https://raw.githubusercontent.com/elastic/kibana/master/.backportrc.json' > .backportrc.json
- name: Use Node.js 14.x
uses: actions/setup-node@v1
- name: Checkout Actions
uses: actions/checkout@v2
with:
node-version: 14.x

- name: Install backport CLI
run: npm install -g backport@5.6.4
repository: 'elastic/kibana-github-actions'
ref: main
path: ./actions

- name: Backport PR
run: |
git config --global user.name "kibanamachine"
git config --global user.email "42973632+kibanamachine@users.noreply.github.com"
backport --fork true --username kibanamachine --accessToken "${{ secrets.KIBANAMACHINE_TOKEN }}" --ci --pr "$PR_NUMBER" --labels backport --assignee "$PR_OWNER" | tee 'output.log'
env:
PR_NUMBER: ${{ github.event.pull_request.number }}
PR_OWNER: ${{ github.event.pull_request.user.login }}
- name: Install Actions
run: npm install --production --prefix ./actions

- name: Report backport status
run: |
COMMENT="Backport result
\`\`\`
$(cat output.log)
\`\`\`"
GITHUB_TOKEN="${{ secrets.KIBANAMACHINE_TOKEN }}" gh api -X POST repos/elastic/kibana/issues/$PR_NUMBER/comments -F body="$COMMENT"
env:
PR_NUMBER: ${{ github.event.pull_request.number }}
- name: Run Backport
uses: ./actions/backport
with:
branch: master
github_token: ${{secrets.KIBANAMACHINE_TOKEN}}
commit_user: kibanamachine
commit_email: 42973632+kibanamachine@users.noreply.github.com
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,6 @@ npm-debug.log*
.ci/bash_standard_lib.sh
.gradle

# apm plugin
/x-pack/plugins/apm/tsconfig.json
apm.tsconfig.json
## @cypress/snapshot from apm plugin
snapshots.js

Expand Down
2 changes: 1 addition & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
library 'kibana-pipeline-library'
kibanaLibrary.load()

kibanaPipeline(timeoutMinutes: 155, checkPrChanges: true, setCommitStatus: true) {
kibanaPipeline(timeoutMinutes: 210, checkPrChanges: true, setCommitStatus: true) {
slackNotifications.onFailure(disabled: !params.NOTIFY_ON_FAILURE) {
githubPr.withDefaultPrComments {
ciStats.trackBuild {
Expand Down
30 changes: 30 additions & 0 deletions docs/api/actions-and-connectors.asciidoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
[[actions-and-connectors-api]]
== Action and connector APIs

Manage Actions and Connectors.

The following action APIs are available:

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

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

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

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

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

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

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

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

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[]
68 changes: 68 additions & 0 deletions docs/api/actions-and-connectors/create.asciidoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
[[actions-and-connectors-api-create]]
=== Create action API
++++
<titleabbrev>Create action API</titleabbrev>
++++

Creates an action.

[[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 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>>.

`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>>.

[[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
}
--------------------------------------------------
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>
++++

Deletes an action by ID.

WARNING: When you delete an action, _it cannot be recovered_.

[[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.

[[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

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

Executes an action by ID.

[[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.

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

`params`::
(Required, object) The parameters of the action. Parameter properties vary depending on
the action type. For information about the parameter properties, refer to <<action-types,Action and connector types>>.

[[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"
}
--------------------------------------------------
Loading

0 comments on commit 7e4520e

Please sign in to comment.