Skip to content
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

[Backport 2.x Manual] Add example in create API for create index pattern, vega visualizatinn, dashboards for docs #6867

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions changelogs/fragments/6855.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
doc:
- Add example for saved object creation part for openapi doc. ([#6855](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/6855))
44 changes: 44 additions & 0 deletions docs/openapi/saved_objects/saved_objects.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,50 @@ paths:
items:
type: string
description: Workspaces that this saved object exists in.
examples:
indexPattern:
summary: Example of creating an index pattern saved object
value:
attributes:
title: 'my-index-pattern'
fields: '[{"count":"1","name":"@timestamp","searchable":"true"}]'
references:
- id: '51339560-1d7c-11ef-b757-55fac6c80d9a'
name: 'dataSource'
type: 'data-source'
vegaVisualization:
summary: Example of creating a Vega visualization saved object
value:
attributes:
title: 'my-vega-visualization'
visState: '{"title":"vegaVisualization","type":"vega","aggs":[]}}'
uiStateJSON: '{}'
description: ''
version: 1
kibanaSavedObjectMeta: {
searchSourceJSON: '{"query":{"language":"kuery","query":""},"filter":[]}'
}
references:
- id: '51339560-1d7c-11ef-b757-55fac6c80d9a'
name: 'dataSource'
type: 'data-source'
dashboards:
summary: Example of creating a dashboard saved object
value:
attributes:
title: 'Revenue Dashboard'
description: 'Revenue dashboard'
panelsJSON: '[{"version":"2.9.0","gridData":{"x":0,"y":0,"w":24,"h":15,"i":"5db1d75d-f680-4869-a0e8-0f2b8b05b99c"},"panelIndex":"5db1d75d-f680-4869-a0e8-0f2b8b05b99c","embeddableConfig":{},"panelRefName":"panel_0"}]'
optionsJSON: '{"hidePanelTitles":false,"useMargins":true}'
version: 1
timeRestore: true
kibanaSavedObjectMeta: {
searchSourceJSON: '{"query":{"language":"kuery","query":""},"filter":[]}'
}
references:
- id: '37cc8650-b882-11e8-a6d9-e546fe2bba5f'
name: 'panel_0'
type: 'visualization'
responses:
'200':
description: The creation request is successful
Expand Down
Loading