Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Fleet] Request diagnostics #142369

Merged
merged 41 commits into from
Nov 10, 2022
Merged
Changes from 1 commit
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
0ec98c2
request diagnostics action API
juliaElastic Sep 30, 2022
af2e1d6
agent diagnostics action UI
juliaElastic Sep 30, 2022
7a47627
call diagnostics api when clicking button, added modal
juliaElastic Oct 3, 2022
03e6ab6
showing diagnostics uploads list with mock data
juliaElastic Oct 4, 2022
6cc9d88
Merge branch 'main' into feat/request-diagnostics
juliaElastic Oct 5, 2022
478c3d5
bulk request diagnostics
juliaElastic Oct 5, 2022
c559655
query action status to show diagnostics status
juliaElastic Oct 5, 2022
f36b539
fix for failed status display
juliaElastic Oct 5, 2022
c0dcc51
changed implementation to query files index in /uploads API
juliaElastic Oct 5, 2022
46b9000
Merge branch 'main' into feat/request-diagnostics
juliaElastic Oct 5, 2022
383c4bf
Merge branch 'main' into feat/request-diagnostics
kibanamachine Oct 5, 2022
e795a39
implemented file download
juliaElastic Oct 6, 2022
ed1a5d1
changed implementation to add downlaod headers for file
juliaElastic Oct 6, 2022
d537961
added toast when a diagnostics became ready
juliaElastic Oct 6, 2022
f165ee7
added tests on request diagnostics and uploads
juliaElastic Oct 7, 2022
a15ba47
fixed checks
juliaElastic Oct 7, 2022
4b7c5c5
fix checks
juliaElastic Oct 7, 2022
30e16aa
Merge branch 'main' into feat/request-diagnostics
kibanamachine Oct 10, 2022
6684a78
returning always octet stream when downloading file
juliaElastic Oct 10, 2022
63202fc
Merge branch 'main' into feat/request-diagnostics
kibanamachine Oct 12, 2022
6944bc2
Merge branch 'main' into feat/request-diagnostics
kibanamachine Oct 17, 2022
099b1d2
Merge branch 'main' into feat/request-diagnostics
kibanamachine Oct 19, 2022
fc1192b
Merge branch 'main' into feat/request-diagnostics
kibanamachine Oct 24, 2022
8c3d5d6
Merge branch 'main' into feat/request-diagnostics
juliaElastic Oct 31, 2022
e19e68c
Merge branch 'main' into feat/request-diagnostics
kibanamachine Oct 31, 2022
ccdca4a
Merge branch 'main' into feat/request-diagnostics
kibanamachine Nov 2, 2022
26ad93c
Merge branch 'main' into feat/request-diagnostics
kibanamachine Nov 2, 2022
02c6b5a
Merge branch 'main' into feat/request-diagnostics
juliaElastic Nov 2, 2022
f758d96
Update tsconfig.json
juliaElastic Nov 2, 2022
e61a15d
Merge branch 'main' into feat/request-diagnostics
kibanamachine Nov 7, 2022
22ad451
fixed test
juliaElastic Nov 7, 2022
0b56f04
Merge branch 'main' into feat/request-diagnostics
juliaElastic Nov 7, 2022
b164e02
[CI] Auto-commit changed files from 'node scripts/generate codeowners'
kibanamachine Nov 7, 2022
448f0fa
Merge branch 'main' into feat/request-diagnostics
juliaElastic Nov 8, 2022
a486196
added feature flag to hide request diagnostics action
juliaElastic Nov 8, 2022
c0755cf
fixed checks
juliaElastic Nov 8, 2022
b3123fa
fixed test
juliaElastic Nov 8, 2022
820edee
removed mock data and changed the query to return diagnostic files
juliaElastic Nov 8, 2022
3cfaf2e
Merge branch 'main' into feat/request-diagnostics
juliaElastic Nov 8, 2022
d622ed3
fixed integration test
juliaElastic Nov 9, 2022
89888ae
added error handling, extracted index names as constants
juliaElastic Nov 9, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fixed integration test
  • Loading branch information
juliaElastic committed Nov 9, 2022

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit d622ed3dfff41ff7f0ccff6b1c59826a32471555
32 changes: 26 additions & 6 deletions x-pack/test/fleet_api_integration/apis/agents/uploads.ts
Original file line number Diff line number Diff line change
@@ -6,7 +6,7 @@
*/

import expect from '@kbn/expect';

import { AGENT_ACTIONS_INDEX, AGENT_ACTIONS_RESULTS_INDEX } from '@kbn/fleet-plugin/common';
import { FtrProviderContext } from '../../../api_integration/ftr_provider_context';
import { setupFleetAndAgents } from './services';
import { skipIfNoDockerRegistry } from '../../helpers';
@@ -17,25 +17,45 @@ export default function (providerContext: FtrProviderContext) {
const supertest = getService('supertest');
const esClient = getService('es');

const ES_INDEX_OPTIONS = { headers: { 'X-elastic-product-origin': 'fleet' } };

describe('fleet_uploads', () => {
skipIfNoDockerRegistry(providerContext);
setupFleetAndAgents(providerContext);
beforeEach(async () => {

before(async () => {
await esArchiver.unload('x-pack/test/functional/es_archives/fleet/empty_fleet_server');
await getService('supertest').post(`/api/fleet/setup`).set('kbn-xsrf', 'xxx').send();

await esClient.create({
index: '.fleet-actions',
id: 'action1',
index: AGENT_ACTIONS_INDEX,
id: new Date().toISOString(),
refresh: true,
body: {
type: 'REQUEST_DIAGNOSTICS',
action_id: 'action1',
agents: ['agent1'],
'@timestamp': '2022-10-07T12:00:00.000Z',
'@timestamp': '2022-10-07T11:00:00.000Z',
},
});

await esClient.create(
{
index: AGENT_ACTIONS_RESULTS_INDEX,
id: new Date().toISOString(),
refresh: true,
body: {
action_id: 'action1',
agent_id: 'agent1',
'@timestamp': '2022-10-07T12:00:00.000Z',
data: {
file_id: 'file1',
},
},
},
ES_INDEX_OPTIONS
);

await esClient.update({
index: '.fleet-agent-files',
id: 'file1',
@@ -59,7 +79,7 @@ export default function (providerContext: FtrProviderContext) {
},
});
});
afterEach(async () => {
after(async () => {
await esArchiver.load('x-pack/test/functional/es_archives/fleet/empty_fleet_server');
});