Skip to content

Commit

Permalink
Merge commit '6c52cce0b854b144794d3278b23358d77c1e0592' into lens/vis…
Browse files Browse the repository at this point in the history
…ualization_updater_removed
  • Loading branch information
mbondyra committed Oct 21, 2021
2 parents 7839af7 + 6c52cce commit dfe4263
Show file tree
Hide file tree
Showing 115 changed files with 1,648 additions and 779 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ Use the <<action-settings, Action configuration settings>> to customize connecto
actionTypeId: .servicenow-sir
config:
apiUrl: https://example.service-now.com/
isLegacy: false
secrets:
username: testuser
password: passwordkeystorevalue
Expand All @@ -45,6 +46,9 @@ Use the <<action-settings, Action configuration settings>> to customize connecto
Config defines information for the connector type.

`apiUrl`:: An address that corresponds to *URL*.
`isLegacy`:: A boolean that indicates if the connector should use the Table API (legacy) or the Import Set API.

Note: If `isLegacy` is set to false the Elastic application should be installed in ServiceNow.

Secrets defines sensitive information for the connector type.

Expand Down
4 changes: 4 additions & 0 deletions docs/management/connectors/action-types/servicenow.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ Use the <<action-settings, Action configuration settings>> to customize connecto
actionTypeId: .servicenow
config:
apiUrl: https://example.service-now.com/
isLegacy: false
secrets:
username: testuser
password: passwordkeystorevalue
Expand All @@ -45,6 +46,9 @@ Use the <<action-settings, Action configuration settings>> to customize connecto
Config defines information for the connector type.

`apiUrl`:: An address that corresponds to *URL*.
`isLegacy`:: A boolean that indicates if the connector should use the Table API (legacy) or the Import Set API.

Note: If `isLegacy` is set to false the Elastic application should be installed in ServiceNow.

Secrets defines sensitive information for the connector type.

Expand Down
2 changes: 2 additions & 0 deletions packages/kbn-es-query/src/filters/build_filters/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ export type FilterMeta = {
negate?: boolean;
// controlledBy is there to identify who owns the filter
controlledBy?: string;
// allows grouping of filters
group?: string;
// index and type are optional only because when you create a new filter, there are no defaults
index?: string;
isMultiIndex?: boolean;
Expand Down
154 changes: 3 additions & 151 deletions src/core/server/saved_objects/migrations/core/call_cluster.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,164 +13,16 @@
*/

import type { estypes } from '@elastic/elasticsearch';
import { IndexMapping } from '../../mappings';

export interface CallCluster {
(path: 'bulk', opts: { body: object[] }): Promise<BulkResult>;
(path: 'count', opts: CountOpts): Promise<{ count: number; _shards: estypes.ShardStatistics }>;
(path: 'clearScroll', opts: { scrollId: string }): Promise<any>;
(path: 'indices.create', opts: IndexCreationOpts): Promise<any>;
(path: 'indices.exists', opts: IndexOpts): Promise<boolean>;
(path: 'indices.existsAlias', opts: { name: string }): Promise<boolean>;
(path: 'indices.get', opts: IndexOpts & Ignorable): Promise<IndicesInfo | NotFound>;
(path: 'indices.getAlias', opts: { name: string } & Ignorable): Promise<AliasResult | NotFound>;
(path: 'indices.getMapping', opts: IndexOpts): Promise<MappingResult>;
(path: 'indices.getSettings', opts: IndexOpts): Promise<IndexSettingsResult>;
(path: 'indices.refresh', opts: IndexOpts): Promise<any>;
(path: 'indices.updateAliases', opts: UpdateAliasesOpts): Promise<any>;
(path: 'indices.deleteTemplate', opts: { name: string }): Promise<any>;
(path: 'cat.templates', opts: { format: 'json'; name: string }): Promise<Array<{ name: string }>>;
(path: 'reindex', opts: ReindexOpts): Promise<any>;
(path: 'scroll', opts: ScrollOpts): Promise<SearchResults>;
(path: 'search', opts: SearchOpts): Promise<SearchResults>;
(path: 'tasks.get', opts: { taskId: string }): Promise<{
completed: boolean;
error?: ErrorResponse;
}>;
}

///////////////////////////////////////////////////////////////////
// callCluster argument type definitions
///////////////////////////////////////////////////////////////////

export interface Ignorable {
ignore: number[];
}

export interface CountOpts {
body: {
query: object;
};
index: string;
}

export interface PutMappingOpts {
body: IndexMapping;
index: string;
}

export interface IndexOpts {
index: string;
}

export interface IndexCreationOpts {
index: string;
body?: {
mappings?: IndexMapping;
settings?: {
number_of_shards: number;
auto_expand_replicas: string;
};
};
}

export interface ReindexOpts {
body: {
dest: IndexOpts;
source: IndexOpts & { size: number };
script?: {
source: string;
lang: 'painless';
};
};
refresh: boolean;
waitForCompletion: boolean;
}

export type AliasAction =
| { remove_index: IndexOpts }
| {
remove_index: { index: string };
}
| { remove: { index: string; alias: string } }
| { add: { index: string; alias: string } };

export interface UpdateAliasesOpts {
body: {
actions: AliasAction[];
};
}

export interface SearchOpts {
body: object;
index: string;
scroll?: string;
}

export interface ScrollOpts {
scroll: string;
scrollId: string;
}

///////////////////////////////////////////////////////////////////
// callCluster result type definitions
///////////////////////////////////////////////////////////////////

export interface NotFound {
status: 404;
}

export interface MappingResult {
[index: string]: {
mappings: IndexMapping;
};
}

export interface AliasResult {
[alias: string]: object;
}

export interface IndexSettingsResult {
[indexName: string]: {
settings: {
index: {
number_of_shards: string;
auto_expand_replicas: string;
provided_name: string;
creation_date: string;
number_of_replicas: string;
uuid: string;
version: { created: '7000001' };
};
};
};
}

export interface RawDoc {
_id: estypes.Id;
_source: any;
_type?: string;
}

export interface SearchResults {
hits: {
hits: RawDoc[];
};
_scroll_id?: string;
_shards: estypes.ShardStatistics;
}

export interface ErrorResponse {
type: string;
reason: string;
}

export interface BulkResult {
items: Array<{ index: { error?: ErrorResponse } }>;
}

export interface IndexInfo {
aliases: AliasResult;
mappings: IndexMapping;
}

export interface IndicesInfo {
[index: string]: IndexInfo;
}
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ export async function convertToAlias(
* alias, meaning that it will only point to one index at a time, so we
* remove any other indices from the alias.
*
* @param {CallCluster} client
* @param {MigrationEsClient} client
* @param {string} index
* @param {string} alias
* @param {AliasAction[]} aliasActions - Optional actions to be added to the updateAliases call
Expand Down
1 change: 0 additions & 1 deletion src/core/server/saved_objects/migrations/core/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
export { DocumentMigrator } from './document_migrator';
export { IndexMigrator } from './index_migrator';
export { buildActiveMappings } from './build_active_mappings';
export type { CallCluster } from './call_cluster';
export type { LogFn, SavedObjectsMigrationLogger } from './migration_logger';
export type { MigrationResult, MigrationStatus } from './migration_coordinator';
export { createMigrationEsClient } from './migration_es_client';
Expand Down
2 changes: 2 additions & 0 deletions src/plugins/data/common/search/expressions/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ export * from './field';
export * from './phrase_filter';
export * from './exists_filter';
export * from './range_filter';
export * from './remove_filter';
export * from './select_filter';
export * from './kibana_filter';
export * from './filters_to_ast';
export * from './timerange';
Expand Down
Loading

0 comments on commit dfe4263

Please sign in to comment.