GET /api/apm/settings/agent-configuration/environments

Spaces method and path for this operation:

get /s/{space_id}/api/apm/settings/agent-configuration/environments

Refer to Spaces for more information.

Retrieve the available environments for a given service, to be used in agent configuration. You must have read privileges for the APM and User Experience feature in Kibana. If serviceName is omitted, environments across all services are returned.

Headers

  • elastic-api-version string Required

    The version of the API to use

    Value is 2023-10-31. Default value is 2023-10-31.

Query parameters

  • serviceName string

    The name of the service. If omitted, environments across all services are returned.

Responses

  • 200 application/json

    Successful response

    Hide response attribute Show response attribute object
    • environments array[object]

      Service environment list

      Hide environments attributes Show environments attributes object
      • alreadyConfigured boolean

        Already configured

      • name string

        Service environment name

  • 400 application/json

    Bad Request response

    Hide response attributes Show response attributes object
    • error string

      Error type

    • message string

      Error message

    • statusCode number

      Error status code

  • 401 application/json

    Unauthorized response

    Hide response attributes Show response attributes object
    • error string

      Error type

    • message string

      Error message

    • statusCode number

      Error status code

  • 404 application/json

    Not found response

    Hide response attributes Show response attributes object
    • error string

      Error type

    • message string

      Error message

    • statusCode number

      Error status code

GET /api/apm/settings/agent-configuration/environments
curl \
 --request GET 'https://<KIBANA_URL>/api/apm/settings/agent-configuration/environments' \
 --header "Authorization: $API_KEY" \
 --header "elastic-api-version: 2023-10-31"
Response examples (200)
An example of a successful response from `GET /api/apm/settings/agent-configuration/environments`.
{
  "environments": [
    {
      "alreadyConfigured": true,
      "name": "production"
    },
    {
      "alreadyConfigured": false,
      "name": "development"
    },
    {
      "alreadyConfigured": false,
      "name": "ALL_OPTION_VALUE"
    }
  ]
}
Response examples (400)
An example of a 400 Bad Request response, returned when the request payload or query parameters fail validation.
{
  "error": "Bad Request",
  "message": "[request body]: expected value of type [string] but got [undefined]",
  "statusCode": 400
}
Response examples (401)
An example of a 401 Unauthorized response, returned when the request is missing valid authentication credentials.
{
  "error": "Unauthorized",
  "message": "[security_exception]: missing authentication credentials for REST request",
  "statusCode": 401
}
Response examples (404)
An example of a 404 Not Found response, returned when the requested resource does not exist or the feature is not available on the current deployment.
{
  "error": "Not Found",
  "message": "Not Found",
  "statusCode": 404
}