diff --git a/oas_docs/bundle.json b/oas_docs/bundle.json index 1bf61ba293cb7..fd2a7bbe22de0 100644 --- a/oas_docs/bundle.json +++ b/oas_docs/bundle.json @@ -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", diff --git a/oas_docs/bundle.serverless.json b/oas_docs/bundle.serverless.json index fedad1196676d..f171dadde991a 100644 --- a/oas_docs/bundle.serverless.json +++ b/oas_docs/bundle.serverless.json @@ -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", diff --git a/oas_docs/output/kibana.serverless.yaml b/oas_docs/output/kibana.serverless.yaml index 1e7b41ea2c1af..afb7d8bbd5f4d 100644 --- a/oas_docs/output/kibana.serverless.yaml +++ b/oas_docs/output/kibana.serverless.yaml @@ -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 diff --git a/oas_docs/output/kibana.yaml b/oas_docs/output/kibana.yaml index 237974a87bbb2..5bbc65ad80bc4 100644 --- a/oas_docs/output/kibana.yaml +++ b/oas_docs/output/kibana.yaml @@ -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 diff --git a/x-pack/plugins/cloud_defend/server/routes/policies/policies.ts b/x-pack/plugins/cloud_defend/server/routes/policies/policies.ts index 71d7f17ca612e..ad40dcf3b693f 100644 --- a/x-pack/plugins/cloud_defend/server/routes/policies/policies.ts +++ b/x-pack/plugins/cloud_defend/server/routes/policies/policies.ts @@ -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, diff --git a/x-pack/plugins/cloud_security_posture/server/routes/benchmarks/v1.ts b/x-pack/plugins/cloud_security_posture/server/routes/benchmarks/v1.ts index 611a58436e995..c52b57d057c38 100644 --- a/x-pack/plugins/cloud_security_posture/server/routes/benchmarks/v1.ts +++ b/x-pack/plugins/cloud_security_posture/server/routes/benchmarks/v1.ts @@ -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, diff --git a/x-pack/plugins/fleet/common/constants/routes.ts b/x-pack/plugins/fleet/common/constants/routes.ts index c071c6feecbf8..61d50d0f9e073 100644 --- a/x-pack/plugins/fleet/common/constants/routes.ts +++ b/x-pack/plugins/fleet/common/constants/routes.ts @@ -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`, diff --git a/x-pack/plugins/fleet/common/types/rest_spec/agent.ts b/x-pack/plugins/fleet/common/types/rest_spec/agent.ts index bb69346bbdce4..b990e5367bb42 100644 --- a/x-pack/plugins/fleet/common/types/rest_spec/agent.ts +++ b/x-pack/plugins/fleet/common/types/rest_spec/agent.ts @@ -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 { - // deprecated in 8.x - list?: Agent[]; statusSummary?: Record; } @@ -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; diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/single_page_layout/index.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/single_page_layout/index.tsx index 24f8fa8a04fe5..93631f63d0e04 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/single_page_layout/index.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/single_page_layout/index.tsx @@ -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); diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/details_page/components/settings/index.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/details_page/components/settings/index.tsx index 91cd710db4343..9de7a3f22adff 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/details_page/components/settings/index.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/details_page/components/settings/index.tsx @@ -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(); } diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/edit_package_policy_page/index.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/edit_package_policy_page/index.tsx index 6157f09968680..9522d02756887 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/edit_package_policy_page/index.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/edit_package_policy_page/index.tsx @@ -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); diff --git a/x-pack/plugins/fleet/server/routes/agent/handlers.ts b/x-pack/plugins/fleet/server/routes/agent/handlers.ts index 4f4b5592f2d04..76d0fefe90fde 100644 --- a/x-pack/plugins/fleet/server/routes/agent/handlers.ts +++ b/x-pack/plugins/fleet/server/routes/agent/handlers.ts @@ -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, - undefined, - TypeOf -> = 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, 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) { diff --git a/x-pack/plugins/fleet/server/routes/agent/index.test.ts b/x-pack/plugins/fleet/server/routes/agent/index.test.ts index 7f210028ff742..34f66da425da3 100644 --- a/x-pack/plugins/fleet/server/routes/agent/index.test.ts +++ b/x-pack/plugins/fleet/server/routes/agent/index.test.ts @@ -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, diff --git a/x-pack/plugins/fleet/server/routes/agent/index.ts b/x-pack/plugins/fleet/server/routes/agent/index.ts index fc45869dc1219..1c40f36a7e481 100644 --- a/x-pack/plugins/fleet/server/routes/agent/index.ts +++ b/x-pack/plugins/fleet/server/routes/agent/index.ts @@ -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({ diff --git a/x-pack/plugins/fleet/server/routes/app/index.ts b/x-pack/plugins/fleet/server/routes/app/index.ts index c0b7dbcfa1743..e66f9f02a687b 100644 --- a/x-pack/plugins/fleet/server/routes/app/index.ts +++ b/x-pack/plugins/fleet/server/routes/app/index.ts @@ -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 - ); }; diff --git a/x-pack/plugins/fleet/server/types/rest_spec/agent.ts b/x-pack/plugins/fleet/server/types/rest_spec/agent.ts index c1dface818f28..f9db02b92a659 100644 --- a/x-pack/plugins/fleet/server/types/rest_spec/agent.ts +++ b/x-pack/plugins/fleet/server/types/rest_spec/agent.ts @@ -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(), diff --git a/x-pack/plugins/osquery/server/routes/fleet_wrapper/get_agent_policies.ts b/x-pack/plugins/osquery/server/routes/fleet_wrapper/get_agent_policies.ts index 9e84410712506..64b10f0a8248e 100644 --- a/x-pack/plugins/osquery/server/routes/fleet_wrapper/get_agent_policies.ts +++ b/x-pack/plugins/osquery/server/routes/fleet_wrapper/get_agent_policies.ts @@ -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 } ); } diff --git a/x-pack/plugins/security_solution/public/management/cypress/tasks/fleet.ts b/x-pack/plugins/security_solution/public/management/cypress/tasks/fleet.ts index e122eebedfc33..5372b46e11f9e 100644 --- a/x-pack/plugins/security_solution/public/management/cypress/tasks/fleet.ts +++ b/x-pack/plugins/security_solution/public/management/cypress/tasks/fleet.ts @@ -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 = export const reassignAgentPolicy = ( agentId: string, agentPolicyId: string -): Cypress.Chainable> => - request({ +): Cypress.Chainable> => + request({ url: agentRouteService.getReassignPath(agentId), - method: 'PUT', + method: 'POST', body: { policy_id: agentPolicyId, }, diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_details.test.tsx b/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_details.test.tsx index ffcee81a3cb8f..75e932d5385fd 100644 --- a/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_details.test.tsx +++ b/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_details.test.tsx @@ -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, }); } diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_details.tsx b/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_details.tsx index 7f72a8d475134..13f18d071d543 100644 --- a/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_details.tsx +++ b/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_details.tsx @@ -60,7 +60,7 @@ export const PolicyDetails = React.memo(() => { const headerRightContent = ( { 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'); diff --git a/x-pack/test/fleet_api_integration/apis/agents/privileges.ts b/x-pack/test/fleet_api_integration/apis/agents/privileges.ts index 9bbb2d1091dab..0b503e28cf136 100644 --- a/x-pack/test/fleet_api_integration/apis/agents/privileges.ts +++ b/x-pack/test/fleet_api_integration/apis/agents/privileges.ts @@ -262,7 +262,7 @@ export default function (providerContext: FtrProviderContext) { }, { method: 'GET', - path: '/api/fleet/agent-status', + path: '/api/fleet/agent_status', scenarios: READ_SCENARIOS, }, { diff --git a/x-pack/test/fleet_api_integration/apis/agents/status.ts b/x-pack/test/fleet_api_integration/apis/agents/status.ts index 7c1134d055bc8..42b60a0624a96 100644 --- a/x-pack/test/fleet_api_integration/apis/agents/status.ts +++ b/x-pack/test/fleet_api_integration/apis/agents/status.ts @@ -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, diff --git a/x-pack/test/fleet_api_integration/apis/agents/update_agent_tags.ts b/x-pack/test/fleet_api_integration/apis/agents/update_agent_tags.ts index 497e82ea6abc4..3a11fc4398aed 100644 --- a/x-pack/test/fleet_api_integration/apis/agents/update_agent_tags.ts +++ b/x-pack/test/fleet_api_integration/apis/agents/update_agent_tags.ts @@ -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 diff --git a/x-pack/test/fleet_api_integration/apis/agents/upgrade.ts b/x-pack/test/fleet_api_integration/apis/agents/upgrade.ts index 33e85b2389b55..621c5843d5dc3 100644 --- a/x-pack/test/fleet_api_integration/apis/agents/upgrade.ts +++ b/x-pack/test/fleet_api_integration/apis/agents/upgrade.ts @@ -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 diff --git a/x-pack/test/fleet_api_integration/apis/fleet_telemetry.ts b/x-pack/test/fleet_api_integration/apis/fleet_telemetry.ts index 6650105775c0f..474d777fcd906 100644 --- a/x-pack/test/fleet_api_integration/apis/fleet_telemetry.ts +++ b/x-pack/test/fleet_api_integration/apis/fleet_telemetry.ts @@ -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; } diff --git a/x-pack/test/fleet_api_integration/apis/service_tokens.ts b/x-pack/test/fleet_api_integration/apis/service_tokens.ts index 13fb8545fd80d..7737f2ad7c261 100644 --- a/x-pack/test/fleet_api_integration/apis/service_tokens.ts +++ b/x-pack/test/fleet_api_integration/apis/service_tokens.ts @@ -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`)