Skip to content

Commit

Permalink
added request diagnostics to openapi (elastic#145222)
Browse files Browse the repository at this point in the history
## Summary

Follow up for elastic#141074

Added Request Diagnostics to OpenAPI spec
  • Loading branch information
juliaElastic authored Nov 17, 2022
1 parent e01649e commit 7e7d557
Show file tree
Hide file tree
Showing 5 changed files with 226 additions and 0 deletions.
103 changes: 103 additions & 0 deletions x-pack/plugins/fleet/common/openapi/bundled.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
60 changes: 60 additions & 0 deletions x-pack/plugins/fleet/common/openapi/bundled.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions x-pack/plugins/fleet/common/openapi/entrypoint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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\")"
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 7e7d557

Please sign in to comment.