Skip to content

Commit

Permalink
Merge branch 'main' into issue_140241
Browse files Browse the repository at this point in the history
  • Loading branch information
kibanamachine authored Sep 21, 2022
2 parents 32e73ae + 4af903d commit 34be473
Show file tree
Hide file tree
Showing 9 changed files with 244 additions and 73 deletions.
92 changes: 91 additions & 1 deletion docs/api/actions-and-connectors/execute.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -437,6 +437,60 @@ the security incident. The IPs are added as observables to the security incident
`message`::
(Required, string) The message to log.
=====
.{swimlane} connectors
[%collapsible%open]
=====
`subAction`::
(Required, string) The action to test. It must be `pushToService`.

`subActionParams`::
(Required, object) The set of configuration properties.
+
.Properties of `subActionParams`
[%collapsible%open]
======
`comments`:::
(Optional, array of objects) Additional information that is sent to {swimlane}.
+
.Properties of `comments` objects
[%collapsible%open]
=======
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 {swimlane} incident.
+
.Properties of `incident`
[%collapsible%open]
=======
`alertId`::::
(Optional, string) The alert identifier.

`caseId`::::
(Optional, string) The case identifier for the incident.

`caseName`::::
(Optional, string) The case name for the incident.

`description`::::
(Optional, string) The description of the incident.

`ruleName`::::
(Optional, string) The rule name.

`severity`::::
(Optional, string) The severity of the incident.
=======
======
=====
====
--

Expand Down Expand Up @@ -549,6 +603,41 @@ The API returns the following:
}
--------------------------------------------------

Create then update a {swimlane} incident:
[source,sh]
--------------------------------------------------
POST api/actions/connector/a4746470-2f94-11ed-b0e0-87533c532698/_execute
{
"params":{
"subAction":"pushToService",
"subActionParams":{
"incident":{
"description":"Description of the incident",
"caseName":"Case name",
"caseId":"1000"
},
"comments":[
{"commentId":"1","comment":"A comment about the incident"}
]
}
}
}
POST api/actions/connector/a4746470-2f94-11ed-b0e0-87533c532698/_execute
{
"params":{
"subAction":"pushToService",
"subActionParams":{
"incident":{
"caseId":"1000",
"caseName":"A new case name"
}
}
}
}
--------------------------------------------------
// KIBANA

Retrieve the list of choices for a {sn-itom} connector:

[source,sh]
Expand Down Expand Up @@ -583,4 +672,5 @@ The API returns the severity and urgency choices, for example:
{"dependent_value":"","label":"3 - Low","value":"3","element":"urgency"}],
"connector_id":"9d9be270-2fd2-11ed-b0e0-87533c532698"
}
--------------------------------------------------
--------------------------------------------------

8 changes: 7 additions & 1 deletion versions.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,17 @@
"notice": "This file is not maintained outside of the main branch and should only be used for tooling.",
"versions": [
{
"version": "8.5.0",
"version": "8.6.0",
"branch": "main",
"currentMajor": true,
"currentMinor": true
},
{
"version": "8.5.0",
"branch": "8.5",
"currentMajor": true,
"previousMinor": true
},
{
"version": "8.4.3",
"branch": "8.4",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,14 @@ describe('Setup Indices', () => {
last_sync_status: { type: 'keyword' },
last_synced: { type: 'date' },
name: { type: 'keyword' },
pipeline: {
properties: {
extract_binary_content: { type: 'boolean' },
name: { type: 'keyword' },
reduce_whitespace: { type: 'boolean' },
run_ml_inference: { type: 'boolean' },
},
},
scheduling: {
properties: {
enabled: { type: 'boolean' },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,14 @@ const connectorMappingsProperties: Record<string, MappingProperty> = {
last_sync_status: { type: 'keyword' },
last_synced: { type: 'date' },
name: { type: 'keyword' },
pipeline: {
properties: {
extract_binary_content: { type: 'boolean' },
name: { type: 'keyword' },
reduce_whitespace: { type: 'boolean' },
run_ml_inference: { type: 'boolean' },
},
},
scheduling: {
properties: {
enabled: { type: 'boolean' },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export const setMonitor = async ({
id?: string;
}): Promise<{ attributes: { errors: ServiceLocationErrors } } | SyntheticsMonitor> => {
if (id) {
return await apiService.put(`${API_URLS.SYNTHETICS_MONITORS}/${id}`);
return await apiService.put(`${API_URLS.SYNTHETICS_MONITORS}/${id}`, monitor);
} else {
return await apiService.post(API_URLS.SYNTHETICS_MONITORS, monitor, undefined, {
preserve_namespace: true,
Expand Down
142 changes: 72 additions & 70 deletions x-pack/test/api_integration/apis/maps/maps_telemetry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,86 +27,88 @@ export default function ({ getService }: FtrProviderContext) {
const mapUsage = apiResponse.stack_stats.kibana.plugins.maps;
delete mapUsage.timeCaptured;

expect(mapUsage.geoShapeAggLayersCount).eql(1);
expect(mapUsage.indexPatternsWithGeoFieldCount).eql(6);
expect(mapUsage.indexPatternsWithGeoPointFieldCount).eql(4);
expect(mapUsage.indexPatternsWithGeoShapeFieldCount).eql(2);
expect(mapUsage.mapsTotalCount).eql(26);
expect(mapUsage.basemaps).eql({});
expect(mapUsage.joins).eql({ term: { min: 1, max: 1, total: 3, avg: 0.11538461538461539 } });
expect(mapUsage.layerTypes).eql({
es_docs: { min: 1, max: 2, total: 18, avg: 0.6923076923076923 },
es_agg_grids: { min: 1, max: 1, total: 6, avg: 0.23076923076923078 },
es_point_to_point: { min: 1, max: 1, total: 1, avg: 0.038461538461538464 },
es_top_hits: { min: 1, max: 1, total: 2, avg: 0.07692307692307693 },
es_agg_heatmap: { min: 1, max: 1, total: 1, avg: 0.038461538461538464 },
kbn_tms_raster: { min: 1, max: 1, total: 1, avg: 0.038461538461538464 },
ems_basemap: { min: 1, max: 1, total: 1, avg: 0.038461538461538464 },
ems_region: { min: 1, max: 1, total: 1, avg: 0.038461538461538464 },
});
expect(mapUsage.resolutions).eql({
coarse: { min: 1, max: 1, total: 4, avg: 0.15384615384615385 },
super_fine: { min: 1, max: 1, total: 3, avg: 0.11538461538461539 },
});
expect(mapUsage.scalingOptions).eql({
limit: { min: 1, max: 2, total: 14, avg: 0.5384615384615384 },
clusters: { min: 1, max: 1, total: 1, avg: 0.038461538461538464 },
mvt: { min: 1, max: 1, total: 3, avg: 0.11538461538461539 },
});
expect(mapUsage.attributesPerMap).eql({
customIconsCount: {
avg: 0,
max: 0,
min: 0,
expect(mapUsage).eql({
geoShapeAggLayersCount: 1,
indexPatternsWithGeoFieldCount: 6,
indexPatternsWithGeoPointFieldCount: 4,
indexPatternsWithGeoShapeFieldCount: 2,
mapsTotalCount: 27,
basemaps: {},
joins: { term: { min: 1, max: 1, total: 3, avg: 0.1111111111111111 } },
layerTypes: {
es_docs: { min: 1, max: 2, total: 19, avg: 0.7037037037037037 },
es_agg_grids: { min: 1, max: 1, total: 6, avg: 0.2222222222222222 },
es_point_to_point: { min: 1, max: 1, total: 1, avg: 0.037037037037037035 },
es_top_hits: { min: 1, max: 1, total: 2, avg: 0.07407407407407407 },
es_agg_heatmap: { min: 1, max: 1, total: 1, avg: 0.037037037037037035 },
kbn_tms_raster: { min: 1, max: 1, total: 1, avg: 0.037037037037037035 },
ems_basemap: { min: 1, max: 1, total: 1, avg: 0.037037037037037035 },
ems_region: { min: 1, max: 1, total: 1, avg: 0.037037037037037035 },
},
dataSourcesCount: {
avg: 1.1538461538461537,
max: 5,
min: 1,
resolutions: {
coarse: { min: 1, max: 1, total: 4, avg: 0.14814814814814814 },
super_fine: { min: 1, max: 1, total: 3, avg: 0.1111111111111111 },
},
emsVectorLayersCount: {
idThatDoesNotExitForEMSFileSource: {
avg: 0.038461538461538464,
max: 1,
min: 1,
},
scalingOptions: {
limit: { min: 1, max: 2, total: 14, avg: 0.5185185185185185 },
clusters: { min: 1, max: 1, total: 1, avg: 0.037037037037037035 },
mvt: { min: 1, max: 1, total: 4, avg: 0.14814814814814814 },
},
layerTypesCount: {
BLENDED_VECTOR: {
avg: 0.038461538461538464,
max: 1,
min: 1,
attributesPerMap: {
customIconsCount: {
avg: 0,
max: 0,
min: 0,
},
EMS_VECTOR_TILE: {
avg: 0.038461538461538464,
max: 1,
dataSourcesCount: {
avg: 1.1481481481481481,
max: 5,
min: 1,
},
GEOJSON_VECTOR: {
avg: 0.8076923076923077,
max: 4,
min: 1,
emsVectorLayersCount: {
idThatDoesNotExitForEMSFileSource: {
avg: 0.037037037037037035,
max: 1,
min: 1,
},
},
HEATMAP: {
avg: 0.038461538461538464,
max: 1,
min: 1,
layerTypesCount: {
BLENDED_VECTOR: {
avg: 0.037037037037037035,
max: 1,
min: 1,
},
EMS_VECTOR_TILE: {
avg: 0.037037037037037035,
max: 1,
min: 1,
},
GEOJSON_VECTOR: {
avg: 0.7777777777777778,
max: 4,
min: 1,
},
HEATMAP: {
avg: 0.037037037037037035,
max: 1,
min: 1,
},
MVT_VECTOR: {
avg: 0.25925925925925924,
max: 1,
min: 1,
},
RASTER_TILE: {
avg: 0.037037037037037035,
max: 1,
min: 1,
},
},
MVT_VECTOR: {
avg: 0.23076923076923078,
max: 1,
layersCount: {
avg: 1.1851851851851851,
max: 6,
min: 1,
},
RASTER_TILE: {
avg: 0.038461538461538464,
max: 1,
min: 1,
},
},
layersCount: {
avg: 1.1923076923076923,
max: 6,
min: 1,
},
});
});
Expand Down
34 changes: 34 additions & 0 deletions x-pack/test/functional/apps/maps/group2/adhoc_data_view.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/

import expect from '@kbn/expect';
import { FtrProviderContext } from '../../../ftr_provider_context';

export default function ({ getPageObjects, getService }: FtrProviderContext) {
const security = getService('security');
const PageObjects = getPageObjects(['maps']);

describe('maps adhoc data view', () => {
before(async () => {
await security.testUser.setRoles(['global_maps_all', 'test_logstash_reader'], {
skipBrowserRefresh: true,
});
await PageObjects.maps.loadSavedMap('adhoc data view');
});

it('should render saved map with adhoc data view', async () => {
const tooltipText = await PageObjects.maps.getLayerTocTooltipMsg('adhocDataView');
expect(tooltipText).to.equal(
'adhocDataView\nFound 908 documents.\nResults narrowed by global search\nResults narrowed by global time'
);
});

after(async () => {
await security.testUser.restoreDefaults();
});
});
}
1 change: 1 addition & 0 deletions x-pack/test/functional/apps/maps/group2/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ export default function ({ loadTestFile, getService }) {
});

loadTestFile(require.resolve('./es_geo_grid_source'));
loadTestFile(require.resolve('./adhoc_data_view'));
loadTestFile(require.resolve('./embeddable'));
});
}
22 changes: 22 additions & 0 deletions x-pack/test/functional/fixtures/kbn_archiver/maps.json
Original file line number Diff line number Diff line change
Expand Up @@ -990,6 +990,28 @@
"version": "WzQ5LDJd"
}

{
"id": "68f85360-3913-11ed-aa60-654006132508",
"type": "map",
"namespaces": [
"default"
],
"updated_at": "2022-09-20T18:39:40.421Z",
"version": "WzM0OSwxXQ==",
"attributes": {
"title": "adhoc data view",
"description": "",
"layerListJSON": "[{\"id\":\"e5b830e4-d939-4b82-b3df-ccb4c3fce478\",\"sourceDescriptor\":{\"geoField\":\"geo.coordinates\",\"id\":\"5883a356-bef3-4e87-89f4-6dfd95a5794d\",\"indexPatternId\":\"1a9589c7-c919-4d35-bd4c-fbe1bcf8dfe4\",\"label\":\"logstash-*\",\"scalingType\":\"MVT\",\"tooltipProperties\":[],\"type\":\"ES_SEARCH\"},\"type\":\"MVT_VECTOR\",\"visible\":true,\"style\":{},\"label\":\"adhocDataView\"}]",
"mapStateJSON": "{\"adHocDataViews\":[{\"id\":\"1a9589c7-c919-4d35-bd4c-fbe1bcf8dfe4\",\"title\":\"logstash-*\",\"timeFieldName\":\"@timestamp\",\"sourceFilters\":[],\"fieldFormats\":{},\"runtimeFieldMap\":{},\"fieldAttrs\":{},\"allowNoIndex\":false,\"name\":\"logstash adhoc data view\"}],\"zoom\":2.36,\"center\":{\"lon\":-116.75537,\"lat\":55.05932},\"timeFilters\":{\"from\":\"2015-09-20T00:00:00.000Z\",\"to\":\"2015-09-22T00:00:00.000Z\"},\"refreshConfig\":{\"isPaused\":false,\"interval\":0},\"query\":{\"language\":\"kuery\",\"query\":\"\"},\"filters\":[{\"meta\":{\"index\":\"1a9589c7-c919-4d35-bd4c-fbe1bcf8dfe4\",\"params\":{\"lt\":1000,\"gte\":0},\"field\":\"bytes\",\"alias\":null,\"negate\":false,\"disabled\":false,\"type\":\"range\",\"key\":\"bytes\",\"value\":{\"lt\":1000,\"gte\":0}},\"query\":{\"range\":{\"bytes\":{\"lt\":1000,\"gte\":0}}},\"$state\":{\"store\":\"appState\"}}],\"settings\":{\"autoFitToDataBounds\":false,\"backgroundColor\":\"#ffffff\",\"customIcons\":[],\"disableInteractive\":false,\"disableTooltipControl\":false,\"hideToolbarOverlay\":false,\"hideLayerControl\":false,\"hideViewControl\":false,\"initialLocation\":\"LAST_SAVED_LOCATION\",\"fixedLocation\":{\"lat\":0,\"lon\":0,\"zoom\":2},\"browserLocation\":{\"zoom\":2},\"keydownScrollZoom\":false,\"maxZoom\":24,\"minZoom\":0,\"showScaleControl\":false,\"showSpatialFilters\":true,\"showTimesliderToggleButton\":true,\"spatialFiltersAlpa\":0.3,\"spatialFiltersFillColor\":\"#DA8B45\",\"spatialFiltersLineColor\":\"#DA8B45\"}}",
"uiStateJSON": "{\"isLayerTOCOpen\":true,\"openTOCDetails\":[]}"
},
"references": [],
"migrationVersion": {
"map": "8.4.0"
},
"coreMigrationVersion": "8.5.0"
}

{
"attributes": {
"description": "",
Expand Down

0 comments on commit 34be473

Please sign in to comment.