From cbe9ad9fbd555729dc3331ce3fc4971fb497e7d5 Mon Sep 17 00:00:00 2001 From: Milosz Marcinkowski Date: Fri, 25 Oct 2024 16:39:25 +0200 Subject: [PATCH 1/9] add missing OpenAPI specs for APM UI APIs --- .../apm/docs/openapi/apm.yaml | 574 +++++++++++++++++- 1 file changed, 573 insertions(+), 1 deletion(-) diff --git a/x-pack/plugins/observability_solution/apm/docs/openapi/apm.yaml b/x-pack/plugins/observability_solution/apm/docs/openapi/apm.yaml index d37137302fd21..3ffae0db3d87e 100644 --- a/x-pack/plugins/observability_solution/apm/docs/openapi/apm.yaml +++ b/x-pack/plugins/observability_solution/apm/docs/openapi/apm.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.0 +openapi: 3.0.2 info: title: APM UI version: 1.0.0 @@ -6,10 +6,18 @@ 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. + - name: APM annotations paths: /api/apm/agent_keys: post: @@ -184,3 +192,567 @@ paths: type: string '@timestamp': type: string + + /api/apm/settings/agent-configuration: + get: + summary: List of agent configurations + description: Get a list of agent configurations. + operationId: getAgentConfigurations + tags: + - APM agent configuration + responses: + '200': + description: Successful response + content: + application/json: + schema: + $ref: '#/components/schemas/agent_configurations_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 + 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' + '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/overwrite' + 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 + '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/name' + - $ref: '#/components/parameters/environment' + responses: + '200': + description: Successful response + content: + application/json: + schema: + $ref: '#/components/schemas/single_agent_configuration_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 + 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' + '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/serviceName' + responses: + '200': + description: Successful response + content: + application/json: + schema: + $ref: '#/components/schemas/service_environments_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/serviceNameRequired' + responses: + '200': + description: Successful response + content: + application/json: + schema: + $ref: '#/components/schemas/service_agent_name_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/page' + - $ref: '#/components/parameters/perPage' + responses: + '200': + description: Successful response + content: + application/json: + schema: + $ref: '#/components/schemas/source_maps_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 + 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' + '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/id' + responses: + '200': + description: Successful response + content: + application/json: + schema: + type: object + additionalProperties: false + '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 + 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 + '404': + description: Not found response + content: + application/json: + schema: + $ref: '#/components/schemas/404_response' +components: + parameters: + name: + in: query + name: name + schema: + type: string + description: Service name + required: true + environment: + in: query + name: environment + schema: + type: string + description: Service environment + required: true + overwrite: + in: query + name: overwrite + schema: + type: boolean + serviceName: + in: query + name: serviceName + schema: + type: string + serviceNameRequired: + in: query + name: serviceName + schema: + type: string + required: true + page: + in: query + name: page + schema: + type: number + perPage: + in: query + name: perPage + schema: + type: number + id: + in: path + name: id + schema: + type: string + schemas: + 404_response: + type: object + properties: + statusCode: + type: number + example: 404 + error: + type: string + example: Not Found + message: + type: string + example: Not Found + 500_response: + type: object + properties: + statusCode: + type: number + example: 500 + error: + type: string + example: Internal Server Error + message: + type: string + 501_response: + type: object + properties: + statusCode: + type: number + example: 501 + error: + type: string + example: Not Implemented + message: + type: string + example: Not Implemented + service_object: + type: object + properties: + name: + type: string + environment: + type: string + settings_object: + type: object + additionalProperties: + type: string + agent_configuration_object: + type: object + required: + - service + - settings + - '@timestamp' + - etag + properties: + agent_name: + type: string + service: + $ref: '#/components/schemas/service_object' + settings: + $ref: '#/components/schemas/settings_object' + '@timestamp': + type: number + applied_by_agent: + type: boolean + etag: + type: string + agent_configuration_intake_object: + type: object + required: + - service + - settings + properties: + agent_name: + type: string + service: + $ref: '#/components/schemas/service_object' + settings: + $ref: '#/components/schemas/settings_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` + 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 + service_environment_object: + type: object + properties: + name: + type: string + alreadyConfigured: + type: boolean + 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). + base_source_map_object: + type: object + properties: + type: + type: string + identifier: + type: string + relative_url: + type: string + created: + type: string + id: + type: string + compressionAlgorithm: + type: string + decodedSha256: + type: string + decodedSize: + type: number + encodedSha256: + type: string + encodedSize: + type: number + encryptionAlgorithm: + type: string + packageName: + type: string + agent_configurations_response: + type: object + properties: + configurations: + type: array + items: + $ref: '#/components/schemas/agent_configuration_object' + single_agent_configuration_response: + allOf: + - type: object + required: + - id + properties: + id: + type: string + - $ref: '#/components/schemas/agent_configuration_object' + delete_agent_configurations_response: + type: object + properties: + result: + type: string + search_agent_configuration_response: + type: object + properties: + _index: + type: string + _id: + type: string + _score: + type: number + _source: + $ref: '#/components/schemas/agent_configuration_object' + service_environments_response: + type: object + properties: + environments: + type: array + items: + $ref: '#/components/schemas/service_environment_object' + service_agent_name_response: + type: object + properties: + agentName: + type: string + source_maps_response: + type: object + properties: + artifacts: + type: array + items: + allOf: + - type: object + properties: + body: + 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' + upload_source_maps_response: + allOf: + - type: object + properties: + body: + type: string + - $ref: '#/components/schemas/base_source_map_object' From 5d33057c28022c012c0771f5675174a50eb771a6 Mon Sep 17 00:00:00 2001 From: Milosz Marcinkowski Date: Wed, 30 Oct 2024 10:59:08 +0100 Subject: [PATCH 2/9] convert old specs to use references --- .../apm/docs/openapi/apm.yaml | 288 +++++++++--------- 1 file changed, 140 insertions(+), 148 deletions(-) diff --git a/x-pack/plugins/observability_solution/apm/docs/openapi/apm.yaml b/x-pack/plugins/observability_solution/apm/docs/openapi/apm.yaml index 3ffae0db3d87e..e6c3509bf2021 100644 --- a/x-pack/plugins/observability_solution/apm/docs/openapi/apm.yaml +++ b/x-pack/plugins/observability_solution/apm/docs/openapi/apm.yaml @@ -17,7 +17,6 @@ tags: 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. - - name: APM annotations paths: /api/apm/agent_keys: post: @@ -31,36 +30,14 @@ paths: content: application/json: schema: - type: object - properties: - name: - type: string - privileges: - type: array - items: - type: string - enum: - - event:write - - config_agent:read + $ref: '#/components/schemas/agent_keys_object' 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 + $ref: '#/components/schemas/agent_keys_response' /api/apm/services/{serviceName}/annotation/search: get: summary: Search for annotations @@ -99,23 +76,7 @@ paths: 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 + $ref: '#/components/schemas/annotation_search_response' /api/apm/services/{serviceName}/annotation: post: summary: Create a service annotation @@ -135,64 +96,14 @@ paths: 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 - + $ref: '#/components/schemas/create_annotation_object' 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 - + $ref: '#/components/schemas/create_annotation_response' /api/apm/settings/agent-configuration: get: summary: List of agent configurations @@ -243,7 +154,10 @@ paths: tags: - APM agent configuration parameters: - - $ref: '#/components/parameters/overwrite' + - name: overwrite + in: query + schema: + type: boolean requestBody: required: true content: @@ -271,8 +185,18 @@ paths: tags: - APM agent configuration parameters: - - $ref: '#/components/parameters/name' - - $ref: '#/components/parameters/environment' + - name: name + in: query + description: Service name + required: true + schema: + type: string + - name: environment + in: query + description: Service environment + required: true + schema: + type: string responses: '200': description: Successful response @@ -320,7 +244,11 @@ paths: tags: - APM agent configuration parameters: - - $ref: '#/components/parameters/serviceName' + - name: serviceName + in: query + description: The name of the service + schema: + type: string responses: '200': description: Successful response @@ -342,7 +270,12 @@ paths: tags: - APM agent configuration parameters: - - $ref: '#/components/parameters/serviceNameRequired' + - name: serviceName + in: query + description: The name of the service + required: true + schema: + type: string responses: '200': description: Successful response @@ -364,8 +297,14 @@ paths: tags: - APM sourcemaps parameters: - - $ref: '#/components/parameters/page' - - $ref: '#/components/parameters/perPage' + - name: page + in: query + schema: + type: number + - name: perPage + in: query + schema: + type: number responses: '200': description: Successful response @@ -424,7 +363,10 @@ paths: tags: - APM sourcemaps parameters: - - $ref: '#/components/parameters/id' + - name: id + in: path + schema: + type: string responses: '200': description: Successful response @@ -479,52 +421,6 @@ paths: schema: $ref: '#/components/schemas/404_response' components: - parameters: - name: - in: query - name: name - schema: - type: string - description: Service name - required: true - environment: - in: query - name: environment - schema: - type: string - description: Service environment - required: true - overwrite: - in: query - name: overwrite - schema: - type: boolean - serviceName: - in: query - name: serviceName - schema: - type: string - serviceNameRequired: - in: query - name: serviceName - schema: - type: string - required: true - page: - in: query - name: page - schema: - type: number - perPage: - in: query - name: perPage - schema: - type: number - id: - in: path - name: id - schema: - type: string schemas: 404_response: type: object @@ -561,6 +457,36 @@ components: message: type: string example: Not Implemented + agent_keys_object: + type: object + properties: + name: + type: string + privileges: + type: array + items: + type: string + enum: + - event:write + - config_agent:read + create_annotation_object: + 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 service_object: type: object properties: @@ -676,6 +602,72 @@ components: type: string packageName: type: string + agent_keys_response: + type: object + properties: + api_key: + type: string + expiration: + type: integer + format: int64 + id: + type: string + name: + type: string + encoded: + type: string + annotation_search_response: + type: object + properties: + annotations: + type: array + items: + type: object + properties: + type: + type: string + enum: + - version + id: + type: string + "@timestamp": + type: number + text: + type: string + create_annotation_response: + 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 agent_configurations_response: type: object properties: From aeacaa0d9a1fc6d3c8ec6f9de62d261ef22343a0 Mon Sep 17 00:00:00 2001 From: Milosz Marcinkowski Date: Wed, 30 Oct 2024 14:14:45 +0100 Subject: [PATCH 3/9] split specs into files and bundle --- oas_docs/scripts/merge_ess_oas.js | 2 +- oas_docs/scripts/merge_serverless_oas.js | 2 +- .../apm/docs/openapi/apm/README.md | 26 +- .../apm/docs/openapi/apm/bundled.json | 1177 +++++++++++++++++ .../openapi/{apm.yaml => apm/bundled.yaml} | 343 +++-- .../apm/docs/openapi/apm/components/README.md | 7 + .../apm/components/schemas/404_response.yaml | 11 + .../apm/components/schemas/500_response.yaml | 10 + .../apm/components/schemas/501_response.yaml | 11 + .../agent_configuration_intake_object.yaml | 11 + .../schemas/agent_configuration_object.yaml | 19 + .../agent_configurations_response.yaml | 6 + .../components/schemas/agent_keys_object.yaml | 11 + .../schemas/agent_keys_response.yaml | 13 + .../schemas/annotation_search_response.yaml | 17 + .../schemas/base_source_map_object.yaml | 26 + .../schemas/create_annotation_object.yaml | 17 + .../schemas/create_annotation_response.yaml | 33 + .../delete_agent_configurations_response.yaml | 4 + .../search_agent_configuration_object.yaml | 14 + .../search_agent_configuration_response.yaml | 10 + .../schemas/service_agent_name_response.yaml | 4 + .../schemas/service_environment_object.yaml | 6 + .../service_environments_response.yaml | 6 + .../components/schemas/service_object.yaml | 6 + .../components/schemas/settings_object.yaml | 3 + .../single_agent_configuration_response.yaml | 8 + .../schemas/source_maps_response.yaml | 28 + .../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 | 19 + .../api@apm@fleet@apm_server_schema.yaml | 32 + ...apm@services@{serviceName}@annotation.yaml | 26 + ...vices@{serviceName}@annotation@search.yaml | 38 + .../api@apm@settings@agent_configuration.yaml | 73 + ...ttings@agent_configuration@agent_name.yaml | 26 + ...m@settings@agent_configuration@search.yaml | 26 + ...apm@settings@agent_configuration@view.yaml | 31 + .../openapi/apm/paths/api@apm@sourcemaps.yaml | 65 + .../apm/paths/api@apm@sourcemaps@{id}.yaml | 31 + ...ings@agent_configuration@environments.yaml | 24 + 43 files changed, 2120 insertions(+), 182 deletions(-) create mode 100644 x-pack/plugins/observability_solution/apm/docs/openapi/apm/bundled.json rename x-pack/plugins/observability_solution/apm/docs/openapi/{apm.yaml => apm/bundled.yaml} (98%) 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/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@{serviceName}@annotation.yaml create mode 100644 x-pack/plugins/observability_solution/apm/docs/openapi/apm/paths/api@apm@services@{serviceName}@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@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 create mode 100644 x-pack/plugins/observability_solution/apm/docs/openapi/apm/paths/apm@settings@agent_configuration@environments.yaml 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/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..a852af2cef953 --- /dev/null +++ b/x-pack/plugins/observability_solution/apm/docs/openapi/apm/bundled.json @@ -0,0 +1,1177 @@ +{ + "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" + ], + "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" + } + } + } + } + } + } + }, + "/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": { + "$ref": "#/components/schemas/annotation_search_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": [ + { + "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" + } + } + } + } + } + } + }, + "/api/apm/settings/agent-configuration": { + "get": { + "summary": "List of agent configurations", + "description": "Get a list of agent configurations.", + "operationId": "getAgentConfigurations", + "tags": [ + "APM agent configuration" + ], + "responses": { + "200": { + "description": "Successful response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/agent_configurations_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" + ], + "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" + } + } + } + }, + "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": [ + { + "name": "overwrite", + "in": "query", + "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 + } + } + } + }, + "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": [ + { + "name": "name", + "in": "query", + "description": "Service name", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "environment", + "in": "query", + "description": "Service environment", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Successful response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/single_agent_configuration_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" + ], + "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" + } + } + } + }, + "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": [ + { + "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" + } + } + } + }, + "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": [ + { + "name": "serviceName", + "in": "query", + "description": "The name of the service", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Successful response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/service_agent_name_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": [ + { + "name": "page", + "in": "query", + "schema": { + "type": "number" + } + }, + { + "name": "perPage", + "in": "query", + "schema": { + "type": "number" + } + } + ], + "responses": { + "200": { + "description": "Successful response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/source_maps_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" + ], + "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" + } + } + } + }, + "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": [ + { + "name": "id", + "in": "path", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Successful response", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": false + } + } + } + }, + "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" + ], + "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 + } + } + } + }, + "404": { + "description": "Not found response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/404_response" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "agent_keys_object": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "privileges": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "event:write", + "config_agent:read" + ] + } + } + } + }, + "agent_keys_response": { + "type": "object", + "properties": { + "api_key": { + "type": "string" + }, + "expiration": { + "type": "integer", + "format": "int64" + }, + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "encoded": { + "type": "string" + } + } + }, + "annotation_search_response": { + "type": "object", + "properties": { + "annotations": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "version" + ] + }, + "id": { + "type": "string" + }, + "@timestamp": { + "type": "number" + }, + "text": { + "type": "string" + } + } + } + } + } + }, + "create_annotation_object": { + "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" + } + } + } + }, + "create_annotation_response": { + "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" + } + } + } + } + }, + "service_object": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "environment": { + "type": "string" + } + } + }, + "settings_object": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "agent_configuration_object": { + "type": "object", + "required": [ + "service", + "settings", + "@timestamp", + "etag" + ], + "properties": { + "agent_name": { + "type": "string" + }, + "service": { + "$ref": "#/components/schemas/service_object" + }, + "settings": { + "$ref": "#/components/schemas/settings_object" + }, + "@timestamp": { + "type": "number" + }, + "applied_by_agent": { + "type": "boolean" + }, + "etag": { + "type": "string" + } + } + }, + "agent_configurations_response": { + "type": "object", + "properties": { + "configurations": { + "type": "array", + "items": { + "$ref": "#/components/schemas/agent_configuration_object" + } + } + } + }, + "404_response": { + "type": "object", + "properties": { + "statusCode": { + "type": "number", + "example": 404 + }, + "error": { + "type": "string", + "example": "Not Found" + }, + "message": { + "type": "string", + "example": "Not Found" + } + } + }, + "agent_configuration_intake_object": { + "type": "object", + "required": [ + "service", + "settings" + ], + "properties": { + "agent_name": { + "type": "string" + }, + "service": { + "$ref": "#/components/schemas/service_object" + }, + "settings": { + "$ref": "#/components/schemas/settings_object" + } + } + }, + "delete_agent_configurations_response": { + "type": "object", + "properties": { + "result": { + "type": "string" + } + } + }, + "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`" + }, + "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" + }, + "_id": { + "type": "string" + }, + "_score": { + "type": "number" + }, + "_source": { + "$ref": "#/components/schemas/agent_configuration_object" + } + } + }, + "service_environment_object": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "alreadyConfigured": { + "type": "boolean" + } + } + }, + "service_environments_response": { + "type": "object", + "properties": { + "environments": { + "type": "array", + "items": { + "$ref": "#/components/schemas/service_environment_object" + } + } + } + }, + "service_agent_name_response": { + "type": "object", + "properties": { + "agentName": { + "type": "string" + } + } + }, + "base_source_map_object": { + "type": "object", + "properties": { + "type": { + "type": "string" + }, + "identifier": { + "type": "string" + }, + "relative_url": { + "type": "string" + }, + "created": { + "type": "string" + }, + "id": { + "type": "string" + }, + "compressionAlgorithm": { + "type": "string" + }, + "decodedSha256": { + "type": "string" + }, + "decodedSize": { + "type": "number" + }, + "encodedSha256": { + "type": "string" + }, + "encodedSize": { + "type": "number" + }, + "encryptionAlgorithm": { + "type": "string" + }, + "packageName": { + "type": "string" + } + } + }, + "source_maps_response": { + "type": "object", + "properties": { + "artifacts": { + "type": "array", + "items": { + "allOf": [ + { + "type": "object", + "properties": { + "body": { + "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" + } + ] + } + } + } + }, + "500_response": { + "type": "object", + "properties": { + "statusCode": { + "type": "number", + "example": 500 + }, + "error": { + "type": "string", + "example": "Internal Server Error" + }, + "message": { + "type": "string" + } + } + }, + "501_response": { + "type": "object", + "properties": { + "statusCode": { + "type": "number", + "example": 501 + }, + "error": { + "type": "string", + "example": "Not Implemented" + }, + "message": { + "type": "string", + "example": "Not Implemented" + } + } + }, + "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.yaml b/x-pack/plugins/observability_solution/apm/docs/openapi/apm/bundled.yaml similarity index 98% rename from x-pack/plugins/observability_solution/apm/docs/openapi/apm.yaml rename to x-pack/plugins/observability_solution/apm/docs/openapi/apm/bundled.yaml index e6c3509bf2021..aadf53fff92ef 100644 --- a/x-pack/plugins/observability_solution/apm/docs/openapi/apm.yaml +++ b/x-pack/plugins/observability_solution/apm/docs/openapi/apm/bundled.yaml @@ -4,17 +4,16 @@ info: version: 1.0.0 tags: - name: APM agent keys - description: > + description: | Configure APM agent keys to authorize requests from APM agents to the APM Server. - name: APM agent configuration - description: > + 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. + 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: @@ -32,7 +31,7 @@ paths: schema: $ref: '#/components/schemas/agent_keys_object' responses: - "200": + '200': description: Agent key created successfully content: application/json: @@ -71,7 +70,7 @@ paths: schema: type: string responses: - "200": + '200': description: Successful response content: application/json: @@ -405,7 +404,7 @@ paths: description: Schema object additionalProperties: true example: - foo: "bar" + foo: bar responses: '200': description: Successful response @@ -422,53 +421,50 @@ paths: $ref: '#/components/schemas/404_response' components: schemas: - 404_response: + agent_keys_object: type: object properties: - statusCode: - type: number - example: 404 - error: - type: string - example: Not Found - message: + name: type: string - example: Not Found - 500_response: + privileges: + type: array + items: + type: string + enum: + - event:write + - config_agent:read + agent_keys_response: type: object properties: - statusCode: - type: number - example: 500 - error: + api_key: type: string - example: Internal Server Error - message: + expiration: + type: integer + format: int64 + id: type: string - 501_response: - type: object - properties: - statusCode: - type: number - example: 501 - error: + name: type: string - example: Not Implemented - message: + encoded: type: string - example: Not Implemented - agent_keys_object: + annotation_search_response: type: object properties: - name: - type: string - privileges: + annotations: type: array items: - type: string - enum: - - event:write - - config_agent:read + type: object + properties: + type: + type: string + enum: + - version + id: + type: string + '@timestamp': + type: number + text: + type: string create_annotation_object: type: object properties: @@ -487,6 +483,40 @@ components: type: array items: type: string + create_annotation_response: + 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 service_object: type: object properties: @@ -518,6 +548,25 @@ components: type: boolean etag: type: string + agent_configurations_response: + type: object + properties: + configurations: + type: array + items: + $ref: '#/components/schemas/agent_configuration_object' + 404_response: + type: object + properties: + statusCode: + type: number + example: 404 + error: + type: string + example: Not Found + message: + type: string + example: Not Found agent_configuration_intake_object: type: object required: @@ -530,6 +579,20 @@ components: $ref: '#/components/schemas/service_object' settings: $ref: '#/components/schemas/settings_object' + delete_agent_configurations_response: + type: object + properties: + result: + type: string + 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: @@ -545,6 +608,17 @@ components: 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 + _id: + type: string + _score: + type: number + _source: + $ref: '#/components/schemas/agent_configuration_object' service_environment_object: type: object properties: @@ -552,29 +626,18 @@ components: type: string alreadyConfigured: type: boolean - upload_source_map_object: + service_environments_response: 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: + environments: + type: array + items: + $ref: '#/components/schemas/service_environment_object' + service_agent_name_response: + type: object + properties: + agentName: 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). base_source_map_object: type: object properties: @@ -602,116 +665,6 @@ components: type: string packageName: type: string - agent_keys_response: - type: object - properties: - api_key: - type: string - expiration: - type: integer - format: int64 - id: - type: string - name: - type: string - encoded: - type: string - annotation_search_response: - type: object - properties: - annotations: - type: array - items: - type: object - properties: - type: - type: string - enum: - - version - id: - type: string - "@timestamp": - type: number - text: - type: string - create_annotation_response: - 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 - agent_configurations_response: - type: object - properties: - configurations: - type: array - items: - $ref: '#/components/schemas/agent_configuration_object' - single_agent_configuration_response: - allOf: - - type: object - required: - - id - properties: - id: - type: string - - $ref: '#/components/schemas/agent_configuration_object' - delete_agent_configurations_response: - type: object - properties: - result: - type: string - search_agent_configuration_response: - type: object - properties: - _index: - type: string - _id: - type: string - _score: - type: number - _source: - $ref: '#/components/schemas/agent_configuration_object' - service_environments_response: - type: object - properties: - environments: - type: array - items: - $ref: '#/components/schemas/service_environment_object' - service_agent_name_response: - type: object - properties: - agentName: - type: string source_maps_response: type: object properties: @@ -741,6 +694,52 @@ components: sourceRoot: type: string - $ref: '#/components/schemas/base_source_map_object' + 500_response: + type: object + properties: + statusCode: + type: number + example: 500 + error: + type: string + example: Internal Server Error + message: + type: string + 501_response: + type: object + properties: + statusCode: + type: number + example: 501 + error: + type: string + example: Not Implemented + message: + type: string + example: Not Implemented + 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 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/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..d72776f85994d --- /dev/null +++ b/x-pack/plugins/observability_solution/apm/docs/openapi/apm/components/schemas/404_response.yaml @@ -0,0 +1,11 @@ +type: object +properties: + statusCode: + type: number + example: 404 + error: + type: string + example: Not Found + message: + type: string + example: Not Found 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..d595071d51ff2 --- /dev/null +++ b/x-pack/plugins/observability_solution/apm/docs/openapi/apm/components/schemas/500_response.yaml @@ -0,0 +1,10 @@ +type: object +properties: + statusCode: + type: number + example: 500 + error: + type: string + example: Internal Server Error + message: + type: string 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..f616beee6411b --- /dev/null +++ b/x-pack/plugins/observability_solution/apm/docs/openapi/apm/components/schemas/501_response.yaml @@ -0,0 +1,11 @@ +type: object +properties: + statusCode: + type: number + example: 501 + error: + type: string + example: Not Implemented + message: + type: string + example: Not Implemented 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..839b5263f3581 --- /dev/null +++ b/x-pack/plugins/observability_solution/apm/docs/openapi/apm/components/schemas/agent_configuration_intake_object.yaml @@ -0,0 +1,11 @@ +type: object +required: + - service + - settings +properties: + agent_name: + type: string + 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..0c3c7c44d7e04 --- /dev/null +++ b/x-pack/plugins/observability_solution/apm/docs/openapi/apm/components/schemas/agent_configuration_object.yaml @@ -0,0 +1,19 @@ +type: object +required: + - service + - settings + - '@timestamp' + - etag +properties: + agent_name: + type: string + service: + $ref: 'service_object.yaml' + settings: + $ref: 'settings_object.yaml' + '@timestamp': + type: number + applied_by_agent: + type: boolean + etag: + type: string 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..ac77d6b785223 --- /dev/null +++ b/x-pack/plugins/observability_solution/apm/docs/openapi/apm/components/schemas/agent_configurations_response.yaml @@ -0,0 +1,6 @@ +type: object +properties: + configurations: + type: array + 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..756bb5420b82b --- /dev/null +++ b/x-pack/plugins/observability_solution/apm/docs/openapi/apm/components/schemas/agent_keys_object.yaml @@ -0,0 +1,11 @@ +type: object +properties: + name: + type: string + privileges: + type: array + 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..9335c3fb58e52 --- /dev/null +++ b/x-pack/plugins/observability_solution/apm/docs/openapi/apm/components/schemas/agent_keys_response.yaml @@ -0,0 +1,13 @@ +type: object +properties: + api_key: + type: string + expiration: + type: integer + format: int64 + id: + type: string + name: + 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..14c39cb05d43a --- /dev/null +++ b/x-pack/plugins/observability_solution/apm/docs/openapi/apm/components/schemas/annotation_search_response.yaml @@ -0,0 +1,17 @@ +type: object +properties: + annotations: + type: array + 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..a5a227fd08a19 --- /dev/null +++ b/x-pack/plugins/observability_solution/apm/docs/openapi/apm/components/schemas/base_source_map_object.yaml @@ -0,0 +1,26 @@ +type: object +properties: + type: + type: string + identifier: + type: string + relative_url: + type: string + created: + type: string + id: + type: string + compressionAlgorithm: + type: string + decodedSha256: + type: string + decodedSize: + type: number + encodedSha256: + type: string + encodedSize: + type: number + encryptionAlgorithm: + type: string + packageName: + type: string 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..a262cd386d073 --- /dev/null +++ b/x-pack/plugins/observability_solution/apm/docs/openapi/apm/components/schemas/create_annotation_object.yaml @@ -0,0 +1,17 @@ +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 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..4f70f6744265e --- /dev/null +++ b/x-pack/plugins/observability_solution/apm/docs/openapi/apm/components/schemas/create_annotation_response.yaml @@ -0,0 +1,33 @@ +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/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..0a1bcdf127a10 --- /dev/null +++ b/x-pack/plugins/observability_solution/apm/docs/openapi/apm/components/schemas/delete_agent_configurations_response.yaml @@ -0,0 +1,4 @@ +type: object +properties: + result: + type: string 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..ae0a884d53f87 --- /dev/null +++ b/x-pack/plugins/observability_solution/apm/docs/openapi/apm/components/schemas/search_agent_configuration_object.yaml @@ -0,0 +1,14 @@ +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` + 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..2cfe1e9521f83 --- /dev/null +++ b/x-pack/plugins/observability_solution/apm/docs/openapi/apm/components/schemas/search_agent_configuration_response.yaml @@ -0,0 +1,10 @@ +type: object +properties: + _index: + type: string + _id: + type: string + _score: + type: number + _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..b318e4f725f20 --- /dev/null +++ b/x-pack/plugins/observability_solution/apm/docs/openapi/apm/components/schemas/service_agent_name_response.yaml @@ -0,0 +1,4 @@ +type: object +properties: + agentName: + type: string 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..aac94236d65c6 --- /dev/null +++ b/x-pack/plugins/observability_solution/apm/docs/openapi/apm/components/schemas/service_environment_object.yaml @@ -0,0 +1,6 @@ +type: object +properties: + name: + type: string + alreadyConfigured: + type: boolean 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..abdf2f56b02bb --- /dev/null +++ b/x-pack/plugins/observability_solution/apm/docs/openapi/apm/components/schemas/service_environments_response.yaml @@ -0,0 +1,6 @@ +type: object +properties: + environments: + type: array + 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..562856349206e --- /dev/null +++ b/x-pack/plugins/observability_solution/apm/docs/openapi/apm/components/schemas/service_object.yaml @@ -0,0 +1,6 @@ +type: object +properties: + name: + type: string + environment: + type: string 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..50601e4061015 --- /dev/null +++ b/x-pack/plugins/observability_solution/apm/docs/openapi/apm/components/schemas/settings_object.yaml @@ -0,0 +1,3 @@ +type: object +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..07ee5f6c8e0e5 --- /dev/null +++ b/x-pack/plugins/observability_solution/apm/docs/openapi/apm/components/schemas/source_maps_response.yaml @@ -0,0 +1,28 @@ +type: object +properties: + artifacts: + type: array + items: + allOf: + - type: object + properties: + body: + 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..e4b8a80fa1e5a --- /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@{serviceName}@annotation@search.yaml' + /api/apm/services/{serviceName}/annotation: + $ref: 'paths/api@apm@services@{serviceName}@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/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..a354d49f734e5 --- /dev/null +++ b/x-pack/plugins/observability_solution/apm/docs/openapi/apm/paths/api@apm@agent_keys.yaml @@ -0,0 +1,19 @@ +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: + $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' 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..8da273dc840f6 --- /dev/null +++ b/x-pack/plugins/observability_solution/apm/docs/openapi/apm/paths/api@apm@fleet@apm_server_schema.yaml @@ -0,0 +1,32 @@ +post: + summary: Save APM server schema + operationId: saveApmServerSchema + tags: + - APM server schema + 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 + '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@{serviceName}@annotation.yaml b/x-pack/plugins/observability_solution/apm/docs/openapi/apm/paths/api@apm@services@{serviceName}@annotation.yaml new file mode 100644 index 0000000000000..2fc370dea1bc3 --- /dev/null +++ b/x-pack/plugins/observability_solution/apm/docs/openapi/apm/paths/api@apm@services@{serviceName}@annotation.yaml @@ -0,0 +1,26 @@ +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: + $ref: '../components/schemas/create_annotation_object.yaml' + responses: + '200': + description: Annotation created successfully + content: + application/json: + schema: + $ref: '../components/schemas/create_annotation_response.yaml' diff --git a/x-pack/plugins/observability_solution/apm/docs/openapi/apm/paths/api@apm@services@{serviceName}@annotation@search.yaml b/x-pack/plugins/observability_solution/apm/docs/openapi/apm/paths/api@apm@services@{serviceName}@annotation@search.yaml new file mode 100644 index 0000000000000..272161b540dfe --- /dev/null +++ b/x-pack/plugins/observability_solution/apm/docs/openapi/apm/paths/api@apm@services@{serviceName}@annotation@search.yaml @@ -0,0 +1,38 @@ +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: + $ref: '../components/schemas/annotation_search_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..6dad441ed6b5c --- /dev/null +++ b/x-pack/plugins/observability_solution/apm/docs/openapi/apm/paths/api@apm@settings@agent_configuration.yaml @@ -0,0 +1,73 @@ +get: + summary: List of agent configurations + description: Get a list of agent configurations. + operationId: getAgentConfigurations + tags: + - APM agent configuration + responses: + '200': + description: Successful response + content: + application/json: + schema: + $ref: '../components/schemas/agent_configurations_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 + 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' + '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: + - name: overwrite + in: query + 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 + '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..43ad49e5ffc33 --- /dev/null +++ b/x-pack/plugins/observability_solution/apm/docs/openapi/apm/paths/api@apm@settings@agent_configuration@agent_name.yaml @@ -0,0 +1,26 @@ +get: + summary: Get agent name for service + description: Retrieve `agentName` for a service. + operationId: getAgentNameForService + tags: + - APM agent configuration + parameters: + - name: serviceName + in: query + description: The name of the service + required: true + schema: + type: string + responses: + '200': + description: Successful response + content: + application/json: + schema: + $ref: '../components/schemas/service_agent_name_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..387b3dac72272 --- /dev/null +++ b/x-pack/plugins/observability_solution/apm/docs/openapi/apm/paths/api@apm@settings@agent_configuration@search.yaml @@ -0,0 +1,26 @@ +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 + 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' + '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..3f89608003a3b --- /dev/null +++ b/x-pack/plugins/observability_solution/apm/docs/openapi/apm/paths/api@apm@settings@agent_configuration@view.yaml @@ -0,0 +1,31 @@ +get: + summary: Get single agent configuration + operationId: getSingleAgentConfiguration + tags: + - APM agent configuration + parameters: + - name: name + in: query + description: Service name + required: true + schema: + type: string + - name: environment + in: query + description: Service environment + required: true + schema: + type: string + responses: + '200': + description: Successful response + content: + application/json: + schema: + $ref: '../components/schemas/single_agent_configuration_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..944cb10666f24 --- /dev/null +++ b/x-pack/plugins/observability_solution/apm/docs/openapi/apm/paths/api@apm@sourcemaps.yaml @@ -0,0 +1,65 @@ +get: + summary: Get source maps + description: Returns an array of Fleet artifacts, including source map uploads. + operationId: getSourceMaps + tags: + - APM sourcemaps + parameters: + - name: page + in: query + schema: + type: number + - name: perPage + in: query + schema: + type: number + responses: + '200': + description: Successful response + content: + application/json: + schema: + $ref: '../components/schemas/source_maps_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 + 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' + '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..1737f90ead107 --- /dev/null +++ b/x-pack/plugins/observability_solution/apm/docs/openapi/apm/paths/api@apm@sourcemaps@{id}.yaml @@ -0,0 +1,31 @@ +delete: + summary: Delete source map + description: Delete a previously uploaded source map. + operationId: deleteSourceMap + tags: + - APM sourcemaps + parameters: + - name: id + in: path + schema: + type: string + responses: + '200': + description: Successful response + content: + application/json: + schema: + type: object + additionalProperties: false + '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/apm@settings@agent_configuration@environments.yaml b/x-pack/plugins/observability_solution/apm/docs/openapi/apm/paths/apm@settings@agent_configuration@environments.yaml new file mode 100644 index 0000000000000..e8a678cee1793 --- /dev/null +++ b/x-pack/plugins/observability_solution/apm/docs/openapi/apm/paths/apm@settings@agent_configuration@environments.yaml @@ -0,0 +1,24 @@ +get: + summary: Get environments for service + operationId: getEnvironmentsForService + tags: + - APM agent configuration + parameters: + - 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' + '404': + description: Not found response + content: + application/json: + schema: + $ref: '../components/schemas/404_response.yaml' From 98a3fa2f591b92fb65738ddb27df87ada39c86c1 Mon Sep 17 00:00:00 2001 From: Milosz Marcinkowski Date: Wed, 30 Oct 2024 16:01:22 +0100 Subject: [PATCH 4/9] add required headers, add 400 response spec --- .../apm/docs/openapi/apm/bundled.json | 260 ++++++++++++++++++ .../apm/docs/openapi/apm/bundled.yaml | 143 ++++++++++ .../headers/elastic_api_version.yaml | 9 + .../apm/components/headers/kbn_xsrf.yaml | 7 + .../apm/components/schemas/400_response.yaml | 11 + .../openapi/apm/paths/api@apm@agent_keys.yaml | 9 + .../api@apm@fleet@apm_server_schema.yaml | 9 + ...apm@services@{serviceName}@annotation.yaml | 8 + ...vices@{serviceName}@annotation@search.yaml | 7 + .../api@apm@settings@agent_configuration.yaml | 25 ++ ...ttings@agent_configuration@agent_name.yaml | 7 + ...m@settings@agent_configuration@search.yaml | 9 + ...apm@settings@agent_configuration@view.yaml | 7 + .../openapi/apm/paths/api@apm@sourcemaps.yaml | 16 ++ .../apm/paths/api@apm@sourcemaps@{id}.yaml | 8 + ...ings@agent_configuration@environments.yaml | 7 + 16 files changed, 542 insertions(+) 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 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 index a852af2cef953..07af1bdbb9ea5 100644 --- a/x-pack/plugins/observability_solution/apm/docs/openapi/apm/bundled.json +++ b/x-pack/plugins/observability_solution/apm/docs/openapi/apm/bundled.json @@ -35,6 +35,14 @@ "tags": [ "APM agent keys" ], + "parameters": [ + { + "$ref": "#/components/parameters/elastic_api_version" + }, + { + "$ref": "#/components/parameters/kbn-xsrf" + } + ], "requestBody": { "required": true, "content": { @@ -55,6 +63,16 @@ } } } + }, + "400": { + "description": "Bad Request response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/400_response" + } + } + } } } } @@ -68,6 +86,9 @@ "APM annotations" ], "parameters": [ + { + "$ref": "#/components/parameters/elastic_api_version" + }, { "name": "serviceName", "in": "path", @@ -115,6 +136,16 @@ } } } + }, + "400": { + "description": "Bad Request response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/400_response" + } + } + } } } } @@ -128,6 +159,12 @@ "APM annotations" ], "parameters": [ + { + "$ref": "#/components/parameters/elastic_api_version" + }, + { + "$ref": "#/components/parameters/kbn-xsrf" + }, { "name": "serviceName", "in": "path", @@ -158,6 +195,16 @@ } } } + }, + "400": { + "description": "Bad Request response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/400_response" + } + } + } } } } @@ -170,6 +217,11 @@ "tags": [ "APM agent configuration" ], + "parameters": [ + { + "$ref": "#/components/parameters/elastic_api_version" + } + ], "responses": { "200": { "description": "Successful response", @@ -181,6 +233,16 @@ } } }, + "400": { + "description": "Bad Request response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/400_response" + } + } + } + }, "404": { "description": "Not found response", "content": { @@ -199,6 +261,14 @@ "tags": [ "APM agent configuration" ], + "parameters": [ + { + "$ref": "#/components/parameters/elastic_api_version" + }, + { + "$ref": "#/components/parameters/kbn-xsrf" + } + ], "requestBody": { "required": true, "content": { @@ -220,6 +290,16 @@ } } }, + "400": { + "description": "Bad Request response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/400_response" + } + } + } + }, "404": { "description": "Not found response", "content": { @@ -239,6 +319,12 @@ "APM agent configuration" ], "parameters": [ + { + "$ref": "#/components/parameters/elastic_api_version" + }, + { + "$ref": "#/components/parameters/kbn-xsrf" + }, { "name": "overwrite", "in": "query", @@ -269,6 +355,16 @@ } } }, + "400": { + "description": "Bad Request response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/400_response" + } + } + } + }, "404": { "description": "Not found response", "content": { @@ -290,6 +386,9 @@ "APM agent configuration" ], "parameters": [ + { + "$ref": "#/components/parameters/elastic_api_version" + }, { "name": "name", "in": "query", @@ -320,6 +419,16 @@ } } }, + "400": { + "description": "Bad Request response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/400_response" + } + } + } + }, "404": { "description": "Not found response", "content": { @@ -341,6 +450,14 @@ "tags": [ "APM agent configuration" ], + "parameters": [ + { + "$ref": "#/components/parameters/elastic_api_version" + }, + { + "$ref": "#/components/parameters/kbn-xsrf" + } + ], "requestBody": { "required": true, "content": { @@ -362,6 +479,16 @@ } } }, + "400": { + "description": "Bad Request response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/400_response" + } + } + } + }, "404": { "description": "Not found response", "content": { @@ -383,6 +510,9 @@ "APM agent configuration" ], "parameters": [ + { + "$ref": "#/components/parameters/elastic_api_version" + }, { "name": "serviceName", "in": "query", @@ -403,6 +533,16 @@ } } }, + "400": { + "description": "Bad Request response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/400_response" + } + } + } + }, "404": { "description": "Not found response", "content": { @@ -425,6 +565,9 @@ "APM agent configuration" ], "parameters": [ + { + "$ref": "#/components/parameters/elastic_api_version" + }, { "name": "serviceName", "in": "query", @@ -446,6 +589,16 @@ } } }, + "400": { + "description": "Bad Request response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/400_response" + } + } + } + }, "404": { "description": "Not found response", "content": { @@ -468,6 +621,9 @@ "APM sourcemaps" ], "parameters": [ + { + "$ref": "#/components/parameters/elastic_api_version" + }, { "name": "page", "in": "query", @@ -494,6 +650,16 @@ } } }, + "400": { + "description": "Bad Request response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/400_response" + } + } + } + }, "500": { "description": "Internal Server Error response", "content": { @@ -523,6 +689,14 @@ "tags": [ "APM sourcemaps" ], + "parameters": [ + { + "$ref": "#/components/parameters/elastic_api_version" + }, + { + "$ref": "#/components/parameters/kbn-xsrf" + } + ], "requestBody": { "required": true, "content": { @@ -544,6 +718,16 @@ } } }, + "400": { + "description": "Bad Request response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/400_response" + } + } + } + }, "500": { "description": "Internal Server Error response", "content": { @@ -576,6 +760,12 @@ "APM sourcemaps" ], "parameters": [ + { + "$ref": "#/components/parameters/elastic_api_version" + }, + { + "$ref": "#/components/parameters/kbn-xsrf" + }, { "name": "id", "in": "path", @@ -596,6 +786,16 @@ } } }, + "400": { + "description": "Bad Request response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/400_response" + } + } + } + }, "500": { "description": "Internal Server Error response", "content": { @@ -626,6 +826,14 @@ "tags": [ "APM server schema" ], + "parameters": [ + { + "$ref": "#/components/parameters/elastic_api_version" + }, + { + "$ref": "#/components/parameters/kbn-xsrf" + } + ], "requestBody": { "required": true, "content": { @@ -658,6 +866,16 @@ } } }, + "400": { + "description": "Bad Request response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/400_response" + } + } + } + }, "404": { "description": "Not found response", "content": { @@ -673,6 +891,31 @@ } }, "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", @@ -713,6 +956,23 @@ } } }, + "400_response": { + "type": "object", + "properties": { + "statusCode": { + "type": "number", + "example": 400 + }, + "error": { + "type": "string", + "example": "Not Found" + }, + "message": { + "type": "string", + "example": "Not Found" + } + } + }, "annotation_search_response": { "type": "object", "properties": { 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 index aadf53fff92ef..28b483cce5ad5 100644 --- a/x-pack/plugins/observability_solution/apm/docs/openapi/apm/bundled.yaml +++ b/x-pack/plugins/observability_solution/apm/docs/openapi/apm/bundled.yaml @@ -24,6 +24,9 @@ paths: operationId: createAgentKey tags: - APM agent keys + parameters: + - $ref: '#/components/parameters/elastic_api_version' + - $ref: '#/components/parameters/kbn-xsrf' requestBody: required: true content: @@ -37,6 +40,12 @@ paths: application/json: schema: $ref: '#/components/schemas/agent_keys_response' + '400': + description: Bad Request response + content: + application/json: + schema: + $ref: '#/components/schemas/400_response' /api/apm/services/{serviceName}/annotation/search: get: summary: Search for annotations @@ -45,6 +54,7 @@ paths: tags: - APM annotations parameters: + - $ref: '#/components/parameters/elastic_api_version' - name: serviceName in: path required: true @@ -76,6 +86,12 @@ paths: application/json: schema: $ref: '#/components/schemas/annotation_search_response' + '400': + description: Bad Request response + content: + application/json: + schema: + $ref: '#/components/schemas/400_response' /api/apm/services/{serviceName}/annotation: post: summary: Create a service annotation @@ -84,6 +100,8 @@ paths: tags: - APM annotations parameters: + - $ref: '#/components/parameters/elastic_api_version' + - $ref: '#/components/parameters/kbn-xsrf' - name: serviceName in: path required: true @@ -103,6 +121,12 @@ paths: application/json: schema: $ref: '#/components/schemas/create_annotation_response' + '400': + description: Bad Request response + content: + application/json: + schema: + $ref: '#/components/schemas/400_response' /api/apm/settings/agent-configuration: get: summary: List of agent configurations @@ -110,6 +134,8 @@ paths: operationId: getAgentConfigurations tags: - APM agent configuration + parameters: + - $ref: '#/components/parameters/elastic_api_version' responses: '200': description: Successful response @@ -117,6 +143,12 @@ paths: application/json: schema: $ref: '#/components/schemas/agent_configurations_response' + '400': + description: Bad Request response + content: + application/json: + schema: + $ref: '#/components/schemas/400_response' '404': description: Not found response content: @@ -128,6 +160,9 @@ paths: operationId: deleteAgentConfiguration tags: - APM agent configuration + parameters: + - $ref: '#/components/parameters/elastic_api_version' + - $ref: '#/components/parameters/kbn-xsrf' requestBody: required: true content: @@ -141,6 +176,12 @@ paths: application/json: schema: $ref: '#/components/schemas/delete_agent_configurations_response' + '400': + description: Bad Request response + content: + application/json: + schema: + $ref: '#/components/schemas/400_response' '404': description: Not found response content: @@ -153,6 +194,8 @@ paths: tags: - APM agent configuration parameters: + - $ref: '#/components/parameters/elastic_api_version' + - $ref: '#/components/parameters/kbn-xsrf' - name: overwrite in: query schema: @@ -171,6 +214,12 @@ paths: schema: type: object additionalProperties: false + '400': + description: Bad Request response + content: + application/json: + schema: + $ref: '#/components/schemas/400_response' '404': description: Not found response content: @@ -184,6 +233,7 @@ paths: tags: - APM agent configuration parameters: + - $ref: '#/components/parameters/elastic_api_version' - name: name in: query description: Service name @@ -203,6 +253,12 @@ paths: application/json: schema: $ref: '#/components/schemas/single_agent_configuration_response' + '400': + description: Bad Request response + content: + application/json: + schema: + $ref: '#/components/schemas/400_response' '404': description: Not found response content: @@ -217,6 +273,9 @@ paths: operationId: searchSingleConfiguration tags: - APM agent configuration + parameters: + - $ref: '#/components/parameters/elastic_api_version' + - $ref: '#/components/parameters/kbn-xsrf' requestBody: required: true content: @@ -230,6 +289,12 @@ paths: application/json: schema: $ref: '#/components/schemas/search_agent_configuration_response' + '400': + description: Bad Request response + content: + application/json: + schema: + $ref: '#/components/schemas/400_response' '404': description: Not found response content: @@ -243,6 +308,7 @@ paths: tags: - APM agent configuration parameters: + - $ref: '#/components/parameters/elastic_api_version' - name: serviceName in: query description: The name of the service @@ -255,6 +321,12 @@ paths: application/json: schema: $ref: '#/components/schemas/service_environments_response' + '400': + description: Bad Request response + content: + application/json: + schema: + $ref: '#/components/schemas/400_response' '404': description: Not found response content: @@ -269,6 +341,7 @@ paths: tags: - APM agent configuration parameters: + - $ref: '#/components/parameters/elastic_api_version' - name: serviceName in: query description: The name of the service @@ -282,6 +355,12 @@ paths: application/json: schema: $ref: '#/components/schemas/service_agent_name_response' + '400': + description: Bad Request response + content: + application/json: + schema: + $ref: '#/components/schemas/400_response' '404': description: Not found response content: @@ -296,6 +375,7 @@ paths: tags: - APM sourcemaps parameters: + - $ref: '#/components/parameters/elastic_api_version' - name: page in: query schema: @@ -311,6 +391,12 @@ paths: application/json: schema: $ref: '#/components/schemas/source_maps_response' + '400': + description: Bad Request response + content: + application/json: + schema: + $ref: '#/components/schemas/400_response' '500': description: Internal Server Error response content: @@ -329,6 +415,9 @@ paths: operationId: uploadSourceMap tags: - APM sourcemaps + parameters: + - $ref: '#/components/parameters/elastic_api_version' + - $ref: '#/components/parameters/kbn-xsrf' requestBody: required: true content: @@ -342,6 +431,12 @@ paths: application/json: schema: $ref: '#/components/schemas/upload_source_maps_response' + '400': + description: Bad Request response + content: + application/json: + schema: + $ref: '#/components/schemas/400_response' '500': description: Internal Server Error response content: @@ -362,6 +457,8 @@ paths: tags: - APM sourcemaps parameters: + - $ref: '#/components/parameters/elastic_api_version' + - $ref: '#/components/parameters/kbn-xsrf' - name: id in: path schema: @@ -374,6 +471,12 @@ paths: schema: type: object additionalProperties: false + '400': + description: Bad Request response + content: + application/json: + schema: + $ref: '#/components/schemas/400_response' '500': description: Internal Server Error response content: @@ -392,6 +495,9 @@ paths: operationId: saveApmServerSchema tags: - APM server schema + parameters: + - $ref: '#/components/parameters/elastic_api_version' + - $ref: '#/components/parameters/kbn-xsrf' requestBody: required: true content: @@ -413,6 +519,12 @@ paths: schema: type: object additionalProperties: false + '400': + description: Bad Request response + content: + application/json: + schema: + $ref: '#/components/schemas/400_response' '404': description: Not found response content: @@ -420,6 +532,25 @@ paths: 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 @@ -447,6 +578,18 @@ components: type: string encoded: type: string + 400_response: + type: object + properties: + statusCode: + type: number + example: 400 + error: + type: string + example: Not Found + message: + type: string + example: Not Found annotation_search_response: type: object properties: 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..c58230d718ff2 --- /dev/null +++ b/x-pack/plugins/observability_solution/apm/docs/openapi/apm/components/schemas/400_response.yaml @@ -0,0 +1,11 @@ +type: object +properties: + statusCode: + type: number + example: 400 + error: + type: string + example: Not Found + message: + type: string + example: Not Found 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 index a354d49f734e5..8baa9600f1358 100644 --- 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 @@ -4,6 +4,9 @@ post: operationId: createAgentKey tags: - APM agent keys + parameters: + - $ref: '../components/headers/elastic_api_version.yaml' + - $ref: '../components/headers/kbn_xsrf.yaml' requestBody: required: true content: @@ -17,3 +20,9 @@ post: 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' 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 index 8da273dc840f6..70fb9de3df1da 100644 --- 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 @@ -3,6 +3,9 @@ post: operationId: saveApmServerSchema tags: - APM server schema + parameters: + - $ref: '../components/headers/elastic_api_version.yaml' + - $ref: '../components/headers/kbn_xsrf.yaml' requestBody: required: true content: @@ -24,6 +27,12 @@ post: schema: type: object additionalProperties: false + '400': + description: Bad Request response + content: + application/json: + schema: + $ref: '../components/schemas/400_response.yaml' '404': description: Not found response content: diff --git a/x-pack/plugins/observability_solution/apm/docs/openapi/apm/paths/api@apm@services@{serviceName}@annotation.yaml b/x-pack/plugins/observability_solution/apm/docs/openapi/apm/paths/api@apm@services@{serviceName}@annotation.yaml index 2fc370dea1bc3..17973858f7711 100644 --- a/x-pack/plugins/observability_solution/apm/docs/openapi/apm/paths/api@apm@services@{serviceName}@annotation.yaml +++ b/x-pack/plugins/observability_solution/apm/docs/openapi/apm/paths/api@apm@services@{serviceName}@annotation.yaml @@ -5,6 +5,8 @@ post: tags: - APM annotations parameters: + - $ref: '../components/headers/elastic_api_version.yaml' + - $ref: '../components/headers/kbn_xsrf.yaml' - name: serviceName in: path required: true @@ -24,3 +26,9 @@ post: 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' diff --git a/x-pack/plugins/observability_solution/apm/docs/openapi/apm/paths/api@apm@services@{serviceName}@annotation@search.yaml b/x-pack/plugins/observability_solution/apm/docs/openapi/apm/paths/api@apm@services@{serviceName}@annotation@search.yaml index 272161b540dfe..edb8bc2cb5b06 100644 --- a/x-pack/plugins/observability_solution/apm/docs/openapi/apm/paths/api@apm@services@{serviceName}@annotation@search.yaml +++ b/x-pack/plugins/observability_solution/apm/docs/openapi/apm/paths/api@apm@services@{serviceName}@annotation@search.yaml @@ -5,6 +5,7 @@ get: tags: - APM annotations parameters: + - $ref: '../components/headers/elastic_api_version.yaml' - name: serviceName in: path required: true @@ -36,3 +37,9 @@ get: 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' 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 index 6dad441ed6b5c..45dc5a21f8b18 100644 --- 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 @@ -4,6 +4,8 @@ get: operationId: getAgentConfigurations tags: - APM agent configuration + parameters: + - $ref: '../components/headers/elastic_api_version.yaml' responses: '200': description: Successful response @@ -11,6 +13,12 @@ get: 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' '404': description: Not found response content: @@ -22,6 +30,9 @@ delete: operationId: deleteAgentConfiguration tags: - APM agent configuration + parameters: + - $ref: '../components/headers/elastic_api_version.yaml' + - $ref: '../components/headers/kbn_xsrf.yaml' requestBody: required: true content: @@ -35,6 +46,12 @@ delete: 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' '404': description: Not found response content: @@ -47,6 +64,8 @@ put: tags: - APM agent configuration parameters: + - $ref: '../components/headers/elastic_api_version.yaml' + - $ref: '../components/headers/kbn_xsrf.yaml' - name: overwrite in: query schema: @@ -65,6 +84,12 @@ put: schema: type: object additionalProperties: false + '400': + description: Bad Request response + content: + application/json: + schema: + $ref: '../components/schemas/400_response.yaml' '404': description: Not found response content: 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 index 43ad49e5ffc33..af5689b021a3d 100644 --- 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 @@ -5,6 +5,7 @@ get: tags: - APM agent configuration parameters: + - $ref: '../components/headers/elastic_api_version.yaml' - name: serviceName in: query description: The name of the service @@ -18,6 +19,12 @@ get: 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' '404': description: Not found response content: 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 index 387b3dac72272..c253f20746c1a 100644 --- 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 @@ -5,6 +5,9 @@ post: operationId: searchSingleConfiguration tags: - APM agent configuration + parameters: + - $ref: '../components/headers/elastic_api_version.yaml' + - $ref: '../components/headers/kbn_xsrf.yaml' requestBody: required: true content: @@ -18,6 +21,12 @@ post: 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' '404': description: Not found response content: 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 index 3f89608003a3b..127f877aa359b 100644 --- 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 @@ -4,6 +4,7 @@ get: tags: - APM agent configuration parameters: + - $ref: '../components/headers/elastic_api_version.yaml' - name: name in: query description: Service name @@ -23,6 +24,12 @@ get: 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' '404': description: Not found response content: 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 index 944cb10666f24..48fbdebc949df 100644 --- 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 @@ -5,6 +5,7 @@ get: tags: - APM sourcemaps parameters: + - $ref: '../components/headers/elastic_api_version.yaml' - name: page in: query schema: @@ -20,6 +21,12 @@ get: 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' '500': description: Internal Server Error response content: @@ -38,6 +45,9 @@ post: operationId: uploadSourceMap tags: - APM sourcemaps + parameters: + - $ref: '../components/headers/elastic_api_version.yaml' + - $ref: '../components/headers/kbn_xsrf.yaml' requestBody: required: true content: @@ -51,6 +61,12 @@ post: 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' '500': description: Internal Server Error response content: 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 index 1737f90ead107..57e7ce141652f 100644 --- 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 @@ -5,6 +5,8 @@ delete: tags: - APM sourcemaps parameters: + - $ref: '../components/headers/elastic_api_version.yaml' + - $ref: '../components/headers/kbn_xsrf.yaml' - name: id in: path schema: @@ -17,6 +19,12 @@ delete: schema: type: object additionalProperties: false + '400': + description: Bad Request response + content: + application/json: + schema: + $ref: '../components/schemas/400_response.yaml' '500': description: Internal Server Error response content: diff --git a/x-pack/plugins/observability_solution/apm/docs/openapi/apm/paths/apm@settings@agent_configuration@environments.yaml b/x-pack/plugins/observability_solution/apm/docs/openapi/apm/paths/apm@settings@agent_configuration@environments.yaml index e8a678cee1793..e40943cd23f45 100644 --- a/x-pack/plugins/observability_solution/apm/docs/openapi/apm/paths/apm@settings@agent_configuration@environments.yaml +++ b/x-pack/plugins/observability_solution/apm/docs/openapi/apm/paths/apm@settings@agent_configuration@environments.yaml @@ -4,6 +4,7 @@ get: tags: - APM agent configuration parameters: + - $ref: '../components/headers/elastic_api_version.yaml' - name: serviceName in: query description: The name of the service @@ -16,6 +17,12 @@ get: 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' '404': description: Not found response content: From 2f7c3fd219eb618b12d0c98e9be088dbd830418e Mon Sep 17 00:00:00 2001 From: Milosz Marcinkowski Date: Wed, 30 Oct 2024 17:34:25 +0100 Subject: [PATCH 5/9] add missing http responses --- .../apm/docs/openapi/apm/bundled.json | 392 +++++++++++++++--- .../apm/docs/openapi/apm/bundled.yaml | 258 ++++++++++-- .../apm/components/schemas/401_response.yaml | 10 + .../apm/components/schemas/403_response.yaml | 10 + .../components/schemas/agent_keys_object.yaml | 3 + .../schemas/agent_keys_response.yaml | 23 +- .../openapi/apm/paths/api@apm@agent_keys.yaml | 18 + .../api@apm@fleet@apm_server_schema.yaml | 12 + ...apm@services@{serviceName}@annotation.yaml | 18 + ...vices@{serviceName}@annotation@search.yaml | 12 + .../api@apm@settings@agent_configuration.yaml | 30 ++ ...ttings@agent_configuration@agent_name.yaml | 6 + ...m@settings@agent_configuration@search.yaml | 6 + ...apm@settings@agent_configuration@view.yaml | 8 +- .../openapi/apm/paths/api@apm@sourcemaps.yaml | 18 + .../apm/paths/api@apm@sourcemaps@{id}.yaml | 12 + ...ings@agent_configuration@environments.yaml | 6 + 17 files changed, 726 insertions(+), 116 deletions(-) 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 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 index 07af1bdbb9ea5..940979f3ddbbd 100644 --- a/x-pack/plugins/observability_solution/apm/docs/openapi/apm/bundled.json +++ b/x-pack/plugins/observability_solution/apm/docs/openapi/apm/bundled.json @@ -40,7 +40,7 @@ "$ref": "#/components/parameters/elastic_api_version" }, { - "$ref": "#/components/parameters/kbn-xsrf" + "$ref": "#/components/parameters/kbn_xsrf" } ], "requestBody": { @@ -73,6 +73,36 @@ } } } + }, + "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" + } + } + } } } } @@ -146,6 +176,26 @@ } } } + }, + "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" + } + } + } } } } @@ -163,7 +213,7 @@ "$ref": "#/components/parameters/elastic_api_version" }, { - "$ref": "#/components/parameters/kbn-xsrf" + "$ref": "#/components/parameters/kbn_xsrf" }, { "name": "serviceName", @@ -205,6 +255,36 @@ } } } + }, + "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" + } + } + } } } } @@ -243,6 +323,16 @@ } } }, + "401": { + "description": "Unauthorized response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/401_response" + } + } + } + }, "404": { "description": "Not found response", "content": { @@ -266,7 +356,7 @@ "$ref": "#/components/parameters/elastic_api_version" }, { - "$ref": "#/components/parameters/kbn-xsrf" + "$ref": "#/components/parameters/kbn_xsrf" } ], "requestBody": { @@ -300,6 +390,26 @@ } } }, + "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": { @@ -323,7 +433,7 @@ "$ref": "#/components/parameters/elastic_api_version" }, { - "$ref": "#/components/parameters/kbn-xsrf" + "$ref": "#/components/parameters/kbn_xsrf" }, { "name": "overwrite", @@ -365,6 +475,26 @@ } } }, + "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": { @@ -393,7 +523,6 @@ "name": "name", "in": "query", "description": "Service name", - "required": true, "schema": { "type": "string" } @@ -402,7 +531,6 @@ "name": "environment", "in": "query", "description": "Service environment", - "required": true, "schema": { "type": "string" } @@ -429,6 +557,16 @@ } } }, + "401": { + "description": "Unauthorized response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/401_response" + } + } + } + }, "404": { "description": "Not found response", "content": { @@ -455,7 +593,7 @@ "$ref": "#/components/parameters/elastic_api_version" }, { - "$ref": "#/components/parameters/kbn-xsrf" + "$ref": "#/components/parameters/kbn_xsrf" } ], "requestBody": { @@ -489,6 +627,16 @@ } } }, + "401": { + "description": "Unauthorized response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/401_response" + } + } + } + }, "404": { "description": "Not found response", "content": { @@ -543,6 +691,16 @@ } } }, + "401": { + "description": "Unauthorized response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/401_response" + } + } + } + }, "404": { "description": "Not found response", "content": { @@ -599,6 +757,16 @@ } } }, + "401": { + "description": "Unauthorized response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/401_response" + } + } + } + }, "404": { "description": "Not found response", "content": { @@ -660,6 +828,16 @@ } } }, + "401": { + "description": "Unauthorized response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/401_response" + } + } + } + }, "500": { "description": "Internal Server Error response", "content": { @@ -694,7 +872,7 @@ "$ref": "#/components/parameters/elastic_api_version" }, { - "$ref": "#/components/parameters/kbn-xsrf" + "$ref": "#/components/parameters/kbn_xsrf" } ], "requestBody": { @@ -728,6 +906,26 @@ } } }, + "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": { @@ -764,7 +962,7 @@ "$ref": "#/components/parameters/elastic_api_version" }, { - "$ref": "#/components/parameters/kbn-xsrf" + "$ref": "#/components/parameters/kbn_xsrf" }, { "name": "id", @@ -796,6 +994,26 @@ } } }, + "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": { @@ -831,7 +1049,7 @@ "$ref": "#/components/parameters/elastic_api_version" }, { - "$ref": "#/components/parameters/kbn-xsrf" + "$ref": "#/components/parameters/kbn_xsrf" } ], "requestBody": { @@ -876,6 +1094,26 @@ } } }, + "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": { @@ -905,7 +1143,7 @@ "type": "string" } }, - "kbn-xsrf": { + "kbn_xsrf": { "description": "A required header to protect against CSRF attacks", "in": "header", "name": "kbn-xsrf", @@ -919,6 +1157,10 @@ "schemas": { "agent_keys_object": { "type": "object", + "required": [ + "name", + "privileges" + ], "properties": { "name": { "type": "string" @@ -938,38 +1180,88 @@ "agent_keys_response": { "type": "object", "properties": { - "api_key": { - "type": "string" + "agentKey": { + "type": "object", + "properties": { + "expiration": { + "type": "integer", + "format": "int64" + }, + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "encoded": { + "type": "string" + } + } + } + } + }, + "400_response": { + "type": "object", + "properties": { + "statusCode": { + "type": "number", + "example": 400 }, - "expiration": { - "type": "integer", - "format": "int64" + "error": { + "type": "string", + "example": "Not Found" }, - "id": { - "type": "string" + "message": { + "type": "string", + "example": "Not Found" + } + } + }, + "401_response": { + "type": "object", + "properties": { + "statusCode": { + "type": "number", + "example": 401 }, - "name": { - "type": "string" + "error": { + "type": "string", + "example": "Unauthorized" }, - "encoded": { + "message": { "type": "string" } } }, - "400_response": { + "403_response": { "type": "object", "properties": { "statusCode": { "type": "number", - "example": 400 + "example": 403 }, "error": { "type": "string", - "example": "Not Found" + "example": "Forbidden" }, "message": { + "type": "string" + } + } + }, + "500_response": { + "type": "object", + "properties": { + "statusCode": { + "type": "number", + "example": 500 + }, + "error": { "type": "string", - "example": "Not Found" + "example": "Internal Server Error" + }, + "message": { + "type": "string" } } }, @@ -1082,6 +1374,23 @@ } } }, + "404_response": { + "type": "object", + "properties": { + "statusCode": { + "type": "number", + "example": 404 + }, + "error": { + "type": "string", + "example": "Not Found" + }, + "message": { + "type": "string", + "example": "Not Found" + } + } + }, "service_object": { "type": "object", "properties": { @@ -1139,23 +1448,6 @@ } } }, - "404_response": { - "type": "object", - "properties": { - "statusCode": { - "type": "number", - "example": 404 - }, - "error": { - "type": "string", - "example": "Not Found" - }, - "message": { - "type": "string", - "example": "Not Found" - } - } - }, "agent_configuration_intake_object": { "type": "object", "required": [ @@ -1356,22 +1648,6 @@ } } }, - "500_response": { - "type": "object", - "properties": { - "statusCode": { - "type": "number", - "example": 500 - }, - "error": { - "type": "string", - "example": "Internal Server Error" - }, - "message": { - "type": "string" - } - } - }, "501_response": { "type": "object", "properties": { 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 index 28b483cce5ad5..d3c14cd0ed8f8 100644 --- a/x-pack/plugins/observability_solution/apm/docs/openapi/apm/bundled.yaml +++ b/x-pack/plugins/observability_solution/apm/docs/openapi/apm/bundled.yaml @@ -26,7 +26,7 @@ paths: - APM agent keys parameters: - $ref: '#/components/parameters/elastic_api_version' - - $ref: '#/components/parameters/kbn-xsrf' + - $ref: '#/components/parameters/kbn_xsrf' requestBody: required: true content: @@ -46,6 +46,24 @@ paths: 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 @@ -92,6 +110,18 @@ paths: 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 @@ -101,7 +131,7 @@ paths: - APM annotations parameters: - $ref: '#/components/parameters/elastic_api_version' - - $ref: '#/components/parameters/kbn-xsrf' + - $ref: '#/components/parameters/kbn_xsrf' - name: serviceName in: path required: true @@ -127,6 +157,24 @@ paths: 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: List of agent configurations @@ -149,6 +197,12 @@ paths: 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: @@ -162,7 +216,7 @@ paths: - APM agent configuration parameters: - $ref: '#/components/parameters/elastic_api_version' - - $ref: '#/components/parameters/kbn-xsrf' + - $ref: '#/components/parameters/kbn_xsrf' requestBody: required: true content: @@ -182,6 +236,18 @@ paths: 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: @@ -195,7 +261,7 @@ paths: - APM agent configuration parameters: - $ref: '#/components/parameters/elastic_api_version' - - $ref: '#/components/parameters/kbn-xsrf' + - $ref: '#/components/parameters/kbn_xsrf' - name: overwrite in: query schema: @@ -220,6 +286,18 @@ paths: 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: @@ -237,13 +315,11 @@ paths: - name: name in: query description: Service name - required: true schema: type: string - name: environment in: query description: Service environment - required: true schema: type: string responses: @@ -259,6 +335,12 @@ paths: 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: @@ -275,7 +357,7 @@ paths: - APM agent configuration parameters: - $ref: '#/components/parameters/elastic_api_version' - - $ref: '#/components/parameters/kbn-xsrf' + - $ref: '#/components/parameters/kbn_xsrf' requestBody: required: true content: @@ -295,6 +377,12 @@ paths: 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: @@ -327,6 +415,12 @@ paths: 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: @@ -361,6 +455,12 @@ paths: 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: @@ -397,6 +497,12 @@ paths: 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: @@ -417,7 +523,7 @@ paths: - APM sourcemaps parameters: - $ref: '#/components/parameters/elastic_api_version' - - $ref: '#/components/parameters/kbn-xsrf' + - $ref: '#/components/parameters/kbn_xsrf' requestBody: required: true content: @@ -437,6 +543,18 @@ paths: 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: @@ -458,7 +576,7 @@ paths: - APM sourcemaps parameters: - $ref: '#/components/parameters/elastic_api_version' - - $ref: '#/components/parameters/kbn-xsrf' + - $ref: '#/components/parameters/kbn_xsrf' - name: id in: path schema: @@ -477,6 +595,18 @@ paths: 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: @@ -497,7 +627,7 @@ paths: - APM server schema parameters: - $ref: '#/components/parameters/elastic_api_version' - - $ref: '#/components/parameters/kbn-xsrf' + - $ref: '#/components/parameters/kbn_xsrf' requestBody: required: true content: @@ -525,6 +655,18 @@ paths: 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: @@ -543,7 +685,7 @@ components: enum: - '2023-10-31' type: string - kbn-xsrf: + kbn_xsrf: description: A required header to protect against CSRF attacks in: header name: kbn-xsrf @@ -554,6 +696,9 @@ components: schemas: agent_keys_object: type: object + required: + - name + - privileges properties: name: type: string @@ -567,17 +712,18 @@ components: agent_keys_response: type: object properties: - api_key: - type: string - expiration: - type: integer - format: int64 - id: - type: string - name: - type: string - encoded: - type: string + agentKey: + type: object + properties: + expiration: + type: integer + format: int64 + id: + type: string + name: + type: string + encoded: + type: string 400_response: type: object properties: @@ -590,6 +736,39 @@ components: message: type: string example: Not Found + 401_response: + type: object + properties: + statusCode: + type: number + example: 401 + error: + type: string + example: Unauthorized + message: + type: string + 403_response: + type: object + properties: + statusCode: + type: number + example: 403 + error: + type: string + example: Forbidden + message: + type: string + 500_response: + type: object + properties: + statusCode: + type: number + example: 500 + error: + type: string + example: Internal Server Error + message: + type: string annotation_search_response: type: object properties: @@ -660,6 +839,18 @@ components: type: string '@timestamp': type: string + 404_response: + type: object + properties: + statusCode: + type: number + example: 404 + error: + type: string + example: Not Found + message: + type: string + example: Not Found service_object: type: object properties: @@ -698,18 +889,6 @@ components: type: array items: $ref: '#/components/schemas/agent_configuration_object' - 404_response: - type: object - properties: - statusCode: - type: number - example: 404 - error: - type: string - example: Not Found - message: - type: string - example: Not Found agent_configuration_intake_object: type: object required: @@ -837,17 +1016,6 @@ components: sourceRoot: type: string - $ref: '#/components/schemas/base_source_map_object' - 500_response: - type: object - properties: - statusCode: - type: number - example: 500 - error: - type: string - example: Internal Server Error - message: - type: string 501_response: type: object properties: 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..efed1377e3fe1 --- /dev/null +++ b/x-pack/plugins/observability_solution/apm/docs/openapi/apm/components/schemas/401_response.yaml @@ -0,0 +1,10 @@ +type: object +properties: + statusCode: + type: number + example: 401 + error: + type: string + example: Unauthorized + message: + type: string 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..b339ad639fd5c --- /dev/null +++ b/x-pack/plugins/observability_solution/apm/docs/openapi/apm/components/schemas/403_response.yaml @@ -0,0 +1,10 @@ +type: object +properties: + statusCode: + type: number + example: 403 + error: + type: string + example: Forbidden + message: + type: string 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 index 756bb5420b82b..0eecaeddc081b 100644 --- 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 @@ -1,4 +1,7 @@ type: object +required: + - name + - privileges properties: name: type: string 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 index 9335c3fb58e52..36cdb697ba4e7 100644 --- 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 @@ -1,13 +1,14 @@ type: object properties: - api_key: - type: string - expiration: - type: integer - format: int64 - id: - type: string - name: - type: string - encoded: - type: string + agentKey: + type: object + properties: + expiration: + type: integer + format: int64 + id: + type: string + name: + type: string + encoded: + type: string 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 index 8baa9600f1358..46b1588517761 100644 --- 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 @@ -26,3 +26,21 @@ post: 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 index 70fb9de3df1da..2c4629b44a211 100644 --- 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 @@ -33,6 +33,18 @@ post: 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: diff --git a/x-pack/plugins/observability_solution/apm/docs/openapi/apm/paths/api@apm@services@{serviceName}@annotation.yaml b/x-pack/plugins/observability_solution/apm/docs/openapi/apm/paths/api@apm@services@{serviceName}@annotation.yaml index 17973858f7711..3894bd6da2015 100644 --- a/x-pack/plugins/observability_solution/apm/docs/openapi/apm/paths/api@apm@services@{serviceName}@annotation.yaml +++ b/x-pack/plugins/observability_solution/apm/docs/openapi/apm/paths/api@apm@services@{serviceName}@annotation.yaml @@ -32,3 +32,21 @@ post: 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@{serviceName}@annotation@search.yaml b/x-pack/plugins/observability_solution/apm/docs/openapi/apm/paths/api@apm@services@{serviceName}@annotation@search.yaml index edb8bc2cb5b06..0f1391be89806 100644 --- a/x-pack/plugins/observability_solution/apm/docs/openapi/apm/paths/api@apm@services@{serviceName}@annotation@search.yaml +++ b/x-pack/plugins/observability_solution/apm/docs/openapi/apm/paths/api@apm@services@{serviceName}@annotation@search.yaml @@ -43,3 +43,15 @@ get: 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 index 45dc5a21f8b18..c7d7251d1d8fb 100644 --- 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 @@ -19,6 +19,12 @@ get: 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: @@ -52,6 +58,18 @@ delete: 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: @@ -90,6 +108,18 @@ put: 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: 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 index af5689b021a3d..a1f3b13451d6a 100644 --- 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 @@ -25,6 +25,12 @@ get: 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: 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 index c253f20746c1a..8ae4ce975fc08 100644 --- 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 @@ -27,6 +27,12 @@ post: 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: 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 index 127f877aa359b..c32bac7df383c 100644 --- 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 @@ -8,13 +8,11 @@ get: - name: name in: query description: Service name - required: true schema: type: string - name: environment in: query description: Service environment - required: true schema: type: string responses: @@ -30,6 +28,12 @@ get: 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: 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 index 48fbdebc949df..0c70853bca01e 100644 --- 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 @@ -27,6 +27,12 @@ get: 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: @@ -67,6 +73,18 @@ post: 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: 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 index 57e7ce141652f..4a6685dc2be38 100644 --- 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 @@ -25,6 +25,18 @@ delete: 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: diff --git a/x-pack/plugins/observability_solution/apm/docs/openapi/apm/paths/apm@settings@agent_configuration@environments.yaml b/x-pack/plugins/observability_solution/apm/docs/openapi/apm/paths/apm@settings@agent_configuration@environments.yaml index e40943cd23f45..c0791b92ac148 100644 --- a/x-pack/plugins/observability_solution/apm/docs/openapi/apm/paths/apm@settings@agent_configuration@environments.yaml +++ b/x-pack/plugins/observability_solution/apm/docs/openapi/apm/paths/apm@settings@agent_configuration@environments.yaml @@ -23,6 +23,12 @@ get: 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: From 822588d78998a54a09dd4fdf86e720f8ab5f4072 Mon Sep 17 00:00:00 2001 From: Milosz Marcinkowski Date: Thu, 31 Oct 2024 11:17:11 +0100 Subject: [PATCH 6/9] adjust specs --- .../apm/docs/openapi/apm/bundled.json | 109 +++++++++++++----- .../apm/docs/openapi/apm/bundled.yaml | 65 ++++++++--- .../schemas/agent_configuration_object.yaml | 3 + .../schemas/agent_keys_response.yaml | 7 ++ .../schemas/create_annotation_object.yaml | 5 + .../schemas/create_annotation_response.yaml | 7 +- .../search_agent_configuration_object.yaml | 1 + .../schemas/service_agent_name_response.yaml | 1 + .../schemas/service_environment_object.yaml | 1 + .../components/schemas/service_object.yaml | 2 + .../schemas/source_maps_response.yaml | 35 +++--- .../apm/docs/openapi/apm/entrypoint.yaml | 2 +- ...ttings@agent_configuration@agent_name.yaml | 1 + ...ngs@agent_configuration@environments.yaml} | 0 ...apm@settings@agent_configuration@view.yaml | 2 + 15 files changed, 182 insertions(+), 59 deletions(-) rename x-pack/plugins/observability_solution/apm/docs/openapi/apm/paths/{apm@settings@agent_configuration@environments.yaml => api@apm@settings@agent_configuration@environments.yaml} (100%) 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 index 940979f3ddbbd..3c51e202898c2 100644 --- a/x-pack/plugins/observability_solution/apm/docs/openapi/apm/bundled.json +++ b/x-pack/plugins/observability_solution/apm/docs/openapi/apm/bundled.json @@ -525,7 +525,8 @@ "description": "Service name", "schema": { "type": "string" - } + }, + "example": "node" }, { "name": "environment", @@ -533,7 +534,8 @@ "description": "Service environment", "schema": { "type": "string" - } + }, + "example": "prod" } ], "responses": { @@ -733,7 +735,8 @@ "required": true, "schema": { "type": "string" - } + }, + "example": "node" } ], "responses": { @@ -1182,6 +1185,12 @@ "properties": { "agentKey": { "type": "object", + "required": [ + "id", + "name", + "api_key", + "encoded" + ], "properties": { "expiration": { "type": "integer", @@ -1193,6 +1202,9 @@ "name": { "type": "string" }, + "api_key": { + "type": "string" + }, "encoded": { "type": "string" } @@ -1295,12 +1307,19 @@ }, "create_annotation_object": { "type": "object", + "required": [ + "@timestamp", + "service" + ], "properties": { "@timestamp": { "type": "string" }, "service": { "type": "object", + "required": [ + "version" + ], "properties": { "version": { "type": "string" @@ -1334,7 +1353,15 @@ "type": "object", "properties": { "annotation": { - "type": "string" + "type": "object", + "properties": { + "type": { + "type": "string" + }, + "title": { + "type": "string" + } + } }, "tags": { "type": "array", @@ -1395,10 +1422,12 @@ "type": "object", "properties": { "name": { - "type": "string" + "type": "string", + "example": "node" }, "environment": { - "type": "string" + "type": "string", + "example": "prod" } } }, @@ -1427,13 +1456,16 @@ "$ref": "#/components/schemas/settings_object" }, "@timestamp": { - "type": "number" + "type": "number", + "example": 1730194190636 }, "applied_by_agent": { - "type": "boolean" + "type": "boolean", + "example": true }, "etag": { - "type": "string" + "type": "string", + "example": "0bc3b5ebf18fba8163fe4c96f491e3767a358f85" } } }, @@ -1503,7 +1535,8 @@ }, "etag": { "type": "string", - "description": "If etags match then `applied_by_agent` field will be set to `true`" + "description": "If etags match then `applied_by_agent` field will be set to `true`", + "example": "0bc3b5ebf18fba8163fe4c96f491e3767a358f85" }, "mark_as_applied_by_agent": { "type": "boolean", @@ -1532,7 +1565,8 @@ "type": "object", "properties": { "name": { - "type": "string" + "type": "string", + "example": "ALL_OPTION_VALUE" }, "alreadyConfigured": { "type": "boolean" @@ -1554,7 +1588,8 @@ "type": "object", "properties": { "agentName": { - "type": "string" + "type": "string", + "example": "nodejs" } } }, @@ -1612,29 +1647,43 @@ "body": { "type": "object", "properties": { - "version": { - "type": "number" - }, - "file": { + "serviceName": { "type": "string" }, - "sources": { - "type": "array", - "items": { - "type": "string" - } - }, - "sourcesContent": { - "type": "array", - "items": { - "type": "string" - } - }, - "mappings": { + "serviceVersion": { "type": "string" }, - "sourceRoot": { + "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" + } + } } } } 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 index d3c14cd0ed8f8..e5678dcde3766 100644 --- a/x-pack/plugins/observability_solution/apm/docs/openapi/apm/bundled.yaml +++ b/x-pack/plugins/observability_solution/apm/docs/openapi/apm/bundled.yaml @@ -317,11 +317,13 @@ paths: 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 @@ -442,6 +444,7 @@ paths: required: true schema: type: string + example: node responses: '200': description: Successful response @@ -714,6 +717,11 @@ components: properties: agentKey: type: object + required: + - id + - name + - api_key + - encoded properties: expiration: type: integer @@ -722,6 +730,8 @@ components: type: string name: type: string + api_key: + type: string encoded: type: string 400_response: @@ -789,11 +799,16 @@ components: type: string create_annotation_object: type: object + required: + - '@timestamp' + - service properties: '@timestamp': type: string service: type: object + required: + - version properties: version: type: string @@ -816,7 +831,12 @@ components: type: object properties: annotation: - type: string + type: object + properties: + type: + type: string + title: + type: string tags: type: array items: @@ -856,8 +876,10 @@ components: properties: name: type: string + example: node environment: type: string + example: prod settings_object: type: object additionalProperties: @@ -878,10 +900,13 @@ components: $ref: '#/components/schemas/settings_object' '@timestamp': type: number + example: 1730194190636 applied_by_agent: type: boolean + example: true etag: type: string + example: 0bc3b5ebf18fba8163fe4c96f491e3767a358f85 agent_configurations_response: type: object properties: @@ -925,6 +950,7 @@ components: 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: | @@ -946,6 +972,7 @@ components: properties: name: type: string + example: ALL_OPTION_VALUE alreadyConfigured: type: boolean service_environments_response: @@ -960,6 +987,7 @@ components: properties: agentName: type: string + example: nodejs base_source_map_object: type: object properties: @@ -999,22 +1027,31 @@ components: body: type: object properties: - version: - type: number - file: + serviceName: type: string - sources: - type: array - items: - type: string - sourcesContent: - type: array - items: - type: string - mappings: + serviceVersion: type: string - sourceRoot: + 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 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 index 0c3c7c44d7e04..c4f05244709cc 100644 --- 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 @@ -13,7 +13,10 @@ properties: $ref: 'settings_object.yaml' '@timestamp': type: number + example: 1730194190636 applied_by_agent: type: boolean + example: true etag: type: string + example: 0bc3b5ebf18fba8163fe4c96f491e3767a358f85 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 index 36cdb697ba4e7..025223bf6c7c7 100644 --- 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 @@ -2,6 +2,11 @@ type: object properties: agentKey: type: object + required: + - id + - name + - api_key + - encoded properties: expiration: type: integer @@ -10,5 +15,7 @@ properties: 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/create_annotation_object.yaml b/x-pack/plugins/observability_solution/apm/docs/openapi/apm/components/schemas/create_annotation_object.yaml index a262cd386d073..4865d75797905 100644 --- 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 @@ -1,9 +1,14 @@ type: object +required: + - '@timestamp' + - service properties: '@timestamp': type: string service: type: object + required: + - version properties: version: 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 index 4f70f6744265e..2a9edf031c489 100644 --- 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 @@ -8,7 +8,12 @@ properties: type: object properties: annotation: - type: string + type: object + properties: + type: + type: string + title: + type: string tags: type: array items: 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 index ae0a884d53f87..abbbf91b77b89 100644 --- 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 @@ -7,6 +7,7 @@ properties: 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: | 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 index b318e4f725f20..4e66198cf09ad 100644 --- 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 @@ -2,3 +2,4 @@ type: object properties: agentName: type: string + 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 index aac94236d65c6..00322668e8dd1 100644 --- 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 @@ -2,5 +2,6 @@ type: object properties: name: type: string + example: ALL_OPTION_VALUE alreadyConfigured: type: boolean 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 index 562856349206e..192cefdcdd807 100644 --- 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 @@ -2,5 +2,7 @@ type: object properties: name: type: string + example: node environment: type: string + example: prod 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 index 07ee5f6c8e0e5..1856aa32ca045 100644 --- 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 @@ -9,20 +9,29 @@ properties: body: type: object properties: - version: - type: number - file: + serviceName: type: string - sources: - type: array - items: - type: string - sourcesContent: - type: array - items: - type: string - mappings: + serviceVersion: type: string - sourceRoot: + 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/entrypoint.yaml b/x-pack/plugins/observability_solution/apm/docs/openapi/apm/entrypoint.yaml index e4b8a80fa1e5a..7a94d2470bc3d 100644 --- a/x-pack/plugins/observability_solution/apm/docs/openapi/apm/entrypoint.yaml +++ b/x-pack/plugins/observability_solution/apm/docs/openapi/apm/entrypoint.yaml @@ -31,7 +31,7 @@ paths: /api/apm/settings/agent-configuration/search: $ref: 'paths/api@apm@settings@agent_configuration@search.yaml' /api/apm/settings/agent-configuration/environments: - $ref: 'paths/apm@settings@agent_configuration@environments.yaml' + $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: 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 index a1f3b13451d6a..4ad10fbb00833 100644 --- 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 @@ -12,6 +12,7 @@ get: required: true schema: type: string + example: node responses: '200': description: Successful response diff --git a/x-pack/plugins/observability_solution/apm/docs/openapi/apm/paths/apm@settings@agent_configuration@environments.yaml b/x-pack/plugins/observability_solution/apm/docs/openapi/apm/paths/api@apm@settings@agent_configuration@environments.yaml similarity index 100% rename from x-pack/plugins/observability_solution/apm/docs/openapi/apm/paths/apm@settings@agent_configuration@environments.yaml rename to x-pack/plugins/observability_solution/apm/docs/openapi/apm/paths/api@apm@settings@agent_configuration@environments.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 index c32bac7df383c..23e5cc2186d12 100644 --- 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 @@ -10,11 +10,13 @@ get: 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 From 09ac6b8d52ab5352cd45fa28b4b6f9026d3bd29f Mon Sep 17 00:00:00 2001 From: Milosz Marcinkowski Date: Thu, 31 Oct 2024 12:09:42 +0100 Subject: [PATCH 7/9] fix linting warnings --- .../apm/docs/openapi/apm/bundled.json | 165 ++++++++++++------ .../apm/docs/openapi/apm/bundled.yaml | 69 +++++++- .../apm/components/schemas/400_response.yaml | 3 + .../apm/components/schemas/401_response.yaml | 3 + .../apm/components/schemas/403_response.yaml | 3 + .../apm/components/schemas/404_response.yaml | 3 + .../apm/components/schemas/500_response.yaml | 3 + .../apm/components/schemas/501_response.yaml | 3 + .../agent_configuration_intake_object.yaml | 1 + .../schemas/agent_configuration_object.yaml | 5 + .../agent_configurations_response.yaml | 1 + .../components/schemas/agent_keys_object.yaml | 2 + .../schemas/agent_keys_response.yaml | 1 + .../schemas/annotation_search_response.yaml | 1 + .../schemas/base_source_map_object.yaml | 12 ++ .../schemas/create_annotation_object.yaml | 4 + .../schemas/create_annotation_response.yaml | 3 + .../delete_agent_configurations_response.yaml | 1 + .../search_agent_configuration_response.yaml | 3 + .../schemas/service_agent_name_response.yaml | 1 + .../schemas/service_environment_object.yaml | 2 + .../service_environments_response.yaml | 1 + .../components/schemas/service_object.yaml | 3 + .../components/schemas/settings_object.yaml | 1 + .../schemas/source_maps_response.yaml | 1 + .../api@apm@settings@agent_configuration.yaml | 4 +- .../openapi/apm/paths/api@apm@sourcemaps.yaml | 2 + .../apm/paths/api@apm@sourcemaps@{id}.yaml | 2 + 28 files changed, 249 insertions(+), 54 deletions(-) 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 index 3c51e202898c2..9fdcc3cdb6294 100644 --- a/x-pack/plugins/observability_solution/apm/docs/openapi/apm/bundled.json +++ b/x-pack/plugins/observability_solution/apm/docs/openapi/apm/bundled.json @@ -291,8 +291,7 @@ }, "/api/apm/settings/agent-configuration": { "get": { - "summary": "List of agent configurations", - "description": "Get a list of agent configurations.", + "summary": "Get a list of agent configurations", "operationId": "getAgentConfigurations", "tags": [ "APM agent configuration" @@ -438,6 +437,7 @@ { "name": "overwrite", "in": "query", + "description": "If the config exists ?overwrite=true is required", "schema": { "type": "boolean" } @@ -798,6 +798,7 @@ { "name": "page", "in": "query", + "description": "Page number", "schema": { "type": "number" } @@ -805,6 +806,7 @@ { "name": "perPage", "in": "query", + "description": "Number of records per page", "schema": { "type": "number" } @@ -970,6 +972,8 @@ { "name": "id", "in": "path", + "description": "Source map identifier", + "required": true, "schema": { "type": "string" } @@ -1166,10 +1170,12 @@ ], "properties": { "name": { - "type": "string" + "type": "string", + "description": "Agent name" }, "privileges": { "type": "array", + "description": "Privileges configuration", "items": { "type": "string", "enum": [ @@ -1185,6 +1191,7 @@ "properties": { "agentKey": { "type": "object", + "description": "Agent key", "required": [ "id", "name", @@ -1217,15 +1224,18 @@ "properties": { "statusCode": { "type": "number", - "example": 400 + "example": 400, + "description": "Error status code" }, "error": { "type": "string", - "example": "Not Found" + "example": "Not Found", + "description": "Error type" }, "message": { "type": "string", - "example": "Not Found" + "example": "Not Found", + "description": "Error message" } } }, @@ -1234,14 +1244,17 @@ "properties": { "statusCode": { "type": "number", - "example": 401 + "example": 401, + "description": "Error status code" }, "error": { "type": "string", - "example": "Unauthorized" + "example": "Unauthorized", + "description": "Error type" }, "message": { - "type": "string" + "type": "string", + "description": "Error message" } } }, @@ -1250,14 +1263,17 @@ "properties": { "statusCode": { "type": "number", - "example": 403 + "example": 403, + "description": "Error status code" }, "error": { "type": "string", - "example": "Forbidden" + "example": "Forbidden", + "description": "Error type" }, "message": { - "type": "string" + "type": "string", + "description": "Error message" } } }, @@ -1266,14 +1282,17 @@ "properties": { "statusCode": { "type": "number", - "example": 500 + "example": 500, + "description": "Error status code" }, "error": { "type": "string", - "example": "Internal Server Error" + "example": "Internal Server Error", + "description": "Error type" }, "message": { - "type": "string" + "type": "string", + "description": "Error message" } } }, @@ -1282,6 +1301,7 @@ "properties": { "annotations": { "type": "array", + "description": "Annotations", "items": { "type": "object", "properties": { @@ -1313,10 +1333,12 @@ ], "properties": { "@timestamp": { - "type": "string" + "type": "string", + "description": "Timestamp" }, "service": { "type": "object", + "description": "Service", "required": [ "version" ], @@ -1330,10 +1352,12 @@ } }, "message": { - "type": "string" + "type": "string", + "description": "Message" }, "tags": { "type": "array", + "description": "Tags", "items": { "type": "string" } @@ -1344,13 +1368,16 @@ "type": "object", "properties": { "_id": { - "type": "string" + "type": "string", + "description": "Identifier" }, "_index": { - "type": "string" + "type": "string", + "description": "Index" }, "_source": { "type": "object", + "description": "Response", "properties": { "annotation": { "type": "object", @@ -1406,33 +1433,40 @@ "properties": { "statusCode": { "type": "number", - "example": 404 + "example": 404, + "description": "Error status code" }, "error": { "type": "string", - "example": "Not Found" + "example": "Not Found", + "description": "Error type" }, "message": { "type": "string", - "example": "Not Found" + "example": "Not Found", + "description": "Error message" } } }, "service_object": { "type": "object", + "description": "Service", "properties": { "name": { "type": "string", - "example": "node" + "example": "node", + "description": "Name" }, "environment": { "type": "string", - "example": "prod" + "example": "prod", + "description": "Environment" } } }, "settings_object": { "type": "object", + "description": "Agent configuration settings", "additionalProperties": { "type": "string" } @@ -1445,9 +1479,11 @@ "@timestamp", "etag" ], + "description": "Agent configuration", "properties": { "agent_name": { - "type": "string" + "type": "string", + "description": "Agent name" }, "service": { "$ref": "#/components/schemas/service_object" @@ -1457,15 +1493,18 @@ }, "@timestamp": { "type": "number", - "example": 1730194190636 + "example": 1730194190636, + "description": "Timestamp" }, "applied_by_agent": { "type": "boolean", - "example": true + "example": true, + "description": "Applied by agent" }, "etag": { "type": "string", - "example": "0bc3b5ebf18fba8163fe4c96f491e3767a358f85" + "example": "0bc3b5ebf18fba8163fe4c96f491e3767a358f85", + "description": "Etag" } } }, @@ -1474,6 +1513,7 @@ "properties": { "configurations": { "type": "array", + "description": "Agent configuration", "items": { "$ref": "#/components/schemas/agent_configuration_object" } @@ -1488,7 +1528,8 @@ ], "properties": { "agent_name": { - "type": "string" + "type": "string", + "description": "Agent name" }, "service": { "$ref": "#/components/schemas/service_object" @@ -1502,7 +1543,8 @@ "type": "object", "properties": { "result": { - "type": "string" + "type": "string", + "description": "Result" } } }, @@ -1548,13 +1590,16 @@ "type": "object", "properties": { "_index": { - "type": "string" + "type": "string", + "description": "Index" }, "_id": { - "type": "string" + "type": "string", + "description": "Identifier" }, "_score": { - "type": "number" + "type": "number", + "description": "Score" }, "_source": { "$ref": "#/components/schemas/agent_configuration_object" @@ -1566,10 +1611,12 @@ "properties": { "name": { "type": "string", - "example": "ALL_OPTION_VALUE" + "example": "ALL_OPTION_VALUE", + "description": "Service environment name" }, "alreadyConfigured": { - "type": "boolean" + "type": "boolean", + "description": "Already configured" } } }, @@ -1578,6 +1625,7 @@ "properties": { "environments": { "type": "array", + "description": "Service environment list", "items": { "$ref": "#/components/schemas/service_environment_object" } @@ -1589,6 +1637,7 @@ "properties": { "agentName": { "type": "string", + "description": "Agent name", "example": "nodejs" } } @@ -1597,40 +1646,52 @@ "type": "object", "properties": { "type": { - "type": "string" + "type": "string", + "description": "Type" }, "identifier": { - "type": "string" + "type": "string", + "description": "Identifier" }, "relative_url": { - "type": "string" + "type": "string", + "description": "Relative URL" }, "created": { - "type": "string" + "type": "string", + "description": "Created date" }, "id": { - "type": "string" + "type": "string", + "description": "Identifier" }, "compressionAlgorithm": { - "type": "string" + "type": "string", + "description": "Compression Algorithm" }, "decodedSha256": { - "type": "string" + "type": "string", + "description": "Decoded SHA-256" }, "decodedSize": { - "type": "number" + "type": "number", + "description": "Decoded size" }, "encodedSha256": { - "type": "string" + "type": "string", + "description": "Encoded SHA-256" }, "encodedSize": { - "type": "number" + "type": "number", + "description": "Encoded size" }, "encryptionAlgorithm": { - "type": "string" + "type": "string", + "description": "Encryption Algorithm" }, "packageName": { - "type": "string" + "type": "string", + "description": "Package name" } } }, @@ -1639,6 +1700,7 @@ "properties": { "artifacts": { "type": "array", + "description": "Artifacts", "items": { "allOf": [ { @@ -1702,15 +1764,18 @@ "properties": { "statusCode": { "type": "number", - "example": 501 + "example": 501, + "description": "Error status code" }, "error": { "type": "string", - "example": "Not Implemented" + "example": "Not Implemented", + "description": "Error type" }, "message": { "type": "string", - "example": "Not Implemented" + "example": "Not Implemented", + "description": "Error message" } } }, 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 index e5678dcde3766..caa71f6645e77 100644 --- a/x-pack/plugins/observability_solution/apm/docs/openapi/apm/bundled.yaml +++ b/x-pack/plugins/observability_solution/apm/docs/openapi/apm/bundled.yaml @@ -177,8 +177,7 @@ paths: $ref: '#/components/schemas/404_response' /api/apm/settings/agent-configuration: get: - summary: List of agent configurations - description: Get a list of agent configurations. + summary: Get a list of agent configurations operationId: getAgentConfigurations tags: - APM agent configuration @@ -264,6 +263,7 @@ paths: - $ref: '#/components/parameters/kbn_xsrf' - name: overwrite in: query + description: If the config exists ?overwrite=true is required schema: type: boolean requestBody: @@ -481,10 +481,12 @@ paths: - $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: @@ -582,6 +584,8 @@ paths: - $ref: '#/components/parameters/kbn_xsrf' - name: id in: path + description: Source map identifier + required: true schema: type: string responses: @@ -705,8 +709,10 @@ components: properties: name: type: string + description: Agent name privileges: type: array + description: Privileges configuration items: type: string enum: @@ -717,6 +723,7 @@ components: properties: agentKey: type: object + description: Agent key required: - id - name @@ -740,50 +747,63 @@ components: 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: @@ -805,8 +825,10 @@ components: properties: '@timestamp': type: string + description: Timestamp service: type: object + description: Service required: - version properties: @@ -816,8 +838,10 @@ components: type: string message: type: string + description: Message tags: type: array + description: Tags items: type: string create_annotation_response: @@ -825,10 +849,13 @@ components: properties: _id: type: string + description: Identifier _index: type: string + description: Index _source: type: object + description: Response properties: annotation: type: object @@ -865,23 +892,30 @@ components: 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: @@ -891,9 +925,11 @@ components: - settings - '@timestamp' - etag + description: Agent configuration properties: agent_name: type: string + description: Agent name service: $ref: '#/components/schemas/service_object' settings: @@ -901,17 +937,21 @@ components: '@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: @@ -922,6 +962,7 @@ components: properties: agent_name: type: string + description: Agent name service: $ref: '#/components/schemas/service_object' settings: @@ -931,6 +972,7 @@ components: properties: result: type: string + description: Result single_agent_configuration_response: allOf: - type: object @@ -961,10 +1003,13 @@ components: 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: @@ -973,13 +1018,16 @@ components: 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: @@ -987,39 +1035,53 @@ components: 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 @@ -1059,12 +1121,15 @@ components: 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: 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 index c58230d718ff2..3f09203cd49d3 100644 --- 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 @@ -3,9 +3,12 @@ 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 index efed1377e3fe1..cf5afb3482e6c 100644 --- 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 @@ -3,8 +3,11 @@ 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 index b339ad639fd5c..f04184dcb1bb2 100644 --- 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 @@ -3,8 +3,11 @@ 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 index d72776f85994d..9e539dcbda096 100644 --- 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 @@ -3,9 +3,12 @@ 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 index d595071d51ff2..e952739138146 100644 --- 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 @@ -3,8 +3,11 @@ 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 index f616beee6411b..f5a1545f7183e 100644 --- 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 @@ -3,9 +3,12 @@ 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 index 839b5263f3581..0be4a414cd35a 100644 --- 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 @@ -5,6 +5,7 @@ required: properties: agent_name: type: string + description: Agent name service: $ref: 'service_object.yaml' settings: 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 index c4f05244709cc..8dfa922c25874 100644 --- 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 @@ -4,9 +4,11 @@ required: - settings - '@timestamp' - etag +description: Agent configuration properties: agent_name: type: string + description: Agent name service: $ref: 'service_object.yaml' settings: @@ -14,9 +16,12 @@ properties: '@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 index ac77d6b785223..a6bdb51466fb4 100644 --- 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 @@ -2,5 +2,6 @@ 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 index 0eecaeddc081b..c5e248471db90 100644 --- 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 @@ -5,8 +5,10 @@ required: properties: name: type: string + description: Agent name privileges: type: array + description: Privileges configuration items: type: string enum: 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 index 025223bf6c7c7..3507dae535faf 100644 --- 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 @@ -2,6 +2,7 @@ type: object properties: agentKey: type: object + description: Agent key required: - id - name 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 index 14c39cb05d43a..7827f17ffb979 100644 --- 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 @@ -2,6 +2,7 @@ type: object properties: annotations: type: array + description: Annotations items: type: object properties: 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 index a5a227fd08a19..f642c933f2b71 100644 --- 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 @@ -2,25 +2,37 @@ 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 index 4865d75797905..6a8f8ba9b96d0 100644 --- 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 @@ -5,8 +5,10 @@ required: properties: '@timestamp': type: string + description: Timestamp service: type: object + description: Service required: - version properties: @@ -16,7 +18,9 @@ properties: 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 index 2a9edf031c489..4738406a1e765 100644 --- 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 @@ -2,10 +2,13 @@ type: object properties: _id: type: string + description: Identifier _index: type: string + description: Index _source: type: object + description: Response properties: annotation: type: object 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 index 0a1bcdf127a10..3dc7c58998b1f 100644 --- 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 @@ -2,3 +2,4 @@ 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_response.yaml b/x-pack/plugins/observability_solution/apm/docs/openapi/apm/components/schemas/search_agent_configuration_response.yaml index 2cfe1e9521f83..d0a5ff1d91a78 100644 --- 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 @@ -2,9 +2,12 @@ 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 index 4e66198cf09ad..b67c34b65df8e 100644 --- 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 @@ -2,4 +2,5 @@ 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 index 00322668e8dd1..0f7f11371e59c 100644 --- 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 @@ -3,5 +3,7 @@ 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 index abdf2f56b02bb..1b8cdc1cab48e 100644 --- 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 @@ -2,5 +2,6 @@ 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 index 192cefdcdd807..c73dd8bc0eb19 100644 --- 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 @@ -1,8 +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 index 50601e4061015..cf09f1b6254bd 100644 --- 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 @@ -1,3 +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/source_maps_response.yaml b/x-pack/plugins/observability_solution/apm/docs/openapi/apm/components/schemas/source_maps_response.yaml index 1856aa32ca045..f5590110fecd2 100644 --- 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 @@ -2,6 +2,7 @@ type: object properties: artifacts: type: array + description: Artifacts items: allOf: - type: object 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 index c7d7251d1d8fb..f508e855a3883 100644 --- 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 @@ -1,6 +1,5 @@ get: - summary: List of agent configurations - description: Get a list of agent configurations. + summary: Get a list of agent configurations operationId: getAgentConfigurations tags: - APM agent configuration @@ -86,6 +85,7 @@ put: - $ref: '../components/headers/kbn_xsrf.yaml' - name: overwrite in: query + description: If the config exists ?overwrite=true is required schema: type: boolean requestBody: 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 index 0c70853bca01e..142cd0d2673c1 100644 --- 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 @@ -8,10 +8,12 @@ get: - $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: 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 index 4a6685dc2be38..3f165360bf60c 100644 --- 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 @@ -9,6 +9,8 @@ delete: - $ref: '../components/headers/kbn_xsrf.yaml' - name: id in: path + description: Source map identifier + required: true schema: type: string responses: From 911c62450d3e1afce13a9e09785104495431ccf3 Mon Sep 17 00:00:00 2001 From: Milosz Marcinkowski Date: Thu, 31 Oct 2024 12:10:00 +0100 Subject: [PATCH 8/9] build Kibana API docs --- oas_docs/output/kibana.serverless.yaml | 1167 ++++++++++++++++++++++-- oas_docs/output/kibana.yaml | 1167 ++++++++++++++++++++++-- 2 files changed, 2152 insertions(+), 182 deletions(-) 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 From 88e55f92f91e04112e831023e163e4990018de52 Mon Sep 17 00:00:00 2001 From: Milosz Marcinkowski Date: Thu, 31 Oct 2024 12:31:48 +0100 Subject: [PATCH 9/9] change files name to snake_case (failing pipeline) --- .../apm/docs/openapi/apm/entrypoint.yaml | 4 ++-- ...n.yaml => api@apm@services@{service_name}@annotation.yaml} | 0 ...=> api@apm@services@{service_name}@annotation@search.yaml} | 0 3 files changed, 2 insertions(+), 2 deletions(-) rename x-pack/plugins/observability_solution/apm/docs/openapi/apm/paths/{api@apm@services@{serviceName}@annotation.yaml => api@apm@services@{service_name}@annotation.yaml} (100%) rename x-pack/plugins/observability_solution/apm/docs/openapi/apm/paths/{api@apm@services@{serviceName}@annotation@search.yaml => api@apm@services@{service_name}@annotation@search.yaml} (100%) 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 index 7a94d2470bc3d..abb21fb980a9a 100644 --- a/x-pack/plugins/observability_solution/apm/docs/openapi/apm/entrypoint.yaml +++ b/x-pack/plugins/observability_solution/apm/docs/openapi/apm/entrypoint.yaml @@ -21,9 +21,9 @@ paths: /api/apm/agent_keys: $ref: 'paths/api@apm@agent_keys.yaml' /api/apm/services/{serviceName}/annotation/search: - $ref: 'paths/api@apm@services@{serviceName}@annotation@search.yaml' + $ref: 'paths/api@apm@services@{service_name}@annotation@search.yaml' /api/apm/services/{serviceName}/annotation: - $ref: 'paths/api@apm@services@{serviceName}@annotation.yaml' + $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: diff --git a/x-pack/plugins/observability_solution/apm/docs/openapi/apm/paths/api@apm@services@{serviceName}@annotation.yaml b/x-pack/plugins/observability_solution/apm/docs/openapi/apm/paths/api@apm@services@{service_name}@annotation.yaml similarity index 100% rename from x-pack/plugins/observability_solution/apm/docs/openapi/apm/paths/api@apm@services@{serviceName}@annotation.yaml rename to x-pack/plugins/observability_solution/apm/docs/openapi/apm/paths/api@apm@services@{service_name}@annotation.yaml diff --git a/x-pack/plugins/observability_solution/apm/docs/openapi/apm/paths/api@apm@services@{serviceName}@annotation@search.yaml b/x-pack/plugins/observability_solution/apm/docs/openapi/apm/paths/api@apm@services@{service_name}@annotation@search.yaml similarity index 100% rename from x-pack/plugins/observability_solution/apm/docs/openapi/apm/paths/api@apm@services@{serviceName}@annotation@search.yaml rename to x-pack/plugins/observability_solution/apm/docs/openapi/apm/paths/api@apm@services@{service_name}@annotation@search.yaml