From abeb16c087e563880736394be8d0c288becff8f8 Mon Sep 17 00:00:00 2001 From: Konstantin Sykulev Date: Thu, 12 Dec 2024 13:55:49 -0600 Subject: [PATCH] Updated deprecated endpoint references with new endpoint (#24723) [#23880](https://github.com/fleetdm/fleet/issues/23880) --------- Co-authored-by: Rachael Shaw --- docs/Contributing/API-for-contributors.md | 37 +++++++++++++++++++++-- 1 file changed, 35 insertions(+), 2 deletions(-) diff --git a/docs/Contributing/API-for-contributors.md b/docs/Contributing/API-for-contributors.md index cb8a4e8bf7..c26b57428e 100644 --- a/docs/Contributing/API-for-contributors.md +++ b/docs/Contributing/API-for-contributors.md @@ -2410,7 +2410,7 @@ One of `query` and `query_id` must be specified. #### Example with one host targeted by hostname -`POST /api/v1/fleet/queries/run_by_names` +`POST /api/v1/fleet/queries/run_by_identifiers` ##### Request body @@ -2449,7 +2449,7 @@ One of `query` and `query_id` must be specified. #### Example with multiple hosts targeted by label name -`POST /api/v1/fleet/queries/run_by_names` +`POST /api/v1/fleet/queries/run_by_identifiers` ##### Request body @@ -2486,6 +2486,39 @@ One of `query` and `query_id` must be specified. } ``` +#### Example with invalid label + +`POST /api/v1/fleet/queries/run_by_identifiers` + +##### Request body + +```json +{ + "query": "SELECT instance_id FROM system_info", + "selected": { + "labels": ["Windows", "Banana", "Apple"] + } +} +``` + +##### Default response + +`Status: 400` + +```json +{ + "message": "Bad request", + "errors": [ + { + "name": "base", + "reason": "Invalid label name(s): Banana, Apple." + } + ], + "uuid": "303649f4-5e45-4379-bae9-64ec0ef56287" +} +``` + + ### Retrieve live query results (standard WebSocket API) You can retrieve the results of a live query using the [standard WebSocket API](#https://developer.mozilla.org/en-US/docs/Web/API/WebSockets_API/Writing_WebSocket_client_applications).