[Fleet] Remove deprecated APIs for agents endpoints (#198313)

This commit is contained in:
Nicolas Chaulet 2024-11-01 08:00:12 -04:00 committed by GitHub
parent 34aab05595
commit 115dbec0ff
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
27 changed files with 26 additions and 1995 deletions

View file

@ -5626,63 +5626,6 @@
]
}
},
"/api/fleet/agent-status": {
"get": {
"operationId": "get-fleet-agent-status-2",
"parameters": [
{
"description": "The version of the API to use",
"in": "header",
"name": "elastic-api-version",
"schema": {
"default": "2023-10-31",
"enum": [
"2023-10-31"
],
"type": "string"
}
},
{
"in": "query",
"name": "policyId",
"required": false,
"schema": {
"type": "string"
}
},
{
"in": "query",
"name": "policyIds",
"required": false,
"schema": {
"anyOf": [
{
"items": {
"type": "string"
},
"type": "array"
},
{
"type": "string"
}
]
}
},
{
"in": "query",
"name": "kuery",
"required": false,
"schema": {
"deprecated": true,
"type": "string"
}
}
],
"responses": {},
"summary": "",
"tags": []
}
},
"/api/fleet/agent_download_sources": {
"get": {
"description": "List agent binary download sources",
@ -12547,7 +12490,6 @@
"name": "kuery",
"required": false,
"schema": {
"deprecated": true,
"type": "string"
}
}
@ -12586,10 +12528,6 @@
"other": {
"type": "number"
},
"total": {
"deprecated": true,
"type": "number"
},
"unenrolled": {
"type": "number"
},
@ -12599,7 +12537,6 @@
},
"required": [
"events",
"total",
"online",
"error",
"offline",
@ -13263,394 +13200,6 @@
},
"type": "array"
},
"list": {
"deprecated": true,
"items": {
"additionalProperties": false,
"properties": {
"access_api_key": {
"type": "string"
},
"access_api_key_id": {
"type": "string"
},
"active": {
"type": "boolean"
},
"agent": {
"additionalProperties": true,
"properties": {
"id": {
"type": "string"
},
"version": {
"type": "string"
}
},
"required": [
"id",
"version"
],
"type": "object"
},
"components": {
"items": {
"additionalProperties": false,
"properties": {
"id": {
"type": "string"
},
"message": {
"type": "string"
},
"status": {
"enum": [
"STARTING",
"CONFIGURING",
"HEALTHY",
"DEGRADED",
"FAILED",
"STOPPING",
"STOPPED"
],
"type": "string"
},
"type": {
"type": "string"
},
"units": {
"items": {
"additionalProperties": false,
"properties": {
"id": {
"type": "string"
},
"message": {
"type": "string"
},
"payload": {
"additionalProperties": {},
"type": "object"
},
"status": {
"enum": [
"STARTING",
"CONFIGURING",
"HEALTHY",
"DEGRADED",
"FAILED",
"STOPPING",
"STOPPED"
],
"type": "string"
},
"type": {
"enum": [
"input",
"output"
],
"type": "string"
}
},
"required": [
"id",
"type",
"status",
"message"
],
"type": "object"
},
"type": "array"
}
},
"required": [
"id",
"type",
"status",
"message"
],
"type": "object"
},
"type": "array"
},
"default_api_key": {
"type": "string"
},
"default_api_key_history": {
"items": {
"additionalProperties": false,
"deprecated": true,
"properties": {
"id": {
"type": "string"
},
"retired_at": {
"type": "string"
}
},
"required": [
"id",
"retired_at"
],
"type": "object"
},
"type": "array"
},
"default_api_key_id": {
"type": "string"
},
"enrolled_at": {
"type": "string"
},
"id": {
"type": "string"
},
"last_checkin": {
"type": "string"
},
"last_checkin_message": {
"type": "string"
},
"last_checkin_status": {
"enum": [
"error",
"online",
"degraded",
"updating",
"starting"
],
"type": "string"
},
"local_metadata": {
"additionalProperties": {},
"type": "object"
},
"metrics": {
"additionalProperties": false,
"properties": {
"cpu_avg": {
"type": "number"
},
"memory_size_byte_avg": {
"type": "number"
}
},
"type": "object"
},
"namespaces": {
"items": {
"type": "string"
},
"type": "array"
},
"outputs": {
"additionalProperties": {
"additionalProperties": false,
"properties": {
"api_key_id": {
"type": "string"
},
"to_retire_api_key_ids": {
"items": {
"additionalProperties": false,
"properties": {
"id": {
"type": "string"
},
"retired_at": {
"type": "string"
}
},
"required": [
"id",
"retired_at"
],
"type": "object"
},
"type": "array"
},
"type": {
"type": "string"
}
},
"required": [
"api_key_id",
"type"
],
"type": "object"
},
"type": "object"
},
"packages": {
"items": {
"type": "string"
},
"type": "array"
},
"policy_id": {
"type": "string"
},
"policy_revision": {
"nullable": true,
"type": "number"
},
"sort": {
"items": {
"anyOf": [
{
"type": "number"
},
{
"type": "string"
},
{
"enum": [],
"nullable": true
}
]
},
"type": "array"
},
"status": {
"enum": [
"offline",
"error",
"online",
"inactive",
"enrolling",
"unenrolling",
"unenrolled",
"updating",
"degraded"
],
"type": "string"
},
"tags": {
"items": {
"type": "string"
},
"type": "array"
},
"type": {
"enum": [
"PERMANENT",
"EPHEMERAL",
"TEMPORARY"
],
"type": "string"
},
"unenrolled_at": {
"type": "string"
},
"unenrollment_started_at": {
"type": "string"
},
"unhealthy_reason": {
"items": {
"enum": [
"input",
"output",
"other"
],
"type": "string"
},
"nullable": true,
"type": "array"
},
"upgrade_details": {
"additionalProperties": false,
"properties": {
"action_id": {
"type": "string"
},
"metadata": {
"additionalProperties": false,
"properties": {
"download_percent": {
"type": "number"
},
"download_rate": {
"type": "number"
},
"error_msg": {
"type": "string"
},
"failed_state": {
"enum": [
"UPG_REQUESTED",
"UPG_SCHEDULED",
"UPG_DOWNLOADING",
"UPG_EXTRACTING",
"UPG_REPLACING",
"UPG_RESTARTING",
"UPG_FAILED",
"UPG_WATCHING",
"UPG_ROLLBACK"
],
"type": "string"
},
"retry_error_msg": {
"type": "string"
},
"retry_until": {
"type": "string"
},
"scheduled_at": {
"type": "string"
}
},
"type": "object"
},
"state": {
"enum": [
"UPG_REQUESTED",
"UPG_SCHEDULED",
"UPG_DOWNLOADING",
"UPG_EXTRACTING",
"UPG_REPLACING",
"UPG_RESTARTING",
"UPG_FAILED",
"UPG_WATCHING",
"UPG_ROLLBACK"
],
"type": "string"
},
"target_version": {
"type": "string"
}
},
"required": [
"target_version",
"action_id",
"state"
],
"type": "object"
},
"upgrade_started_at": {
"nullable": true,
"type": "string"
},
"upgraded_at": {
"nullable": true,
"type": "string"
},
"user_provided_metadata": {
"additionalProperties": {},
"type": "object"
}
},
"required": [
"id",
"packages",
"type",
"active",
"enrolled_at",
"local_metadata"
],
"type": "object"
},
"type": "array"
},
"page": {
"type": "number"
},
@ -16695,62 +16244,6 @@
"tags": [
"Elastic Agent actions"
]
},
"put": {
"operationId": "put-fleet-agents-agentid-reassign",
"parameters": [
{
"description": "The version of the API to use",
"in": "header",
"name": "elastic-api-version",
"schema": {
"default": "2023-10-31",
"enum": [
"2023-10-31"
],
"type": "string"
}
},
{
"description": "A required header to protect against CSRF attacks",
"in": "header",
"name": "kbn-xsrf",
"required": true,
"schema": {
"example": "true",
"type": "string"
}
},
{
"in": "path",
"name": "agentId",
"required": true,
"schema": {
"type": "string"
}
}
],
"requestBody": {
"content": {
"application/json; Elastic-Api-Version=2023-10-31": {
"schema": {
"additionalProperties": false,
"properties": {
"policy_id": {
"type": "string"
}
},
"required": [
"policy_id"
],
"type": "object"
}
}
}
},
"responses": {},
"summary": "",
"tags": []
}
},
"/api/fleet/agents/{agentId}/request_diagnostics": {
@ -39679,39 +39172,6 @@
]
}
},
"/api/fleet/service-tokens": {
"post": {
"description": "Create a service token",
"operationId": "post-fleet-service-tokens-2",
"parameters": [
{
"description": "The version of the API to use",
"in": "header",
"name": "elastic-api-version",
"schema": {
"default": "2023-10-31",
"enum": [
"2023-10-31"
],
"type": "string"
}
},
{
"description": "A required header to protect against CSRF attacks",
"in": "header",
"name": "kbn-xsrf",
"required": true,
"schema": {
"example": "true",
"type": "string"
}
}
],
"responses": {},
"summary": "",
"tags": []
}
},
"/api/fleet/service_tokens": {
"post": {
"description": "Create a service token",

View file

@ -5626,63 +5626,6 @@
]
}
},
"/api/fleet/agent-status": {
"get": {
"operationId": "get-fleet-agent-status-2",
"parameters": [
{
"description": "The version of the API to use",
"in": "header",
"name": "elastic-api-version",
"schema": {
"default": "2023-10-31",
"enum": [
"2023-10-31"
],
"type": "string"
}
},
{
"in": "query",
"name": "policyId",
"required": false,
"schema": {
"type": "string"
}
},
{
"in": "query",
"name": "policyIds",
"required": false,
"schema": {
"anyOf": [
{
"items": {
"type": "string"
},
"type": "array"
},
{
"type": "string"
}
]
}
},
{
"in": "query",
"name": "kuery",
"required": false,
"schema": {
"deprecated": true,
"type": "string"
}
}
],
"responses": {},
"summary": "",
"tags": []
}
},
"/api/fleet/agent_download_sources": {
"get": {
"description": "List agent binary download sources",
@ -12547,7 +12490,6 @@
"name": "kuery",
"required": false,
"schema": {
"deprecated": true,
"type": "string"
}
}
@ -12586,10 +12528,6 @@
"other": {
"type": "number"
},
"total": {
"deprecated": true,
"type": "number"
},
"unenrolled": {
"type": "number"
},
@ -12599,7 +12537,6 @@
},
"required": [
"events",
"total",
"online",
"error",
"offline",
@ -13263,394 +13200,6 @@
},
"type": "array"
},
"list": {
"deprecated": true,
"items": {
"additionalProperties": false,
"properties": {
"access_api_key": {
"type": "string"
},
"access_api_key_id": {
"type": "string"
},
"active": {
"type": "boolean"
},
"agent": {
"additionalProperties": true,
"properties": {
"id": {
"type": "string"
},
"version": {
"type": "string"
}
},
"required": [
"id",
"version"
],
"type": "object"
},
"components": {
"items": {
"additionalProperties": false,
"properties": {
"id": {
"type": "string"
},
"message": {
"type": "string"
},
"status": {
"enum": [
"STARTING",
"CONFIGURING",
"HEALTHY",
"DEGRADED",
"FAILED",
"STOPPING",
"STOPPED"
],
"type": "string"
},
"type": {
"type": "string"
},
"units": {
"items": {
"additionalProperties": false,
"properties": {
"id": {
"type": "string"
},
"message": {
"type": "string"
},
"payload": {
"additionalProperties": {},
"type": "object"
},
"status": {
"enum": [
"STARTING",
"CONFIGURING",
"HEALTHY",
"DEGRADED",
"FAILED",
"STOPPING",
"STOPPED"
],
"type": "string"
},
"type": {
"enum": [
"input",
"output"
],
"type": "string"
}
},
"required": [
"id",
"type",
"status",
"message"
],
"type": "object"
},
"type": "array"
}
},
"required": [
"id",
"type",
"status",
"message"
],
"type": "object"
},
"type": "array"
},
"default_api_key": {
"type": "string"
},
"default_api_key_history": {
"items": {
"additionalProperties": false,
"deprecated": true,
"properties": {
"id": {
"type": "string"
},
"retired_at": {
"type": "string"
}
},
"required": [
"id",
"retired_at"
],
"type": "object"
},
"type": "array"
},
"default_api_key_id": {
"type": "string"
},
"enrolled_at": {
"type": "string"
},
"id": {
"type": "string"
},
"last_checkin": {
"type": "string"
},
"last_checkin_message": {
"type": "string"
},
"last_checkin_status": {
"enum": [
"error",
"online",
"degraded",
"updating",
"starting"
],
"type": "string"
},
"local_metadata": {
"additionalProperties": {},
"type": "object"
},
"metrics": {
"additionalProperties": false,
"properties": {
"cpu_avg": {
"type": "number"
},
"memory_size_byte_avg": {
"type": "number"
}
},
"type": "object"
},
"namespaces": {
"items": {
"type": "string"
},
"type": "array"
},
"outputs": {
"additionalProperties": {
"additionalProperties": false,
"properties": {
"api_key_id": {
"type": "string"
},
"to_retire_api_key_ids": {
"items": {
"additionalProperties": false,
"properties": {
"id": {
"type": "string"
},
"retired_at": {
"type": "string"
}
},
"required": [
"id",
"retired_at"
],
"type": "object"
},
"type": "array"
},
"type": {
"type": "string"
}
},
"required": [
"api_key_id",
"type"
],
"type": "object"
},
"type": "object"
},
"packages": {
"items": {
"type": "string"
},
"type": "array"
},
"policy_id": {
"type": "string"
},
"policy_revision": {
"nullable": true,
"type": "number"
},
"sort": {
"items": {
"anyOf": [
{
"type": "number"
},
{
"type": "string"
},
{
"enum": [],
"nullable": true
}
]
},
"type": "array"
},
"status": {
"enum": [
"offline",
"error",
"online",
"inactive",
"enrolling",
"unenrolling",
"unenrolled",
"updating",
"degraded"
],
"type": "string"
},
"tags": {
"items": {
"type": "string"
},
"type": "array"
},
"type": {
"enum": [
"PERMANENT",
"EPHEMERAL",
"TEMPORARY"
],
"type": "string"
},
"unenrolled_at": {
"type": "string"
},
"unenrollment_started_at": {
"type": "string"
},
"unhealthy_reason": {
"items": {
"enum": [
"input",
"output",
"other"
],
"type": "string"
},
"nullable": true,
"type": "array"
},
"upgrade_details": {
"additionalProperties": false,
"properties": {
"action_id": {
"type": "string"
},
"metadata": {
"additionalProperties": false,
"properties": {
"download_percent": {
"type": "number"
},
"download_rate": {
"type": "number"
},
"error_msg": {
"type": "string"
},
"failed_state": {
"enum": [
"UPG_REQUESTED",
"UPG_SCHEDULED",
"UPG_DOWNLOADING",
"UPG_EXTRACTING",
"UPG_REPLACING",
"UPG_RESTARTING",
"UPG_FAILED",
"UPG_WATCHING",
"UPG_ROLLBACK"
],
"type": "string"
},
"retry_error_msg": {
"type": "string"
},
"retry_until": {
"type": "string"
},
"scheduled_at": {
"type": "string"
}
},
"type": "object"
},
"state": {
"enum": [
"UPG_REQUESTED",
"UPG_SCHEDULED",
"UPG_DOWNLOADING",
"UPG_EXTRACTING",
"UPG_REPLACING",
"UPG_RESTARTING",
"UPG_FAILED",
"UPG_WATCHING",
"UPG_ROLLBACK"
],
"type": "string"
},
"target_version": {
"type": "string"
}
},
"required": [
"target_version",
"action_id",
"state"
],
"type": "object"
},
"upgrade_started_at": {
"nullable": true,
"type": "string"
},
"upgraded_at": {
"nullable": true,
"type": "string"
},
"user_provided_metadata": {
"additionalProperties": {},
"type": "object"
}
},
"required": [
"id",
"packages",
"type",
"active",
"enrolled_at",
"local_metadata"
],
"type": "object"
},
"type": "array"
},
"page": {
"type": "number"
},
@ -16695,62 +16244,6 @@
"tags": [
"Elastic Agent actions"
]
},
"put": {
"operationId": "put-fleet-agents-agentid-reassign",
"parameters": [
{
"description": "The version of the API to use",
"in": "header",
"name": "elastic-api-version",
"schema": {
"default": "2023-10-31",
"enum": [
"2023-10-31"
],
"type": "string"
}
},
{
"description": "A required header to protect against CSRF attacks",
"in": "header",
"name": "kbn-xsrf",
"required": true,
"schema": {
"example": "true",
"type": "string"
}
},
{
"in": "path",
"name": "agentId",
"required": true,
"schema": {
"type": "string"
}
}
],
"requestBody": {
"content": {
"application/json; Elastic-Api-Version=2023-10-31": {
"schema": {
"additionalProperties": false,
"properties": {
"policy_id": {
"type": "string"
}
},
"required": [
"policy_id"
],
"type": "object"
}
}
}
},
"responses": {},
"summary": "",
"tags": []
}
},
"/api/fleet/agents/{agentId}/request_diagnostics": {
@ -39679,39 +39172,6 @@
]
}
},
"/api/fleet/service-tokens": {
"post": {
"description": "Create a service token",
"operationId": "post-fleet-service-tokens-2",
"parameters": [
{
"description": "The version of the API to use",
"in": "header",
"name": "elastic-api-version",
"schema": {
"default": "2023-10-31",
"enum": [
"2023-10-31"
],
"type": "string"
}
},
{
"description": "A required header to protect against CSRF attacks",
"in": "header",
"name": "kbn-xsrf",
"required": true,
"schema": {
"example": "true",
"type": "string"
}
}
],
"responses": {},
"summary": "",
"tags": []
}
},
"/api/fleet/service_tokens": {
"post": {
"description": "Create a service token",

View file

@ -14811,7 +14811,6 @@ paths:
name: kuery
required: false
schema:
deprecated: true
type: string
responses:
'200':
@ -14841,16 +14840,12 @@ paths:
type: number
other:
type: number
total:
deprecated: true
type: number
unenrolled:
type: number
updating:
type: number
required:
- events
- total
- online
- error
- offline
@ -14954,41 +14949,6 @@ paths:
summary: ''
tags:
- Elastic Agents
/api/fleet/agent-status:
get:
operationId: get-fleet-agent-status-2
parameters:
- description: The version of the API to use
in: header
name: elastic-api-version
schema:
default: '2023-10-31'
enum:
- '2023-10-31'
type: string
- in: query
name: policyId
required: false
schema:
type: string
- in: query
name: policyIds
required: false
schema:
anyOf:
- items:
type: string
type: array
- type: string
- in: query
name: kuery
required: false
schema:
deprecated: true
type: string
responses: {}
summary: ''
tags: []
/api/fleet/agents:
get:
description: List agents
@ -15342,285 +15302,6 @@ paths:
- enrolled_at
- local_metadata
type: array
list:
deprecated: true
items:
additionalProperties: false
type: object
properties:
access_api_key:
type: string
access_api_key_id:
type: string
active:
type: boolean
agent:
additionalProperties: true
type: object
properties:
id:
type: string
version:
type: string
required:
- id
- version
components:
items:
additionalProperties: false
type: object
properties:
id:
type: string
message:
type: string
status:
enum:
- STARTING
- CONFIGURING
- HEALTHY
- DEGRADED
- FAILED
- STOPPING
- STOPPED
type: string
type:
type: string
units:
items:
additionalProperties: false
type: object
properties:
id:
type: string
message:
type: string
payload:
additionalProperties: {}
type: object
status:
enum:
- STARTING
- CONFIGURING
- HEALTHY
- DEGRADED
- FAILED
- STOPPING
- STOPPED
type: string
type:
enum:
- input
- output
type: string
required:
- id
- type
- status
- message
type: array
required:
- id
- type
- status
- message
type: array
default_api_key:
type: string
default_api_key_history:
items:
additionalProperties: false
deprecated: true
type: object
properties:
id:
type: string
retired_at:
type: string
required:
- id
- retired_at
type: array
default_api_key_id:
type: string
enrolled_at:
type: string
id:
type: string
last_checkin:
type: string
last_checkin_message:
type: string
last_checkin_status:
enum:
- error
- online
- degraded
- updating
- starting
type: string
local_metadata:
additionalProperties: {}
type: object
metrics:
additionalProperties: false
type: object
properties:
cpu_avg:
type: number
memory_size_byte_avg:
type: number
namespaces:
items:
type: string
type: array
outputs:
additionalProperties:
additionalProperties: false
type: object
properties:
api_key_id:
type: string
to_retire_api_key_ids:
items:
additionalProperties: false
type: object
properties:
id:
type: string
retired_at:
type: string
required:
- id
- retired_at
type: array
type:
type: string
required:
- api_key_id
- type
type: object
packages:
items:
type: string
type: array
policy_id:
type: string
policy_revision:
nullable: true
type: number
sort:
items:
anyOf:
- type: number
- type: string
- enum: []
nullable: true
type: array
status:
enum:
- offline
- error
- online
- inactive
- enrolling
- unenrolling
- unenrolled
- updating
- degraded
type: string
tags:
items:
type: string
type: array
type:
enum:
- PERMANENT
- EPHEMERAL
- TEMPORARY
type: string
unenrolled_at:
type: string
unenrollment_started_at:
type: string
unhealthy_reason:
items:
enum:
- input
- output
- other
type: string
nullable: true
type: array
upgrade_details:
additionalProperties: false
type: object
properties:
action_id:
type: string
metadata:
additionalProperties: false
type: object
properties:
download_percent:
type: number
download_rate:
type: number
error_msg:
type: string
failed_state:
enum:
- UPG_REQUESTED
- UPG_SCHEDULED
- UPG_DOWNLOADING
- UPG_EXTRACTING
- UPG_REPLACING
- UPG_RESTARTING
- UPG_FAILED
- UPG_WATCHING
- UPG_ROLLBACK
type: string
retry_error_msg:
type: string
retry_until:
type: string
scheduled_at:
type: string
state:
enum:
- UPG_REQUESTED
- UPG_SCHEDULED
- UPG_DOWNLOADING
- UPG_EXTRACTING
- UPG_REPLACING
- UPG_RESTARTING
- UPG_FAILED
- UPG_WATCHING
- UPG_ROLLBACK
type: string
target_version:
type: string
required:
- target_version
- action_id
- state
upgrade_started_at:
nullable: true
type: string
upgraded_at:
nullable: true
type: string
user_provided_metadata:
additionalProperties: {}
type: object
required:
- id
- packages
- type
- active
- enrolled_at
- local_metadata
type: array
page:
type: number
perPage:
@ -16657,43 +16338,6 @@ paths:
summary: ''
tags:
- Elastic Agent actions
put:
operationId: put-fleet-agents-agentid-reassign
parameters:
- description: The version of the API to use
in: header
name: elastic-api-version
schema:
default: '2023-10-31'
enum:
- '2023-10-31'
type: string
- description: A required header to protect against CSRF attacks
in: header
name: kbn-xsrf
required: true
schema:
example: 'true'
type: string
- in: path
name: agentId
required: true
schema:
type: string
requestBody:
content:
application/json; Elastic-Api-Version=2023-10-31:
schema:
additionalProperties: false
type: object
properties:
policy_id:
type: string
required:
- policy_id
responses: {}
summary: ''
tags: []
/api/fleet/agents/{agentId}/request_diagnostics:
post:
description: Request agent diagnostics
@ -33408,29 +33052,6 @@ paths:
summary: ''
tags:
- Fleet service tokens
/api/fleet/service-tokens:
post:
description: Create a service token
operationId: post-fleet-service-tokens-2
parameters:
- description: The version of the API to use
in: header
name: elastic-api-version
schema:
default: '2023-10-31'
enum:
- '2023-10-31'
type: string
- description: A required header to protect against CSRF attacks
in: header
name: kbn-xsrf
required: true
schema:
example: 'true'
type: string
responses: {}
summary: ''
tags: []
/api/fleet/settings:
get:
description: Get settings

View file

@ -18244,7 +18244,6 @@ paths:
name: kuery
required: false
schema:
deprecated: true
type: string
responses:
'200':
@ -18274,16 +18273,12 @@ paths:
type: number
other:
type: number
total:
deprecated: true
type: number
unenrolled:
type: number
updating:
type: number
required:
- events
- total
- online
- error
- offline
@ -18387,41 +18382,6 @@ paths:
summary: ''
tags:
- Elastic Agents
/api/fleet/agent-status:
get:
operationId: get-fleet-agent-status-2
parameters:
- description: The version of the API to use
in: header
name: elastic-api-version
schema:
default: '2023-10-31'
enum:
- '2023-10-31'
type: string
- in: query
name: policyId
required: false
schema:
type: string
- in: query
name: policyIds
required: false
schema:
anyOf:
- items:
type: string
type: array
- type: string
- in: query
name: kuery
required: false
schema:
deprecated: true
type: string
responses: {}
summary: ''
tags: []
/api/fleet/agents:
get:
description: List agents
@ -18775,285 +18735,6 @@ paths:
- enrolled_at
- local_metadata
type: array
list:
deprecated: true
items:
additionalProperties: false
type: object
properties:
access_api_key:
type: string
access_api_key_id:
type: string
active:
type: boolean
agent:
additionalProperties: true
type: object
properties:
id:
type: string
version:
type: string
required:
- id
- version
components:
items:
additionalProperties: false
type: object
properties:
id:
type: string
message:
type: string
status:
enum:
- STARTING
- CONFIGURING
- HEALTHY
- DEGRADED
- FAILED
- STOPPING
- STOPPED
type: string
type:
type: string
units:
items:
additionalProperties: false
type: object
properties:
id:
type: string
message:
type: string
payload:
additionalProperties: {}
type: object
status:
enum:
- STARTING
- CONFIGURING
- HEALTHY
- DEGRADED
- FAILED
- STOPPING
- STOPPED
type: string
type:
enum:
- input
- output
type: string
required:
- id
- type
- status
- message
type: array
required:
- id
- type
- status
- message
type: array
default_api_key:
type: string
default_api_key_history:
items:
additionalProperties: false
deprecated: true
type: object
properties:
id:
type: string
retired_at:
type: string
required:
- id
- retired_at
type: array
default_api_key_id:
type: string
enrolled_at:
type: string
id:
type: string
last_checkin:
type: string
last_checkin_message:
type: string
last_checkin_status:
enum:
- error
- online
- degraded
- updating
- starting
type: string
local_metadata:
additionalProperties: {}
type: object
metrics:
additionalProperties: false
type: object
properties:
cpu_avg:
type: number
memory_size_byte_avg:
type: number
namespaces:
items:
type: string
type: array
outputs:
additionalProperties:
additionalProperties: false
type: object
properties:
api_key_id:
type: string
to_retire_api_key_ids:
items:
additionalProperties: false
type: object
properties:
id:
type: string
retired_at:
type: string
required:
- id
- retired_at
type: array
type:
type: string
required:
- api_key_id
- type
type: object
packages:
items:
type: string
type: array
policy_id:
type: string
policy_revision:
nullable: true
type: number
sort:
items:
anyOf:
- type: number
- type: string
- enum: []
nullable: true
type: array
status:
enum:
- offline
- error
- online
- inactive
- enrolling
- unenrolling
- unenrolled
- updating
- degraded
type: string
tags:
items:
type: string
type: array
type:
enum:
- PERMANENT
- EPHEMERAL
- TEMPORARY
type: string
unenrolled_at:
type: string
unenrollment_started_at:
type: string
unhealthy_reason:
items:
enum:
- input
- output
- other
type: string
nullable: true
type: array
upgrade_details:
additionalProperties: false
type: object
properties:
action_id:
type: string
metadata:
additionalProperties: false
type: object
properties:
download_percent:
type: number
download_rate:
type: number
error_msg:
type: string
failed_state:
enum:
- UPG_REQUESTED
- UPG_SCHEDULED
- UPG_DOWNLOADING
- UPG_EXTRACTING
- UPG_REPLACING
- UPG_RESTARTING
- UPG_FAILED
- UPG_WATCHING
- UPG_ROLLBACK
type: string
retry_error_msg:
type: string
retry_until:
type: string
scheduled_at:
type: string
state:
enum:
- UPG_REQUESTED
- UPG_SCHEDULED
- UPG_DOWNLOADING
- UPG_EXTRACTING
- UPG_REPLACING
- UPG_RESTARTING
- UPG_FAILED
- UPG_WATCHING
- UPG_ROLLBACK
type: string
target_version:
type: string
required:
- target_version
- action_id
- state
upgrade_started_at:
nullable: true
type: string
upgraded_at:
nullable: true
type: string
user_provided_metadata:
additionalProperties: {}
type: object
required:
- id
- packages
- type
- active
- enrolled_at
- local_metadata
type: array
page:
type: number
perPage:
@ -20090,43 +19771,6 @@ paths:
summary: ''
tags:
- Elastic Agent actions
put:
operationId: put-fleet-agents-agentid-reassign
parameters:
- description: The version of the API to use
in: header
name: elastic-api-version
schema:
default: '2023-10-31'
enum:
- '2023-10-31'
type: string
- description: A required header to protect against CSRF attacks
in: header
name: kbn-xsrf
required: true
schema:
example: 'true'
type: string
- in: path
name: agentId
required: true
schema:
type: string
requestBody:
content:
application/json; Elastic-Api-Version=2023-10-31:
schema:
additionalProperties: false
type: object
properties:
policy_id:
type: string
required:
- policy_id
responses: {}
summary: ''
tags: []
/api/fleet/agents/{agentId}/request_diagnostics:
post:
description: Request agent diagnostics
@ -36841,29 +36485,6 @@ paths:
summary: ''
tags:
- Fleet service tokens
/api/fleet/service-tokens:
post:
description: Create a service token
operationId: post-fleet-service-tokens-2
parameters:
- description: The version of the API to use
in: header
name: elastic-api-version
schema:
default: '2023-10-31'
enum:
- '2023-10-31'
type: string
- description: A required header to protect against CSRF attacks
in: header
name: kbn-xsrf
required: true
schema:
example: 'true'
type: string
responses: {}
summary: ''
tags: []
/api/fleet/settings:
get:
description: Get settings

View file

@ -42,7 +42,7 @@ const createPolicies = (
const agentPolicyStatus = {
id: agentPolicy.id,
name: agentPolicy.name,
agents: agentStatusByAgentPolicyId[agentPolicy.id]?.total,
agents: agentStatusByAgentPolicyId[agentPolicy.id]?.active,
};
return {
package_policy: cloudDefendPackage,

View file

@ -48,7 +48,7 @@ export const getBenchmarksData = (
const agentPolicyStatus = {
id: agentPolicy.id,
name: agentPolicy.name,
agents: agentStatusByAgentPolicyId[agentPolicy.id]?.total,
agents: agentStatusByAgentPolicyId[agentPolicy.id]?.active,
};
return {
package_policy: cspPackage,

View file

@ -135,8 +135,6 @@ export const APP_API_ROUTES = {
CHECK_PERMISSIONS_PATTERN: `${API_ROOT}/check-permissions`,
GENERATE_SERVICE_TOKEN_PATTERN: `${API_ROOT}/service_tokens`,
AGENT_POLICIES_SPACES: `${INTERNAL_ROOT}/agent_policies_spaces`,
// deprecated since 8.0
GENERATE_SERVICE_TOKEN_PATTERN_DEPRECATED: `${API_ROOT}/service-tokens`,
};
// Agent API routes
@ -159,8 +157,6 @@ export const AGENT_API_ROUTES = {
AVAILABLE_VERSIONS_PATTERN: `${API_ROOT}/agents/available_versions`,
STATUS_PATTERN: `${API_ROOT}/agent_status`,
DATA_PATTERN: `${API_ROOT}/agent_status/data`,
// deprecated since 8.0
STATUS_PATTERN_DEPRECATED: `${API_ROOT}/agent-status`,
UPGRADE_PATTERN: `${API_ROOT}/agents/{agentId}/upgrade`,
BULK_UPGRADE_PATTERN: `${API_ROOT}/agents/bulk_upgrade`,
ACTION_STATUS_PATTERN: `${API_ROOT}/agents/action_status`,

View file

@ -21,15 +21,13 @@ import type { ListResult, ListWithKuery } from './common';
export interface GetAgentsRequest {
query: ListWithKuery & {
showInactive: boolean;
showInactive?: boolean;
showUpgradeable?: boolean;
withMetrics?: boolean;
};
}
export interface GetAgentsResponse extends ListResult<Agent> {
// deprecated in 8.x
list?: Agent[];
statusSummary?: Record<AgentStatus, number>;
}
@ -128,16 +126,6 @@ export type PostBulkAgentUpgradeResponse = BulkAgentAction;
// eslint-disable-next-line @typescript-eslint/no-empty-interface
export interface PostAgentUpgradeResponse {}
// deprecated
export interface PutAgentReassignRequest {
params: {
agentId: string;
};
body: { policy_id: string };
}
// deprecated
// eslint-disable-next-line @typescript-eslint/no-empty-interface
export interface PutAgentReassignResponse {}
export interface PostAgentReassignRequest {
params: {
agentId: string;
@ -217,8 +205,6 @@ export interface GetAgentStatusRequest {
export interface GetAgentStatusResponse {
results: {
events: number;
// deprecated
total: number;
online: number;
error: number;
offline: number;

View file

@ -238,8 +238,8 @@ export const CreatePackagePolicySinglePage: CreatePackagePolicyParams = ({
let count = 0;
for (const policyId of agentPolicyIds) {
const { data } = await sendGetAgentStatus({ policyId });
if (data?.results.total) {
count += data.results.total;
if (data?.results.active) {
count += data.results.active;
}
}
setAgentCount(count);

View file

@ -150,8 +150,8 @@ export const SettingsView = memo<{ agentPolicy: AgentPolicy }>(
if (isFleetEnabled) {
setIsLoading(true);
const { data } = await sendGetAgentStatus({ policyId: agentPolicy.id });
if (data?.results.total) {
setAgentCount(data.results.total);
if (data?.results.active) {
setAgentCount(data.results.active);
} else {
await submitUpdateAgentPolicy();
}

View file

@ -166,8 +166,8 @@ export const EditPackagePolicyForm = memo<{
let count = 0;
for (const id of packagePolicy.policy_ids) {
const { data } = await sendGetAgentStatus({ policyId: id });
if (data?.results.total) {
count += data.results.total;
if (data?.results.active) {
count += data.results.active;
}
}
setAgentCount(count);

View file

@ -5,7 +5,7 @@
* 2.0.
*/
import { uniq } from 'lodash';
import { omit, uniq } from 'lodash';
import { type RequestHandler, SavedObjectsErrorHelpers } from '@kbn/core/server';
import type { TypeOf } from '@kbn/config-schema';
@ -13,7 +13,6 @@ import type {
GetAgentsResponse,
GetOneAgentResponse,
GetAgentStatusResponse,
PutAgentReassignResponse,
GetAgentTagsResponse,
GetAvailableVersionsResponse,
GetActionStatusResponse,
@ -30,7 +29,6 @@ import type {
DeleteAgentRequestSchema,
GetAgentStatusRequestSchema,
GetAgentDataRequestSchema,
PutAgentReassignRequestSchemaDeprecated,
PostAgentReassignRequestSchema,
PostBulkAgentReassignRequestSchema,
PostBulkUpdateAgentTagsRequestSchema,
@ -207,7 +205,6 @@ export const getAgentsHandler: FleetRequestHandler<
}
const body: GetAgentsResponse = {
list: agents, // deprecated
items: agents,
total,
page,
@ -243,29 +240,6 @@ export const getAgentTagsHandler: RequestHandler<
}
};
export const putAgentsReassignHandlerDeprecated: RequestHandler<
TypeOf<typeof PutAgentReassignRequestSchemaDeprecated.params>,
undefined,
TypeOf<typeof PutAgentReassignRequestSchemaDeprecated.body>
> = async (context, request, response) => {
const coreContext = await context.core;
const soClient = coreContext.savedObjects.client;
const esClient = coreContext.elasticsearch.client.asInternalUser;
try {
await AgentService.reassignAgent(
soClient,
esClient,
request.params.agentId,
request.body.policy_id
);
const body: PutAgentReassignResponse = {};
return response.ok({ body });
} catch (error) {
return defaultFleetErrorHandler({ error, response });
}
};
export const postAgentReassignHandler: RequestHandler<
TypeOf<typeof PostAgentReassignRequestSchema.params>,
undefined,
@ -341,7 +315,7 @@ export const getAgentStatusForAgentPolicyHandler: FleetRequestHandler<
parsePolicyIds(request.query.policyIds)
);
const body: GetAgentStatusResponse = { results };
const body: GetAgentStatusResponse = { results: omit(results, 'total') };
return response.ok({ body });
} catch (error) {

View file

@ -222,7 +222,6 @@ describe('schema validation', () => {
it('list agents should return valid response', async () => {
const expectedResponse: GetAgentsResponse = {
items: [agent],
list: [agent],
total: 1,
page: 1,
perPage: 1,
@ -366,7 +365,6 @@ describe('schema validation', () => {
const expectedResponse: GetAgentStatusResponse = {
results: {
events: 1,
total: 1,
online: 1,
error: 1,
offline: 1,

View file

@ -23,7 +23,6 @@ import {
GetAgentStatusRequestSchema,
GetAgentDataRequestSchema,
PostNewAgentActionRequestSchema,
PutAgentReassignRequestSchemaDeprecated,
PostAgentReassignRequestSchema,
PostBulkAgentReassignRequestSchema,
PostAgentUpgradeRequestSchema,
@ -68,7 +67,6 @@ import {
updateAgentHandler,
deleteAgentHandler,
getAgentStatusForAgentPolicyHandler,
putAgentsReassignHandlerDeprecated,
postBulkAgentReassignHandler,
getAgentDataHandler,
bulkUpdateAgentTagsHandler,
@ -391,23 +389,6 @@ export const registerAPIRoutes = (router: FleetAuthzRouter, config: FleetConfigT
postAgentUnenrollHandler
);
router.versioned
.put({
path: AGENT_API_ROUTES.REASSIGN_PATTERN,
fleetAuthz: {
fleet: { allAgents: true },
},
// @ts-expect-error TODO(https://github.com/elastic/kibana/issues/196095): Replace {RouteDeprecationInfo}
deprecated: true,
})
.addVersion(
{
version: API_VERSIONS.public.v1,
validate: { request: PutAgentReassignRequestSchemaDeprecated },
},
putAgentsReassignHandlerDeprecated
);
router.versioned
.post({
path: AGENT_API_ROUTES.REASSIGN_PATTERN,
@ -613,22 +594,6 @@ export const registerAPIRoutes = (router: FleetAuthzRouter, config: FleetConfigT
},
getAgentStatusForAgentPolicyHandler
);
router.versioned
.get({
path: AGENT_API_ROUTES.STATUS_PATTERN_DEPRECATED,
fleetAuthz: {
fleet: { readAgents: true },
},
// @ts-expect-error TODO(https://github.com/elastic/kibana/issues/196095): Replace {RouteDeprecationInfo}
deprecated: true,
})
.addVersion(
{
version: API_VERSIONS.public.v1,
validate: { request: GetAgentStatusRequestSchema },
},
getAgentStatusForAgentPolicyHandler
);
// Agent data
router.versioned
.get({

View file

@ -285,22 +285,4 @@ export const registerRoutes = (router: FleetAuthzRouter, config: FleetConfigType
},
generateServiceTokenHandler
);
router.versioned
.post({
path: APP_API_ROUTES.GENERATE_SERVICE_TOKEN_PATTERN_DEPRECATED,
fleetAuthz: {
fleet: { allAgents: true },
},
description: `Create a service token`,
// @ts-expect-error TODO(https://github.com/elastic/kibana/issues/196095): Replace {RouteDeprecationInfo}
deprecated: true,
})
.addVersion(
{
version: API_VERSIONS.public.v1,
validate: {},
},
generateServiceTokenHandler
);
};

View file

@ -217,11 +217,6 @@ export const AgentResponseSchema = schema.object({
});
export const GetAgentsResponseSchema = ListResponseSchema(AgentResponseSchema).extends({
list: schema.maybe(
schema.arrayOf(AgentResponseSchema, {
meta: { deprecated: true },
})
),
statusSummary: schema.maybe(schema.recordOf(AgentStatusSchema, schema.number())),
});
@ -377,15 +372,6 @@ export const PostBulkAgentUpgradeRequestSchema = {
}),
};
export const PutAgentReassignRequestSchemaDeprecated = {
params: schema.object({
agentId: schema.string(),
}),
body: schema.object({
policy_id: schema.string(),
}),
};
export const PostAgentReassignRequestSchema = {
params: schema.object({
agentId: schema.string(),
@ -518,9 +504,6 @@ export const GetAgentStatusRequestSchema = {
return validationObj?.error;
}
},
meta: {
deprecated: true,
},
})
),
}),
@ -529,11 +512,6 @@ export const GetAgentStatusRequestSchema = {
export const GetAgentStatusResponseSchema = schema.object({
results: schema.object({
events: schema.number(),
total: schema.number({
meta: {
deprecated: true,
},
}),
online: schema.number(),
error: schema.number(),
offline: schema.number(),

View file

@ -59,7 +59,7 @@ export const getAgentPoliciesRoute = (router: IRouter, osqueryContext: OsqueryAp
(agentPolicy: GetAgentPoliciesResponseItem) =>
agentService?.asInternalUser
.getAgentStatusForAgentPolicy(agentPolicy.id)
.then(({ total: agentTotal }) => (agentPolicy.agents = agentTotal)),
.then(({ active: agentTotal }) => (agentPolicy.agents = agentTotal)),
{ concurrency: 10 }
);
}

View file

@ -22,7 +22,7 @@ import {
} from '@kbn/fleet-plugin/common';
import type {
GetOneAgentResponse,
PutAgentReassignResponse,
PostAgentReassignResponse,
UpdateAgentPolicyResponse,
} from '@kbn/fleet-plugin/common/types';
import { uninstallTokensRouteService } from '@kbn/fleet-plugin/common/services/routes';
@ -56,10 +56,10 @@ export const getAgentByHostName = (hostname: string): Cypress.Chainable<Agent> =
export const reassignAgentPolicy = (
agentId: string,
agentPolicyId: string
): Cypress.Chainable<Cypress.Response<PutAgentReassignResponse>> =>
request<PutAgentReassignResponse>({
): Cypress.Chainable<Cypress.Response<PostAgentReassignResponse>> =>
request<PostAgentReassignResponse>({
url: agentRouteService.getReassignPath(agentId),
method: 'PUT',
method: 'POST',
body: {
policy_id: agentPolicyId,
},

View file

@ -124,7 +124,7 @@ describe('Policy Details', () => {
if (path === `${AGENT_API_ROUTES.STATUS_PATTERN}`) {
asyncActions = asyncActions.then(async () => sleep());
return Promise.resolve({
results: { events: 0, total: 5, online: 3, error: 1, offline: 1 },
results: { events: 0, active: 5, online: 3, error: 1, offline: 1 },
success: true,
});
}

View file

@ -60,7 +60,7 @@ export const PolicyDetails = React.memo(() => {
const headerRightContent = (
<AgentsSummary
total={policyAgentStatusSummary?.total ?? 0}
total={policyAgentStatusSummary?.active ?? 0}
online={policyAgentStatusSummary?.online ?? 0}
offline={policyAgentStatusSummary?.offline ?? 0}
error={policyAgentStatusSummary?.error ?? 0}

View file

@ -47,20 +47,20 @@ export default function ({ getService }: FtrProviderContext) {
it('should return the list of agents when requesting as admin', async () => {
const { body: apiResponse } = await supertest.get(`/api/fleet/agents`).expect(200);
expect(apiResponse).to.have.keys('page', 'total', 'items', 'list');
expect(apiResponse).to.have.keys('page', 'total', 'items');
expect(apiResponse.total).to.eql(4);
});
it('should return 200 if the passed kuery is valid', async () => {
await supertest
.get(`/api/fleet/agent_status?kuery=fleet-agents.local_metadata.host.hostname:test`)
.get(`/api/fleet/agents?kuery=fleet-agents.local_metadata.host.hostname:test`)
.set('kbn-xsrf', 'xxxx')
.expect(200);
});
it('should return 200 also if the passed kuery does not have prefix fleet-agents', async () => {
await supertest
.get(`/api/fleet/agent_status?kuery=local_metadata.host.hostname:test`)
.get(`/api/fleet/agents?kuery=local_metadata.host.hostname:test`)
.set('kbn-xsrf', 'xxxx')
.expect(200);
});
@ -181,7 +181,7 @@ export default function ({ getService }: FtrProviderContext) {
.get(`/api/fleet/agents?withMetrics=true`)
.expect(200);
expect(apiResponse).to.have.keys('page', 'total', 'items', 'list');
expect(apiResponse).to.have.keys('page', 'total', 'items');
expect(apiResponse.total).to.eql(4);
const agent1: Agent = apiResponse.items.find((agent: any) => agent.id === 'agent1');

View file

@ -262,7 +262,7 @@ export default function (providerContext: FtrProviderContext) {
},
{
method: 'GET',
path: '/api/fleet/agent-status',
path: '/api/fleet/agent_status',
scenarios: READ_SCENARIOS,
},
{

View file

@ -217,7 +217,6 @@ export default function ({ getService }: FtrProviderContext) {
results: {
events: 0,
other: 0,
total: 8,
online: 2,
active: 8,
all: 11,
@ -230,10 +229,6 @@ export default function ({ getService }: FtrProviderContext) {
});
});
it('should work with deprecated api', async () => {
await supertest.get(`/api/fleet/agent-status`).set('kbn-xsrf', 'xxxx').expect(200);
});
it('should work with adequate package privileges', async () => {
await superTestWithoutAuth
.get(`/api/fleet/agent_status`)
@ -296,7 +291,6 @@ export default function ({ getService }: FtrProviderContext) {
results: {
events: 0,
other: 0,
total: 10,
online: 3,
active: 10,
all: 11,

View file

@ -170,7 +170,7 @@ export default function (providerContext: FtrProviderContext) {
it('should not update tags of hosted agent', async () => {
// move agent2 to policy2 to keep it regular
await supertest.put(`/api/fleet/agents/agent2/reassign`).set('kbn-xsrf', 'xxx').send({
await supertest.post(`/api/fleet/agents/agent2/reassign`).set('kbn-xsrf', 'xxx').send({
policy_id: 'policy2',
});
// update enrolled policy to hosted

View file

@ -1525,7 +1525,7 @@ export default function (providerContext: FtrProviderContext) {
it('enrolled in a hosted agent policy bulk upgrade should respond with 200 and object of results. Should not update the hosted agent SOs', async () => {
// move agent2 to policy2 to keep it regular
await supertest.put(`/api/fleet/agents/agent2/reassign`).set('kbn-xsrf', 'xxx').send({
await supertest.post(`/api/fleet/agents/agent2/reassign`).set('kbn-xsrf', 'xxx').send({
policy_id: 'policy2',
});
// update enrolled policy to hosted

View file

@ -137,7 +137,7 @@ export default function (providerContext: FtrProviderContext) {
.set('kbn-xsrf', 'xxxx')
.expect(200);
if (apiResponse.list.length === expectedAgentCount) {
if (apiResponse.items.length === expectedAgentCount) {
return apiResponse;
}

View file

@ -45,10 +45,6 @@ export default function (providerContext: FtrProviderContext) {
});
});
it('should work with deprecated api', async () => {
await supertest.post(`/api/fleet/service-tokens`).set('kbn-xsrf', 'xxxx').expect(200);
});
it('should create a valid remote service account token', async () => {
const { body: apiResponse } = await supertest
.post(`/api/fleet/service_tokens`)