Skip to content

Commit

Permalink
Merge branch 'master' of github.com:elastic/kibana into timeline-bug-7.9
Browse files Browse the repository at this point in the history
  • Loading branch information
XavierM committed Jul 14, 2020
2 parents 0adabc8 + 86733f6 commit 6aa5371
Show file tree
Hide file tree
Showing 680 changed files with 14,264 additions and 8,213 deletions.
File renamed without changes.
64 changes: 64 additions & 0 deletions .ci/Jenkinsfile_baseline_trigger
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
#!/bin/groovy

def MAXIMUM_COMMITS_TO_CHECK = 10
def MAXIMUM_COMMITS_TO_BUILD = 5

if (!params.branches_yaml) {
error "'branches_yaml' parameter must be specified"
}

def additionalBranches = []

def branches = readYaml(text: params.branches_yaml) + additionalBranches

library 'kibana-pipeline-library'
kibanaLibrary.load()

withGithubCredentials {
branches.each { branch ->
stage(branch) {
def commits = getCommits(branch, MAXIMUM_COMMITS_TO_CHECK, MAXIMUM_COMMITS_TO_BUILD)

commits.take(MAXIMUM_COMMITS_TO_BUILD).each { commit ->
catchErrors {
githubCommitStatus.create(commit, 'pending', 'Baseline started.', 'kibana-ci-baseline')

build(
propagate: false,
wait: false,
job: 'elastic+kibana+baseline-capture',
parameters: [
string(name: 'branch_specifier', value: branch),
string(name: 'commit', value: commit),
]
)
}
}
}
}
}

def getCommits(String branch, maximumCommitsToCheck, maximumCommitsToBuild) {
print "Getting latest commits for ${branch}..."
def commits = githubApi.get("repos/elastic/kibana/commits?sha=${branch}").take(maximumCommitsToCheck).collect { it.sha }
def commitsToBuild = []

for (commit in commits) {
print "Getting statuses for ${commit}"
def status = githubApi.get("repos/elastic/kibana/statuses/${commit}").find { it.context == 'kibana-ci-baseline' }
print "Commit '${commit}' already built? ${status ? 'Yes' : 'No'}"

if (!status) {
commitsToBuild << commit
} else {
// Stop at the first commit we find that's already been triggered
break
}

if (commitsToBuild.size() >= maximumCommitsToBuild) {
break
}
}

return commitsToBuild.reverse() // We want the builds to trigger oldest-to-newest
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ experimental[] Create a centrally-managed Logstash pipeline, or update an existi
[[logstash-configuration-management-api-create-request-body]]
==== Request body

`id`::
(Required, string) The pipeline ID.

`description`::
(Optional, string) The pipeline description.

Expand Down
21 changes: 19 additions & 2 deletions docs/api/using-api.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,23 @@ NOTE: The {kib} Console supports only Elasticsearch APIs. You are unable to inte
[float]
[[api-authentication]]
=== Authentication
{kib} supports token-based authentication with the same username and password that you use to log into the {kib} Console. In a given HTTP tool, and when available, you can select to use its 'Basic Authentication' option, which is where the username and password are stored in order to be passed as part of the call.
The {kib} APIs support key- and token-based authentication.

[float]
[[token-api-authentication]]
==== Token-based authentication

To use token-based authentication, you use the same username and password that you use to log into Elastic.
In a given HTTP tool, and when available, you can select to use its 'Basic Authentication' option,
which is where the username and password are stored in order to be passed as part of the call.

[float]
[[key-authentication]]
==== Key-based authentication

To use key-based authentication, you create an API key using the Elastic Console, then specify the key in the header of your API calls.

For information about API keys, refer to <<api-keys,API keys>>.

[float]
[[api-calls]]
Expand Down Expand Up @@ -51,7 +67,8 @@ For all APIs, you must use a request header. The {kib} APIs support the `kbn-xsr
* XSRF protections are disabled using the `server.xsrf.disableProtection` setting

`Content-Type: application/json`::
Applicable only when you send a payload in the API request. {kib} API requests and responses use JSON. Typically, if you include the `kbn-xsrf` header, you must also include the `Content-Type` header.
Applicable only when you send a payload in the API request. {kib} API requests and responses use JSON.
Typically, if you include the `kbn-xsrf` header, you must also include the `Content-Type` header.

Request header example:

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) &gt; [EsaggsExpressionFunctionDefinition](./kibana-plugin-plugins-data-public.esaggsexpressionfunctiondefinition.md)

## EsaggsExpressionFunctionDefinition type

<b>Signature:</b>

```typescript
export declare type EsaggsExpressionFunctionDefinition = ExpressionFunctionDefinition<'esaggs', Input, Arguments, Output>;
```
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@
| [AggGroupName](./kibana-plugin-plugins-data-public.agggroupname.md) | |
| [AggParam](./kibana-plugin-plugins-data-public.aggparam.md) | |
| [CustomFilter](./kibana-plugin-plugins-data-public.customfilter.md) | |
| [EsaggsExpressionFunctionDefinition](./kibana-plugin-plugins-data-public.esaggsexpressionfunctiondefinition.md) | |
| [EsQuerySortValue](./kibana-plugin-plugins-data-public.esquerysortvalue.md) | |
| [ExistsFilter](./kibana-plugin-plugins-data-public.existsfilter.md) | |
| [FieldFormatId](./kibana-plugin-plugins-data-public.fieldformatid.md) | id type is needed for creating custom converters. |
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-plugins-data-server](./kibana-plugin-plugins-data-server.md) &gt; [EsaggsExpressionFunctionDefinition](./kibana-plugin-plugins-data-server.esaggsexpressionfunctiondefinition.md)

## EsaggsExpressionFunctionDefinition type

<b>Signature:</b>

```typescript
export declare type EsaggsExpressionFunctionDefinition = ExpressionFunctionDefinition<'esaggs', Input, Arguments, Output>;
```
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@

| Type Alias | Description |
| --- | --- |
| [EsaggsExpressionFunctionDefinition](./kibana-plugin-plugins-data-server.esaggsexpressionfunctiondefinition.md) | |
| [FieldFormatsGetConfigFn](./kibana-plugin-plugins-data-server.fieldformatsgetconfigfn.md) | |
| [IFieldFormatsRegistry](./kibana-plugin-plugins-data-server.ifieldformatsregistry.md) | |
| [ParsedInterval](./kibana-plugin-plugins-data-server.parsedinterval.md) | |
Expand Down
12 changes: 6 additions & 6 deletions src/dev/precommit_hook/casing_check_config.js
Original file line number Diff line number Diff line change
Expand Up @@ -173,12 +173,12 @@ export const TEMPORARILY_IGNORED_PATHS = [
'x-pack/plugins/monitoring/public/icons/health-green.svg',
'x-pack/plugins/monitoring/public/icons/health-red.svg',
'x-pack/plugins/monitoring/public/icons/health-yellow.svg',
'x-pack/plugins/reporting/server/export_types/printable_pdf/server/lib/pdf/assets/fonts/noto/NotoSansCJKtc-Medium.ttf',
'x-pack/plugins/reporting/server/export_types/printable_pdf/server/lib/pdf/assets/fonts/noto/NotoSansCJKtc-Regular.ttf',
'x-pack/plugins/reporting/server/export_types/printable_pdf/server/lib/pdf/assets/fonts/roboto/Roboto-Italic.ttf',
'x-pack/plugins/reporting/server/export_types/printable_pdf/server/lib/pdf/assets/fonts/roboto/Roboto-Medium.ttf',
'x-pack/plugins/reporting/server/export_types/printable_pdf/server/lib/pdf/assets/fonts/roboto/Roboto-Regular.ttf',
'x-pack/plugins/reporting/server/export_types/printable_pdf/server/lib/pdf/assets/img/logo-grey.png',
'x-pack/plugins/reporting/server/export_types/printable_pdf/lib/pdf/assets/fonts/noto/NotoSansCJKtc-Medium.ttf',
'x-pack/plugins/reporting/server/export_types/printable_pdf/lib/pdf/assets/fonts/noto/NotoSansCJKtc-Regular.ttf',
'x-pack/plugins/reporting/server/export_types/printable_pdf/lib/pdf/assets/fonts/roboto/Roboto-Italic.ttf',
'x-pack/plugins/reporting/server/export_types/printable_pdf/lib/pdf/assets/fonts/roboto/Roboto-Medium.ttf',
'x-pack/plugins/reporting/server/export_types/printable_pdf/lib/pdf/assets/fonts/roboto/Roboto-Regular.ttf',
'x-pack/plugins/reporting/server/export_types/printable_pdf/lib/pdf/assets/img/logo-grey.png',
'x-pack/test/functional/es_archives/monitoring/beats-with-restarted-instance/data.json.gz',
'x-pack/test/functional/es_archives/monitoring/beats-with-restarted-instance/mappings.json',
'x-pack/test/functional/es_archives/monitoring/logstash-pipelines/data.json.gz',
Expand Down
1 change: 1 addition & 0 deletions src/plugins/data/common/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,6 @@ export * from './kbn_field_types';
export * from './query';
export * from './search';
export * from './search/aggs';
export * from './search/expressions';
export * from './types';
export * from './utils';
43 changes: 43 additions & 0 deletions src/plugins/data/common/search/expressions/esaggs.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

import {
KibanaContext,
KibanaDatatable,
ExpressionFunctionDefinition,
} from '../../../../../plugins/expressions/common';

type Input = KibanaContext | null;
type Output = Promise<KibanaDatatable>;

interface Arguments {
index: string;
metricsAtAllLevels: boolean;
partialRows: boolean;
includeFormatHints: boolean;
aggConfigs: string;
timeFields?: string[];
}

export type EsaggsExpressionFunctionDefinition = ExpressionFunctionDefinition<
'esaggs',
Input,
Arguments,
Output
>;
20 changes: 20 additions & 0 deletions src/plugins/data/common/search/expressions/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

export * from './esaggs';
2 changes: 1 addition & 1 deletion src/plugins/data/public/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ import {
toAbsoluteDates,
} from '../common';

export { ParsedInterval } from '../common';
export { EsaggsExpressionFunctionDefinition, ParsedInterval } from '../common';

export {
// aggs
Expand Down
13 changes: 12 additions & 1 deletion src/plugins/data/public/public.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ import { EuiButtonEmptyProps } from '@elastic/eui';
import { EuiComboBoxProps } from '@elastic/eui';
import { EuiConfirmModalProps } from '@elastic/eui';
import { EuiGlobalToastListToast } from '@elastic/eui';
import { EventEmitter } from 'events';
import { ExclusiveUnion } from '@elastic/eui';
import { ExistsParams } from 'elasticsearch';
import { ExplainParams } from 'elasticsearch';
Expand Down Expand Up @@ -145,7 +146,7 @@ import { ReindexParams } from 'elasticsearch';
import { ReindexRethrottleParams } from 'elasticsearch';
import { RenderSearchTemplateParams } from 'elasticsearch';
import { RequestAdapter } from 'src/plugins/inspector/common';
import { RequestStatistics } from 'src/plugins/inspector/common';
import { RequestStatistics as RequestStatistics_2 } from 'src/plugins/inspector/common';
import { Required } from '@kbn/utility-types';
import * as Rx from 'rxjs';
import { SavedObject } from 'src/core/server';
Expand Down Expand Up @@ -180,6 +181,7 @@ import { UiActionsSetup } from 'src/plugins/ui_actions/public';
import { UiActionsStart } from 'src/plugins/ui_actions/public';
import { Unit } from '@elastic/datemath';
import { UnregisterCallback } from 'history';
import { UnwrapPromiseOrReturn } from '@kbn/utility-types';
import { UpdateDocumentByQueryParams } from 'elasticsearch';
import { UpdateDocumentParams } from 'elasticsearch';
import { UserProvidedValues } from 'src/core/server/types';
Expand Down Expand Up @@ -425,6 +427,15 @@ export enum ES_FIELD_TYPES {
// @public (undocumented)
export const ES_SEARCH_STRATEGY = "es";

// Warning: (ae-forgotten-export) The symbol "ExpressionFunctionDefinition" needs to be exported by the entry point index.d.ts
// Warning: (ae-forgotten-export) The symbol "Input" needs to be exported by the entry point index.d.ts
// Warning: (ae-forgotten-export) The symbol "Arguments" needs to be exported by the entry point index.d.ts
// Warning: (ae-forgotten-export) The symbol "Output" needs to be exported by the entry point index.d.ts
// Warning: (ae-missing-release-tag) "EsaggsExpressionFunctionDefinition" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
export type EsaggsExpressionFunctionDefinition = ExpressionFunctionDefinition<'esaggs', Input, Arguments, Output>;

// Warning: (ae-missing-release-tag) "esFilters" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
Expand Down
23 changes: 4 additions & 19 deletions src/plugins/data/public/search/expressions/esaggs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,8 @@

import { get, hasIn } from 'lodash';
import { i18n } from '@kbn/i18n';
import {
KibanaContext,
KibanaDatatable,
ExpressionFunctionDefinition,
KibanaDatatableColumn,
} from 'src/plugins/expressions/public';

import { KibanaDatatable, KibanaDatatableColumn } from 'src/plugins/expressions/public';
import { calculateObjectHash } from '../../../../../plugins/kibana_utils/public';
import { PersistedState } from '../../../../../plugins/visualizations/public';
import { Adapters } from '../../../../../plugins/inspector/public';
Expand All @@ -34,6 +30,7 @@ import { ISearchSource } from '../search_source';
import { tabifyAggResponse } from '../tabify';
import {
calculateBounds,
EsaggsExpressionFunctionDefinition,
Filter,
getTime,
IIndexPattern,
Expand Down Expand Up @@ -71,18 +68,6 @@ export interface RequestHandlerParams {

const name = 'esaggs';

type Input = KibanaContext | null;
type Output = Promise<KibanaDatatable>;

interface Arguments {
index: string;
metricsAtAllLevels: boolean;
partialRows: boolean;
includeFormatHints: boolean;
aggConfigs: string;
timeFields?: string[];
}

const handleCourierRequest = async ({
searchSource,
aggs,
Expand Down Expand Up @@ -244,7 +229,7 @@ const handleCourierRequest = async ({
return (searchSource as any).tabifiedResponse;
};

export const esaggs = (): ExpressionFunctionDefinition<typeof name, Input, Arguments, Output> => ({
export const esaggs = (): EsaggsExpressionFunctionDefinition => ({
name,
type: 'kibana_datatable',
inputTypes: ['kibana_context', 'null'],
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/data/server/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ import {
toAbsoluteDates,
} from '../common';

export { ParsedInterval } from '../common';
export { EsaggsExpressionFunctionDefinition, ParsedInterval } from '../common';

export {
ISearchStrategy,
Expand Down
11 changes: 11 additions & 0 deletions src/plugins/data/server/server.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ import { DeleteTemplateParams } from 'elasticsearch';
import { DetailedPeerCertificate } from 'tls';
import { Duration } from 'moment';
import { ErrorToastOptions } from 'src/core/public/notifications';
import { EventEmitter } from 'events';
import { ExistsParams } from 'elasticsearch';
import { ExplainParams } from 'elasticsearch';
import { FieldStatsParams } from 'elasticsearch';
Expand Down Expand Up @@ -146,6 +147,7 @@ import { ToastInputFields } from 'src/core/public/notifications';
import { Type } from '@kbn/config-schema';
import { TypeOf } from '@kbn/config-schema';
import { Unit } from '@elastic/datemath';
import { UnwrapPromiseOrReturn } from '@kbn/utility-types';
import { UpdateDocumentByQueryParams } from 'elasticsearch';
import { UpdateDocumentParams } from 'elasticsearch';
import { Url } from 'url';
Expand Down Expand Up @@ -220,6 +222,15 @@ export enum ES_FIELD_TYPES {
_TYPE = "_type"
}

// Warning: (ae-forgotten-export) The symbol "ExpressionFunctionDefinition" needs to be exported by the entry point index.d.ts
// Warning: (ae-forgotten-export) The symbol "Input" needs to be exported by the entry point index.d.ts
// Warning: (ae-forgotten-export) The symbol "Arguments" needs to be exported by the entry point index.d.ts
// Warning: (ae-forgotten-export) The symbol "Output" needs to be exported by the entry point index.d.ts
// Warning: (ae-missing-release-tag) "EsaggsExpressionFunctionDefinition" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
export type EsaggsExpressionFunctionDefinition = ExpressionFunctionDefinition<'esaggs', Input, Arguments, Output>;

// Warning: (ae-missing-release-tag) "esFilters" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
Expand Down
Loading

0 comments on commit 6aa5371

Please sign in to comment.