-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add APM OpenAPI spec #180096
Merged
Merged
Add APM OpenAPI spec #180096
Changes from 1 commit
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
8d0f3d2
Add APM OpenAPI spec
smith d66abf2
Merge branch 'main' into nls/openapi
smith f794511
Merge branch 'main' into nls/openapi
smith c2737b4
Merge branch 'main' into nls/openapi
smith 803cb61
Merge branch 'main' into nls/openapi
smith 31d7b7b
Merge branch 'main' into nls/openapi
smith a4ed728
Merge branch 'main' into nls/openapi
smith ba53547
Merge branch 'main' into nls/openapi
smith File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
169 changes: 169 additions & 0 deletions
169
x-pack/plugins/observability_solution/apm/docs/openapi/apm.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,169 @@ | ||
openapi: 3.0.0 | ||
info: | ||
title: APM UI | ||
version: 1.0.0 | ||
paths: | ||
/api/apm/agent_keys: | ||
post: | ||
summary: Create an APM agent key | ||
description: Create a new agent key for APM. | ||
requestBody: | ||
required: true | ||
content: | ||
application/json: | ||
schema: | ||
type: object | ||
properties: | ||
name: | ||
type: string | ||
privileges: | ||
type: array | ||
items: | ||
type: string | ||
enum: | ||
- event:write | ||
- config_agent:read | ||
responses: | ||
"200": | ||
description: Agent key created successfully | ||
content: | ||
application/json: | ||
schema: | ||
type: object | ||
properties: | ||
api_key: | ||
type: string | ||
expiration: | ||
type: integer | ||
format: int64 | ||
id: | ||
type: string | ||
name: | ||
type: string | ||
encoded: | ||
type: string | ||
/api/apm/services/{serviceName}/annotation/search: | ||
get: | ||
summary: Search for annotations | ||
description: Search for annotations related to a specific service. | ||
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": | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This one seems to return 500 when business logic error happens - should be 400 though. |
||
description: Successful response | ||
content: | ||
application/json: | ||
schema: | ||
type: object | ||
properties: | ||
annotations: | ||
type: array | ||
items: | ||
type: object | ||
properties: | ||
type: | ||
type: string | ||
enum: | ||
- version | ||
id: | ||
type: string | ||
"@timestamp": | ||
type: number | ||
text: | ||
type: string | ||
/api/apm/services/{serviceName}/annotation: | ||
post: | ||
summary: Create a service annotation | ||
description: Create a new annotation for a specific service. | ||
parameters: | ||
- name: serviceName | ||
in: path | ||
required: true | ||
description: The name of the service | ||
schema: | ||
type: string | ||
requestBody: | ||
required: true | ||
content: | ||
application/json: | ||
schema: | ||
type: object | ||
properties: | ||
'@timestamp': | ||
type: string | ||
service: | ||
type: object | ||
properties: | ||
version: | ||
type: string | ||
environment: | ||
type: string | ||
message: | ||
type: string | ||
tags: | ||
type: array | ||
items: | ||
type: string | ||
|
||
responses: | ||
'200': | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It also responds with 404 |
||
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 |
17 changes: 17 additions & 0 deletions
17
x-pack/plugins/observability_solution/apm/docs/openapi/apm/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# APM app OpenAPI documentation | ||
|
||
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: | ||
|
||
* [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) | ||
|
||
Not included: | ||
|
||
* [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 specifications for the included APIs are in the apm.yaml file in this directory. | ||
|
||
These specifications are manually written. The missing ones will be included in the future. |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This endpoint also returns 400 and 403. Should we doc that too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not at this time. These specs are incomplete and we're going to be updating them.