File tree Expand file tree Collapse file tree 8 files changed +37
-3
lines changed
x-pack/platform/plugins/shared/fleet Expand file tree Collapse file tree 8 files changed +37
-3
lines changed Original file line number Diff line number Diff line change 1571515715 ],
1571615716 "type": "object"
1571715717 },
15718+ "audit_unenrolled_reason": {
15719+ "type": "string"
15720+ },
1571815721 "components": {
1571915722 "items": {
1572015723 "additionalProperties": false,
1772517728 ],
1772617729 "type": "object"
1772717730 },
17731+ "audit_unenrolled_reason": {
17732+ "type": "string"
17733+ },
1772817734 "components": {
1772917735 "items": {
1773017736 "additionalProperties": false,
1820218208 ],
1820318209 "type": "object"
1820418210 },
18211+ "audit_unenrolled_reason": {
18212+ "type": "string"
18213+ },
1820518214 "components": {
1820618215 "items": {
1820718216 "additionalProperties": false,
Original file line number Diff line number Diff line change 1571515715 ],
1571615716 "type": "object"
1571715717 },
15718+ "audit_unenrolled_reason": {
15719+ "type": "string"
15720+ },
1571815721 "components": {
1571915722 "items": {
1572015723 "additionalProperties": false,
1772517728 ],
1772617729 "type": "object"
1772717730 },
17731+ "audit_unenrolled_reason": {
17732+ "type": "string"
17733+ },
1772817734 "components": {
1772917735 "items": {
1773017736 "additionalProperties": false,
1820218208 ],
1820318209 "type": "object"
1820418210 },
18211+ "audit_unenrolled_reason": {
18212+ "type": "string"
18213+ },
1820518214 "components": {
1820618215 "items": {
1820718216 "additionalProperties": false,
Original file line number Diff line number Diff line change @@ -16084,6 +16084,8 @@ paths:
1608416084 required:
1608516085 - id
1608616086 - version
16087+ audit_unenrolled_reason:
16088+ type: string
1608716089 components:
1608816090 items:
1608916091 additionalProperties: false
@@ -16529,6 +16531,8 @@ paths:
1652916531 required:
1653016532 - id
1653116533 - version
16534+ audit_unenrolled_reason:
16535+ type: string
1653216536 components:
1653316537 items:
1653416538 additionalProperties: false
@@ -16866,6 +16870,8 @@ paths:
1686616870 required:
1686716871 - id
1686816872 - version
16873+ audit_unenrolled_reason:
16874+ type: string
1686916875 components:
1687016876 items:
1687116877 additionalProperties: false
Original file line number Diff line number Diff line change @@ -18213,6 +18213,8 @@ paths:
1821318213 required:
1821418214 - id
1821518215 - version
18216+ audit_unenrolled_reason:
18217+ type: string
1821618218 components:
1821718219 items:
1821818220 additionalProperties: false
@@ -18655,6 +18657,8 @@ paths:
1865518657 required:
1865618658 - id
1865718659 - version
18660+ audit_unenrolled_reason:
18661+ type: string
1865818662 components:
1865918663 items:
1866018664 additionalProperties: false
@@ -18991,6 +18995,8 @@ paths:
1899118995 required:
1899218996 - id
1899318997 - version
18998+ audit_unenrolled_reason:
18999+ type: string
1899419000 components:
1899519001 items:
1899619002 additionalProperties: false
Original file line number Diff line number Diff line change @@ -92,6 +92,7 @@ interface AgentBase {
9292 enrolled_at : string ;
9393 unenrolled_at ?: string ;
9494 unenrollment_started_at ?: string ;
95+ audit_unenrolled_reason ?: string ;
9596 upgraded_at ?: string | null ;
9697 upgrade_started_at ?: string | null ;
9798 upgrade_details ?: AgentUpgradeDetails ;
@@ -255,6 +256,10 @@ export interface FleetServerAgent {
255256 /**
256257 * Date/time the Elastic Agent was last upgraded
257258 */
259+ audit_unenrolled_reason ?: string ;
260+ /**
261+ * Reason for agent unenrollment
262+ */
258263 upgraded_at ?: string | null ;
259264 /**
260265 * Date/time the Elastic Agent started the current upgrade
Original file line number Diff line number Diff line change @@ -112,7 +112,6 @@ export async function getAgents(
112112 } else {
113113 throw new FleetError ( 'Either options.agentIds or options.kuery are required to get agents' ) ;
114114 }
115-
116115 return agents ;
117116}
118117
@@ -490,7 +489,6 @@ async function _filterAgents(
490489 appContextService . getLogger ( ) . error ( `Error querying agents: ${ JSON . stringify ( err ) } ` ) ;
491490 throw err ;
492491 }
493-
494492 const agents = res . hits . hits . map ( searchHitToAgent ) ;
495493 const total = res . hits . total as number ;
496494
Original file line number Diff line number Diff line change @@ -65,6 +65,7 @@ export function searchHitToAgent(
6565 enrolled_at : hit . _source ?. enrolled_at ! ,
6666 unenrolled_at : hit . _source ?. unenrolled_at ! ,
6767 unenrollment_started_at : hit . _source ?. unenrollment_started_at ,
68+ audit_unenrolled_reason : hit . _source ?. audit_unenrolled_reason ! ,
6869 upgraded_at : hit . _source ?. upgraded_at ,
6970 upgrade_started_at : hit . _source ?. upgrade_started_at ,
7071 upgrade_details : hit . _source ?. upgrade_details ,
@@ -106,7 +107,6 @@ export function searchHitToAgent(
106107 } else {
107108 agent . status = hit . fields . status [ 0 ] ;
108109 }
109-
110110 return agent ;
111111}
112112
Original file line number Diff line number Diff line change @@ -135,6 +135,7 @@ export const AgentResponseSchema = schema.object({
135135 enrolled_at : schema . string ( ) ,
136136 unenrolled_at : schema . maybe ( schema . string ( ) ) ,
137137 unenrollment_started_at : schema . maybe ( schema . string ( ) ) ,
138+ audit_unenrolled_reason : schema . maybe ( schema . string ( ) ) ,
138139 upgraded_at : schema . maybe ( schema . oneOf ( [ schema . literal ( null ) , schema . string ( ) ] ) ) ,
139140 upgrade_started_at : schema . maybe ( schema . oneOf ( [ schema . literal ( null ) , schema . string ( ) ] ) ) ,
140141 upgrade_details : schema . maybe (
You can’t perform that action at this time.
0 commit comments