Skip to content

Commit

Permalink
updated openapi for bulk action responses
Browse files Browse the repository at this point in the history
  • Loading branch information
juliaElastic committed Sep 23, 2022
1 parent 30d5ed5 commit b4d17f1
Show file tree
Hide file tree
Showing 7 changed files with 64 additions and 26 deletions.
25 changes: 24 additions & 1 deletion x-pack/plugins/fleet/common/openapi/bundled.json
Original file line number Diff line number Diff line change
Expand Up @@ -616,7 +616,6 @@
"in": "query"
}
],
"required": true,
"post": {
"summary": "Packages - Install",
"tags": [],
Expand Down Expand Up @@ -1253,6 +1252,12 @@
"application/json": {
"schema": {
"type": "object",
"properties": {
"actionId": {
"type": "string",
"description": "action id when running in async mode (>10k agents)"
}
},
"additionalProperties": {
"type": "object",
"properties": {
Expand Down Expand Up @@ -1842,6 +1847,12 @@
"application/json": {
"schema": {
"type": "object",
"properties": {
"actionId": {
"type": "string",
"description": "action id when running in async mode (>10k agents)"
}
},
"additionalProperties": {
"type": "object",
"properties": {
Expand Down Expand Up @@ -1918,6 +1929,12 @@
"application/json": {
"schema": {
"type": "object",
"properties": {
"actionId": {
"type": "string",
"description": "action id when running in async mode (>10k agents)"
}
},
"additionalProperties": {
"type": "object",
"properties": {
Expand Down Expand Up @@ -2001,6 +2018,12 @@
"application/json": {
"schema": {
"type": "object",
"properties": {
"actionId": {
"type": "string",
"description": "action id when running in async mode (>10k agents)"
}
},
"additionalProperties": {
"type": "object",
"properties": {
Expand Down
19 changes: 17 additions & 2 deletions x-pack/plugins/fleet/common/openapi/bundled.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,6 @@ paths:
name: ignoreUnverified
description: Ignore if the package is fails signature verification
in: query
required: true
post:
summary: Packages - Install
tags: []
Expand Down Expand Up @@ -772,6 +771,10 @@ paths:
application/json:
schema:
type: object
properties:
actionId:
type: string
description: action id when running in async mode (>10k agents)
additionalProperties:
type: object
properties:
Expand Down Expand Up @@ -1139,6 +1142,10 @@ paths:
application/json:
schema:
type: object
properties:
actionId:
type: string
description: action id when running in async mode (>10k agents)
additionalProperties:
type: object
properties:
Expand Down Expand Up @@ -1185,6 +1192,10 @@ paths:
application/json:
schema:
type: object
properties:
actionId:
type: string
description: action id when running in async mode (>10k agents)
additionalProperties:
type: object
properties:
Expand Down Expand Up @@ -1236,6 +1247,10 @@ paths:
application/json:
schema:
type: object
properties:
actionId:
type: string
description: action id when running in async mode (>10k agents)
additionalProperties:
type: object
properties:
Expand Down Expand Up @@ -1332,7 +1347,7 @@ paths:
name: full
description: >-
When set to true, retrieve the related package policies for each
agent policy/
agent policy.
description: ''
post:
summary: Agent policy - Create
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ post:
application/json:
schema:
type: object
properties:
actionId:
type: string
description: action id when running in async mode (>10k agents)
additionalProperties:
type: object
properties:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ post:
application/json:
schema:
type: object
properties:
actionId:
type: string
description: action id when running in async mode (>10k agents)
additionalProperties:
type: object
properties:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ post:
application/json:
schema:
type: object
properties:
actionId:
type: string
description: action id when running in async mode (>10k agents)
additionalProperties:
type: object
properties:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ post:
application/json:
schema:
type: object
properties:
actionId:
type: string
description: action id when running in async mode (>10k agents)
additionalProperties:
type: object
properties:
Expand Down
30 changes: 7 additions & 23 deletions x-pack/plugins/fleet/common/types/rest_spec/agent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,15 @@ export interface PostBulkAgentUnenrollRequest {
};
}

export type PostBulkAgentUnenrollResponse = Record<
export type BulkAgentAction = Record<
Agent['id'],
{
success: boolean;
error?: string;
}
>;
> & { actionId?: string };

export type PostBulkAgentUnenrollResponse = BulkAgentAction;

export interface PostAgentUpgradeRequest {
params: {
Expand All @@ -100,13 +102,7 @@ export interface PostBulkAgentUpgradeRequest {
};
}

export type PostBulkAgentUpgradeResponse = Record<
Agent['id'],
{
success: boolean;
error?: string;
}
>;
export type PostBulkAgentUpgradeResponse = BulkAgentAction;

// eslint-disable-next-line @typescript-eslint/no-empty-interface
export interface PostAgentUpgradeResponse {}
Expand All @@ -129,21 +125,9 @@ export interface PostBulkAgentReassignRequest {
};
}

export type PostBulkAgentReassignResponse = Record<
Agent['id'],
{
success: boolean;
error?: string;
}
>;
export type PostBulkAgentReassignResponse = BulkAgentAction;

export type PostBulkUpdateAgentTagsResponse = Record<
Agent['id'],
{
success: boolean;
error?: string;
}
>;
export type PostBulkUpdateAgentTagsResponse = BulkAgentAction;

export interface DeleteAgentRequest {
params: {
Expand Down

0 comments on commit b4d17f1

Please sign in to comment.