From e0838147bddeee43edbcb83ced8d0346f917047c Mon Sep 17 00:00:00 2001 From: Milosz Marcinkowski <38698566+miloszmarcinkowski@users.noreply.github.com> Date: Thu, 31 Oct 2024 14:59:19 +0100 Subject: [PATCH] OpenAPI docs for APM UI APIs (#197946) ## Summary Closes #197582 This PR adds missing OpenAPI specification for APM UI APIs. Documentation specs have been divided into files per path. See [readme](https://github.com/elastic/kibana/blob/88e55f92f91e04112e831023e163e4990018de52/x-pack/plugins/observability_solution/apm/docs/openapi/apm/README.md) for specific information. --- oas_docs/output/kibana.serverless.yaml | 1167 ++++++++++- oas_docs/output/kibana.yaml | 1167 ++++++++++- oas_docs/scripts/merge_ess_oas.js | 2 +- oas_docs/scripts/merge_serverless_oas.js | 2 +- .../apm/docs/openapi/apm.yaml | 186 -- .../apm/docs/openapi/apm/README.md | 26 +- .../apm/docs/openapi/apm/bundled.json | 1827 +++++++++++++++++ .../apm/docs/openapi/apm/bundled.yaml | 1162 +++++++++++ .../apm/docs/openapi/apm/components/README.md | 7 + .../headers/elastic_api_version.yaml | 9 + .../apm/components/headers/kbn_xsrf.yaml | 7 + .../apm/components/schemas/400_response.yaml | 14 + .../apm/components/schemas/401_response.yaml | 13 + .../apm/components/schemas/403_response.yaml | 13 + .../apm/components/schemas/404_response.yaml | 14 + .../apm/components/schemas/500_response.yaml | 13 + .../apm/components/schemas/501_response.yaml | 14 + .../agent_configuration_intake_object.yaml | 12 + .../schemas/agent_configuration_object.yaml | 27 + .../agent_configurations_response.yaml | 7 + .../components/schemas/agent_keys_object.yaml | 16 + .../schemas/agent_keys_response.yaml | 22 + .../schemas/annotation_search_response.yaml | 18 + .../schemas/base_source_map_object.yaml | 38 + .../schemas/create_annotation_object.yaml | 26 + .../schemas/create_annotation_response.yaml | 41 + .../delete_agent_configurations_response.yaml | 5 + .../search_agent_configuration_object.yaml | 15 + .../search_agent_configuration_response.yaml | 13 + .../schemas/service_agent_name_response.yaml | 6 + .../schemas/service_environment_object.yaml | 9 + .../service_environments_response.yaml | 7 + .../components/schemas/service_object.yaml | 11 + .../components/schemas/settings_object.yaml | 4 + .../single_agent_configuration_response.yaml | 8 + .../schemas/source_maps_response.yaml | 38 + .../schemas/upload_source_map_object.yaml | 22 + .../schemas/upload_source_maps_response.yaml | 6 + .../apm/docs/openapi/apm/entrypoint.yaml | 42 + .../apm/docs/openapi/apm/paths/README.md | 10 + .../openapi/apm/paths/api@apm@agent_keys.yaml | 46 + .../api@apm@fleet@apm_server_schema.yaml | 53 + ...pm@services@{service_name}@annotation.yaml | 52 + ...ices@{service_name}@annotation@search.yaml | 57 + .../api@apm@settings@agent_configuration.yaml | 128 ++ ...ttings@agent_configuration@agent_name.yaml | 40 + ...ings@agent_configuration@environments.yaml | 37 + ...m@settings@agent_configuration@search.yaml | 41 + ...apm@settings@agent_configuration@view.yaml | 44 + .../openapi/apm/paths/api@apm@sourcemaps.yaml | 101 + .../apm/paths/api@apm@sourcemaps@{id}.yaml | 53 + 51 files changed, 6320 insertions(+), 378 deletions(-) delete mode 100644 x-pack/plugins/observability_solution/apm/docs/openapi/apm.yaml create mode 100644 x-pack/plugins/observability_solution/apm/docs/openapi/apm/bundled.json create mode 100644 x-pack/plugins/observability_solution/apm/docs/openapi/apm/bundled.yaml create mode 100644 x-pack/plugins/observability_solution/apm/docs/openapi/apm/components/README.md create mode 100644 x-pack/plugins/observability_solution/apm/docs/openapi/apm/components/headers/elastic_api_version.yaml create mode 100644 x-pack/plugins/observability_solution/apm/docs/openapi/apm/components/headers/kbn_xsrf.yaml create mode 100644 x-pack/plugins/observability_solution/apm/docs/openapi/apm/components/schemas/400_response.yaml create mode 100644 x-pack/plugins/observability_solution/apm/docs/openapi/apm/components/schemas/401_response.yaml create mode 100644 x-pack/plugins/observability_solution/apm/docs/openapi/apm/components/schemas/403_response.yaml create mode 100644 x-pack/plugins/observability_solution/apm/docs/openapi/apm/components/schemas/404_response.yaml create mode 100644 x-pack/plugins/observability_solution/apm/docs/openapi/apm/components/schemas/500_response.yaml create mode 100644 x-pack/plugins/observability_solution/apm/docs/openapi/apm/components/schemas/501_response.yaml create mode 100644 x-pack/plugins/observability_solution/apm/docs/openapi/apm/components/schemas/agent_configuration_intake_object.yaml create mode 100644 x-pack/plugins/observability_solution/apm/docs/openapi/apm/components/schemas/agent_configuration_object.yaml create mode 100644 x-pack/plugins/observability_solution/apm/docs/openapi/apm/components/schemas/agent_configurations_response.yaml create mode 100644 x-pack/plugins/observability_solution/apm/docs/openapi/apm/components/schemas/agent_keys_object.yaml create mode 100644 x-pack/plugins/observability_solution/apm/docs/openapi/apm/components/schemas/agent_keys_response.yaml create mode 100644 x-pack/plugins/observability_solution/apm/docs/openapi/apm/components/schemas/annotation_search_response.yaml create mode 100644 x-pack/plugins/observability_solution/apm/docs/openapi/apm/components/schemas/base_source_map_object.yaml create mode 100644 x-pack/plugins/observability_solution/apm/docs/openapi/apm/components/schemas/create_annotation_object.yaml create mode 100644 x-pack/plugins/observability_solution/apm/docs/openapi/apm/components/schemas/create_annotation_response.yaml create mode 100644 x-pack/plugins/observability_solution/apm/docs/openapi/apm/components/schemas/delete_agent_configurations_response.yaml create mode 100644 x-pack/plugins/observability_solution/apm/docs/openapi/apm/components/schemas/search_agent_configuration_object.yaml create mode 100644 x-pack/plugins/observability_solution/apm/docs/openapi/apm/components/schemas/search_agent_configuration_response.yaml create mode 100644 x-pack/plugins/observability_solution/apm/docs/openapi/apm/components/schemas/service_agent_name_response.yaml create mode 100644 x-pack/plugins/observability_solution/apm/docs/openapi/apm/components/schemas/service_environment_object.yaml create mode 100644 x-pack/plugins/observability_solution/apm/docs/openapi/apm/components/schemas/service_environments_response.yaml create mode 100644 x-pack/plugins/observability_solution/apm/docs/openapi/apm/components/schemas/service_object.yaml create mode 100644 x-pack/plugins/observability_solution/apm/docs/openapi/apm/components/schemas/settings_object.yaml create mode 100644 x-pack/plugins/observability_solution/apm/docs/openapi/apm/components/schemas/single_agent_configuration_response.yaml create mode 100644 x-pack/plugins/observability_solution/apm/docs/openapi/apm/components/schemas/source_maps_response.yaml create mode 100644 x-pack/plugins/observability_solution/apm/docs/openapi/apm/components/schemas/upload_source_map_object.yaml create mode 100644 x-pack/plugins/observability_solution/apm/docs/openapi/apm/components/schemas/upload_source_maps_response.yaml create mode 100644 x-pack/plugins/observability_solution/apm/docs/openapi/apm/entrypoint.yaml create mode 100644 x-pack/plugins/observability_solution/apm/docs/openapi/apm/paths/README.md create mode 100644 x-pack/plugins/observability_solution/apm/docs/openapi/apm/paths/api@apm@agent_keys.yaml create mode 100644 x-pack/plugins/observability_solution/apm/docs/openapi/apm/paths/api@apm@fleet@apm_server_schema.yaml create mode 100644 x-pack/plugins/observability_solution/apm/docs/openapi/apm/paths/api@apm@services@{service_name}@annotation.yaml create mode 100644 x-pack/plugins/observability_solution/apm/docs/openapi/apm/paths/api@apm@services@{service_name}@annotation@search.yaml create mode 100644 x-pack/plugins/observability_solution/apm/docs/openapi/apm/paths/api@apm@settings@agent_configuration.yaml create mode 100644 x-pack/plugins/observability_solution/apm/docs/openapi/apm/paths/api@apm@settings@agent_configuration@agent_name.yaml create mode 100644 x-pack/plugins/observability_solution/apm/docs/openapi/apm/paths/api@apm@settings@agent_configuration@environments.yaml create mode 100644 x-pack/plugins/observability_solution/apm/docs/openapi/apm/paths/api@apm@settings@agent_configuration@search.yaml create mode 100644 x-pack/plugins/observability_solution/apm/docs/openapi/apm/paths/api@apm@settings@agent_configuration@view.yaml create mode 100644 x-pack/plugins/observability_solution/apm/docs/openapi/apm/paths/api@apm@sourcemaps.yaml create mode 100644 x-pack/plugins/observability_solution/apm/docs/openapi/apm/paths/api@apm@sourcemaps@{id}.yaml diff --git a/oas_docs/output/kibana.serverless.yaml b/oas_docs/output/kibana.serverless.yaml index e88f038430235..1e7b41ea2c1af 100644 --- a/oas_docs/output/kibana.serverless.yaml +++ b/oas_docs/output/kibana.serverless.yaml @@ -4736,49 +4736,110 @@ paths: post: description: Create a new agent key for APM. operationId: createAgentKey + parameters: + - $ref: '#/components/parameters/APM_UI_elastic_api_version' + - $ref: '#/components/parameters/APM_UI_kbn_xsrf' requestBody: content: application/json; Elastic-Api-Version=2023-10-31: schema: - type: object - properties: - name: - type: string - privileges: - items: - enum: - - event:write - - config_agent:read - type: string - type: array + $ref: '#/components/schemas/APM_UI_agent_keys_object' required: true responses: '200': content: application/json; Elastic-Api-Version=2023-10-31: schema: - type: object - properties: - api_key: - type: string - encoded: - type: string - expiration: - format: int64 - type: integer - id: - type: string - name: - type: string + $ref: '#/components/schemas/APM_UI_agent_keys_response' description: Agent key created successfully + '400': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: '#/components/schemas/APM_UI_400_response' + description: Bad Request response + '401': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: '#/components/schemas/APM_UI_401_response' + description: Unauthorized response + '403': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: '#/components/schemas/APM_UI_403_response' + description: Forbidden response + '500': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: '#/components/schemas/APM_UI_500_response' + description: Internal Server Error response summary: Create an APM agent key tags: - APM agent keys + /api/apm/fleet/apm_server_schema: + post: + operationId: saveApmServerSchema + parameters: + - $ref: '#/components/parameters/APM_UI_elastic_api_version' + - $ref: '#/components/parameters/APM_UI_kbn_xsrf' + requestBody: + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + type: object + properties: + schema: + additionalProperties: true + description: Schema object + example: + foo: bar + type: object + required: true + responses: + '200': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + additionalProperties: false + type: object + description: Successful response + '400': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: '#/components/schemas/APM_UI_400_response' + description: Bad Request response + '401': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: '#/components/schemas/APM_UI_401_response' + description: Unauthorized response + '403': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: '#/components/schemas/APM_UI_403_response' + description: Forbidden response + '404': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: '#/components/schemas/APM_UI_404_response' + description: Not found response + summary: Save APM server schema + tags: + - APM server schema /api/apm/services/{serviceName}/annotation: post: description: Create a new annotation for a specific service. operationId: createAnnotation parameters: + - $ref: '#/components/parameters/APM_UI_elastic_api_version' + - $ref: '#/components/parameters/APM_UI_kbn_xsrf' - description: The name of the service in: path name: serviceName @@ -4789,63 +4850,39 @@ paths: content: application/json; Elastic-Api-Version=2023-10-31: schema: - type: object - properties: - '@timestamp': - type: string - message: - type: string - service: - type: object - properties: - environment: - type: string - version: - type: string - tags: - items: - type: string - type: array + $ref: '#/components/schemas/APM_UI_create_annotation_object' required: true responses: '200': content: application/json; Elastic-Api-Version=2023-10-31: schema: - type: object - properties: - _id: - type: string - _index: - type: string - _source: - type: object - properties: - '@timestamp': - type: string - annotation: - type: string - event: - type: object - properties: - created: - type: string - message: - type: string - service: - type: object - properties: - environment: - type: string - name: - type: string - version: - type: string - tags: - items: - type: string - type: array + $ref: '#/components/schemas/APM_UI_create_annotation_response' description: Annotation created successfully + '400': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: '#/components/schemas/APM_UI_400_response' + description: Bad Request response + '401': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: '#/components/schemas/APM_UI_401_response' + description: Unauthorized response + '403': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: '#/components/schemas/APM_UI_403_response' + description: Forbidden response + '404': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: '#/components/schemas/APM_UI_404_response' + description: Not found response summary: Create a service annotation tags: - APM annotations @@ -4854,6 +4891,7 @@ paths: description: Search for annotations related to a specific service. operationId: getAnnotation parameters: + - $ref: '#/components/parameters/APM_UI_elastic_api_version' - description: The name of the service in: path name: serviceName @@ -4883,27 +4921,484 @@ paths: content: application/json; Elastic-Api-Version=2023-10-31: schema: - type: object - properties: - annotations: - items: - type: object - properties: - '@timestamp': - type: number - id: - type: string - text: - type: string - type: - enum: - - version - type: string - type: array + $ref: '#/components/schemas/APM_UI_annotation_search_response' description: Successful response + '400': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: '#/components/schemas/APM_UI_400_response' + description: Bad Request response + '401': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: '#/components/schemas/APM_UI_401_response' + description: Unauthorized response + '500': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: '#/components/schemas/APM_UI_500_response' + description: Internal Server Error response summary: Search for annotations tags: - APM annotations + /api/apm/settings/agent-configuration: + delete: + operationId: deleteAgentConfiguration + parameters: + - $ref: '#/components/parameters/APM_UI_elastic_api_version' + - $ref: '#/components/parameters/APM_UI_kbn_xsrf' + requestBody: + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: '#/components/schemas/APM_UI_service_object' + required: true + responses: + '200': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: >- + #/components/schemas/APM_UI_delete_agent_configurations_response + description: Successful response + '400': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: '#/components/schemas/APM_UI_400_response' + description: Bad Request response + '401': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: '#/components/schemas/APM_UI_401_response' + description: Unauthorized response + '403': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: '#/components/schemas/APM_UI_403_response' + description: Forbidden response + '404': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: '#/components/schemas/APM_UI_404_response' + description: Not found response + summary: Delete agent configuration + tags: + - APM agent configuration + get: + operationId: getAgentConfigurations + parameters: + - $ref: '#/components/parameters/APM_UI_elastic_api_version' + responses: + '200': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: '#/components/schemas/APM_UI_agent_configurations_response' + description: Successful response + '400': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: '#/components/schemas/APM_UI_400_response' + description: Bad Request response + '401': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: '#/components/schemas/APM_UI_401_response' + description: Unauthorized response + '404': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: '#/components/schemas/APM_UI_404_response' + description: Not found response + summary: Get a list of agent configurations + tags: + - APM agent configuration + put: + operationId: createUpdateAgentConfiguration + parameters: + - $ref: '#/components/parameters/APM_UI_elastic_api_version' + - $ref: '#/components/parameters/APM_UI_kbn_xsrf' + - description: If the config exists ?overwrite=true is required + in: query + name: overwrite + schema: + type: boolean + requestBody: + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: '#/components/schemas/APM_UI_agent_configuration_intake_object' + required: true + responses: + '200': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + additionalProperties: false + type: object + description: Successful response + '400': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: '#/components/schemas/APM_UI_400_response' + description: Bad Request response + '401': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: '#/components/schemas/APM_UI_401_response' + description: Unauthorized response + '403': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: '#/components/schemas/APM_UI_403_response' + description: Forbidden response + '404': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: '#/components/schemas/APM_UI_404_response' + description: Not found response + summary: Create or update agent configuration + tags: + - APM agent configuration + /api/apm/settings/agent-configuration/agent_name: + get: + description: Retrieve `agentName` for a service. + operationId: getAgentNameForService + parameters: + - $ref: '#/components/parameters/APM_UI_elastic_api_version' + - description: The name of the service + example: node + in: query + name: serviceName + required: true + schema: + type: string + responses: + '200': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: '#/components/schemas/APM_UI_service_agent_name_response' + description: Successful response + '400': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: '#/components/schemas/APM_UI_400_response' + description: Bad Request response + '401': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: '#/components/schemas/APM_UI_401_response' + description: Unauthorized response + '404': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: '#/components/schemas/APM_UI_404_response' + description: Not found response + summary: Get agent name for service + tags: + - APM agent configuration + /api/apm/settings/agent-configuration/environments: + get: + operationId: getEnvironmentsForService + parameters: + - $ref: '#/components/parameters/APM_UI_elastic_api_version' + - description: The name of the service + in: query + name: serviceName + schema: + type: string + responses: + '200': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: '#/components/schemas/APM_UI_service_environments_response' + description: Successful response + '400': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: '#/components/schemas/APM_UI_400_response' + description: Bad Request response + '401': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: '#/components/schemas/APM_UI_401_response' + description: Unauthorized response + '404': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: '#/components/schemas/APM_UI_404_response' + description: Not found response + summary: Get environments for service + tags: + - APM agent configuration + /api/apm/settings/agent-configuration/search: + post: + description: > + This endpoint allows to search for single agent configuration and update + 'applied_by_agent' field. + operationId: searchSingleConfiguration + parameters: + - $ref: '#/components/parameters/APM_UI_elastic_api_version' + - $ref: '#/components/parameters/APM_UI_kbn_xsrf' + requestBody: + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: '#/components/schemas/APM_UI_search_agent_configuration_object' + required: true + responses: + '200': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: >- + #/components/schemas/APM_UI_search_agent_configuration_response + description: Successful response + '400': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: '#/components/schemas/APM_UI_400_response' + description: Bad Request response + '401': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: '#/components/schemas/APM_UI_401_response' + description: Unauthorized response + '404': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: '#/components/schemas/APM_UI_404_response' + description: Not found response + summary: Lookup single agent configuration + tags: + - APM agent configuration + /api/apm/settings/agent-configuration/view: + get: + operationId: getSingleAgentConfiguration + parameters: + - $ref: '#/components/parameters/APM_UI_elastic_api_version' + - description: Service name + example: node + in: query + name: name + schema: + type: string + - description: Service environment + example: prod + in: query + name: environment + schema: + type: string + responses: + '200': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: >- + #/components/schemas/APM_UI_single_agent_configuration_response + description: Successful response + '400': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: '#/components/schemas/APM_UI_400_response' + description: Bad Request response + '401': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: '#/components/schemas/APM_UI_401_response' + description: Unauthorized response + '404': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: '#/components/schemas/APM_UI_404_response' + description: Not found response + summary: Get single agent configuration + tags: + - APM agent configuration + /api/apm/sourcemaps: + get: + description: Returns an array of Fleet artifacts, including source map uploads. + operationId: getSourceMaps + parameters: + - $ref: '#/components/parameters/APM_UI_elastic_api_version' + - description: Page number + in: query + name: page + schema: + type: number + - description: Number of records per page + in: query + name: perPage + schema: + type: number + responses: + '200': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: '#/components/schemas/APM_UI_source_maps_response' + description: Successful response + '400': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: '#/components/schemas/APM_UI_400_response' + description: Bad Request response + '401': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: '#/components/schemas/APM_UI_401_response' + description: Unauthorized response + '500': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: '#/components/schemas/APM_UI_500_response' + description: Internal Server Error response + '501': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: '#/components/schemas/APM_UI_501_response' + description: Not Implemented response + summary: Get source maps + tags: + - APM sourcemaps + post: + description: Upload a source map for a specific service and version. + operationId: uploadSourceMap + parameters: + - $ref: '#/components/parameters/APM_UI_elastic_api_version' + - $ref: '#/components/parameters/APM_UI_kbn_xsrf' + requestBody: + content: + multipart/form-data; Elastic-Api-Version=2023-10-31: + schema: + $ref: '#/components/schemas/APM_UI_upload_source_map_object' + required: true + responses: + '200': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: '#/components/schemas/APM_UI_upload_source_maps_response' + description: Successful response + '400': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: '#/components/schemas/APM_UI_400_response' + description: Bad Request response + '401': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: '#/components/schemas/APM_UI_401_response' + description: Unauthorized response + '403': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: '#/components/schemas/APM_UI_403_response' + description: Forbidden response + '500': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: '#/components/schemas/APM_UI_500_response' + description: Internal Server Error response + '501': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: '#/components/schemas/APM_UI_501_response' + description: Not Implemented response + summary: Upload source map + tags: + - APM sourcemaps + /api/apm/sourcemaps/{id}: + delete: + description: Delete a previously uploaded source map. + operationId: deleteSourceMap + parameters: + - $ref: '#/components/parameters/APM_UI_elastic_api_version' + - $ref: '#/components/parameters/APM_UI_kbn_xsrf' + - description: Source map identifier + in: path + name: id + required: true + schema: + type: string + responses: + '200': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + additionalProperties: false + type: object + description: Successful response + '400': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: '#/components/schemas/APM_UI_400_response' + description: Bad Request response + '401': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: '#/components/schemas/APM_UI_401_response' + description: Unauthorized response + '403': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: '#/components/schemas/APM_UI_403_response' + description: Forbidden response + '500': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: '#/components/schemas/APM_UI_500_response' + description: Internal Server Error response + '501': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: '#/components/schemas/APM_UI_501_response' + description: Not Implemented response + summary: Delete source map + tags: + - APM sourcemaps /api/asset_criticality: delete: description: Delete the asset criticality record for a specific entity. @@ -39931,6 +40426,24 @@ components: title: Kibana Sample Data Logs type: index-pattern parameters: + APM_UI_elastic_api_version: + description: The version of the API to use + in: header + name: elastic-api-version + required: true + schema: + default: '2023-10-31' + enum: + - '2023-10-31' + type: string + APM_UI_kbn_xsrf: + description: A required header to protect against CSRF attacks + in: header + name: kbn-xsrf + required: true + schema: + example: 'true' + type: string Data_views_field_name: description: The name of the runtime field. in: path @@ -39997,6 +40510,471 @@ components: example: default type: string schemas: + APM_UI_400_response: + type: object + properties: + error: + description: Error type + example: Not Found + type: string + message: + description: Error message + example: Not Found + type: string + statusCode: + description: Error status code + example: 400 + type: number + APM_UI_401_response: + type: object + properties: + error: + description: Error type + example: Unauthorized + type: string + message: + description: Error message + type: string + statusCode: + description: Error status code + example: 401 + type: number + APM_UI_403_response: + type: object + properties: + error: + description: Error type + example: Forbidden + type: string + message: + description: Error message + type: string + statusCode: + description: Error status code + example: 403 + type: number + APM_UI_404_response: + type: object + properties: + error: + description: Error type + example: Not Found + type: string + message: + description: Error message + example: Not Found + type: string + statusCode: + description: Error status code + example: 404 + type: number + APM_UI_500_response: + type: object + properties: + error: + description: Error type + example: Internal Server Error + type: string + message: + description: Error message + type: string + statusCode: + description: Error status code + example: 500 + type: number + APM_UI_501_response: + type: object + properties: + error: + description: Error type + example: Not Implemented + type: string + message: + description: Error message + example: Not Implemented + type: string + statusCode: + description: Error status code + example: 501 + type: number + APM_UI_agent_configuration_intake_object: + type: object + properties: + agent_name: + description: Agent name + type: string + service: + $ref: '#/components/schemas/APM_UI_service_object' + settings: + $ref: '#/components/schemas/APM_UI_settings_object' + required: + - service + - settings + APM_UI_agent_configuration_object: + description: Agent configuration + type: object + properties: + '@timestamp': + description: Timestamp + example: 1730194190636 + type: number + agent_name: + description: Agent name + type: string + applied_by_agent: + description: Applied by agent + example: true + type: boolean + etag: + description: Etag + example: 0bc3b5ebf18fba8163fe4c96f491e3767a358f85 + type: string + service: + $ref: '#/components/schemas/APM_UI_service_object' + settings: + $ref: '#/components/schemas/APM_UI_settings_object' + required: + - service + - settings + - '@timestamp' + - etag + APM_UI_agent_configurations_response: + type: object + properties: + configurations: + description: Agent configuration + items: + $ref: '#/components/schemas/APM_UI_agent_configuration_object' + type: array + APM_UI_agent_keys_object: + type: object + properties: + name: + description: Agent name + type: string + privileges: + description: Privileges configuration + items: + enum: + - event:write + - config_agent:read + type: string + type: array + required: + - name + - privileges + APM_UI_agent_keys_response: + type: object + properties: + agentKey: + description: Agent key + type: object + properties: + api_key: + type: string + encoded: + type: string + expiration: + format: int64 + type: integer + id: + type: string + name: + type: string + required: + - id + - name + - api_key + - encoded + APM_UI_annotation_search_response: + type: object + properties: + annotations: + description: Annotations + items: + type: object + properties: + '@timestamp': + type: number + id: + type: string + text: + type: string + type: + enum: + - version + type: string + type: array + APM_UI_base_source_map_object: + type: object + properties: + compressionAlgorithm: + description: Compression Algorithm + type: string + created: + description: Created date + type: string + decodedSha256: + description: Decoded SHA-256 + type: string + decodedSize: + description: Decoded size + type: number + encodedSha256: + description: Encoded SHA-256 + type: string + encodedSize: + description: Encoded size + type: number + encryptionAlgorithm: + description: Encryption Algorithm + type: string + id: + description: Identifier + type: string + identifier: + description: Identifier + type: string + packageName: + description: Package name + type: string + relative_url: + description: Relative URL + type: string + type: + description: Type + type: string + APM_UI_create_annotation_object: + type: object + properties: + '@timestamp': + description: Timestamp + type: string + message: + description: Message + type: string + service: + description: Service + type: object + properties: + environment: + type: string + version: + type: string + required: + - version + tags: + description: Tags + items: + type: string + type: array + required: + - '@timestamp' + - service + APM_UI_create_annotation_response: + type: object + properties: + _id: + description: Identifier + type: string + _index: + description: Index + type: string + _source: + description: Response + type: object + properties: + '@timestamp': + type: string + annotation: + type: object + properties: + title: + type: string + type: + type: string + event: + type: object + properties: + created: + type: string + message: + type: string + service: + type: object + properties: + environment: + type: string + name: + type: string + version: + type: string + tags: + items: + type: string + type: array + APM_UI_delete_agent_configurations_response: + type: object + properties: + result: + description: Result + type: string + APM_UI_search_agent_configuration_object: + type: object + properties: + etag: + description: If etags match then `applied_by_agent` field will be set to `true` + example: 0bc3b5ebf18fba8163fe4c96f491e3767a358f85 + type: string + mark_as_applied_by_agent: + description: > + `markAsAppliedByAgent=true` means "force setting it to true + regardless of etag". + + This is needed for Jaeger agent that doesn't have etags + type: boolean + service: + $ref: '#/components/schemas/APM_UI_service_object' + required: + - service + APM_UI_search_agent_configuration_response: + type: object + properties: + _id: + description: Identifier + type: string + _index: + description: Index + type: string + _score: + description: Score + type: number + _source: + $ref: '#/components/schemas/APM_UI_agent_configuration_object' + APM_UI_service_agent_name_response: + type: object + properties: + agentName: + description: Agent name + example: nodejs + type: string + APM_UI_service_environment_object: + type: object + properties: + alreadyConfigured: + description: Already configured + type: boolean + name: + description: Service environment name + example: ALL_OPTION_VALUE + type: string + APM_UI_service_environments_response: + type: object + properties: + environments: + description: Service environment list + items: + $ref: '#/components/schemas/APM_UI_service_environment_object' + type: array + APM_UI_service_object: + description: Service + type: object + properties: + environment: + description: Environment + example: prod + type: string + name: + description: Name + example: node + type: string + APM_UI_settings_object: + additionalProperties: + type: string + description: Agent configuration settings + type: object + APM_UI_single_agent_configuration_response: + allOf: + - type: object + properties: + id: + type: string + required: + - id + - $ref: '#/components/schemas/APM_UI_agent_configuration_object' + APM_UI_source_maps_response: + type: object + properties: + artifacts: + description: Artifacts + items: + allOf: + - type: object + properties: + body: + type: object + properties: + bundleFilepath: + type: string + serviceName: + type: string + serviceVersion: + type: string + sourceMap: + type: object + properties: + file: + type: string + mappings: + type: string + sourceRoot: + type: string + sources: + items: + type: string + type: array + sourcesContent: + items: + type: string + type: array + version: + type: number + - $ref: '#/components/schemas/APM_UI_base_source_map_object' + type: array + APM_UI_upload_source_map_object: + type: object + properties: + bundle_filepath: + description: >- + The absolute path of the final bundle as used in the web + application. + type: string + service_name: + description: The name of the service that the service map should apply to. + type: string + service_version: + description: The version of the service that the service map should apply to. + type: string + sourcemap: + description: > + The source map. String or file upload. It must follow the + + [source map revision 3 + proposal](https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k). + format: binary + type: string + required: + - service_name + - service_version + - bundle_filepath + - sourcemap + APM_UI_upload_source_maps_response: + allOf: + - type: object + properties: + body: + type: string + - $ref: '#/components/schemas/APM_UI_base_source_map_object' Data_views_400_response: title: Bad request type: object @@ -51746,6 +52724,9 @@ security: - apiKeyAuth: [] tags: - name: alerting + - description: | + Adjust APM agent configuration without need to redeploy your application. + name: APM agent configuration - description: > Configure APM agent keys to authorize requests from APM agents to the APM Server. @@ -51755,6 +52736,10 @@ tags: Annotations enable you to easily see how events are impacting the performance of your applications. name: APM annotations + - description: Create APM fleet server schema. + name: APM server schema + - description: Configure APM source maps. + name: APM sourcemaps - name: connectors - name: Data streams - description: >- diff --git a/oas_docs/output/kibana.yaml b/oas_docs/output/kibana.yaml index 144c4a60f3e29..237974a87bbb2 100644 --- a/oas_docs/output/kibana.yaml +++ b/oas_docs/output/kibana.yaml @@ -5917,49 +5917,110 @@ paths: post: description: Create a new agent key for APM. operationId: createAgentKey + parameters: + - $ref: '#/components/parameters/APM_UI_elastic_api_version' + - $ref: '#/components/parameters/APM_UI_kbn_xsrf' requestBody: content: application/json; Elastic-Api-Version=2023-10-31: schema: - type: object - properties: - name: - type: string - privileges: - items: - enum: - - event:write - - config_agent:read - type: string - type: array + $ref: '#/components/schemas/APM_UI_agent_keys_object' required: true responses: '200': content: application/json; Elastic-Api-Version=2023-10-31: schema: - type: object - properties: - api_key: - type: string - encoded: - type: string - expiration: - format: int64 - type: integer - id: - type: string - name: - type: string + $ref: '#/components/schemas/APM_UI_agent_keys_response' description: Agent key created successfully + '400': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: '#/components/schemas/APM_UI_400_response' + description: Bad Request response + '401': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: '#/components/schemas/APM_UI_401_response' + description: Unauthorized response + '403': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: '#/components/schemas/APM_UI_403_response' + description: Forbidden response + '500': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: '#/components/schemas/APM_UI_500_response' + description: Internal Server Error response summary: Create an APM agent key tags: - APM agent keys + /api/apm/fleet/apm_server_schema: + post: + operationId: saveApmServerSchema + parameters: + - $ref: '#/components/parameters/APM_UI_elastic_api_version' + - $ref: '#/components/parameters/APM_UI_kbn_xsrf' + requestBody: + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + type: object + properties: + schema: + additionalProperties: true + description: Schema object + example: + foo: bar + type: object + required: true + responses: + '200': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + additionalProperties: false + type: object + description: Successful response + '400': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: '#/components/schemas/APM_UI_400_response' + description: Bad Request response + '401': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: '#/components/schemas/APM_UI_401_response' + description: Unauthorized response + '403': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: '#/components/schemas/APM_UI_403_response' + description: Forbidden response + '404': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: '#/components/schemas/APM_UI_404_response' + description: Not found response + summary: Save APM server schema + tags: + - APM server schema /api/apm/services/{serviceName}/annotation: post: description: Create a new annotation for a specific service. operationId: createAnnotation parameters: + - $ref: '#/components/parameters/APM_UI_elastic_api_version' + - $ref: '#/components/parameters/APM_UI_kbn_xsrf' - description: The name of the service in: path name: serviceName @@ -5970,63 +6031,39 @@ paths: content: application/json; Elastic-Api-Version=2023-10-31: schema: - type: object - properties: - '@timestamp': - type: string - message: - type: string - service: - type: object - properties: - environment: - type: string - version: - type: string - tags: - items: - type: string - type: array + $ref: '#/components/schemas/APM_UI_create_annotation_object' required: true responses: '200': content: application/json; Elastic-Api-Version=2023-10-31: schema: - type: object - properties: - _id: - type: string - _index: - type: string - _source: - type: object - properties: - '@timestamp': - type: string - annotation: - type: string - event: - type: object - properties: - created: - type: string - message: - type: string - service: - type: object - properties: - environment: - type: string - name: - type: string - version: - type: string - tags: - items: - type: string - type: array + $ref: '#/components/schemas/APM_UI_create_annotation_response' description: Annotation created successfully + '400': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: '#/components/schemas/APM_UI_400_response' + description: Bad Request response + '401': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: '#/components/schemas/APM_UI_401_response' + description: Unauthorized response + '403': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: '#/components/schemas/APM_UI_403_response' + description: Forbidden response + '404': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: '#/components/schemas/APM_UI_404_response' + description: Not found response summary: Create a service annotation tags: - APM annotations @@ -6035,6 +6072,7 @@ paths: description: Search for annotations related to a specific service. operationId: getAnnotation parameters: + - $ref: '#/components/parameters/APM_UI_elastic_api_version' - description: The name of the service in: path name: serviceName @@ -6064,27 +6102,484 @@ paths: content: application/json; Elastic-Api-Version=2023-10-31: schema: - type: object - properties: - annotations: - items: - type: object - properties: - '@timestamp': - type: number - id: - type: string - text: - type: string - type: - enum: - - version - type: string - type: array + $ref: '#/components/schemas/APM_UI_annotation_search_response' description: Successful response + '400': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: '#/components/schemas/APM_UI_400_response' + description: Bad Request response + '401': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: '#/components/schemas/APM_UI_401_response' + description: Unauthorized response + '500': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: '#/components/schemas/APM_UI_500_response' + description: Internal Server Error response summary: Search for annotations tags: - APM annotations + /api/apm/settings/agent-configuration: + delete: + operationId: deleteAgentConfiguration + parameters: + - $ref: '#/components/parameters/APM_UI_elastic_api_version' + - $ref: '#/components/parameters/APM_UI_kbn_xsrf' + requestBody: + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: '#/components/schemas/APM_UI_service_object' + required: true + responses: + '200': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: >- + #/components/schemas/APM_UI_delete_agent_configurations_response + description: Successful response + '400': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: '#/components/schemas/APM_UI_400_response' + description: Bad Request response + '401': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: '#/components/schemas/APM_UI_401_response' + description: Unauthorized response + '403': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: '#/components/schemas/APM_UI_403_response' + description: Forbidden response + '404': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: '#/components/schemas/APM_UI_404_response' + description: Not found response + summary: Delete agent configuration + tags: + - APM agent configuration + get: + operationId: getAgentConfigurations + parameters: + - $ref: '#/components/parameters/APM_UI_elastic_api_version' + responses: + '200': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: '#/components/schemas/APM_UI_agent_configurations_response' + description: Successful response + '400': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: '#/components/schemas/APM_UI_400_response' + description: Bad Request response + '401': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: '#/components/schemas/APM_UI_401_response' + description: Unauthorized response + '404': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: '#/components/schemas/APM_UI_404_response' + description: Not found response + summary: Get a list of agent configurations + tags: + - APM agent configuration + put: + operationId: createUpdateAgentConfiguration + parameters: + - $ref: '#/components/parameters/APM_UI_elastic_api_version' + - $ref: '#/components/parameters/APM_UI_kbn_xsrf' + - description: If the config exists ?overwrite=true is required + in: query + name: overwrite + schema: + type: boolean + requestBody: + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: '#/components/schemas/APM_UI_agent_configuration_intake_object' + required: true + responses: + '200': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + additionalProperties: false + type: object + description: Successful response + '400': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: '#/components/schemas/APM_UI_400_response' + description: Bad Request response + '401': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: '#/components/schemas/APM_UI_401_response' + description: Unauthorized response + '403': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: '#/components/schemas/APM_UI_403_response' + description: Forbidden response + '404': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: '#/components/schemas/APM_UI_404_response' + description: Not found response + summary: Create or update agent configuration + tags: + - APM agent configuration + /api/apm/settings/agent-configuration/agent_name: + get: + description: Retrieve `agentName` for a service. + operationId: getAgentNameForService + parameters: + - $ref: '#/components/parameters/APM_UI_elastic_api_version' + - description: The name of the service + example: node + in: query + name: serviceName + required: true + schema: + type: string + responses: + '200': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: '#/components/schemas/APM_UI_service_agent_name_response' + description: Successful response + '400': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: '#/components/schemas/APM_UI_400_response' + description: Bad Request response + '401': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: '#/components/schemas/APM_UI_401_response' + description: Unauthorized response + '404': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: '#/components/schemas/APM_UI_404_response' + description: Not found response + summary: Get agent name for service + tags: + - APM agent configuration + /api/apm/settings/agent-configuration/environments: + get: + operationId: getEnvironmentsForService + parameters: + - $ref: '#/components/parameters/APM_UI_elastic_api_version' + - description: The name of the service + in: query + name: serviceName + schema: + type: string + responses: + '200': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: '#/components/schemas/APM_UI_service_environments_response' + description: Successful response + '400': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: '#/components/schemas/APM_UI_400_response' + description: Bad Request response + '401': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: '#/components/schemas/APM_UI_401_response' + description: Unauthorized response + '404': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: '#/components/schemas/APM_UI_404_response' + description: Not found response + summary: Get environments for service + tags: + - APM agent configuration + /api/apm/settings/agent-configuration/search: + post: + description: > + This endpoint allows to search for single agent configuration and update + 'applied_by_agent' field. + operationId: searchSingleConfiguration + parameters: + - $ref: '#/components/parameters/APM_UI_elastic_api_version' + - $ref: '#/components/parameters/APM_UI_kbn_xsrf' + requestBody: + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: '#/components/schemas/APM_UI_search_agent_configuration_object' + required: true + responses: + '200': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: >- + #/components/schemas/APM_UI_search_agent_configuration_response + description: Successful response + '400': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: '#/components/schemas/APM_UI_400_response' + description: Bad Request response + '401': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: '#/components/schemas/APM_UI_401_response' + description: Unauthorized response + '404': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: '#/components/schemas/APM_UI_404_response' + description: Not found response + summary: Lookup single agent configuration + tags: + - APM agent configuration + /api/apm/settings/agent-configuration/view: + get: + operationId: getSingleAgentConfiguration + parameters: + - $ref: '#/components/parameters/APM_UI_elastic_api_version' + - description: Service name + example: node + in: query + name: name + schema: + type: string + - description: Service environment + example: prod + in: query + name: environment + schema: + type: string + responses: + '200': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: >- + #/components/schemas/APM_UI_single_agent_configuration_response + description: Successful response + '400': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: '#/components/schemas/APM_UI_400_response' + description: Bad Request response + '401': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: '#/components/schemas/APM_UI_401_response' + description: Unauthorized response + '404': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: '#/components/schemas/APM_UI_404_response' + description: Not found response + summary: Get single agent configuration + tags: + - APM agent configuration + /api/apm/sourcemaps: + get: + description: Returns an array of Fleet artifacts, including source map uploads. + operationId: getSourceMaps + parameters: + - $ref: '#/components/parameters/APM_UI_elastic_api_version' + - description: Page number + in: query + name: page + schema: + type: number + - description: Number of records per page + in: query + name: perPage + schema: + type: number + responses: + '200': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: '#/components/schemas/APM_UI_source_maps_response' + description: Successful response + '400': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: '#/components/schemas/APM_UI_400_response' + description: Bad Request response + '401': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: '#/components/schemas/APM_UI_401_response' + description: Unauthorized response + '500': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: '#/components/schemas/APM_UI_500_response' + description: Internal Server Error response + '501': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: '#/components/schemas/APM_UI_501_response' + description: Not Implemented response + summary: Get source maps + tags: + - APM sourcemaps + post: + description: Upload a source map for a specific service and version. + operationId: uploadSourceMap + parameters: + - $ref: '#/components/parameters/APM_UI_elastic_api_version' + - $ref: '#/components/parameters/APM_UI_kbn_xsrf' + requestBody: + content: + multipart/form-data; Elastic-Api-Version=2023-10-31: + schema: + $ref: '#/components/schemas/APM_UI_upload_source_map_object' + required: true + responses: + '200': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: '#/components/schemas/APM_UI_upload_source_maps_response' + description: Successful response + '400': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: '#/components/schemas/APM_UI_400_response' + description: Bad Request response + '401': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: '#/components/schemas/APM_UI_401_response' + description: Unauthorized response + '403': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: '#/components/schemas/APM_UI_403_response' + description: Forbidden response + '500': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: '#/components/schemas/APM_UI_500_response' + description: Internal Server Error response + '501': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: '#/components/schemas/APM_UI_501_response' + description: Not Implemented response + summary: Upload source map + tags: + - APM sourcemaps + /api/apm/sourcemaps/{id}: + delete: + description: Delete a previously uploaded source map. + operationId: deleteSourceMap + parameters: + - $ref: '#/components/parameters/APM_UI_elastic_api_version' + - $ref: '#/components/parameters/APM_UI_kbn_xsrf' + - description: Source map identifier + in: path + name: id + required: true + schema: + type: string + responses: + '200': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + additionalProperties: false + type: object + description: Successful response + '400': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: '#/components/schemas/APM_UI_400_response' + description: Bad Request response + '401': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: '#/components/schemas/APM_UI_401_response' + description: Unauthorized response + '403': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: '#/components/schemas/APM_UI_403_response' + description: Forbidden response + '500': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: '#/components/schemas/APM_UI_500_response' + description: Internal Server Error response + '501': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: '#/components/schemas/APM_UI_501_response' + description: Not Implemented response + summary: Delete source map + tags: + - APM sourcemaps /api/asset_criticality: delete: description: Delete the asset criticality record for a specific entity. @@ -45568,6 +46063,24 @@ components: required: true schema: type: string + APM_UI_elastic_api_version: + description: The version of the API to use + in: header + name: elastic-api-version + required: true + schema: + default: '2023-10-31' + enum: + - '2023-10-31' + type: string + APM_UI_kbn_xsrf: + description: A required header to protect against CSRF attacks + in: header + name: kbn-xsrf + required: true + schema: + example: 'true' + type: string Cases_alert_id: description: An identifier for the alert. in: path @@ -46059,6 +46572,471 @@ components: description: Specifies the data type for the field. example: scaled_float type: string + APM_UI_400_response: + type: object + properties: + error: + description: Error type + example: Not Found + type: string + message: + description: Error message + example: Not Found + type: string + statusCode: + description: Error status code + example: 400 + type: number + APM_UI_401_response: + type: object + properties: + error: + description: Error type + example: Unauthorized + type: string + message: + description: Error message + type: string + statusCode: + description: Error status code + example: 401 + type: number + APM_UI_403_response: + type: object + properties: + error: + description: Error type + example: Forbidden + type: string + message: + description: Error message + type: string + statusCode: + description: Error status code + example: 403 + type: number + APM_UI_404_response: + type: object + properties: + error: + description: Error type + example: Not Found + type: string + message: + description: Error message + example: Not Found + type: string + statusCode: + description: Error status code + example: 404 + type: number + APM_UI_500_response: + type: object + properties: + error: + description: Error type + example: Internal Server Error + type: string + message: + description: Error message + type: string + statusCode: + description: Error status code + example: 500 + type: number + APM_UI_501_response: + type: object + properties: + error: + description: Error type + example: Not Implemented + type: string + message: + description: Error message + example: Not Implemented + type: string + statusCode: + description: Error status code + example: 501 + type: number + APM_UI_agent_configuration_intake_object: + type: object + properties: + agent_name: + description: Agent name + type: string + service: + $ref: '#/components/schemas/APM_UI_service_object' + settings: + $ref: '#/components/schemas/APM_UI_settings_object' + required: + - service + - settings + APM_UI_agent_configuration_object: + description: Agent configuration + type: object + properties: + '@timestamp': + description: Timestamp + example: 1730194190636 + type: number + agent_name: + description: Agent name + type: string + applied_by_agent: + description: Applied by agent + example: true + type: boolean + etag: + description: Etag + example: 0bc3b5ebf18fba8163fe4c96f491e3767a358f85 + type: string + service: + $ref: '#/components/schemas/APM_UI_service_object' + settings: + $ref: '#/components/schemas/APM_UI_settings_object' + required: + - service + - settings + - '@timestamp' + - etag + APM_UI_agent_configurations_response: + type: object + properties: + configurations: + description: Agent configuration + items: + $ref: '#/components/schemas/APM_UI_agent_configuration_object' + type: array + APM_UI_agent_keys_object: + type: object + properties: + name: + description: Agent name + type: string + privileges: + description: Privileges configuration + items: + enum: + - event:write + - config_agent:read + type: string + type: array + required: + - name + - privileges + APM_UI_agent_keys_response: + type: object + properties: + agentKey: + description: Agent key + type: object + properties: + api_key: + type: string + encoded: + type: string + expiration: + format: int64 + type: integer + id: + type: string + name: + type: string + required: + - id + - name + - api_key + - encoded + APM_UI_annotation_search_response: + type: object + properties: + annotations: + description: Annotations + items: + type: object + properties: + '@timestamp': + type: number + id: + type: string + text: + type: string + type: + enum: + - version + type: string + type: array + APM_UI_base_source_map_object: + type: object + properties: + compressionAlgorithm: + description: Compression Algorithm + type: string + created: + description: Created date + type: string + decodedSha256: + description: Decoded SHA-256 + type: string + decodedSize: + description: Decoded size + type: number + encodedSha256: + description: Encoded SHA-256 + type: string + encodedSize: + description: Encoded size + type: number + encryptionAlgorithm: + description: Encryption Algorithm + type: string + id: + description: Identifier + type: string + identifier: + description: Identifier + type: string + packageName: + description: Package name + type: string + relative_url: + description: Relative URL + type: string + type: + description: Type + type: string + APM_UI_create_annotation_object: + type: object + properties: + '@timestamp': + description: Timestamp + type: string + message: + description: Message + type: string + service: + description: Service + type: object + properties: + environment: + type: string + version: + type: string + required: + - version + tags: + description: Tags + items: + type: string + type: array + required: + - '@timestamp' + - service + APM_UI_create_annotation_response: + type: object + properties: + _id: + description: Identifier + type: string + _index: + description: Index + type: string + _source: + description: Response + type: object + properties: + '@timestamp': + type: string + annotation: + type: object + properties: + title: + type: string + type: + type: string + event: + type: object + properties: + created: + type: string + message: + type: string + service: + type: object + properties: + environment: + type: string + name: + type: string + version: + type: string + tags: + items: + type: string + type: array + APM_UI_delete_agent_configurations_response: + type: object + properties: + result: + description: Result + type: string + APM_UI_search_agent_configuration_object: + type: object + properties: + etag: + description: If etags match then `applied_by_agent` field will be set to `true` + example: 0bc3b5ebf18fba8163fe4c96f491e3767a358f85 + type: string + mark_as_applied_by_agent: + description: > + `markAsAppliedByAgent=true` means "force setting it to true + regardless of etag". + + This is needed for Jaeger agent that doesn't have etags + type: boolean + service: + $ref: '#/components/schemas/APM_UI_service_object' + required: + - service + APM_UI_search_agent_configuration_response: + type: object + properties: + _id: + description: Identifier + type: string + _index: + description: Index + type: string + _score: + description: Score + type: number + _source: + $ref: '#/components/schemas/APM_UI_agent_configuration_object' + APM_UI_service_agent_name_response: + type: object + properties: + agentName: + description: Agent name + example: nodejs + type: string + APM_UI_service_environment_object: + type: object + properties: + alreadyConfigured: + description: Already configured + type: boolean + name: + description: Service environment name + example: ALL_OPTION_VALUE + type: string + APM_UI_service_environments_response: + type: object + properties: + environments: + description: Service environment list + items: + $ref: '#/components/schemas/APM_UI_service_environment_object' + type: array + APM_UI_service_object: + description: Service + type: object + properties: + environment: + description: Environment + example: prod + type: string + name: + description: Name + example: node + type: string + APM_UI_settings_object: + additionalProperties: + type: string + description: Agent configuration settings + type: object + APM_UI_single_agent_configuration_response: + allOf: + - type: object + properties: + id: + type: string + required: + - id + - $ref: '#/components/schemas/APM_UI_agent_configuration_object' + APM_UI_source_maps_response: + type: object + properties: + artifacts: + description: Artifacts + items: + allOf: + - type: object + properties: + body: + type: object + properties: + bundleFilepath: + type: string + serviceName: + type: string + serviceVersion: + type: string + sourceMap: + type: object + properties: + file: + type: string + mappings: + type: string + sourceRoot: + type: string + sources: + items: + type: string + type: array + sourcesContent: + items: + type: string + type: array + version: + type: number + - $ref: '#/components/schemas/APM_UI_base_source_map_object' + type: array + APM_UI_upload_source_map_object: + type: object + properties: + bundle_filepath: + description: >- + The absolute path of the final bundle as used in the web + application. + type: string + service_name: + description: The name of the service that the service map should apply to. + type: string + service_version: + description: The version of the service that the service map should apply to. + type: string + sourcemap: + description: > + The source map. String or file upload. It must follow the + + [source map revision 3 + proposal](https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k). + format: binary + type: string + required: + - service_name + - service_version + - bundle_filepath + - sourcemap + APM_UI_upload_source_maps_response: + allOf: + - type: object + properties: + body: + type: string + - $ref: '#/components/schemas/APM_UI_base_source_map_object' Cases_4xx_response: properties: error: @@ -60117,6 +61095,9 @@ security: - basicAuth: [] tags: - name: alerting + - description: | + Adjust APM agent configuration without need to redeploy your application. + name: APM agent configuration - description: > Configure APM agent keys to authorize requests from APM agents to the APM Server. @@ -60126,6 +61107,10 @@ tags: Annotations enable you to easily see how events are impacting the performance of your applications. name: APM annotations + - description: Create APM fleet server schema. + name: APM server schema + - description: Configure APM source maps. + name: APM sourcemaps - description: Case APIs enable you to open and track issues. name: cases - name: connectors diff --git a/oas_docs/scripts/merge_ess_oas.js b/oas_docs/scripts/merge_ess_oas.js index 218e8dfa5b803..d8bc45e64c2f2 100644 --- a/oas_docs/scripts/merge_ess_oas.js +++ b/oas_docs/scripts/merge_ess_oas.js @@ -22,7 +22,7 @@ const { REPO_ROOT } = require('@kbn/repo-info'); `${REPO_ROOT}/packages/core/saved-objects/docs/openapi/bundled.yaml`, // Observability Solution - `${REPO_ROOT}/x-pack/plugins/observability_solution/apm/docs/openapi/apm.yaml`, + `${REPO_ROOT}/x-pack/plugins/observability_solution/apm/docs/openapi/apm/bundled.yaml`, `${REPO_ROOT}/x-pack/plugins/observability_solution/slo/docs/openapi/slo/bundled.yaml`, // Security solution diff --git a/oas_docs/scripts/merge_serverless_oas.js b/oas_docs/scripts/merge_serverless_oas.js index c66187dea8d8d..63d2df0f32d3f 100644 --- a/oas_docs/scripts/merge_serverless_oas.js +++ b/oas_docs/scripts/merge_serverless_oas.js @@ -20,7 +20,7 @@ const { REPO_ROOT } = require('@kbn/repo-info'); `${REPO_ROOT}/packages/core/saved-objects/docs/openapi/bundled_serverless.yaml`, // Observability Solution - `${REPO_ROOT}/x-pack/plugins/observability_solution/apm/docs/openapi/apm.yaml`, + `${REPO_ROOT}/x-pack/plugins/observability_solution/apm/docs/openapi/apm/bundled.yaml`, `${REPO_ROOT}/x-pack/plugins/observability_solution/slo/docs/openapi/slo/bundled.yaml`, // Security solution diff --git a/x-pack/plugins/observability_solution/apm/docs/openapi/apm.yaml b/x-pack/plugins/observability_solution/apm/docs/openapi/apm.yaml deleted file mode 100644 index d37137302fd21..0000000000000 --- a/x-pack/plugins/observability_solution/apm/docs/openapi/apm.yaml +++ /dev/null @@ -1,186 +0,0 @@ -openapi: 3.0.0 -info: - title: APM UI - version: 1.0.0 -tags: - - name: APM agent keys - description: > - Configure APM agent keys to authorize requests from APM agents to the APM Server. - - name: APM annotations - description: > - Annotate visualizations in the APM app with significant events. - Annotations enable you to easily see how events are impacting the performance of your applications. -paths: - /api/apm/agent_keys: - post: - summary: Create an APM agent key - description: Create a new agent key for APM. - operationId: createAgentKey - tags: - - APM agent keys - requestBody: - required: true - content: - application/json: - schema: - type: object - properties: - name: - type: string - privileges: - type: array - items: - type: string - enum: - - event:write - - config_agent:read - responses: - "200": - description: Agent key created successfully - content: - application/json: - schema: - type: object - properties: - api_key: - type: string - expiration: - type: integer - format: int64 - id: - type: string - name: - type: string - encoded: - type: string - /api/apm/services/{serviceName}/annotation/search: - get: - summary: Search for annotations - description: Search for annotations related to a specific service. - operationId: getAnnotation - tags: - - APM annotations - parameters: - - name: serviceName - in: path - required: true - description: The name of the service - schema: - type: string - - name: environment - in: query - required: false - description: The environment to filter annotations by - schema: - type: string - - name: start - in: query - required: false - description: The start date for the search - schema: - type: string - - name: end - in: query - required: false - description: The end date for the search - schema: - type: string - responses: - "200": - description: Successful response - content: - application/json: - schema: - type: object - properties: - annotations: - type: array - items: - type: object - properties: - type: - type: string - enum: - - version - id: - type: string - "@timestamp": - type: number - text: - type: string - /api/apm/services/{serviceName}/annotation: - post: - summary: Create a service annotation - description: Create a new annotation for a specific service. - operationId: createAnnotation - tags: - - APM annotations - parameters: - - name: serviceName - in: path - required: true - description: The name of the service - schema: - type: string - requestBody: - required: true - content: - application/json: - schema: - type: object - properties: - '@timestamp': - type: string - service: - type: object - properties: - version: - type: string - environment: - type: string - message: - type: string - tags: - type: array - items: - type: string - - responses: - '200': - description: Annotation created successfully - content: - application/json: - schema: - type: object - properties: - _id: - type: string - _index: - type: string - _source: - type: object - properties: - annotation: - type: string - tags: - type: array - items: - type: string - message: - type: string - service: - type: object - properties: - name: - type: string - environment: - type: string - version: - type: string - event: - type: object - properties: - created: - type: string - '@timestamp': - type: string diff --git a/x-pack/plugins/observability_solution/apm/docs/openapi/apm/README.md b/x-pack/plugins/observability_solution/apm/docs/openapi/apm/README.md index da35d6b891239..74b9c6a034821 100644 --- a/x-pack/plugins/observability_solution/apm/docs/openapi/apm/README.md +++ b/x-pack/plugins/observability_solution/apm/docs/openapi/apm/README.md @@ -2,16 +2,26 @@ This directory contains [OpenAPI specifications](https://swagger.io/specification/) for the [APM app API](https://www.elastic.co/guide/en/kibana/current/apm-api.html) in Kibana. -Included: +# OpenAPI (Experimental) -* [Agent Configuration API](https://www.elastic.co/guide/en/kibana/current/agent-config-api.html) -* [Annotation API](https://www.elastic.co/guide/en/kibana/current/apm-annotation-api.html) +The current self-contained spec file is available as `bundled.json` or `bundled.yaml` and can be used for online tools like those found at . +This spec is experimental and may be incomplete or change later. -Not included: +A guide about the openApi specification can be found at [https://swagger.io/docs/specification/about/](https://swagger.io/docs/specification/about/). -* [APM agent Key API](https://www.elastic.co/guide/en/kibana/current/agent-key-api.html) -* [RUM source map API](https://www.elastic.co/guide/en/kibana/current/rum-sourcemap-api.html) +## The `openapi` folder -The specifications for the included APIs are in the apm.yaml file in this directory. +* `entrypoint.yaml` is the overview file which pulls together all the paths and components. +* [Paths](paths/README.md): Defines each endpoint. A path can have one operation per http method. +* [Components](components/README.md): Defines reusable components. -These specifications are manually written. The missing ones will be included in the future. +## Tools + +Generate the `bundled` files by running the following commands: + +```bash +npx @redocly/cli bundle entrypoint.yaml --output bundled.yaml --ext yaml +npx @redocly/cli bundle entrypoint.yaml --output bundled.json --ext json +``` + +Then join these files with the rest of the Kibana APIs per `oas_docs/README.md` diff --git a/x-pack/plugins/observability_solution/apm/docs/openapi/apm/bundled.json b/x-pack/plugins/observability_solution/apm/docs/openapi/apm/bundled.json new file mode 100644 index 0000000000000..9fdcc3cdb6294 --- /dev/null +++ b/x-pack/plugins/observability_solution/apm/docs/openapi/apm/bundled.json @@ -0,0 +1,1827 @@ +{ + "openapi": "3.0.2", + "info": { + "title": "APM UI", + "version": "1.0.0" + }, + "tags": [ + { + "name": "APM agent keys", + "description": "Configure APM agent keys to authorize requests from APM agents to the APM Server.\n" + }, + { + "name": "APM agent configuration", + "description": "Adjust APM agent configuration without need to redeploy your application.\n" + }, + { + "name": "APM sourcemaps", + "description": "Configure APM source maps." + }, + { + "name": "APM annotations", + "description": "Annotate visualizations in the APM app with significant events. Annotations enable you to easily see how events are impacting the performance of your applications.\n" + }, + { + "name": "APM server schema", + "description": "Create APM fleet server schema." + } + ], + "paths": { + "/api/apm/agent_keys": { + "post": { + "summary": "Create an APM agent key", + "description": "Create a new agent key for APM.", + "operationId": "createAgentKey", + "tags": [ + "APM agent keys" + ], + "parameters": [ + { + "$ref": "#/components/parameters/elastic_api_version" + }, + { + "$ref": "#/components/parameters/kbn_xsrf" + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/agent_keys_object" + } + } + } + }, + "responses": { + "200": { + "description": "Agent key created successfully", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/agent_keys_response" + } + } + } + }, + "400": { + "description": "Bad Request response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/400_response" + } + } + } + }, + "401": { + "description": "Unauthorized response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/401_response" + } + } + } + }, + "403": { + "description": "Forbidden response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/403_response" + } + } + } + }, + "500": { + "description": "Internal Server Error response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/500_response" + } + } + } + } + } + } + }, + "/api/apm/services/{serviceName}/annotation/search": { + "get": { + "summary": "Search for annotations", + "description": "Search for annotations related to a specific service.", + "operationId": "getAnnotation", + "tags": [ + "APM annotations" + ], + "parameters": [ + { + "$ref": "#/components/parameters/elastic_api_version" + }, + { + "name": "serviceName", + "in": "path", + "required": true, + "description": "The name of the service", + "schema": { + "type": "string" + } + }, + { + "name": "environment", + "in": "query", + "required": false, + "description": "The environment to filter annotations by", + "schema": { + "type": "string" + } + }, + { + "name": "start", + "in": "query", + "required": false, + "description": "The start date for the search", + "schema": { + "type": "string" + } + }, + { + "name": "end", + "in": "query", + "required": false, + "description": "The end date for the search", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Successful response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/annotation_search_response" + } + } + } + }, + "400": { + "description": "Bad Request response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/400_response" + } + } + } + }, + "401": { + "description": "Unauthorized response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/401_response" + } + } + } + }, + "500": { + "description": "Internal Server Error response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/500_response" + } + } + } + } + } + } + }, + "/api/apm/services/{serviceName}/annotation": { + "post": { + "summary": "Create a service annotation", + "description": "Create a new annotation for a specific service.", + "operationId": "createAnnotation", + "tags": [ + "APM annotations" + ], + "parameters": [ + { + "$ref": "#/components/parameters/elastic_api_version" + }, + { + "$ref": "#/components/parameters/kbn_xsrf" + }, + { + "name": "serviceName", + "in": "path", + "required": true, + "description": "The name of the service", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/create_annotation_object" + } + } + } + }, + "responses": { + "200": { + "description": "Annotation created successfully", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/create_annotation_response" + } + } + } + }, + "400": { + "description": "Bad Request response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/400_response" + } + } + } + }, + "401": { + "description": "Unauthorized response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/401_response" + } + } + } + }, + "403": { + "description": "Forbidden response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/403_response" + } + } + } + }, + "404": { + "description": "Not found response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/404_response" + } + } + } + } + } + } + }, + "/api/apm/settings/agent-configuration": { + "get": { + "summary": "Get a list of agent configurations", + "operationId": "getAgentConfigurations", + "tags": [ + "APM agent configuration" + ], + "parameters": [ + { + "$ref": "#/components/parameters/elastic_api_version" + } + ], + "responses": { + "200": { + "description": "Successful response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/agent_configurations_response" + } + } + } + }, + "400": { + "description": "Bad Request response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/400_response" + } + } + } + }, + "401": { + "description": "Unauthorized response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/401_response" + } + } + } + }, + "404": { + "description": "Not found response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/404_response" + } + } + } + } + } + }, + "delete": { + "summary": "Delete agent configuration", + "operationId": "deleteAgentConfiguration", + "tags": [ + "APM agent configuration" + ], + "parameters": [ + { + "$ref": "#/components/parameters/elastic_api_version" + }, + { + "$ref": "#/components/parameters/kbn_xsrf" + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/service_object" + } + } + } + }, + "responses": { + "200": { + "description": "Successful response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/delete_agent_configurations_response" + } + } + } + }, + "400": { + "description": "Bad Request response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/400_response" + } + } + } + }, + "401": { + "description": "Unauthorized response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/401_response" + } + } + } + }, + "403": { + "description": "Forbidden response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/403_response" + } + } + } + }, + "404": { + "description": "Not found response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/404_response" + } + } + } + } + } + }, + "put": { + "summary": "Create or update agent configuration", + "operationId": "createUpdateAgentConfiguration", + "tags": [ + "APM agent configuration" + ], + "parameters": [ + { + "$ref": "#/components/parameters/elastic_api_version" + }, + { + "$ref": "#/components/parameters/kbn_xsrf" + }, + { + "name": "overwrite", + "in": "query", + "description": "If the config exists ?overwrite=true is required", + "schema": { + "type": "boolean" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/agent_configuration_intake_object" + } + } + } + }, + "responses": { + "200": { + "description": "Successful response", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": false + } + } + } + }, + "400": { + "description": "Bad Request response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/400_response" + } + } + } + }, + "401": { + "description": "Unauthorized response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/401_response" + } + } + } + }, + "403": { + "description": "Forbidden response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/403_response" + } + } + } + }, + "404": { + "description": "Not found response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/404_response" + } + } + } + } + } + } + }, + "/api/apm/settings/agent-configuration/view": { + "get": { + "summary": "Get single agent configuration", + "operationId": "getSingleAgentConfiguration", + "tags": [ + "APM agent configuration" + ], + "parameters": [ + { + "$ref": "#/components/parameters/elastic_api_version" + }, + { + "name": "name", + "in": "query", + "description": "Service name", + "schema": { + "type": "string" + }, + "example": "node" + }, + { + "name": "environment", + "in": "query", + "description": "Service environment", + "schema": { + "type": "string" + }, + "example": "prod" + } + ], + "responses": { + "200": { + "description": "Successful response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/single_agent_configuration_response" + } + } + } + }, + "400": { + "description": "Bad Request response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/400_response" + } + } + } + }, + "401": { + "description": "Unauthorized response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/401_response" + } + } + } + }, + "404": { + "description": "Not found response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/404_response" + } + } + } + } + } + } + }, + "/api/apm/settings/agent-configuration/search": { + "post": { + "summary": "Lookup single agent configuration", + "description": "This endpoint allows to search for single agent configuration and update 'applied_by_agent' field.\n", + "operationId": "searchSingleConfiguration", + "tags": [ + "APM agent configuration" + ], + "parameters": [ + { + "$ref": "#/components/parameters/elastic_api_version" + }, + { + "$ref": "#/components/parameters/kbn_xsrf" + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/search_agent_configuration_object" + } + } + } + }, + "responses": { + "200": { + "description": "Successful response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/search_agent_configuration_response" + } + } + } + }, + "400": { + "description": "Bad Request response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/400_response" + } + } + } + }, + "401": { + "description": "Unauthorized response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/401_response" + } + } + } + }, + "404": { + "description": "Not found response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/404_response" + } + } + } + } + } + } + }, + "/api/apm/settings/agent-configuration/environments": { + "get": { + "summary": "Get environments for service", + "operationId": "getEnvironmentsForService", + "tags": [ + "APM agent configuration" + ], + "parameters": [ + { + "$ref": "#/components/parameters/elastic_api_version" + }, + { + "name": "serviceName", + "in": "query", + "description": "The name of the service", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Successful response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/service_environments_response" + } + } + } + }, + "400": { + "description": "Bad Request response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/400_response" + } + } + } + }, + "401": { + "description": "Unauthorized response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/401_response" + } + } + } + }, + "404": { + "description": "Not found response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/404_response" + } + } + } + } + } + } + }, + "/api/apm/settings/agent-configuration/agent_name": { + "get": { + "summary": "Get agent name for service", + "description": "Retrieve `agentName` for a service.", + "operationId": "getAgentNameForService", + "tags": [ + "APM agent configuration" + ], + "parameters": [ + { + "$ref": "#/components/parameters/elastic_api_version" + }, + { + "name": "serviceName", + "in": "query", + "description": "The name of the service", + "required": true, + "schema": { + "type": "string" + }, + "example": "node" + } + ], + "responses": { + "200": { + "description": "Successful response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/service_agent_name_response" + } + } + } + }, + "400": { + "description": "Bad Request response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/400_response" + } + } + } + }, + "401": { + "description": "Unauthorized response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/401_response" + } + } + } + }, + "404": { + "description": "Not found response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/404_response" + } + } + } + } + } + } + }, + "/api/apm/sourcemaps": { + "get": { + "summary": "Get source maps", + "description": "Returns an array of Fleet artifacts, including source map uploads.", + "operationId": "getSourceMaps", + "tags": [ + "APM sourcemaps" + ], + "parameters": [ + { + "$ref": "#/components/parameters/elastic_api_version" + }, + { + "name": "page", + "in": "query", + "description": "Page number", + "schema": { + "type": "number" + } + }, + { + "name": "perPage", + "in": "query", + "description": "Number of records per page", + "schema": { + "type": "number" + } + } + ], + "responses": { + "200": { + "description": "Successful response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/source_maps_response" + } + } + } + }, + "400": { + "description": "Bad Request response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/400_response" + } + } + } + }, + "401": { + "description": "Unauthorized response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/401_response" + } + } + } + }, + "500": { + "description": "Internal Server Error response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/500_response" + } + } + } + }, + "501": { + "description": "Not Implemented response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/501_response" + } + } + } + } + } + }, + "post": { + "summary": "Upload source map", + "description": "Upload a source map for a specific service and version.", + "operationId": "uploadSourceMap", + "tags": [ + "APM sourcemaps" + ], + "parameters": [ + { + "$ref": "#/components/parameters/elastic_api_version" + }, + { + "$ref": "#/components/parameters/kbn_xsrf" + } + ], + "requestBody": { + "required": true, + "content": { + "multipart/form-data": { + "schema": { + "$ref": "#/components/schemas/upload_source_map_object" + } + } + } + }, + "responses": { + "200": { + "description": "Successful response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/upload_source_maps_response" + } + } + } + }, + "400": { + "description": "Bad Request response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/400_response" + } + } + } + }, + "401": { + "description": "Unauthorized response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/401_response" + } + } + } + }, + "403": { + "description": "Forbidden response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/403_response" + } + } + } + }, + "500": { + "description": "Internal Server Error response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/500_response" + } + } + } + }, + "501": { + "description": "Not Implemented response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/501_response" + } + } + } + } + } + } + }, + "/api/apm/sourcemaps/{id}": { + "delete": { + "summary": "Delete source map", + "description": "Delete a previously uploaded source map.", + "operationId": "deleteSourceMap", + "tags": [ + "APM sourcemaps" + ], + "parameters": [ + { + "$ref": "#/components/parameters/elastic_api_version" + }, + { + "$ref": "#/components/parameters/kbn_xsrf" + }, + { + "name": "id", + "in": "path", + "description": "Source map identifier", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Successful response", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": false + } + } + } + }, + "400": { + "description": "Bad Request response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/400_response" + } + } + } + }, + "401": { + "description": "Unauthorized response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/401_response" + } + } + } + }, + "403": { + "description": "Forbidden response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/403_response" + } + } + } + }, + "500": { + "description": "Internal Server Error response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/500_response" + } + } + } + }, + "501": { + "description": "Not Implemented response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/501_response" + } + } + } + } + } + } + }, + "/api/apm/fleet/apm_server_schema": { + "post": { + "summary": "Save APM server schema", + "operationId": "saveApmServerSchema", + "tags": [ + "APM server schema" + ], + "parameters": [ + { + "$ref": "#/components/parameters/elastic_api_version" + }, + { + "$ref": "#/components/parameters/kbn_xsrf" + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "schema": { + "type": "object", + "description": "Schema object", + "additionalProperties": true, + "example": { + "foo": "bar" + } + } + } + } + } + } + }, + "responses": { + "200": { + "description": "Successful response", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": false + } + } + } + }, + "400": { + "description": "Bad Request response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/400_response" + } + } + } + }, + "401": { + "description": "Unauthorized response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/401_response" + } + } + } + }, + "403": { + "description": "Forbidden response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/403_response" + } + } + } + }, + "404": { + "description": "Not found response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/404_response" + } + } + } + } + } + } + } + }, + "components": { + "parameters": { + "elastic_api_version": { + "description": "The version of the API to use", + "in": "header", + "name": "elastic-api-version", + "required": true, + "schema": { + "default": "2023-10-31", + "enum": [ + "2023-10-31" + ], + "type": "string" + } + }, + "kbn_xsrf": { + "description": "A required header to protect against CSRF attacks", + "in": "header", + "name": "kbn-xsrf", + "required": true, + "schema": { + "example": "true", + "type": "string" + } + } + }, + "schemas": { + "agent_keys_object": { + "type": "object", + "required": [ + "name", + "privileges" + ], + "properties": { + "name": { + "type": "string", + "description": "Agent name" + }, + "privileges": { + "type": "array", + "description": "Privileges configuration", + "items": { + "type": "string", + "enum": [ + "event:write", + "config_agent:read" + ] + } + } + } + }, + "agent_keys_response": { + "type": "object", + "properties": { + "agentKey": { + "type": "object", + "description": "Agent key", + "required": [ + "id", + "name", + "api_key", + "encoded" + ], + "properties": { + "expiration": { + "type": "integer", + "format": "int64" + }, + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "api_key": { + "type": "string" + }, + "encoded": { + "type": "string" + } + } + } + } + }, + "400_response": { + "type": "object", + "properties": { + "statusCode": { + "type": "number", + "example": 400, + "description": "Error status code" + }, + "error": { + "type": "string", + "example": "Not Found", + "description": "Error type" + }, + "message": { + "type": "string", + "example": "Not Found", + "description": "Error message" + } + } + }, + "401_response": { + "type": "object", + "properties": { + "statusCode": { + "type": "number", + "example": 401, + "description": "Error status code" + }, + "error": { + "type": "string", + "example": "Unauthorized", + "description": "Error type" + }, + "message": { + "type": "string", + "description": "Error message" + } + } + }, + "403_response": { + "type": "object", + "properties": { + "statusCode": { + "type": "number", + "example": 403, + "description": "Error status code" + }, + "error": { + "type": "string", + "example": "Forbidden", + "description": "Error type" + }, + "message": { + "type": "string", + "description": "Error message" + } + } + }, + "500_response": { + "type": "object", + "properties": { + "statusCode": { + "type": "number", + "example": 500, + "description": "Error status code" + }, + "error": { + "type": "string", + "example": "Internal Server Error", + "description": "Error type" + }, + "message": { + "type": "string", + "description": "Error message" + } + } + }, + "annotation_search_response": { + "type": "object", + "properties": { + "annotations": { + "type": "array", + "description": "Annotations", + "items": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "version" + ] + }, + "id": { + "type": "string" + }, + "@timestamp": { + "type": "number" + }, + "text": { + "type": "string" + } + } + } + } + } + }, + "create_annotation_object": { + "type": "object", + "required": [ + "@timestamp", + "service" + ], + "properties": { + "@timestamp": { + "type": "string", + "description": "Timestamp" + }, + "service": { + "type": "object", + "description": "Service", + "required": [ + "version" + ], + "properties": { + "version": { + "type": "string" + }, + "environment": { + "type": "string" + } + } + }, + "message": { + "type": "string", + "description": "Message" + }, + "tags": { + "type": "array", + "description": "Tags", + "items": { + "type": "string" + } + } + } + }, + "create_annotation_response": { + "type": "object", + "properties": { + "_id": { + "type": "string", + "description": "Identifier" + }, + "_index": { + "type": "string", + "description": "Index" + }, + "_source": { + "type": "object", + "description": "Response", + "properties": { + "annotation": { + "type": "object", + "properties": { + "type": { + "type": "string" + }, + "title": { + "type": "string" + } + } + }, + "tags": { + "type": "array", + "items": { + "type": "string" + } + }, + "message": { + "type": "string" + }, + "service": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "environment": { + "type": "string" + }, + "version": { + "type": "string" + } + } + }, + "event": { + "type": "object", + "properties": { + "created": { + "type": "string" + } + } + }, + "@timestamp": { + "type": "string" + } + } + } + } + }, + "404_response": { + "type": "object", + "properties": { + "statusCode": { + "type": "number", + "example": 404, + "description": "Error status code" + }, + "error": { + "type": "string", + "example": "Not Found", + "description": "Error type" + }, + "message": { + "type": "string", + "example": "Not Found", + "description": "Error message" + } + } + }, + "service_object": { + "type": "object", + "description": "Service", + "properties": { + "name": { + "type": "string", + "example": "node", + "description": "Name" + }, + "environment": { + "type": "string", + "example": "prod", + "description": "Environment" + } + } + }, + "settings_object": { + "type": "object", + "description": "Agent configuration settings", + "additionalProperties": { + "type": "string" + } + }, + "agent_configuration_object": { + "type": "object", + "required": [ + "service", + "settings", + "@timestamp", + "etag" + ], + "description": "Agent configuration", + "properties": { + "agent_name": { + "type": "string", + "description": "Agent name" + }, + "service": { + "$ref": "#/components/schemas/service_object" + }, + "settings": { + "$ref": "#/components/schemas/settings_object" + }, + "@timestamp": { + "type": "number", + "example": 1730194190636, + "description": "Timestamp" + }, + "applied_by_agent": { + "type": "boolean", + "example": true, + "description": "Applied by agent" + }, + "etag": { + "type": "string", + "example": "0bc3b5ebf18fba8163fe4c96f491e3767a358f85", + "description": "Etag" + } + } + }, + "agent_configurations_response": { + "type": "object", + "properties": { + "configurations": { + "type": "array", + "description": "Agent configuration", + "items": { + "$ref": "#/components/schemas/agent_configuration_object" + } + } + } + }, + "agent_configuration_intake_object": { + "type": "object", + "required": [ + "service", + "settings" + ], + "properties": { + "agent_name": { + "type": "string", + "description": "Agent name" + }, + "service": { + "$ref": "#/components/schemas/service_object" + }, + "settings": { + "$ref": "#/components/schemas/settings_object" + } + } + }, + "delete_agent_configurations_response": { + "type": "object", + "properties": { + "result": { + "type": "string", + "description": "Result" + } + } + }, + "single_agent_configuration_response": { + "allOf": [ + { + "type": "object", + "required": [ + "id" + ], + "properties": { + "id": { + "type": "string" + } + } + }, + { + "$ref": "#/components/schemas/agent_configuration_object" + } + ] + }, + "search_agent_configuration_object": { + "type": "object", + "required": [ + "service" + ], + "properties": { + "service": { + "$ref": "#/components/schemas/service_object" + }, + "etag": { + "type": "string", + "description": "If etags match then `applied_by_agent` field will be set to `true`", + "example": "0bc3b5ebf18fba8163fe4c96f491e3767a358f85" + }, + "mark_as_applied_by_agent": { + "type": "boolean", + "description": "`markAsAppliedByAgent=true` means \"force setting it to true regardless of etag\".\nThis is needed for Jaeger agent that doesn't have etags\n" + } + } + }, + "search_agent_configuration_response": { + "type": "object", + "properties": { + "_index": { + "type": "string", + "description": "Index" + }, + "_id": { + "type": "string", + "description": "Identifier" + }, + "_score": { + "type": "number", + "description": "Score" + }, + "_source": { + "$ref": "#/components/schemas/agent_configuration_object" + } + } + }, + "service_environment_object": { + "type": "object", + "properties": { + "name": { + "type": "string", + "example": "ALL_OPTION_VALUE", + "description": "Service environment name" + }, + "alreadyConfigured": { + "type": "boolean", + "description": "Already configured" + } + } + }, + "service_environments_response": { + "type": "object", + "properties": { + "environments": { + "type": "array", + "description": "Service environment list", + "items": { + "$ref": "#/components/schemas/service_environment_object" + } + } + } + }, + "service_agent_name_response": { + "type": "object", + "properties": { + "agentName": { + "type": "string", + "description": "Agent name", + "example": "nodejs" + } + } + }, + "base_source_map_object": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "Type" + }, + "identifier": { + "type": "string", + "description": "Identifier" + }, + "relative_url": { + "type": "string", + "description": "Relative URL" + }, + "created": { + "type": "string", + "description": "Created date" + }, + "id": { + "type": "string", + "description": "Identifier" + }, + "compressionAlgorithm": { + "type": "string", + "description": "Compression Algorithm" + }, + "decodedSha256": { + "type": "string", + "description": "Decoded SHA-256" + }, + "decodedSize": { + "type": "number", + "description": "Decoded size" + }, + "encodedSha256": { + "type": "string", + "description": "Encoded SHA-256" + }, + "encodedSize": { + "type": "number", + "description": "Encoded size" + }, + "encryptionAlgorithm": { + "type": "string", + "description": "Encryption Algorithm" + }, + "packageName": { + "type": "string", + "description": "Package name" + } + } + }, + "source_maps_response": { + "type": "object", + "properties": { + "artifacts": { + "type": "array", + "description": "Artifacts", + "items": { + "allOf": [ + { + "type": "object", + "properties": { + "body": { + "type": "object", + "properties": { + "serviceName": { + "type": "string" + }, + "serviceVersion": { + "type": "string" + }, + "bundleFilepath": { + "type": "string" + }, + "sourceMap": { + "type": "object", + "properties": { + "version": { + "type": "number" + }, + "file": { + "type": "string" + }, + "sources": { + "type": "array", + "items": { + "type": "string" + } + }, + "sourcesContent": { + "type": "array", + "items": { + "type": "string" + } + }, + "mappings": { + "type": "string" + }, + "sourceRoot": { + "type": "string" + } + } + } + } + } + } + }, + { + "$ref": "#/components/schemas/base_source_map_object" + } + ] + } + } + } + }, + "501_response": { + "type": "object", + "properties": { + "statusCode": { + "type": "number", + "example": 501, + "description": "Error status code" + }, + "error": { + "type": "string", + "example": "Not Implemented", + "description": "Error type" + }, + "message": { + "type": "string", + "example": "Not Implemented", + "description": "Error message" + } + } + }, + "upload_source_map_object": { + "type": "object", + "required": [ + "service_name", + "service_version", + "bundle_filepath", + "sourcemap" + ], + "properties": { + "service_name": { + "type": "string", + "description": "The name of the service that the service map should apply to." + }, + "service_version": { + "type": "string", + "description": "The version of the service that the service map should apply to." + }, + "bundle_filepath": { + "type": "string", + "description": "The absolute path of the final bundle as used in the web application." + }, + "sourcemap": { + "type": "string", + "format": "binary", + "description": "The source map. String or file upload. It must follow the\n[source map revision 3 proposal](https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k).\n" + } + } + }, + "upload_source_maps_response": { + "allOf": [ + { + "type": "object", + "properties": { + "body": { + "type": "string" + } + } + }, + { + "$ref": "#/components/schemas/base_source_map_object" + } + ] + } + } + } +} \ No newline at end of file diff --git a/x-pack/plugins/observability_solution/apm/docs/openapi/apm/bundled.yaml b/x-pack/plugins/observability_solution/apm/docs/openapi/apm/bundled.yaml new file mode 100644 index 0000000000000..caa71f6645e77 --- /dev/null +++ b/x-pack/plugins/observability_solution/apm/docs/openapi/apm/bundled.yaml @@ -0,0 +1,1162 @@ +openapi: 3.0.2 +info: + title: APM UI + version: 1.0.0 +tags: + - name: APM agent keys + description: | + Configure APM agent keys to authorize requests from APM agents to the APM Server. + - name: APM agent configuration + description: | + Adjust APM agent configuration without need to redeploy your application. + - name: APM sourcemaps + description: Configure APM source maps. + - name: APM annotations + description: | + Annotate visualizations in the APM app with significant events. Annotations enable you to easily see how events are impacting the performance of your applications. + - name: APM server schema + description: Create APM fleet server schema. +paths: + /api/apm/agent_keys: + post: + summary: Create an APM agent key + description: Create a new agent key for APM. + operationId: createAgentKey + tags: + - APM agent keys + parameters: + - $ref: '#/components/parameters/elastic_api_version' + - $ref: '#/components/parameters/kbn_xsrf' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/agent_keys_object' + responses: + '200': + description: Agent key created successfully + content: + application/json: + schema: + $ref: '#/components/schemas/agent_keys_response' + '400': + description: Bad Request response + content: + application/json: + schema: + $ref: '#/components/schemas/400_response' + '401': + description: Unauthorized response + content: + application/json: + schema: + $ref: '#/components/schemas/401_response' + '403': + description: Forbidden response + content: + application/json: + schema: + $ref: '#/components/schemas/403_response' + '500': + description: Internal Server Error response + content: + application/json: + schema: + $ref: '#/components/schemas/500_response' + /api/apm/services/{serviceName}/annotation/search: + get: + summary: Search for annotations + description: Search for annotations related to a specific service. + operationId: getAnnotation + tags: + - APM annotations + parameters: + - $ref: '#/components/parameters/elastic_api_version' + - name: serviceName + in: path + required: true + description: The name of the service + schema: + type: string + - name: environment + in: query + required: false + description: The environment to filter annotations by + schema: + type: string + - name: start + in: query + required: false + description: The start date for the search + schema: + type: string + - name: end + in: query + required: false + description: The end date for the search + schema: + type: string + responses: + '200': + description: Successful response + content: + application/json: + schema: + $ref: '#/components/schemas/annotation_search_response' + '400': + description: Bad Request response + content: + application/json: + schema: + $ref: '#/components/schemas/400_response' + '401': + description: Unauthorized response + content: + application/json: + schema: + $ref: '#/components/schemas/401_response' + '500': + description: Internal Server Error response + content: + application/json: + schema: + $ref: '#/components/schemas/500_response' + /api/apm/services/{serviceName}/annotation: + post: + summary: Create a service annotation + description: Create a new annotation for a specific service. + operationId: createAnnotation + tags: + - APM annotations + parameters: + - $ref: '#/components/parameters/elastic_api_version' + - $ref: '#/components/parameters/kbn_xsrf' + - name: serviceName + in: path + required: true + description: The name of the service + schema: + type: string + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/create_annotation_object' + responses: + '200': + description: Annotation created successfully + content: + application/json: + schema: + $ref: '#/components/schemas/create_annotation_response' + '400': + description: Bad Request response + content: + application/json: + schema: + $ref: '#/components/schemas/400_response' + '401': + description: Unauthorized response + content: + application/json: + schema: + $ref: '#/components/schemas/401_response' + '403': + description: Forbidden response + content: + application/json: + schema: + $ref: '#/components/schemas/403_response' + '404': + description: Not found response + content: + application/json: + schema: + $ref: '#/components/schemas/404_response' + /api/apm/settings/agent-configuration: + get: + summary: Get a list of agent configurations + operationId: getAgentConfigurations + tags: + - APM agent configuration + parameters: + - $ref: '#/components/parameters/elastic_api_version' + responses: + '200': + description: Successful response + content: + application/json: + schema: + $ref: '#/components/schemas/agent_configurations_response' + '400': + description: Bad Request response + content: + application/json: + schema: + $ref: '#/components/schemas/400_response' + '401': + description: Unauthorized response + content: + application/json: + schema: + $ref: '#/components/schemas/401_response' + '404': + description: Not found response + content: + application/json: + schema: + $ref: '#/components/schemas/404_response' + delete: + summary: Delete agent configuration + operationId: deleteAgentConfiguration + tags: + - APM agent configuration + parameters: + - $ref: '#/components/parameters/elastic_api_version' + - $ref: '#/components/parameters/kbn_xsrf' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/service_object' + responses: + '200': + description: Successful response + content: + application/json: + schema: + $ref: '#/components/schemas/delete_agent_configurations_response' + '400': + description: Bad Request response + content: + application/json: + schema: + $ref: '#/components/schemas/400_response' + '401': + description: Unauthorized response + content: + application/json: + schema: + $ref: '#/components/schemas/401_response' + '403': + description: Forbidden response + content: + application/json: + schema: + $ref: '#/components/schemas/403_response' + '404': + description: Not found response + content: + application/json: + schema: + $ref: '#/components/schemas/404_response' + put: + summary: Create or update agent configuration + operationId: createUpdateAgentConfiguration + tags: + - APM agent configuration + parameters: + - $ref: '#/components/parameters/elastic_api_version' + - $ref: '#/components/parameters/kbn_xsrf' + - name: overwrite + in: query + description: If the config exists ?overwrite=true is required + schema: + type: boolean + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/agent_configuration_intake_object' + responses: + '200': + description: Successful response + content: + application/json: + schema: + type: object + additionalProperties: false + '400': + description: Bad Request response + content: + application/json: + schema: + $ref: '#/components/schemas/400_response' + '401': + description: Unauthorized response + content: + application/json: + schema: + $ref: '#/components/schemas/401_response' + '403': + description: Forbidden response + content: + application/json: + schema: + $ref: '#/components/schemas/403_response' + '404': + description: Not found response + content: + application/json: + schema: + $ref: '#/components/schemas/404_response' + /api/apm/settings/agent-configuration/view: + get: + summary: Get single agent configuration + operationId: getSingleAgentConfiguration + tags: + - APM agent configuration + parameters: + - $ref: '#/components/parameters/elastic_api_version' + - name: name + in: query + description: Service name + schema: + type: string + example: node + - name: environment + in: query + description: Service environment + schema: + type: string + example: prod + responses: + '200': + description: Successful response + content: + application/json: + schema: + $ref: '#/components/schemas/single_agent_configuration_response' + '400': + description: Bad Request response + content: + application/json: + schema: + $ref: '#/components/schemas/400_response' + '401': + description: Unauthorized response + content: + application/json: + schema: + $ref: '#/components/schemas/401_response' + '404': + description: Not found response + content: + application/json: + schema: + $ref: '#/components/schemas/404_response' + /api/apm/settings/agent-configuration/search: + post: + summary: Lookup single agent configuration + description: | + This endpoint allows to search for single agent configuration and update 'applied_by_agent' field. + operationId: searchSingleConfiguration + tags: + - APM agent configuration + parameters: + - $ref: '#/components/parameters/elastic_api_version' + - $ref: '#/components/parameters/kbn_xsrf' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/search_agent_configuration_object' + responses: + '200': + description: Successful response + content: + application/json: + schema: + $ref: '#/components/schemas/search_agent_configuration_response' + '400': + description: Bad Request response + content: + application/json: + schema: + $ref: '#/components/schemas/400_response' + '401': + description: Unauthorized response + content: + application/json: + schema: + $ref: '#/components/schemas/401_response' + '404': + description: Not found response + content: + application/json: + schema: + $ref: '#/components/schemas/404_response' + /api/apm/settings/agent-configuration/environments: + get: + summary: Get environments for service + operationId: getEnvironmentsForService + tags: + - APM agent configuration + parameters: + - $ref: '#/components/parameters/elastic_api_version' + - name: serviceName + in: query + description: The name of the service + schema: + type: string + responses: + '200': + description: Successful response + content: + application/json: + schema: + $ref: '#/components/schemas/service_environments_response' + '400': + description: Bad Request response + content: + application/json: + schema: + $ref: '#/components/schemas/400_response' + '401': + description: Unauthorized response + content: + application/json: + schema: + $ref: '#/components/schemas/401_response' + '404': + description: Not found response + content: + application/json: + schema: + $ref: '#/components/schemas/404_response' + /api/apm/settings/agent-configuration/agent_name: + get: + summary: Get agent name for service + description: Retrieve `agentName` for a service. + operationId: getAgentNameForService + tags: + - APM agent configuration + parameters: + - $ref: '#/components/parameters/elastic_api_version' + - name: serviceName + in: query + description: The name of the service + required: true + schema: + type: string + example: node + responses: + '200': + description: Successful response + content: + application/json: + schema: + $ref: '#/components/schemas/service_agent_name_response' + '400': + description: Bad Request response + content: + application/json: + schema: + $ref: '#/components/schemas/400_response' + '401': + description: Unauthorized response + content: + application/json: + schema: + $ref: '#/components/schemas/401_response' + '404': + description: Not found response + content: + application/json: + schema: + $ref: '#/components/schemas/404_response' + /api/apm/sourcemaps: + get: + summary: Get source maps + description: Returns an array of Fleet artifacts, including source map uploads. + operationId: getSourceMaps + tags: + - APM sourcemaps + parameters: + - $ref: '#/components/parameters/elastic_api_version' + - name: page + in: query + description: Page number + schema: + type: number + - name: perPage + in: query + description: Number of records per page + schema: + type: number + responses: + '200': + description: Successful response + content: + application/json: + schema: + $ref: '#/components/schemas/source_maps_response' + '400': + description: Bad Request response + content: + application/json: + schema: + $ref: '#/components/schemas/400_response' + '401': + description: Unauthorized response + content: + application/json: + schema: + $ref: '#/components/schemas/401_response' + '500': + description: Internal Server Error response + content: + application/json: + schema: + $ref: '#/components/schemas/500_response' + '501': + description: Not Implemented response + content: + application/json: + schema: + $ref: '#/components/schemas/501_response' + post: + summary: Upload source map + description: Upload a source map for a specific service and version. + operationId: uploadSourceMap + tags: + - APM sourcemaps + parameters: + - $ref: '#/components/parameters/elastic_api_version' + - $ref: '#/components/parameters/kbn_xsrf' + requestBody: + required: true + content: + multipart/form-data: + schema: + $ref: '#/components/schemas/upload_source_map_object' + responses: + '200': + description: Successful response + content: + application/json: + schema: + $ref: '#/components/schemas/upload_source_maps_response' + '400': + description: Bad Request response + content: + application/json: + schema: + $ref: '#/components/schemas/400_response' + '401': + description: Unauthorized response + content: + application/json: + schema: + $ref: '#/components/schemas/401_response' + '403': + description: Forbidden response + content: + application/json: + schema: + $ref: '#/components/schemas/403_response' + '500': + description: Internal Server Error response + content: + application/json: + schema: + $ref: '#/components/schemas/500_response' + '501': + description: Not Implemented response + content: + application/json: + schema: + $ref: '#/components/schemas/501_response' + /api/apm/sourcemaps/{id}: + delete: + summary: Delete source map + description: Delete a previously uploaded source map. + operationId: deleteSourceMap + tags: + - APM sourcemaps + parameters: + - $ref: '#/components/parameters/elastic_api_version' + - $ref: '#/components/parameters/kbn_xsrf' + - name: id + in: path + description: Source map identifier + required: true + schema: + type: string + responses: + '200': + description: Successful response + content: + application/json: + schema: + type: object + additionalProperties: false + '400': + description: Bad Request response + content: + application/json: + schema: + $ref: '#/components/schemas/400_response' + '401': + description: Unauthorized response + content: + application/json: + schema: + $ref: '#/components/schemas/401_response' + '403': + description: Forbidden response + content: + application/json: + schema: + $ref: '#/components/schemas/403_response' + '500': + description: Internal Server Error response + content: + application/json: + schema: + $ref: '#/components/schemas/500_response' + '501': + description: Not Implemented response + content: + application/json: + schema: + $ref: '#/components/schemas/501_response' + /api/apm/fleet/apm_server_schema: + post: + summary: Save APM server schema + operationId: saveApmServerSchema + tags: + - APM server schema + parameters: + - $ref: '#/components/parameters/elastic_api_version' + - $ref: '#/components/parameters/kbn_xsrf' + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + schema: + type: object + description: Schema object + additionalProperties: true + example: + foo: bar + responses: + '200': + description: Successful response + content: + application/json: + schema: + type: object + additionalProperties: false + '400': + description: Bad Request response + content: + application/json: + schema: + $ref: '#/components/schemas/400_response' + '401': + description: Unauthorized response + content: + application/json: + schema: + $ref: '#/components/schemas/401_response' + '403': + description: Forbidden response + content: + application/json: + schema: + $ref: '#/components/schemas/403_response' + '404': + description: Not found response + content: + application/json: + schema: + $ref: '#/components/schemas/404_response' +components: + parameters: + elastic_api_version: + description: The version of the API to use + in: header + name: elastic-api-version + required: true + schema: + default: '2023-10-31' + enum: + - '2023-10-31' + type: string + kbn_xsrf: + description: A required header to protect against CSRF attacks + in: header + name: kbn-xsrf + required: true + schema: + example: 'true' + type: string + schemas: + agent_keys_object: + type: object + required: + - name + - privileges + properties: + name: + type: string + description: Agent name + privileges: + type: array + description: Privileges configuration + items: + type: string + enum: + - event:write + - config_agent:read + agent_keys_response: + type: object + properties: + agentKey: + type: object + description: Agent key + required: + - id + - name + - api_key + - encoded + properties: + expiration: + type: integer + format: int64 + id: + type: string + name: + type: string + api_key: + type: string + encoded: + type: string + 400_response: + type: object + properties: + statusCode: + type: number + example: 400 + description: Error status code + error: + type: string + example: Not Found + description: Error type + message: + type: string + example: Not Found + description: Error message + 401_response: + type: object + properties: + statusCode: + type: number + example: 401 + description: Error status code + error: + type: string + example: Unauthorized + description: Error type + message: + type: string + description: Error message + 403_response: + type: object + properties: + statusCode: + type: number + example: 403 + description: Error status code + error: + type: string + example: Forbidden + description: Error type + message: + type: string + description: Error message + 500_response: + type: object + properties: + statusCode: + type: number + example: 500 + description: Error status code + error: + type: string + example: Internal Server Error + description: Error type + message: + type: string + description: Error message + annotation_search_response: + type: object + properties: + annotations: + type: array + description: Annotations + items: + type: object + properties: + type: + type: string + enum: + - version + id: + type: string + '@timestamp': + type: number + text: + type: string + create_annotation_object: + type: object + required: + - '@timestamp' + - service + properties: + '@timestamp': + type: string + description: Timestamp + service: + type: object + description: Service + required: + - version + properties: + version: + type: string + environment: + type: string + message: + type: string + description: Message + tags: + type: array + description: Tags + items: + type: string + create_annotation_response: + type: object + properties: + _id: + type: string + description: Identifier + _index: + type: string + description: Index + _source: + type: object + description: Response + properties: + annotation: + type: object + properties: + type: + type: string + title: + type: string + tags: + type: array + items: + type: string + message: + type: string + service: + type: object + properties: + name: + type: string + environment: + type: string + version: + type: string + event: + type: object + properties: + created: + type: string + '@timestamp': + type: string + 404_response: + type: object + properties: + statusCode: + type: number + example: 404 + description: Error status code + error: + type: string + example: Not Found + description: Error type + message: + type: string + example: Not Found + description: Error message + service_object: + type: object + description: Service + properties: + name: + type: string + example: node + description: Name + environment: + type: string + example: prod + description: Environment + settings_object: + type: object + description: Agent configuration settings + additionalProperties: + type: string + agent_configuration_object: + type: object + required: + - service + - settings + - '@timestamp' + - etag + description: Agent configuration + properties: + agent_name: + type: string + description: Agent name + service: + $ref: '#/components/schemas/service_object' + settings: + $ref: '#/components/schemas/settings_object' + '@timestamp': + type: number + example: 1730194190636 + description: Timestamp + applied_by_agent: + type: boolean + example: true + description: Applied by agent + etag: + type: string + example: 0bc3b5ebf18fba8163fe4c96f491e3767a358f85 + description: Etag + agent_configurations_response: + type: object + properties: + configurations: + type: array + description: Agent configuration + items: + $ref: '#/components/schemas/agent_configuration_object' + agent_configuration_intake_object: + type: object + required: + - service + - settings + properties: + agent_name: + type: string + description: Agent name + service: + $ref: '#/components/schemas/service_object' + settings: + $ref: '#/components/schemas/settings_object' + delete_agent_configurations_response: + type: object + properties: + result: + type: string + description: Result + single_agent_configuration_response: + allOf: + - type: object + required: + - id + properties: + id: + type: string + - $ref: '#/components/schemas/agent_configuration_object' + search_agent_configuration_object: + type: object + required: + - service + properties: + service: + $ref: '#/components/schemas/service_object' + etag: + type: string + description: If etags match then `applied_by_agent` field will be set to `true` + example: 0bc3b5ebf18fba8163fe4c96f491e3767a358f85 + mark_as_applied_by_agent: + type: boolean + description: | + `markAsAppliedByAgent=true` means "force setting it to true regardless of etag". + This is needed for Jaeger agent that doesn't have etags + search_agent_configuration_response: + type: object + properties: + _index: + type: string + description: Index + _id: + type: string + description: Identifier + _score: + type: number + description: Score + _source: + $ref: '#/components/schemas/agent_configuration_object' + service_environment_object: + type: object + properties: + name: + type: string + example: ALL_OPTION_VALUE + description: Service environment name + alreadyConfigured: + type: boolean + description: Already configured + service_environments_response: + type: object + properties: + environments: + type: array + description: Service environment list + items: + $ref: '#/components/schemas/service_environment_object' + service_agent_name_response: + type: object + properties: + agentName: + type: string + description: Agent name + example: nodejs + base_source_map_object: + type: object + properties: + type: + type: string + description: Type + identifier: + type: string + description: Identifier + relative_url: + type: string + description: Relative URL + created: + type: string + description: Created date + id: + type: string + description: Identifier + compressionAlgorithm: + type: string + description: Compression Algorithm + decodedSha256: + type: string + description: Decoded SHA-256 + decodedSize: + type: number + description: Decoded size + encodedSha256: + type: string + description: Encoded SHA-256 + encodedSize: + type: number + description: Encoded size + encryptionAlgorithm: + type: string + description: Encryption Algorithm + packageName: + type: string + description: Package name + source_maps_response: + type: object + properties: + artifacts: + type: array + description: Artifacts + items: + allOf: + - type: object + properties: + body: + type: object + properties: + serviceName: + type: string + serviceVersion: + type: string + bundleFilepath: + type: string + sourceMap: + type: object + properties: + version: + type: number + file: + type: string + sources: + type: array + items: + type: string + sourcesContent: + type: array + items: + type: string + mappings: + type: string + sourceRoot: + type: string + - $ref: '#/components/schemas/base_source_map_object' + 501_response: + type: object + properties: + statusCode: + type: number + example: 501 + description: Error status code + error: + type: string + example: Not Implemented + description: Error type + message: + type: string + example: Not Implemented + description: Error message + upload_source_map_object: + type: object + required: + - service_name + - service_version + - bundle_filepath + - sourcemap + properties: + service_name: + type: string + description: The name of the service that the service map should apply to. + service_version: + type: string + description: The version of the service that the service map should apply to. + bundle_filepath: + type: string + description: The absolute path of the final bundle as used in the web application. + sourcemap: + type: string + format: binary + description: | + The source map. String or file upload. It must follow the + [source map revision 3 proposal](https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k). + upload_source_maps_response: + allOf: + - type: object + properties: + body: + type: string + - $ref: '#/components/schemas/base_source_map_object' diff --git a/x-pack/plugins/observability_solution/apm/docs/openapi/apm/components/README.md b/x-pack/plugins/observability_solution/apm/docs/openapi/apm/components/README.md new file mode 100644 index 0000000000000..6beadcd86e1e9 --- /dev/null +++ b/x-pack/plugins/observability_solution/apm/docs/openapi/apm/components/README.md @@ -0,0 +1,7 @@ +Reusable components +=========== + + - `examples` - reusable [Example objects](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.2.md#example-object) + - `headers` - reusable [Header objects](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#header-object) + - `parameters` - reusable [Parameter objects](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#parameter-object) + - `schemas` - reusable [Schema objects](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.2.md#schema-object) diff --git a/x-pack/plugins/observability_solution/apm/docs/openapi/apm/components/headers/elastic_api_version.yaml b/x-pack/plugins/observability_solution/apm/docs/openapi/apm/components/headers/elastic_api_version.yaml new file mode 100644 index 0000000000000..b11a093b7b581 --- /dev/null +++ b/x-pack/plugins/observability_solution/apm/docs/openapi/apm/components/headers/elastic_api_version.yaml @@ -0,0 +1,9 @@ +description: The version of the API to use +in: header +name: elastic-api-version +required: true +schema: + default: '2023-10-31' + enum: + - '2023-10-31' + type: string diff --git a/x-pack/plugins/observability_solution/apm/docs/openapi/apm/components/headers/kbn_xsrf.yaml b/x-pack/plugins/observability_solution/apm/docs/openapi/apm/components/headers/kbn_xsrf.yaml new file mode 100644 index 0000000000000..25fcd49c04e65 --- /dev/null +++ b/x-pack/plugins/observability_solution/apm/docs/openapi/apm/components/headers/kbn_xsrf.yaml @@ -0,0 +1,7 @@ +description: A required header to protect against CSRF attacks +in: header +name: kbn-xsrf +required: true +schema: + example: 'true' + type: string diff --git a/x-pack/plugins/observability_solution/apm/docs/openapi/apm/components/schemas/400_response.yaml b/x-pack/plugins/observability_solution/apm/docs/openapi/apm/components/schemas/400_response.yaml new file mode 100644 index 0000000000000..3f09203cd49d3 --- /dev/null +++ b/x-pack/plugins/observability_solution/apm/docs/openapi/apm/components/schemas/400_response.yaml @@ -0,0 +1,14 @@ +type: object +properties: + statusCode: + type: number + example: 400 + description: Error status code + error: + type: string + example: Not Found + description: Error type + message: + type: string + example: Not Found + description: Error message diff --git a/x-pack/plugins/observability_solution/apm/docs/openapi/apm/components/schemas/401_response.yaml b/x-pack/plugins/observability_solution/apm/docs/openapi/apm/components/schemas/401_response.yaml new file mode 100644 index 0000000000000..cf5afb3482e6c --- /dev/null +++ b/x-pack/plugins/observability_solution/apm/docs/openapi/apm/components/schemas/401_response.yaml @@ -0,0 +1,13 @@ +type: object +properties: + statusCode: + type: number + example: 401 + description: Error status code + error: + type: string + example: Unauthorized + description: Error type + message: + type: string + description: Error message diff --git a/x-pack/plugins/observability_solution/apm/docs/openapi/apm/components/schemas/403_response.yaml b/x-pack/plugins/observability_solution/apm/docs/openapi/apm/components/schemas/403_response.yaml new file mode 100644 index 0000000000000..f04184dcb1bb2 --- /dev/null +++ b/x-pack/plugins/observability_solution/apm/docs/openapi/apm/components/schemas/403_response.yaml @@ -0,0 +1,13 @@ +type: object +properties: + statusCode: + type: number + example: 403 + description: Error status code + error: + type: string + example: Forbidden + description: Error type + message: + type: string + description: Error message diff --git a/x-pack/plugins/observability_solution/apm/docs/openapi/apm/components/schemas/404_response.yaml b/x-pack/plugins/observability_solution/apm/docs/openapi/apm/components/schemas/404_response.yaml new file mode 100644 index 0000000000000..9e539dcbda096 --- /dev/null +++ b/x-pack/plugins/observability_solution/apm/docs/openapi/apm/components/schemas/404_response.yaml @@ -0,0 +1,14 @@ +type: object +properties: + statusCode: + type: number + example: 404 + description: Error status code + error: + type: string + example: Not Found + description: Error type + message: + type: string + example: Not Found + description: Error message diff --git a/x-pack/plugins/observability_solution/apm/docs/openapi/apm/components/schemas/500_response.yaml b/x-pack/plugins/observability_solution/apm/docs/openapi/apm/components/schemas/500_response.yaml new file mode 100644 index 0000000000000..e952739138146 --- /dev/null +++ b/x-pack/plugins/observability_solution/apm/docs/openapi/apm/components/schemas/500_response.yaml @@ -0,0 +1,13 @@ +type: object +properties: + statusCode: + type: number + example: 500 + description: Error status code + error: + type: string + example: Internal Server Error + description: Error type + message: + type: string + description: Error message diff --git a/x-pack/plugins/observability_solution/apm/docs/openapi/apm/components/schemas/501_response.yaml b/x-pack/plugins/observability_solution/apm/docs/openapi/apm/components/schemas/501_response.yaml new file mode 100644 index 0000000000000..f5a1545f7183e --- /dev/null +++ b/x-pack/plugins/observability_solution/apm/docs/openapi/apm/components/schemas/501_response.yaml @@ -0,0 +1,14 @@ +type: object +properties: + statusCode: + type: number + example: 501 + description: Error status code + error: + type: string + example: Not Implemented + description: Error type + message: + type: string + example: Not Implemented + description: Error message diff --git a/x-pack/plugins/observability_solution/apm/docs/openapi/apm/components/schemas/agent_configuration_intake_object.yaml b/x-pack/plugins/observability_solution/apm/docs/openapi/apm/components/schemas/agent_configuration_intake_object.yaml new file mode 100644 index 0000000000000..0be4a414cd35a --- /dev/null +++ b/x-pack/plugins/observability_solution/apm/docs/openapi/apm/components/schemas/agent_configuration_intake_object.yaml @@ -0,0 +1,12 @@ +type: object +required: + - service + - settings +properties: + agent_name: + type: string + description: Agent name + service: + $ref: 'service_object.yaml' + settings: + $ref: 'settings_object.yaml' diff --git a/x-pack/plugins/observability_solution/apm/docs/openapi/apm/components/schemas/agent_configuration_object.yaml b/x-pack/plugins/observability_solution/apm/docs/openapi/apm/components/schemas/agent_configuration_object.yaml new file mode 100644 index 0000000000000..8dfa922c25874 --- /dev/null +++ b/x-pack/plugins/observability_solution/apm/docs/openapi/apm/components/schemas/agent_configuration_object.yaml @@ -0,0 +1,27 @@ +type: object +required: + - service + - settings + - '@timestamp' + - etag +description: Agent configuration +properties: + agent_name: + type: string + description: Agent name + service: + $ref: 'service_object.yaml' + settings: + $ref: 'settings_object.yaml' + '@timestamp': + type: number + example: 1730194190636 + description: Timestamp + applied_by_agent: + type: boolean + example: true + description: Applied by agent + etag: + type: string + example: 0bc3b5ebf18fba8163fe4c96f491e3767a358f85 + description: Etag diff --git a/x-pack/plugins/observability_solution/apm/docs/openapi/apm/components/schemas/agent_configurations_response.yaml b/x-pack/plugins/observability_solution/apm/docs/openapi/apm/components/schemas/agent_configurations_response.yaml new file mode 100644 index 0000000000000..a6bdb51466fb4 --- /dev/null +++ b/x-pack/plugins/observability_solution/apm/docs/openapi/apm/components/schemas/agent_configurations_response.yaml @@ -0,0 +1,7 @@ +type: object +properties: + configurations: + type: array + description: Agent configuration + items: + $ref: 'agent_configuration_object.yaml' diff --git a/x-pack/plugins/observability_solution/apm/docs/openapi/apm/components/schemas/agent_keys_object.yaml b/x-pack/plugins/observability_solution/apm/docs/openapi/apm/components/schemas/agent_keys_object.yaml new file mode 100644 index 0000000000000..c5e248471db90 --- /dev/null +++ b/x-pack/plugins/observability_solution/apm/docs/openapi/apm/components/schemas/agent_keys_object.yaml @@ -0,0 +1,16 @@ +type: object +required: + - name + - privileges +properties: + name: + type: string + description: Agent name + privileges: + type: array + description: Privileges configuration + items: + type: string + enum: + - event:write + - config_agent:read diff --git a/x-pack/plugins/observability_solution/apm/docs/openapi/apm/components/schemas/agent_keys_response.yaml b/x-pack/plugins/observability_solution/apm/docs/openapi/apm/components/schemas/agent_keys_response.yaml new file mode 100644 index 0000000000000..3507dae535faf --- /dev/null +++ b/x-pack/plugins/observability_solution/apm/docs/openapi/apm/components/schemas/agent_keys_response.yaml @@ -0,0 +1,22 @@ +type: object +properties: + agentKey: + type: object + description: Agent key + required: + - id + - name + - api_key + - encoded + properties: + expiration: + type: integer + format: int64 + id: + type: string + name: + type: string + api_key: + type: string + encoded: + type: string diff --git a/x-pack/plugins/observability_solution/apm/docs/openapi/apm/components/schemas/annotation_search_response.yaml b/x-pack/plugins/observability_solution/apm/docs/openapi/apm/components/schemas/annotation_search_response.yaml new file mode 100644 index 0000000000000..7827f17ffb979 --- /dev/null +++ b/x-pack/plugins/observability_solution/apm/docs/openapi/apm/components/schemas/annotation_search_response.yaml @@ -0,0 +1,18 @@ +type: object +properties: + annotations: + type: array + description: Annotations + items: + type: object + properties: + type: + type: string + enum: + - version + id: + type: string + "@timestamp": + type: number + text: + type: string diff --git a/x-pack/plugins/observability_solution/apm/docs/openapi/apm/components/schemas/base_source_map_object.yaml b/x-pack/plugins/observability_solution/apm/docs/openapi/apm/components/schemas/base_source_map_object.yaml new file mode 100644 index 0000000000000..f642c933f2b71 --- /dev/null +++ b/x-pack/plugins/observability_solution/apm/docs/openapi/apm/components/schemas/base_source_map_object.yaml @@ -0,0 +1,38 @@ +type: object +properties: + type: + type: string + description: Type + identifier: + type: string + description: Identifier + relative_url: + type: string + description: Relative URL + created: + type: string + description: Created date + id: + type: string + description: Identifier + compressionAlgorithm: + type: string + description: Compression Algorithm + decodedSha256: + type: string + description: Decoded SHA-256 + decodedSize: + type: number + description: Decoded size + encodedSha256: + type: string + description: Encoded SHA-256 + encodedSize: + type: number + description: Encoded size + encryptionAlgorithm: + type: string + description: Encryption Algorithm + packageName: + type: string + description: Package name diff --git a/x-pack/plugins/observability_solution/apm/docs/openapi/apm/components/schemas/create_annotation_object.yaml b/x-pack/plugins/observability_solution/apm/docs/openapi/apm/components/schemas/create_annotation_object.yaml new file mode 100644 index 0000000000000..6a8f8ba9b96d0 --- /dev/null +++ b/x-pack/plugins/observability_solution/apm/docs/openapi/apm/components/schemas/create_annotation_object.yaml @@ -0,0 +1,26 @@ +type: object +required: + - '@timestamp' + - service +properties: + '@timestamp': + type: string + description: Timestamp + service: + type: object + description: Service + required: + - version + properties: + version: + type: string + environment: + type: string + message: + type: string + description: Message + tags: + type: array + description: Tags + items: + type: string diff --git a/x-pack/plugins/observability_solution/apm/docs/openapi/apm/components/schemas/create_annotation_response.yaml b/x-pack/plugins/observability_solution/apm/docs/openapi/apm/components/schemas/create_annotation_response.yaml new file mode 100644 index 0000000000000..4738406a1e765 --- /dev/null +++ b/x-pack/plugins/observability_solution/apm/docs/openapi/apm/components/schemas/create_annotation_response.yaml @@ -0,0 +1,41 @@ +type: object +properties: + _id: + type: string + description: Identifier + _index: + type: string + description: Index + _source: + type: object + description: Response + properties: + annotation: + type: object + properties: + type: + type: string + title: + type: string + tags: + type: array + items: + type: string + message: + type: string + service: + type: object + properties: + name: + type: string + environment: + type: string + version: + type: string + event: + type: object + properties: + created: + type: string + '@timestamp': + type: string diff --git a/x-pack/plugins/observability_solution/apm/docs/openapi/apm/components/schemas/delete_agent_configurations_response.yaml b/x-pack/plugins/observability_solution/apm/docs/openapi/apm/components/schemas/delete_agent_configurations_response.yaml new file mode 100644 index 0000000000000..3dc7c58998b1f --- /dev/null +++ b/x-pack/plugins/observability_solution/apm/docs/openapi/apm/components/schemas/delete_agent_configurations_response.yaml @@ -0,0 +1,5 @@ +type: object +properties: + result: + type: string + description: Result diff --git a/x-pack/plugins/observability_solution/apm/docs/openapi/apm/components/schemas/search_agent_configuration_object.yaml b/x-pack/plugins/observability_solution/apm/docs/openapi/apm/components/schemas/search_agent_configuration_object.yaml new file mode 100644 index 0000000000000..abbbf91b77b89 --- /dev/null +++ b/x-pack/plugins/observability_solution/apm/docs/openapi/apm/components/schemas/search_agent_configuration_object.yaml @@ -0,0 +1,15 @@ +type: object +required: + - service +properties: + service: + $ref: 'service_object.yaml' + etag: + type: string + description: If etags match then `applied_by_agent` field will be set to `true` + example: 0bc3b5ebf18fba8163fe4c96f491e3767a358f85 + mark_as_applied_by_agent: + type: boolean + description: | + `markAsAppliedByAgent=true` means "force setting it to true regardless of etag". + This is needed for Jaeger agent that doesn't have etags diff --git a/x-pack/plugins/observability_solution/apm/docs/openapi/apm/components/schemas/search_agent_configuration_response.yaml b/x-pack/plugins/observability_solution/apm/docs/openapi/apm/components/schemas/search_agent_configuration_response.yaml new file mode 100644 index 0000000000000..d0a5ff1d91a78 --- /dev/null +++ b/x-pack/plugins/observability_solution/apm/docs/openapi/apm/components/schemas/search_agent_configuration_response.yaml @@ -0,0 +1,13 @@ +type: object +properties: + _index: + type: string + description: Index + _id: + type: string + description: Identifier + _score: + type: number + description: Score + _source: + $ref: 'agent_configuration_object.yaml' diff --git a/x-pack/plugins/observability_solution/apm/docs/openapi/apm/components/schemas/service_agent_name_response.yaml b/x-pack/plugins/observability_solution/apm/docs/openapi/apm/components/schemas/service_agent_name_response.yaml new file mode 100644 index 0000000000000..b67c34b65df8e --- /dev/null +++ b/x-pack/plugins/observability_solution/apm/docs/openapi/apm/components/schemas/service_agent_name_response.yaml @@ -0,0 +1,6 @@ +type: object +properties: + agentName: + type: string + description: Agent name + example: nodejs diff --git a/x-pack/plugins/observability_solution/apm/docs/openapi/apm/components/schemas/service_environment_object.yaml b/x-pack/plugins/observability_solution/apm/docs/openapi/apm/components/schemas/service_environment_object.yaml new file mode 100644 index 0000000000000..0f7f11371e59c --- /dev/null +++ b/x-pack/plugins/observability_solution/apm/docs/openapi/apm/components/schemas/service_environment_object.yaml @@ -0,0 +1,9 @@ +type: object +properties: + name: + type: string + example: ALL_OPTION_VALUE + description: Service environment name + alreadyConfigured: + type: boolean + description: Already configured diff --git a/x-pack/plugins/observability_solution/apm/docs/openapi/apm/components/schemas/service_environments_response.yaml b/x-pack/plugins/observability_solution/apm/docs/openapi/apm/components/schemas/service_environments_response.yaml new file mode 100644 index 0000000000000..1b8cdc1cab48e --- /dev/null +++ b/x-pack/plugins/observability_solution/apm/docs/openapi/apm/components/schemas/service_environments_response.yaml @@ -0,0 +1,7 @@ +type: object +properties: + environments: + type: array + description: Service environment list + items: + $ref: 'service_environment_object.yaml' diff --git a/x-pack/plugins/observability_solution/apm/docs/openapi/apm/components/schemas/service_object.yaml b/x-pack/plugins/observability_solution/apm/docs/openapi/apm/components/schemas/service_object.yaml new file mode 100644 index 0000000000000..c73dd8bc0eb19 --- /dev/null +++ b/x-pack/plugins/observability_solution/apm/docs/openapi/apm/components/schemas/service_object.yaml @@ -0,0 +1,11 @@ +type: object +description: Service +properties: + name: + type: string + example: node + description: Name + environment: + type: string + example: prod + description: Environment diff --git a/x-pack/plugins/observability_solution/apm/docs/openapi/apm/components/schemas/settings_object.yaml b/x-pack/plugins/observability_solution/apm/docs/openapi/apm/components/schemas/settings_object.yaml new file mode 100644 index 0000000000000..cf09f1b6254bd --- /dev/null +++ b/x-pack/plugins/observability_solution/apm/docs/openapi/apm/components/schemas/settings_object.yaml @@ -0,0 +1,4 @@ +type: object +description: Agent configuration settings +additionalProperties: + type: string diff --git a/x-pack/plugins/observability_solution/apm/docs/openapi/apm/components/schemas/single_agent_configuration_response.yaml b/x-pack/plugins/observability_solution/apm/docs/openapi/apm/components/schemas/single_agent_configuration_response.yaml new file mode 100644 index 0000000000000..4ef312304cc60 --- /dev/null +++ b/x-pack/plugins/observability_solution/apm/docs/openapi/apm/components/schemas/single_agent_configuration_response.yaml @@ -0,0 +1,8 @@ +allOf: + - type: object + required: + - id + properties: + id: + type: string + - $ref: 'agent_configuration_object.yaml' diff --git a/x-pack/plugins/observability_solution/apm/docs/openapi/apm/components/schemas/source_maps_response.yaml b/x-pack/plugins/observability_solution/apm/docs/openapi/apm/components/schemas/source_maps_response.yaml new file mode 100644 index 0000000000000..f5590110fecd2 --- /dev/null +++ b/x-pack/plugins/observability_solution/apm/docs/openapi/apm/components/schemas/source_maps_response.yaml @@ -0,0 +1,38 @@ +type: object +properties: + artifacts: + type: array + description: Artifacts + items: + allOf: + - type: object + properties: + body: + type: object + properties: + serviceName: + type: string + serviceVersion: + type: string + bundleFilepath: + type: string + sourceMap: + type: object + properties: + version: + type: number + file: + type: string + sources: + type: array + items: + type: string + sourcesContent: + type: array + items: + type: string + mappings: + type: string + sourceRoot: + type: string + - $ref: 'base_source_map_object.yaml' diff --git a/x-pack/plugins/observability_solution/apm/docs/openapi/apm/components/schemas/upload_source_map_object.yaml b/x-pack/plugins/observability_solution/apm/docs/openapi/apm/components/schemas/upload_source_map_object.yaml new file mode 100644 index 0000000000000..00483e3606df0 --- /dev/null +++ b/x-pack/plugins/observability_solution/apm/docs/openapi/apm/components/schemas/upload_source_map_object.yaml @@ -0,0 +1,22 @@ +type: object +required: + - service_name + - service_version + - bundle_filepath + - sourcemap +properties: + service_name: + type: string + description: The name of the service that the service map should apply to. + service_version: + type: string + description: The version of the service that the service map should apply to. + bundle_filepath: + type: string + description: The absolute path of the final bundle as used in the web application. + sourcemap: + type: string + format: binary + description: | + The source map. String or file upload. It must follow the + [source map revision 3 proposal](https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k). diff --git a/x-pack/plugins/observability_solution/apm/docs/openapi/apm/components/schemas/upload_source_maps_response.yaml b/x-pack/plugins/observability_solution/apm/docs/openapi/apm/components/schemas/upload_source_maps_response.yaml new file mode 100644 index 0000000000000..6b677374de4ab --- /dev/null +++ b/x-pack/plugins/observability_solution/apm/docs/openapi/apm/components/schemas/upload_source_maps_response.yaml @@ -0,0 +1,6 @@ +allOf: + - type: object + properties: + body: + type: string + - $ref: 'base_source_map_object.yaml' diff --git a/x-pack/plugins/observability_solution/apm/docs/openapi/apm/entrypoint.yaml b/x-pack/plugins/observability_solution/apm/docs/openapi/apm/entrypoint.yaml new file mode 100644 index 0000000000000..abb21fb980a9a --- /dev/null +++ b/x-pack/plugins/observability_solution/apm/docs/openapi/apm/entrypoint.yaml @@ -0,0 +1,42 @@ +openapi: 3.0.2 +info: + title: APM UI + version: 1.0.0 +tags: + - name: APM agent keys + description: > + Configure APM agent keys to authorize requests from APM agents to the APM Server. + - name: APM agent configuration + description: > + Adjust APM agent configuration without need to redeploy your application. + - name: APM sourcemaps + description: Configure APM source maps. + - name: APM annotations + description: > + Annotate visualizations in the APM app with significant events. + Annotations enable you to easily see how events are impacting the performance of your applications. + - name: APM server schema + description: Create APM fleet server schema. +paths: + /api/apm/agent_keys: + $ref: 'paths/api@apm@agent_keys.yaml' + /api/apm/services/{serviceName}/annotation/search: + $ref: 'paths/api@apm@services@{service_name}@annotation@search.yaml' + /api/apm/services/{serviceName}/annotation: + $ref: 'paths/api@apm@services@{service_name}@annotation.yaml' + /api/apm/settings/agent-configuration: + $ref: 'paths/api@apm@settings@agent_configuration.yaml' + /api/apm/settings/agent-configuration/view: + $ref: 'paths/api@apm@settings@agent_configuration@view.yaml' + /api/apm/settings/agent-configuration/search: + $ref: 'paths/api@apm@settings@agent_configuration@search.yaml' + /api/apm/settings/agent-configuration/environments: + $ref: 'paths/api@apm@settings@agent_configuration@environments.yaml' + /api/apm/settings/agent-configuration/agent_name: + $ref: 'paths/api@apm@settings@agent_configuration@agent_name.yaml' + /api/apm/sourcemaps: + $ref: 'paths/api@apm@sourcemaps.yaml' + /api/apm/sourcemaps/{id}: + $ref: 'paths/api@apm@sourcemaps@{id}.yaml' + /api/apm/fleet/apm_server_schema: + $ref: 'paths/api@apm@fleet@apm_server_schema.yaml' diff --git a/x-pack/plugins/observability_solution/apm/docs/openapi/apm/paths/README.md b/x-pack/plugins/observability_solution/apm/docs/openapi/apm/paths/README.md new file mode 100644 index 0000000000000..b7818c8474fc8 --- /dev/null +++ b/x-pack/plugins/observability_solution/apm/docs/openapi/apm/paths/README.md @@ -0,0 +1,10 @@ +Paths +===== + +Each path definition for which there is a specification exists within this folder. + +These files currently use the following conventions: + +* path separator token (e.g. `@`) is included in the file name +* path parameter (e.g. `{example}`) is included in the file name +* there is one file per path; each file can contain multiple operations diff --git a/x-pack/plugins/observability_solution/apm/docs/openapi/apm/paths/api@apm@agent_keys.yaml b/x-pack/plugins/observability_solution/apm/docs/openapi/apm/paths/api@apm@agent_keys.yaml new file mode 100644 index 0000000000000..46b1588517761 --- /dev/null +++ b/x-pack/plugins/observability_solution/apm/docs/openapi/apm/paths/api@apm@agent_keys.yaml @@ -0,0 +1,46 @@ +post: + summary: Create an APM agent key + description: Create a new agent key for APM. + operationId: createAgentKey + tags: + - APM agent keys + parameters: + - $ref: '../components/headers/elastic_api_version.yaml' + - $ref: '../components/headers/kbn_xsrf.yaml' + requestBody: + required: true + content: + application/json: + schema: + $ref: '../components/schemas/agent_keys_object.yaml' + responses: + "200": + description: Agent key created successfully + content: + application/json: + schema: + $ref: '../components/schemas/agent_keys_response.yaml' + '400': + description: Bad Request response + content: + application/json: + schema: + $ref: '../components/schemas/400_response.yaml' + '401': + description: Unauthorized response + content: + application/json: + schema: + $ref: '../components/schemas/401_response.yaml' + '403': + description: Forbidden response + content: + application/json: + schema: + $ref: '../components/schemas/403_response.yaml' + '500': + description: Internal Server Error response + content: + application/json: + schema: + $ref: '../components/schemas/500_response.yaml' diff --git a/x-pack/plugins/observability_solution/apm/docs/openapi/apm/paths/api@apm@fleet@apm_server_schema.yaml b/x-pack/plugins/observability_solution/apm/docs/openapi/apm/paths/api@apm@fleet@apm_server_schema.yaml new file mode 100644 index 0000000000000..2c4629b44a211 --- /dev/null +++ b/x-pack/plugins/observability_solution/apm/docs/openapi/apm/paths/api@apm@fleet@apm_server_schema.yaml @@ -0,0 +1,53 @@ +post: + summary: Save APM server schema + operationId: saveApmServerSchema + tags: + - APM server schema + parameters: + - $ref: '../components/headers/elastic_api_version.yaml' + - $ref: '../components/headers/kbn_xsrf.yaml' + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + schema: + type: object + description: Schema object + additionalProperties: true + example: + foo: "bar" + responses: + '200': + description: Successful response + content: + application/json: + schema: + type: object + additionalProperties: false + '400': + description: Bad Request response + content: + application/json: + schema: + $ref: '../components/schemas/400_response.yaml' + '401': + description: Unauthorized response + content: + application/json: + schema: + $ref: '../components/schemas/401_response.yaml' + '403': + description: Forbidden response + content: + application/json: + schema: + $ref: '../components/schemas/403_response.yaml' + '404': + description: Not found response + content: + application/json: + schema: + $ref: '../components/schemas/404_response.yaml' diff --git a/x-pack/plugins/observability_solution/apm/docs/openapi/apm/paths/api@apm@services@{service_name}@annotation.yaml b/x-pack/plugins/observability_solution/apm/docs/openapi/apm/paths/api@apm@services@{service_name}@annotation.yaml new file mode 100644 index 0000000000000..3894bd6da2015 --- /dev/null +++ b/x-pack/plugins/observability_solution/apm/docs/openapi/apm/paths/api@apm@services@{service_name}@annotation.yaml @@ -0,0 +1,52 @@ +post: + summary: Create a service annotation + description: Create a new annotation for a specific service. + operationId: createAnnotation + tags: + - APM annotations + parameters: + - $ref: '../components/headers/elastic_api_version.yaml' + - $ref: '../components/headers/kbn_xsrf.yaml' + - name: serviceName + in: path + required: true + description: The name of the service + schema: + type: string + requestBody: + required: true + content: + application/json: + schema: + $ref: '../components/schemas/create_annotation_object.yaml' + responses: + '200': + description: Annotation created successfully + content: + application/json: + schema: + $ref: '../components/schemas/create_annotation_response.yaml' + '400': + description: Bad Request response + content: + application/json: + schema: + $ref: '../components/schemas/400_response.yaml' + '401': + description: Unauthorized response + content: + application/json: + schema: + $ref: '../components/schemas/401_response.yaml' + '403': + description: Forbidden response + content: + application/json: + schema: + $ref: '../components/schemas/403_response.yaml' + '404': + description: Not found response + content: + application/json: + schema: + $ref: '../components/schemas/404_response.yaml' diff --git a/x-pack/plugins/observability_solution/apm/docs/openapi/apm/paths/api@apm@services@{service_name}@annotation@search.yaml b/x-pack/plugins/observability_solution/apm/docs/openapi/apm/paths/api@apm@services@{service_name}@annotation@search.yaml new file mode 100644 index 0000000000000..0f1391be89806 --- /dev/null +++ b/x-pack/plugins/observability_solution/apm/docs/openapi/apm/paths/api@apm@services@{service_name}@annotation@search.yaml @@ -0,0 +1,57 @@ +get: + summary: Search for annotations + description: Search for annotations related to a specific service. + operationId: getAnnotation + tags: + - APM annotations + parameters: + - $ref: '../components/headers/elastic_api_version.yaml' + - name: serviceName + in: path + required: true + description: The name of the service + schema: + type: string + - name: environment + in: query + required: false + description: The environment to filter annotations by + schema: + type: string + - name: start + in: query + required: false + description: The start date for the search + schema: + type: string + - name: end + in: query + required: false + description: The end date for the search + schema: + type: string + responses: + "200": + description: Successful response + content: + application/json: + schema: + $ref: '../components/schemas/annotation_search_response.yaml' + '400': + description: Bad Request response + content: + application/json: + schema: + $ref: '../components/schemas/400_response.yaml' + '401': + description: Unauthorized response + content: + application/json: + schema: + $ref: '../components/schemas/401_response.yaml' + '500': + description: Internal Server Error response + content: + application/json: + schema: + $ref: '../components/schemas/500_response.yaml' diff --git a/x-pack/plugins/observability_solution/apm/docs/openapi/apm/paths/api@apm@settings@agent_configuration.yaml b/x-pack/plugins/observability_solution/apm/docs/openapi/apm/paths/api@apm@settings@agent_configuration.yaml new file mode 100644 index 0000000000000..f508e855a3883 --- /dev/null +++ b/x-pack/plugins/observability_solution/apm/docs/openapi/apm/paths/api@apm@settings@agent_configuration.yaml @@ -0,0 +1,128 @@ +get: + summary: Get a list of agent configurations + operationId: getAgentConfigurations + tags: + - APM agent configuration + parameters: + - $ref: '../components/headers/elastic_api_version.yaml' + responses: + '200': + description: Successful response + content: + application/json: + schema: + $ref: '../components/schemas/agent_configurations_response.yaml' + '400': + description: Bad Request response + content: + application/json: + schema: + $ref: '../components/schemas/400_response.yaml' + '401': + description: Unauthorized response + content: + application/json: + schema: + $ref: '../components/schemas/401_response.yaml' + '404': + description: Not found response + content: + application/json: + schema: + $ref: '../components/schemas/404_response.yaml' +delete: + summary: Delete agent configuration + operationId: deleteAgentConfiguration + tags: + - APM agent configuration + parameters: + - $ref: '../components/headers/elastic_api_version.yaml' + - $ref: '../components/headers/kbn_xsrf.yaml' + requestBody: + required: true + content: + application/json: + schema: + $ref: '../components/schemas/service_object.yaml' + responses: + '200': + description: Successful response + content: + application/json: + schema: + $ref: '../components/schemas/delete_agent_configurations_response.yaml' + '400': + description: Bad Request response + content: + application/json: + schema: + $ref: '../components/schemas/400_response.yaml' + '401': + description: Unauthorized response + content: + application/json: + schema: + $ref: '../components/schemas/401_response.yaml' + '403': + description: Forbidden response + content: + application/json: + schema: + $ref: '../components/schemas/403_response.yaml' + '404': + description: Not found response + content: + application/json: + schema: + $ref: '../components/schemas/404_response.yaml' +put: + summary: Create or update agent configuration + operationId: createUpdateAgentConfiguration + tags: + - APM agent configuration + parameters: + - $ref: '../components/headers/elastic_api_version.yaml' + - $ref: '../components/headers/kbn_xsrf.yaml' + - name: overwrite + in: query + description: If the config exists ?overwrite=true is required + schema: + type: boolean + requestBody: + required: true + content: + application/json: + schema: + $ref: '../components/schemas/agent_configuration_intake_object.yaml' + responses: + '200': + description: Successful response + content: + application/json: + schema: + type: object + additionalProperties: false + '400': + description: Bad Request response + content: + application/json: + schema: + $ref: '../components/schemas/400_response.yaml' + '401': + description: Unauthorized response + content: + application/json: + schema: + $ref: '../components/schemas/401_response.yaml' + '403': + description: Forbidden response + content: + application/json: + schema: + $ref: '../components/schemas/403_response.yaml' + '404': + description: Not found response + content: + application/json: + schema: + $ref: '../components/schemas/404_response.yaml' diff --git a/x-pack/plugins/observability_solution/apm/docs/openapi/apm/paths/api@apm@settings@agent_configuration@agent_name.yaml b/x-pack/plugins/observability_solution/apm/docs/openapi/apm/paths/api@apm@settings@agent_configuration@agent_name.yaml new file mode 100644 index 0000000000000..4ad10fbb00833 --- /dev/null +++ b/x-pack/plugins/observability_solution/apm/docs/openapi/apm/paths/api@apm@settings@agent_configuration@agent_name.yaml @@ -0,0 +1,40 @@ +get: + summary: Get agent name for service + description: Retrieve `agentName` for a service. + operationId: getAgentNameForService + tags: + - APM agent configuration + parameters: + - $ref: '../components/headers/elastic_api_version.yaml' + - name: serviceName + in: query + description: The name of the service + required: true + schema: + type: string + example: node + responses: + '200': + description: Successful response + content: + application/json: + schema: + $ref: '../components/schemas/service_agent_name_response.yaml' + '400': + description: Bad Request response + content: + application/json: + schema: + $ref: '../components/schemas/400_response.yaml' + '401': + description: Unauthorized response + content: + application/json: + schema: + $ref: '../components/schemas/401_response.yaml' + '404': + description: Not found response + content: + application/json: + schema: + $ref: '../components/schemas/404_response.yaml' diff --git a/x-pack/plugins/observability_solution/apm/docs/openapi/apm/paths/api@apm@settings@agent_configuration@environments.yaml b/x-pack/plugins/observability_solution/apm/docs/openapi/apm/paths/api@apm@settings@agent_configuration@environments.yaml new file mode 100644 index 0000000000000..c0791b92ac148 --- /dev/null +++ b/x-pack/plugins/observability_solution/apm/docs/openapi/apm/paths/api@apm@settings@agent_configuration@environments.yaml @@ -0,0 +1,37 @@ +get: + summary: Get environments for service + operationId: getEnvironmentsForService + tags: + - APM agent configuration + parameters: + - $ref: '../components/headers/elastic_api_version.yaml' + - name: serviceName + in: query + description: The name of the service + schema: + type: string + responses: + '200': + description: Successful response + content: + application/json: + schema: + $ref: '../components/schemas/service_environments_response.yaml' + '400': + description: Bad Request response + content: + application/json: + schema: + $ref: '../components/schemas/400_response.yaml' + '401': + description: Unauthorized response + content: + application/json: + schema: + $ref: '../components/schemas/401_response.yaml' + '404': + description: Not found response + content: + application/json: + schema: + $ref: '../components/schemas/404_response.yaml' diff --git a/x-pack/plugins/observability_solution/apm/docs/openapi/apm/paths/api@apm@settings@agent_configuration@search.yaml b/x-pack/plugins/observability_solution/apm/docs/openapi/apm/paths/api@apm@settings@agent_configuration@search.yaml new file mode 100644 index 0000000000000..8ae4ce975fc08 --- /dev/null +++ b/x-pack/plugins/observability_solution/apm/docs/openapi/apm/paths/api@apm@settings@agent_configuration@search.yaml @@ -0,0 +1,41 @@ +post: + summary: Lookup single agent configuration + description: | + This endpoint allows to search for single agent configuration and update 'applied_by_agent' field. + operationId: searchSingleConfiguration + tags: + - APM agent configuration + parameters: + - $ref: '../components/headers/elastic_api_version.yaml' + - $ref: '../components/headers/kbn_xsrf.yaml' + requestBody: + required: true + content: + application/json: + schema: + $ref: '../components/schemas/search_agent_configuration_object.yaml' + responses: + '200': + description: Successful response + content: + application/json: + schema: + $ref: '../components/schemas/search_agent_configuration_response.yaml' + '400': + description: Bad Request response + content: + application/json: + schema: + $ref: '../components/schemas/400_response.yaml' + '401': + description: Unauthorized response + content: + application/json: + schema: + $ref: '../components/schemas/401_response.yaml' + '404': + description: Not found response + content: + application/json: + schema: + $ref: '../components/schemas/404_response.yaml' diff --git a/x-pack/plugins/observability_solution/apm/docs/openapi/apm/paths/api@apm@settings@agent_configuration@view.yaml b/x-pack/plugins/observability_solution/apm/docs/openapi/apm/paths/api@apm@settings@agent_configuration@view.yaml new file mode 100644 index 0000000000000..23e5cc2186d12 --- /dev/null +++ b/x-pack/plugins/observability_solution/apm/docs/openapi/apm/paths/api@apm@settings@agent_configuration@view.yaml @@ -0,0 +1,44 @@ +get: + summary: Get single agent configuration + operationId: getSingleAgentConfiguration + tags: + - APM agent configuration + parameters: + - $ref: '../components/headers/elastic_api_version.yaml' + - name: name + in: query + description: Service name + schema: + type: string + example: node + - name: environment + in: query + description: Service environment + schema: + type: string + example: prod + responses: + '200': + description: Successful response + content: + application/json: + schema: + $ref: '../components/schemas/single_agent_configuration_response.yaml' + '400': + description: Bad Request response + content: + application/json: + schema: + $ref: '../components/schemas/400_response.yaml' + '401': + description: Unauthorized response + content: + application/json: + schema: + $ref: '../components/schemas/401_response.yaml' + '404': + description: Not found response + content: + application/json: + schema: + $ref: '../components/schemas/404_response.yaml' diff --git a/x-pack/plugins/observability_solution/apm/docs/openapi/apm/paths/api@apm@sourcemaps.yaml b/x-pack/plugins/observability_solution/apm/docs/openapi/apm/paths/api@apm@sourcemaps.yaml new file mode 100644 index 0000000000000..142cd0d2673c1 --- /dev/null +++ b/x-pack/plugins/observability_solution/apm/docs/openapi/apm/paths/api@apm@sourcemaps.yaml @@ -0,0 +1,101 @@ +get: + summary: Get source maps + description: Returns an array of Fleet artifacts, including source map uploads. + operationId: getSourceMaps + tags: + - APM sourcemaps + parameters: + - $ref: '../components/headers/elastic_api_version.yaml' + - name: page + in: query + description: Page number + schema: + type: number + - name: perPage + in: query + description: Number of records per page + schema: + type: number + responses: + '200': + description: Successful response + content: + application/json: + schema: + $ref: '../components/schemas/source_maps_response.yaml' + '400': + description: Bad Request response + content: + application/json: + schema: + $ref: '../components/schemas/400_response.yaml' + '401': + description: Unauthorized response + content: + application/json: + schema: + $ref: '../components/schemas/401_response.yaml' + '500': + description: Internal Server Error response + content: + application/json: + schema: + $ref: '../components/schemas/500_response.yaml' + '501': + description: Not Implemented response + content: + application/json: + schema: + $ref: '../components/schemas/501_response.yaml' +post: + summary: Upload source map + description: Upload a source map for a specific service and version. + operationId: uploadSourceMap + tags: + - APM sourcemaps + parameters: + - $ref: '../components/headers/elastic_api_version.yaml' + - $ref: '../components/headers/kbn_xsrf.yaml' + requestBody: + required: true + content: + multipart/form-data: + schema: + $ref: '../components/schemas/upload_source_map_object.yaml' + responses: + '200': + description: Successful response + content: + application/json: + schema: + $ref: '../components/schemas/upload_source_maps_response.yaml' + '400': + description: Bad Request response + content: + application/json: + schema: + $ref: '../components/schemas/400_response.yaml' + '401': + description: Unauthorized response + content: + application/json: + schema: + $ref: '../components/schemas/401_response.yaml' + '403': + description: Forbidden response + content: + application/json: + schema: + $ref: '../components/schemas/403_response.yaml' + '500': + description: Internal Server Error response + content: + application/json: + schema: + $ref: '../components/schemas/500_response.yaml' + '501': + description: Not Implemented response + content: + application/json: + schema: + $ref: '../components/schemas/501_response.yaml' diff --git a/x-pack/plugins/observability_solution/apm/docs/openapi/apm/paths/api@apm@sourcemaps@{id}.yaml b/x-pack/plugins/observability_solution/apm/docs/openapi/apm/paths/api@apm@sourcemaps@{id}.yaml new file mode 100644 index 0000000000000..3f165360bf60c --- /dev/null +++ b/x-pack/plugins/observability_solution/apm/docs/openapi/apm/paths/api@apm@sourcemaps@{id}.yaml @@ -0,0 +1,53 @@ +delete: + summary: Delete source map + description: Delete a previously uploaded source map. + operationId: deleteSourceMap + tags: + - APM sourcemaps + parameters: + - $ref: '../components/headers/elastic_api_version.yaml' + - $ref: '../components/headers/kbn_xsrf.yaml' + - name: id + in: path + description: Source map identifier + required: true + schema: + type: string + responses: + '200': + description: Successful response + content: + application/json: + schema: + type: object + additionalProperties: false + '400': + description: Bad Request response + content: + application/json: + schema: + $ref: '../components/schemas/400_response.yaml' + '401': + description: Unauthorized response + content: + application/json: + schema: + $ref: '../components/schemas/401_response.yaml' + '403': + description: Forbidden response + content: + application/json: + schema: + $ref: '../components/schemas/403_response.yaml' + '500': + description: Internal Server Error response + content: + application/json: + schema: + $ref: '../components/schemas/500_response.yaml' + '501': + description: Not Implemented response + content: + application/json: + schema: + $ref: '../components/schemas/501_response.yaml'