Skip to content

Commit

Permalink
Merge branch 'main' into connectors/servicenow-docs
Browse files Browse the repository at this point in the history
  • Loading branch information
kibanamachine authored May 16, 2022
2 parents efffbe4 + 6ed28ac commit b0b14b9
Show file tree
Hide file tree
Showing 442 changed files with 7,639 additions and 15,446 deletions.
4 changes: 2 additions & 2 deletions .buildkite/scripts/build_kibana.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ set -euo pipefail
export KBN_NP_PLUGINS_BUILT=true

echo "--- Build Kibana Distribution"
if [[ "${GITHUB_PR_LABELS:-}" == *"ci:build-all-platforms"* ]]; then
if is_pr_with_label "ci:build-all-platforms"; then
node scripts/build --all-platforms --skip-os-packages
elif [[ "${GITHUB_PR_LABELS:-}" == *"ci:build-os-packages"* ]]; then
elif is_pr_with_label "ci:build-os-packages"; then
node scripts/build --all-platforms --docker-cross-compile
else
node scripts/build
Expand Down
2 changes: 1 addition & 1 deletion .buildkite/scripts/common/env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export ELASTIC_APM_SERVER_URL=https://kibana-ci-apm.apm.us-central1.gcp.cloud.es
export ELASTIC_APM_SECRET_TOKEN=7YKhoXsO4MzjhXjx2c

if is_pr; then
if [[ "${GITHUB_PR_LABELS:-}" == *"ci:collect-apm"* ]]; then
if is_pr_with_label "ci:collect-apm"; then
export ELASTIC_APM_ACTIVE=true
export ELASTIC_APM_CONTEXT_PROPAGATION_ONLY=false
else
Expand Down
21 changes: 20 additions & 1 deletion .buildkite/scripts/common/util.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,25 @@ is_pr() {
false
}

is_pr_with_label() {
match="$1"

IFS=',' read -ra labels <<< "${GITHUB_PR_LABELS:-}"

for label in "${labels[@]}"
do
if [ "$label" == "$match" ]; then
return
fi
done

false
}

is_auto_commit_disabled() {
is_pr_with_label "ci:no-auto-commit"
}

check_for_changed_files() {
RED='\033[0;31m'
YELLOW='\033[0;33m'
Expand All @@ -23,7 +42,7 @@ check_for_changed_files() {
GIT_CHANGES="$(git ls-files --modified -- . ':!:.bazelrc')"

if [ "$GIT_CHANGES" ]; then
if [[ "$SHOULD_AUTO_COMMIT_CHANGES" == "true" && "${BUILDKITE_PULL_REQUEST:-}" ]]; then
if ! is_auto_commit_disabled && [[ "$SHOULD_AUTO_COMMIT_CHANGES" == "true" && "${BUILDKITE_PULL_REQUEST:-}" ]]; then
NEW_COMMIT_MESSAGE="[CI] Auto-commit changed files from '$1'"
PREVIOUS_COMMIT_MESSAGE="$(git log -1 --pretty=%B)"

Expand Down
10 changes: 6 additions & 4 deletions .buildkite/scripts/steps/artifacts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ buildkite-agent artifact upload "dependencies-$FULL_VERSION.csv.sha512.txt"
buildkite-agent artifact upload 'i18n/*.json'
cd -

cd .beats
buildkite-agent artifact upload 'metricbeat-*'
buildkite-agent artifact upload 'filebeat-*'
cd -
if [ -d .beats ]; then
cd .beats
buildkite-agent artifact upload 'metricbeat-*'
buildkite-agent artifact upload 'filebeat-*'
cd -
fi
16 changes: 11 additions & 5 deletions .buildkite/scripts/steps/lint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,26 @@ checks-reporter-with-killswitch "Lint: stylelint" \
node scripts/stylelint
echo "stylelint ✅"

echo '--- Lint: eslint'
# disable "Exit immediately" mode so that we can run eslint, capture it's exit code, and respond appropriately
# after possibly commiting fixed files to the repo
set +e;

echo '--- Lint: eslint'
checks-reporter-with-killswitch "Lint: eslint" \
if is_pr && ! is_auto_commit_disabled; then
node scripts/eslint --no-cache --fix
else
node scripts/eslint --no-cache
fi

eslint_exit=$?

# re-enable "Exit immediately" mode
set -e;

check_for_changed_files 'node scripts/eslint --no-cache --fix' true
desc="node scripts/eslint --no-cache"
if is_pr && ! is_auto_commit_disabled; then
desc="$desc --fix"
fi

check_for_changed_files "$desc" true

if [[ "${eslint_exit}" != "0" ]]; then
exit 1
Expand Down
8 changes: 4 additions & 4 deletions docs/api/actions-and-connectors.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ 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>>.

include::actions-and-connectors/get.asciidoc[]
include::actions-and-connectors/get_all.asciidoc[]
include::actions-and-connectors/create.asciidoc[leveloffset=+1]
include::actions-and-connectors/delete.asciidoc[leveloffset=+1]
include::actions-and-connectors/get.asciidoc[leveloffset=+1]
include::actions-and-connectors/get_all.asciidoc[leveloffset=+1]
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[]
include::actions-and-connectors/legacy/index.asciidoc[]
include::actions-and-connectors/legacy/get.asciidoc[]
include::actions-and-connectors/legacy/get_all.asciidoc[]
Expand Down
31 changes: 22 additions & 9 deletions docs/api/actions-and-connectors/create.asciidoc
Original file line number Diff line number Diff line change
@@ -1,26 +1,37 @@
[[create-connector-api]]
=== Create connector API
== Create connector API
++++
<titleabbrev>Create connector</titleabbrev>
++++

Creates a connector.

[discrete]
[[create-connector-api-request]]
==== Request
=== {api-request-title}

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

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

[discrete]
=== {api-prereq-title}

You must have `all` privileges for the *Actions and Connectors* feature in the
*Management* section of the
<<kibana-feature-privileges,{kib} feature privileges>>.

[discrete]
[[create-connector-api-path-params]]
==== Path parameters
=== {api-path-parms-title}

`space_id`::
(Optional, string) An identifier for the space. If `space_id` is not provided in the URL, the default space is used.
(Optional, string) An identifier for the space. If `space_id` is not provided
in the URL, the default space is used.

[discrete]
[[create-connector-api-request-body]]
==== Request body
=== {api-request-body-title}

`name`::
(Required, string) The display name for the connector.
Expand All @@ -38,25 +49,27 @@ Creates a connector.
+
WARNING: Remember these values. You must provide them each time you call the <<update-connector-api, update>> API.

[discrete]
[[create-connector-api-request-codes]]
==== Response code
=== {api-response-codes-title}

`200`::
Indicates a successful call.

[discrete]
[[create-connector-api-example]]
==== Example
=== {api-examples-title}

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

Expand Down
23 changes: 17 additions & 6 deletions docs/api/actions-and-connectors/delete.asciidoc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[[delete-connector-api]]
=== Delete connector API
== Delete connector API
++++
<titleabbrev>Delete connector</titleabbrev>
++++
Expand All @@ -8,32 +8,43 @@ Deletes an connector by ID.

WARNING: When you delete a connector, _it cannot be recovered_.

[discrete]
[[delete-connector-api-request]]
==== Request
=== {api-request-title}

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

`DELETE <kibana host>:<port>/s/<space_id>/api/actions/connector/<id>`

[discrete]
=== {api-prereq-title}

You must have `all` privileges for the *Actions and Connectors* feature in the
*Management* section of the
<<kibana-feature-privileges,{kib} feature privileges>>.

[discrete]
[[delete-connector-api-path-params]]
==== Path parameters
=== {api-path-parms-title}

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

[discrete]
[[delete-connector-api-response-codes]]
==== Response code
=== {api-response-codes-title}

`200`::
Indicates a successful call.

==== Example
[discrete]
=== {api-examples-title}

[source,sh]
--------------------------------------------------
$ curl -X DELETE api/actions/connector/c55b6eb0-6bad-11eb-9f3b-611eebc6c3ad
DELETE api/actions/connector/c55b6eb0-6bad-11eb-9f3b-611eebc6c3ad
--------------------------------------------------
// KIBANA
25 changes: 18 additions & 7 deletions docs/api/actions-and-connectors/get.asciidoc
Original file line number Diff line number Diff line change
@@ -1,39 +1,50 @@
[[get-connector-api]]
=== Get connector API
== Get connector API
++++
<titleabbrev>Get connector</titleabbrev>
++++

Retrieves a connector by ID.

[discrete]
[[get-connector-api-request]]
==== Request
=== {api-request-title}

`GET <kibana host>:<port>/api/actions/connector/<id>`

`GET <kibana host>:<port>/s/<space_id>/api/actions/connector/<id>`

[discrete]
=== {api-prereq-title}

You must have `read` privileges for the *Actions and Connectors* feature in the
*Management* section of the
<<kibana-feature-privileges,{kib} feature privileges>>.

[discrete]
[[get-connector-api-params]]
==== Path parameters
=== {api-path-parms-title}

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

[discrete]
[[get-connector-api-codes]]
==== Response code
=== {api-response-codes-title}

`200`::
Indicates a successful call.

[discrete]
[[get-connector-api-example]]
==== Example
=== {api-examples-title}

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

Expand All @@ -54,4 +65,4 @@ The API returns the following:
"is_deprecated": false,
"is_missing_secrets": false
}
--------------------------------------------------
--------------------------------------------------
25 changes: 18 additions & 7 deletions docs/api/actions-and-connectors/get_all.asciidoc
Original file line number Diff line number Diff line change
@@ -1,36 +1,47 @@
[[get-all-connectors-api]]
=== Get all connectors API
== Get all connectors API
++++
<titleabbrev>Get all connectors</titleabbrev>
++++

Retrieves all connectors.

[discrete]
[[get-all-connectors-api-request]]
==== Request
=== {api-request-title}

`GET <kibana host>:<port>/api/actions/connectors`

`GET <kibana host>:<port>/s/<space_id>/api/actions/connectors`

[discrete]
=== {api-prereq-title}

You must have `read` privileges for the *Actions and Connectors* feature in the
*Management* section of the
<<kibana-feature-privileges,{kib} feature privileges>>.

[discrete]
[[get-all-connectors-api-path-params]]
==== Path parameters
=== {api-path-parms-title}

`space_id`::
(Optional, string) An identifier for the space. If `space_id` is not provided in the URL, the default space is used.

[discrete]
[[get-all-connectors-api-codes]]
==== Response code
=== {api-response-codes-title}

`200`::
Indicates a successful call.

[discrete]
[[get-all-connectors-api-example]]
==== Example
=== {api-examples-title}

[source,sh]
--------------------------------------------------
$ curl -X GET api/actions/connectors
GET api/actions/connectors
--------------------------------------------------
// KIBANA

Expand Down Expand Up @@ -64,4 +75,4 @@ The API returns the following:
]
--------------------------------------------------

<1> `referenced_by_count` - The number of saved-objects referencing this connector. This value is not calculated if `is_preconfigured: true`.
<1> `referenced_by_count` indicates the number of saved objects that reference the connector. This value is not calculated if `is_preconfigured` is `true`.
2 changes: 1 addition & 1 deletion docs/api/alerting/find_rules.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ NOTE: Rule `params` are stored as a {ref}/flattened.html[flattened field type] a
(Optional, array|string) The fields to perform the `simple_query_string` parsed query against.

`fields`::
(Optional, array|string) The fields to return in the `attributes` key of the response.
(Optional, array of strings) The fields to return in the `attributes` key of the response.

`sort_field`::
(Optional, string) Sorts the response. Could be a rule field returned in the `attributes` key of the response.
Expand Down
Loading

0 comments on commit b0b14b9

Please sign in to comment.