-
Notifications
You must be signed in to change notification settings - Fork 186
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add upgrade agents global action (#6501)
* Add upgrade agents global action * Add Upgrade result modal * Update CHANGELOG * Minor fixes * Add unit tests * Improve upgrade progress message * Remove wazuh-endpoints plugin * Fix file name * Fix import * Fix get tasks status for readonly user * Improve return condition * Improve error message for Timeout status * Add tooltipo to timeout status * Modularize get status functions * Fix status name and key values * Separate upgrade service in two services
- Loading branch information
1 parent
be39ae4
commit 0760cdd
Showing
53 changed files
with
1,436 additions
and
1,068 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 6 additions & 2 deletions
8
plugins/main/public/components/endpoints-summary/services/add-agents-to-group.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,13 @@ | ||
import IApiResponse from '../../../react-services/interfaces/api-response.interface'; | ||
import { paginatedAgentsGroupService } from './paginated-agents-group'; | ||
import { paginatedAgentsRequestService } from './paginated-agents-request'; | ||
|
||
export const addAgentsToGroupService = async (parameters: { | ||
agentIds: string[]; | ||
groupId: string; | ||
pageSize?: number; | ||
}): Promise<IApiResponse<string>> => | ||
await paginatedAgentsGroupService({ addOrRemove: 'add', ...parameters }); | ||
await paginatedAgentsRequestService({ | ||
method: 'PUT', | ||
url: '/agents/group', | ||
...parameters, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 6 additions & 2 deletions
8
plugins/main/public/components/endpoints-summary/services/remove-agents-from-group.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,13 @@ | ||
import IApiResponse from '../../../react-services/interfaces/api-response.interface'; | ||
import { paginatedAgentsGroupService } from './paginated-agents-group'; | ||
import { paginatedAgentsRequestService } from './paginated-agents-request'; | ||
|
||
export const removeAgentsFromGroupService = async (parameters: { | ||
agentIds: string[]; | ||
groupId: string; | ||
pageSize?: number; | ||
}): Promise<IApiResponse<string>> => | ||
await paginatedAgentsGroupService({ addOrRemove: 'remove', ...parameters }); | ||
await paginatedAgentsRequestService({ | ||
method: 'DELETE', | ||
url: '/agents/group', | ||
...parameters, | ||
}); |
11 changes: 11 additions & 0 deletions
11
plugins/main/public/components/endpoints-summary/services/upgrade-agent.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import IApiResponse from '../../../react-services/interfaces/api-response.interface'; | ||
import { WzRequest } from '../../../react-services/wz-request'; | ||
import { ResponseUpgradeAgents } from '../types'; | ||
|
||
export const upgradeAgentService = async (agentId: string) => | ||
(await WzRequest.apiReq('PUT', '/agents/upgrade', { | ||
params: { | ||
agents_list: agentId, | ||
wait_for_complete: true, | ||
}, | ||
})) as IApiResponse<ResponseUpgradeAgents>; |
Oops, something went wrong.