mirror of
https://github.com/elastic/kibana.git
synced 2025-06-28 19:13:14 -04:00
128 lines
No EOL
3.5 KiB
Text
128 lines
No EOL
3.5 KiB
Text
[[get-parameters-api]]
|
|
== Get Parameters API
|
|
++++
|
|
<titleabbrev>Get Parameters</titleabbrev>
|
|
++++
|
|
|
|
Retrieves parameters based on the provided criteria.
|
|
|
|
=== {api-request-title}
|
|
|
|
`GET <kibana host>:<port>/api/synthetics/params/{id?}`
|
|
|
|
`GET <kibana host>:<port>/s/<space_id>/api/synthetics/params/{id?}`
|
|
|
|
=== {api-prereq-title}
|
|
|
|
You must have `read` privileges for the *Synthetics* feature in the *{observability}* section of the
|
|
<<kibana-feature-privileges,{kib} feature privileges>>.
|
|
|
|
[[parameters-get-query-params]]
|
|
==== Query Parameters
|
|
|
|
`id`::
|
|
(Optional, string) The unique identifier of the parameter. If provided, this API will retrieve a specific parameter by its ID. If not provided, it will retrieve a list of all parameters.
|
|
|
|
[[parameters-get-response-example]]
|
|
==== Response Example
|
|
|
|
The API response includes parameter(s) as JSON objects, where each parameter object has the following attributes:
|
|
|
|
- `id` (string): The unique identifier of the parameter.
|
|
- `key` (string): The key of the parameter.
|
|
|
|
If the user has read-only permissions to the Synthetics app, the following additional attributes will be included:
|
|
|
|
- `description` (string, optional): The description of the parameter.
|
|
- `tags` (array of strings, optional): An array of tags associated with the parameter.
|
|
- `namespaces` (array of strings): Namespaces associated with the parameter.
|
|
|
|
If the user has write permissions, the following additional attribute will be included:
|
|
|
|
- `value` (string): The value associated with the parameter.
|
|
|
|
|
|
Here's an example request for retrieving a single parameter by its ID:
|
|
|
|
[source,sh]
|
|
--------------------------------------------------
|
|
GET /api/synthetics/params/unique-parameter-id
|
|
--------------------------------------------------
|
|
|
|
|
|
Here's an example response for retrieving a single parameter by its ID:
|
|
|
|
For users with read-only permissions:
|
|
|
|
[source,json]
|
|
--------------------------------------------------
|
|
{
|
|
"id": "unique-parameter-id",
|
|
"key": "your-api-key",
|
|
"description": "Param to use in browser monitor",
|
|
"tags": ["authentication", "security"],
|
|
"namespaces": ["namespace1", "namespace2"]
|
|
}
|
|
--------------------------------------------------
|
|
|
|
For users with write permissions:
|
|
|
|
[source,json]
|
|
--------------------------------------------------
|
|
{
|
|
"id": "unique-parameter-id",
|
|
"key": "your-param-key",
|
|
"description": "Param to use in browser monitor",
|
|
"tags": ["authentication", "security"],
|
|
"namespaces": ["namespace1", "namespace2"],
|
|
"value": "your-param-value"
|
|
}
|
|
--------------------------------------------------
|
|
|
|
And here's an example response for retrieving a list of parameters:
|
|
|
|
For users with read-only permissions:
|
|
|
|
[source,json]
|
|
--------------------------------------------------
|
|
[
|
|
{
|
|
"id": "param1-id",
|
|
"key": "param1",
|
|
"description": "Description for param1",
|
|
"tags": ["tag1", "tag2"],
|
|
"namespaces": ["namespace1"]
|
|
},
|
|
{
|
|
"id": "param2-id",
|
|
"key": "param2",
|
|
"description": "Description for param2",
|
|
"tags": ["tag3"],
|
|
"namespaces": ["namespace2"]
|
|
}
|
|
]
|
|
--------------------------------------------------
|
|
|
|
For users with write permissions:
|
|
|
|
[source,json]
|
|
--------------------------------------------------
|
|
[
|
|
{
|
|
"id": "param1-id",
|
|
"key": "param1",
|
|
"description": "Description for param1",
|
|
"tags": ["tag1", "tag2"],
|
|
"namespaces": ["namespace1"],
|
|
"value": "value1"
|
|
},
|
|
{
|
|
"id": "param2-id",
|
|
"key": "param2",
|
|
"description": "Description for param2",
|
|
"tags": ["tag3"],
|
|
"namespaces": ["namespace2"],
|
|
"value": "value2"
|
|
}
|
|
]
|
|
-------------------------------------------------- |