Skip to content

Commit

Permalink
Add bulk-reassign-agents req/res spec
Browse files Browse the repository at this point in the history
  • Loading branch information
John Schulz committed Jul 22, 2021
1 parent c8ad15b commit 1ad65b6
Show file tree
Hide file tree
Showing 4 changed files with 227 additions and 77 deletions.
155 changes: 112 additions & 43 deletions x-pack/plugins/fleet/common/openapi/bundled.json
Original file line number Diff line number Diff line change
Expand Up @@ -702,7 +702,7 @@
}
}
},
"/agents/{agentId}/unenroll": {
"/agents/{agentId}/upgrade": {
"parameters": [
{
"schema": {
Expand All @@ -714,15 +714,15 @@
}
],
"post": {
"summary": "Agent - Unenroll",
"summary": "Agent - Upgrade",
"tags": [],
"responses": {
"200": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"type": "object"
"$ref": "#/components/schemas/upgrade_agent"
}
}
}
Expand All @@ -732,54 +732,33 @@
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"error": {
"type": "string"
},
"message": {
"type": "string"
},
"statusCode": {
"type": "number",
"enum": [
400
]
}
}
"$ref": "#/components/schemas/upgrade_agent"
}
}
}
}
},
"operationId": "unenroll-agent",
"operationId": "upgrade-agent",
"parameters": [
{
"$ref": "#/components/parameters/kbn_xsrf"
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"revoke": {
"type": "boolean"
},
"force": {
"type": "boolean"
}
}
"$ref": "#/components/schemas/upgrade_agent"
}
}
}
}
}
},
"/agents/bulk_unenroll": {
"/agents/bulk_reassign": {
"post": {
"summary": "Agents - Bulk unenroll",
"summary": "Agents - Bulk reassign",
"tags": [],
"responses": {
"200": {
Expand Down Expand Up @@ -807,7 +786,7 @@
}
}
},
"operationId": "bulk-unenroll-agents",
"operationId": "bulk-reassign-agents",
"parameters": [
{
"$ref": "#/components/parameters/kbn_xsrf"
Expand All @@ -819,11 +798,8 @@
"schema": {
"type": "object",
"properties": {
"revoke": {
"type": "boolean"
},
"force": {
"type": "boolean"
"policy_id": {
"type": "string"
},
"agents": {
"oneOf": [
Expand All @@ -840,6 +816,7 @@
}
},
"required": [
"policy_id",
"agents"
]
}
Expand All @@ -848,7 +825,7 @@
}
}
},
"/agents/{agentId}/upgrade": {
"/agents/{agentId}/unenroll": {
"parameters": [
{
"schema": {
Expand All @@ -860,15 +837,15 @@
}
],
"post": {
"summary": "Agent - Upgrade",
"summary": "Agent - Unenroll",
"tags": [],
"responses": {
"200": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/upgrade_agent"
"type": "object"
}
}
}
Expand All @@ -878,24 +855,116 @@
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/upgrade_agent"
"type": "object",
"properties": {
"error": {
"type": "string"
},
"message": {
"type": "string"
},
"statusCode": {
"type": "number",
"enum": [
400
]
}
}
}
}
}
}
},
"operationId": "upgrade-agent",
"operationId": "unenroll-agent",
"parameters": [
{
"$ref": "#/components/parameters/kbn_xsrf"
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/upgrade_agent"
"type": "object",
"properties": {
"revoke": {
"type": "boolean"
},
"force": {
"type": "boolean"
}
}
}
}
}
}
}
},
"/agents/bulk_unenroll": {
"post": {
"summary": "Agents - Bulk unenroll",
"tags": [],
"responses": {
"200": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"type": "object",
"additionalProperties": {
"type": "object",
"properties": {
"success": {
"type": "boolean"
},
"error": {
"type": "string"
}
},
"required": [
"success"
]
}
}
}
}
}
},
"operationId": "bulk-unenroll-agents",
"parameters": [
{
"$ref": "#/components/parameters/kbn_xsrf"
}
],
"requestBody": {
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"revoke": {
"type": "boolean"
},
"force": {
"type": "boolean"
},
"agents": {
"oneOf": [
{
"type": "string"
},
{
"type": "array",
"items": {
"type": "string"
}
}
]
}
},
"required": [
"agents"
]
}
}
}
Expand Down
104 changes: 72 additions & 32 deletions x-pack/plugins/fleet/common/openapi/bundled.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,78 @@ paths:
type: string
required:
- policy_id
'/agents/{agentId}/upgrade':
parameters:
- schema:
type: string
name: agentId
in: path
required: true
post:
summary: Agent - Upgrade
tags: []
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/upgrade_agent'
'400':
description: BAD REQUEST
content:
application/json:
schema:
$ref: '#/components/schemas/upgrade_agent'
operationId: upgrade-agent
parameters:
- $ref: '#/components/parameters/kbn_xsrf'
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/upgrade_agent'
/agents/bulk_reassign:
post:
summary: Agents - Bulk reassign
tags: []
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
additionalProperties:
type: object
properties:
success:
type: boolean
error:
type: string
required:
- success
operationId: bulk-reassign-agents
parameters:
- $ref: '#/components/parameters/kbn_xsrf'
requestBody:
content:
application/json:
schema:
type: object
properties:
policy_id:
type: string
agents:
oneOf:
- type: string
- type: array
items:
type: string
required:
- policy_id
- agents
'/agents/{agentId}/unenroll':
parameters:
- schema:
Expand Down Expand Up @@ -514,38 +586,6 @@ paths:
type: string
required:
- agents
'/agents/{agentId}/upgrade':
parameters:
- schema:
type: string
name: agentId
in: path
required: true
post:
summary: Agent - Upgrade
tags: []
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/upgrade_agent'
'400':
description: BAD REQUEST
content:
application/json:
schema:
$ref: '#/components/schemas/upgrade_agent'
operationId: upgrade-agent
parameters:
- $ref: '#/components/parameters/kbn_xsrf'
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/upgrade_agent'
/agent_policies:
get:
summary: Agent policies - List
Expand Down
Loading

0 comments on commit 1ad65b6

Please sign in to comment.