Skip to content

Commit

Permalink
[Ingest Manager] Rename settings.monitoring to agent.monitoring (#…
Browse files Browse the repository at this point in the history
…71467)

* Rename settings.monitoring to agent.monitoring; simplify default file name for downloaded agent yaml

* Fix test
  • Loading branch information
jen-huang authored Jul 13, 2020
1 parent ec43d45 commit 7282597
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const CONFIG_KEYS_ORDER = [
'revision',
'type',
'outputs',
'settings',
'agent',
'inputs',
'enabled',
'use_output',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export interface FullAgentConfig {
};
inputs: FullAgentConfigInput[];
revision?: number;
settings?: {
agent?: {
monitoring: {
use_output?: string;
enabled: boolean;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ export const downloadFullAgentConfig: RequestHandler<
const body = configToYaml(fullAgentConfig);
const headers: ResponseHeaders = {
'content-type': 'text/x-yaml',
'content-disposition': `attachment; filename="elastic-agent-config-${fullAgentConfig.id}.yml"`,
'content-disposition': `attachment; filename="elastic-agent.yml"`,
};
return response.ok({
body,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ describe('agent config', () => {
},
inputs: [],
revision: 1,
settings: {
agent: {
monitoring: {
enabled: false,
logs: false,
Expand Down Expand Up @@ -90,7 +90,7 @@ describe('agent config', () => {
},
inputs: [],
revision: 1,
settings: {
agent: {
monitoring: {
use_output: 'default',
enabled: true,
Expand Down Expand Up @@ -120,7 +120,7 @@ describe('agent config', () => {
},
inputs: [],
revision: 1,
settings: {
agent: {
monitoring: {
use_output: 'default',
enabled: true,
Expand Down
4 changes: 2 additions & 2 deletions x-pack/plugins/ingest_manager/server/services/agent_config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ class AgentConfigService {
revision: config.revision,
...(config.monitoring_enabled && config.monitoring_enabled.length > 0
? {
settings: {
agent: {
monitoring: {
use_output: defaultOutput.name,
enabled: true,
Expand All @@ -427,7 +427,7 @@ class AgentConfigService {
},
}
: {
settings: {
agent: {
monitoring: { enabled: false, logs: false, metrics: false },
},
}),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
},
},
revision: 3,
settings: {
agent: {
monitoring: {
enabled: false,
logs: false,
Expand Down

0 comments on commit 7282597

Please sign in to comment.