Skip to content

Commit

Permalink
[Fleet] Add UI controls to setting/outputs to configure new shipper (e…
Browse files Browse the repository at this point in the history
…lastic#145755)

## Summary
Closes elastic#141508

### Description
Implements a form for the new Elastic Agent Shipper. **It only gets
enabled only when the user explicitly enables it from the yaml editor.**
- To enable the form, add to the yaml editor under outputs one of the
following, save and then the new section should appear under "advanced
options"
```
# Enables the shipper with default settings
shipper: {}

# Also enables the shipper
shipper:
  enabled: true
```

I added the following new parameters to `Output` and to `ingest-outputs`
SO as well:
```
shipper?: {
    disk_queue_enabled?: boolean;
    disk_queue_path?: string;
    disk_queue_max_size?: number;
    disk_queue_encryption_enabled?: boolean;
    disk_queue_compression_enabled?: boolean;
    compression_level?: number;
    loadbalance?: boolean;
    mem_queue_events?: number;
    queue_flush_timeout?: number;
    max_batch_bytes?: number;
}
```

Note that another PR will likely follow to align with the structure
defined in the new shipper (see [this
comment](elastic#141508 (comment))
for further explanation)

<details><summary>Screenshots</summary>
<img width="745" alt="Screenshot 2022-11-23 at 12 35 38"
src="https://user-images.githubusercontent.com/16084106/203537091-47ed64f8-bb13-4960-b1aa-5bc73fd2e37b.png">

<img width="720" alt="Screenshot 2022-11-23 at 12 35 06"
src="https://user-images.githubusercontent.com/16084106/203537130-e5cfcf89-a88d-43a2-8348-2f79c324ff80.png">

Generated policy under "view policy":
<img width="737" alt="Screenshot 2022-11-23 at 12 34 09"
src="https://user-images.githubusercontent.com/16084106/203536868-2d11d236-5056-473d-97a0-edae327665fc.png">



</details>

### Checklist

- [ ] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [ ] Any UI touched in this PR is usable by keyboard only (learn more
about [keyboard accessibility](https://webaim.org/techniques/keyboard/))
- [ ] Any UI touched in this PR does not create any new axe failures
(run axe in browser:
[FF](https://addons.mozilla.org/en-US/firefox/addon/axe-devtools/),
[Chrome](https://chrome.google.com/webstore/detail/axe-web-accessibility-tes/lhdoppojpmngadmnindnejefpokejbdd?hl=en-US))

Co-authored-by: Kibana Machine <[email protected]>
Co-authored-by: Christiane (Tina) Heiligers <[email protected]>
Co-authored-by: Alejandro Fernández Haro <[email protected]>
Co-authored-by: Nicolas Chaulet <[email protected]>
Co-authored-by: nima <[email protected]>
Co-authored-by: Josh Dover <[email protected]>
  • Loading branch information
7 people authored and jennypavlova committed Jan 13, 2023
1 parent 5844ae8 commit 4190f1f
Show file tree
Hide file tree
Showing 16 changed files with 962 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ describe('checking migration metadata changes on all registered SO types', () =>
"infrastructure-ui-source": "7c8dbbc0a608911f1b683a944f4a65383f6153ed",
"ingest-agent-policies": "54d586fdafae83ba326e47d1a3727b0d9c910a12",
"ingest-download-sources": "1e69dabd6db5e320fe08c5bda8f35f29bafc6b54",
"ingest-outputs": "4888b16d55a452bf5fff2bb407e0361567eae63a",
"ingest-outputs": "29181ecfdc7723f544325ecef7266bccbc691a54",
"ingest-package-policies": "d93048bf153f9043946e8965065a88014f7ccb41",
"ingest_manager_settings": "6f36714825cc15ea8d7cda06fde7851611a532b4",
"inventory-view": "bc2bd1e7ec7c186159447ab228d269f22bd39056",
Expand Down
29 changes: 29 additions & 0 deletions x-pack/plugins/fleet/common/openapi/bundled.json
Original file line number Diff line number Diff line change
Expand Up @@ -6363,6 +6363,35 @@
"type": "string"
}
}
},
"proxy_id": {
"type": "string"
},
"shipper": {
"type": "object",
"properties": {
"disk_queue_enabled": {
"type": "boolean"
},
"disk_queue_path": {
"type": "string"
},
"disk_queue_max_size": {
"type": "number"
},
"disk_queue_encryption_enabled": {
"type": "boolean"
},
"disk_queue_compression_enabled": {
"type": "boolean"
},
"compression_level": {
"type": "number"
},
"loadbalance": {
"type": "boolean"
}
}
}
},
"required": [
Expand Down
19 changes: 19 additions & 0 deletions x-pack/plugins/fleet/common/openapi/bundled.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4075,6 +4075,25 @@ components:
type: string
key:
type: string
proxy_id:
type: string
shipper:
type: object
properties:
disk_queue_enabled:
type: boolean
disk_queue_path:
type: string
disk_queue_max_size:
type: number
disk_queue_encryption_enabled:
type: boolean
disk_queue_compression_enabled:
type: boolean
compression_level:
type: number
loadbalance:
type: boolean
required:
- id
- is_default
Expand Down
19 changes: 19 additions & 0 deletions x-pack/plugins/fleet/common/openapi/components/schemas/output.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,25 @@ properties:
type: string
key:
type: string
proxy_id:
type: string
shipper:
type: object
properties:
disk_queue_enabled:
type: boolean
disk_queue_path:
type: string
disk_queue_max_size:
type: number
disk_queue_encryption_enabled:
type: boolean
disk_queue_compression_enabled:
type: boolean
compression_level:
type: number
loadbalance:
type: boolean
required:
- id
- is_default
Expand Down
14 changes: 14 additions & 0 deletions x-pack/plugins/fleet/common/types/models/output.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ export interface NewOutput {
key?: string;
} | null;
proxy_id?: string | null;
shipper?: ShipperOutput | null;
}

export type OutputSOAttributes = NewOutput & {
Expand All @@ -36,3 +37,16 @@ export type OutputSOAttributes = NewOutput & {
export type Output = NewOutput & {
id: string;
};

export interface ShipperOutput {
disk_queue_enabled?: boolean | null;
disk_queue_path?: string | null;
disk_queue_max_size?: number | null;
disk_queue_encryption_enabled?: boolean | null;
disk_queue_compression_enabled?: boolean | null;
compression_level?: number | null;
loadbalance?: boolean | null;
mem_queue_events?: number | null;
queue_flush_timeout?: number | null;
max_batch_bytes?: number | null;
}
24 changes: 24 additions & 0 deletions x-pack/plugins/fleet/common/types/rest_spec/output.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,18 @@ export interface PutOutputRequest {
certificate?: string;
key?: string;
};
shipper?: {
disk_queue_enabled?: boolean;
disk_queue_path?: string;
disk_queue_max_size?: number;
disk_queue_encryption_enabled?: boolean;
disk_queue_compression_enabled?: boolean;
compression_level?: number;
loadbalance?: boolean;
mem_queue_events?: number;
queue_flush_timeout?: number;
max_batch_bytes?: number;
};
};
}

Expand All @@ -61,6 +73,18 @@ export interface PostOutputRequest {
key?: string;
};
proxy_id?: string | null;
shipper?: {
disk_queue_enabled?: boolean;
disk_queue_path?: string;
disk_queue_max_size?: number;
disk_queue_encryption_enabled?: boolean;
disk_queue_compression_enabled?: boolean;
compression_level?: number;
loadbalance?: boolean;
mem_queue_events?: number;
queue_flush_timeout?: number;
max_batch_bytes?: number;
};
};
}

Expand Down
Loading

0 comments on commit 4190f1f

Please sign in to comment.