diff --git a/x-pack/plugins/fleet/common/openapi/bundled.json b/x-pack/plugins/fleet/common/openapi/bundled.json index 72b3dddb7958..9b55cfdf7018 100644 --- a/x-pack/plugins/fleet/common/openapi/bundled.json +++ b/x-pack/plugins/fleet/common/openapi/bundled.json @@ -2127,6 +2127,109 @@ "operationId": "get-agent-tags" } }, + "/agents/{agentId}/request_diagnostics": { + "parameters": [ + { + "schema": { + "type": "string" + }, + "name": "agentId", + "in": "path", + "required": true + } + ], + "post": { + "summary": "Agent - Request Diagnostics", + "tags": [], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "actionId": { + "type": "string" + } + } + } + } + } + } + }, + "operationId": "request-diagnostics-agent", + "parameters": [ + { + "$ref": "#/components/parameters/kbn_xsrf" + } + ] + } + }, + "/agents/bulk_request_diagnostics": { + "post": { + "summary": "Agent - Bulk Request Diagnostics", + "tags": [], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "actionId": { + "type": "string" + } + } + } + } + } + } + }, + "operationId": "bulk-request-diagnostics", + "parameters": [ + { + "$ref": "#/components/parameters/kbn_xsrf" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "batchSize": { + "type": "number" + }, + "agents": { + "oneOf": [ + { + "type": "string", + "description": "KQL query string, leave empty to action all agents" + }, + { + "type": "array", + "items": { + "type": "string" + }, + "description": "list of agent IDs" + } + ] + } + }, + "required": [ + "agents" + ] + }, + "example": { + "agents": "fleet-agents.policy_id : (\"policy1\" or \"policy2\")" + } + } + } + } + } + }, "/agent_policies": { "get": { "summary": "Agent policies - List", diff --git a/x-pack/plugins/fleet/common/openapi/bundled.yaml b/x-pack/plugins/fleet/common/openapi/bundled.yaml index 489e49fe30af..423f232d41f6 100644 --- a/x-pack/plugins/fleet/common/openapi/bundled.yaml +++ b/x-pack/plugins/fleet/common/openapi/bundled.yaml @@ -1314,6 +1314,66 @@ paths: schema: $ref: '#/components/schemas/get_agent_tags_response' operationId: get-agent-tags + /agents/{agentId}/request_diagnostics: + parameters: + - schema: + type: string + name: agentId + in: path + required: true + post: + summary: Agent - Request Diagnostics + tags: [] + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + actionId: + type: string + operationId: request-diagnostics-agent + parameters: + - $ref: '#/components/parameters/kbn_xsrf' + /agents/bulk_request_diagnostics: + post: + summary: Agent - Bulk Request Diagnostics + tags: [] + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + actionId: + type: string + operationId: bulk-request-diagnostics + parameters: + - $ref: '#/components/parameters/kbn_xsrf' + requestBody: + content: + application/json: + schema: + type: object + properties: + batchSize: + type: number + agents: + oneOf: + - type: string + description: KQL query string, leave empty to action all agents + - type: array + items: + type: string + description: list of agent IDs + required: + - agents + example: + agents: 'fleet-agents.policy_id : ("policy1" or "policy2")' /agent_policies: get: summary: Agent policies - List diff --git a/x-pack/plugins/fleet/common/openapi/entrypoint.yaml b/x-pack/plugins/fleet/common/openapi/entrypoint.yaml index bccfa64ff772..af7cb62b5c1f 100644 --- a/x-pack/plugins/fleet/common/openapi/entrypoint.yaml +++ b/x-pack/plugins/fleet/common/openapi/entrypoint.yaml @@ -77,6 +77,10 @@ paths: $ref: 'paths/agents@bulk_update_tags.yaml' /agents/tags: $ref: paths/agent_tags.yaml + '/agents/{agentId}/request_diagnostics': + $ref: 'paths/agents@{agent_id}@request_diagnostics.yaml' + /agents/bulk_request_diagnostics: + $ref: 'paths/agents@bulk_request_diagnostics.yaml' # Agent policies endpoints /agent_policies: $ref: paths/agent_policies.yaml diff --git a/x-pack/plugins/fleet/common/openapi/paths/agents@bulk_request_diagnostics.yaml b/x-pack/plugins/fleet/common/openapi/paths/agents@bulk_request_diagnostics.yaml new file mode 100644 index 000000000000..ea76360c892f --- /dev/null +++ b/x-pack/plugins/fleet/common/openapi/paths/agents@bulk_request_diagnostics.yaml @@ -0,0 +1,36 @@ +post: + summary: Agent - Bulk Request Diagnostics + tags: [] + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + actionId: + type: string + operationId: bulk-request-diagnostics + parameters: + - $ref: ../components/headers/kbn_xsrf.yaml + requestBody: + content: + application/json: + schema: + type: object + properties: + batchSize: + type: number + agents: + oneOf: + - type: string + description: KQL query string, leave empty to action all agents + - type: array + items: + type: string + description: list of agent IDs + required: + - agents + example: + agents: "fleet-agents.policy_id : (\"policy1\" or \"policy2\")" diff --git a/x-pack/plugins/fleet/common/openapi/paths/agents@{agent_id}@request_diagnostics.yaml b/x-pack/plugins/fleet/common/openapi/paths/agents@{agent_id}@request_diagnostics.yaml new file mode 100644 index 000000000000..574ca0bbf918 --- /dev/null +++ b/x-pack/plugins/fleet/common/openapi/paths/agents@{agent_id}@request_diagnostics.yaml @@ -0,0 +1,23 @@ +parameters: + - schema: + type: string + name: agentId + in: path + required: true +post: + summary: Agent - Request Diagnostics + tags: [] + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + actionId: + type: string + operationId: request-diagnostics-agent + parameters: + - $ref: ../components/headers/kbn_xsrf.yaml +