[Synthetics] Edit private locations labels and tags in Synthetics (#221515)

This PR closes #221508.



https://github.com/user-attachments/assets/0b57487a-7188-4722-99dc-5cb44c15f129

- Added a new API endpoint to edit the label of private locations.
- When a label is updated, all monitors deployed in that location are
automatically updated to reflect the change.
- The UI now allows users to edit only the label of a private location.
- Added comprehensive API tests to cover the new functionality.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
Francesco Fagnani 2025-06-20 09:57:13 +02:00 committed by GitHub
parent b759ebba3d
commit b1b8fb0a88
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
37 changed files with 994 additions and 111 deletions

View file

@ -56759,6 +56759,69 @@ paths:
summary: Get a private location
tags:
- synthetics
put:
description: |
Update an existing private location's label.
You must have `all` privileges for the Synthetics and Uptime feature in the Observability section of the Kibana feature privileges.
When a private location's label is updated, all monitors using this location will also be updated to maintain data consistency.
operationId: put-private-location
parameters:
- description: The unique identifier of the private location to be updated.
in: path
name: id
required: true
schema:
type: string
requestBody:
content:
application/json:
examples:
putPrivateLocationRequestExample1:
description: Update a private location's label.
value: |-
{
"label": "Updated Private Location Name"
}
schema:
type: object
properties:
label:
description: A new label for the private location. Must be at least 1 character long.
minLength: 1
type: string
required:
- label
required: true
responses:
'200':
content:
application/json:
examples:
putPrivateLocationResponseExample1:
value: |-
{
"label": "Updated Private Location Name",
"id": "test-private-location-id",
"agentPolicyId": "test-private-location-id",
"isServiceManaged": false,
"isInvalid": false,
"tags": ["private", "testing", "updated"],
"geo": {
"lat": 37.7749,
"lon": -122.4194
},
"spaces": ["*"]
}
schema:
$ref: '#/components/schemas/Synthetics_getPrivateLocation'
description: A successful response.
'400':
description: If the `label` is shorter than 1 character the API will return a 400 Bad Request response with a corresponding error message.
'404':
description: If the private location with the specified ID does not exist, the API will return a 404 Not Found response.
summary: Update a private location
tags:
- synthetics
/api/task_manager/_health:
get:
description: |