[OAS][DOCS] Add x-topics info about running APIs in spaces (#189144)

This commit is contained in:
Lisa Cawley 2024-07-25 11:23:52 -07:00 committed by GitHub
parent 794a948b75
commit 42c5d918d3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 76 additions and 1 deletions

View file

@ -22,6 +22,8 @@ info:
```
GET kbn:/api/data_views
```
For more information about the console, refer to [Run API requests](https://www.elastic.co/guide/en/kibana/current/console-kibana.html).
version: "1.0.2"
license:
name: Elastic License 2.0

View file

@ -44,7 +44,7 @@ api-docs-lint-serverless: ## Run spectral API docs linter on kibana.serverless.y
.PHONY: api-docs-overlay
api-docs-overlay: ## Run spectral API docs linter on kibana.serverless.yaml
@npx bump overlay "output/kibana.yaml" "overlays/kibana.overlays.yaml" > "output/kibana.new.yaml"
@npx bump overlay "output/kibana.serverless.yaml" "overlays/kibana.overlays.yaml" > "output/kibana.serverless.new.yaml"
@npx bump overlay "output/kibana.serverless.yaml" "overlays/kibana.overlays.serverless.yaml" > "output/kibana.serverless.new.yaml"
help: ## Display help
@awk 'BEGIN {FS = ":.*##"; printf "Usage:\n make \033[36m<target>\033[0m\n"} /^[a-zA-Z_-]+:.*?##/ { printf " \033[36m%-15s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST)

View file

@ -41,6 +41,10 @@ info:
GET kbn:/api/data_views
```
For more information about the console, refer to [Run API
requests](https://www.elastic.co/guide/en/kibana/current/console-kibana.html).
version: 1.0.2
license:
name: Elastic License 2.0

View file

@ -0,0 +1,30 @@
# overlays.yaml
overlay: 1.0.0
info:
title: Overlays for the Kibana API document
version: 0.0.1
actions:
- target: '$.servers.*'
description: Remove all servers so we can add our own.
remove: true
- target: '$.servers'
description: Add server into the now empty server array.
update:
- url: https://{kibana_url}
variables:
kibana_url:
default: localhost:5601
- target: '$.components.securitySchemes'
description: Add an API key security scheme
update:
apiKeyAuth:
in: header
name: Authorization
type: apiKey
description: You must create an API key and use the encoded value in the request header. To learn about creating keys, go to [API keys](https://www.elastic.co/docs/current/serverless/api-keys).
- target: '$'
description: Add document-level security.
update:
security:
- apiKeyAuth: []

View file

@ -14,3 +14,42 @@ actions:
variables:
kibana_url:
default: localhost:5601
- target: '$.components.securitySchemes'
description: Add an API key security scheme
update:
apiKeyAuth:
in: header
name: Authorization
type: apiKey
description: You must create an API key and use the encoded value in the request header. To learn about creating keys, go to [API keys](https://www.elastic.co/guide/en/kibana/current/api-keys.html).
- target: '$.components.securitySchemes'
description: Add an basic security scheme
update:
basicAuth:
type: http
scheme: basic
- target: '$'
description: Add document-level security.
update:
security:
- apiKeyAuth: []
- basicAuth: []
- target: '$'
description: Add an extra page about spaces
update:
x-topics:
- title: Kibana spaces
content: |
Spaces enable you to organize your dashboards and other saved objects into meaningful categories.
You can use the default space or create your own spaces.
To run APIs in non-default spaces, you must add `s/{space_id}/` to the path.
For example:
```
curl -X GET "http://localhost:5601/s/marketing/api/data_views"
```
If you use the Kibana console to send API requests, it automatically adds the appropriate space identifier.
To learn more, check out [Spaces](https://www.elastic.co/guide/en/kibana/current/xpack-spaces.html).