Skip to content

Commit

Permalink
Add example in create API for create index pattern, vega visualizatin…
Browse files Browse the repository at this point in the history
…n, dashboards for docs (#6855)

* Add example in create API for create index pattern, vega visualization, dashboards for docs

Signed-off-by: Yuanqi(Ella) Zhu <zhyuanqi@amazon.com>

* Changeset file for PR #6855 created/updated

---------

Signed-off-by: Yuanqi(Ella) Zhu <zhyuanqi@amazon.com>
Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com>
  • Loading branch information
zhyuanqi and opensearch-changeset-bot[bot] authored May 29, 2024
1 parent eb3efa8 commit 089a2de
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 0 deletions.
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))
3 changes: 3 additions & 0 deletions docs/_sidebar.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
- [Client_management_design](multi-datasource/client_management_design.md)
- [High_level_design](multi-datasource/high_level_design.md)
- [User_stories](multi-datasource/user_stories.md)
- [Openapi](openapi/README.md)
- Plugins
- [Data_persistence](plugins/data_persistence.md)
- Saved_objects
Expand Down Expand Up @@ -159,6 +160,7 @@
- [Opensearch dashboards.release notes 2.11.1](../release-notes/opensearch-dashboards.release-notes-2.11.1.md)
- [Opensearch dashboards.release notes 2.12.0](../release-notes/opensearch-dashboards.release-notes-2.12.0.md)
- [Opensearch dashboards.release notes 2.13.0](../release-notes/opensearch-dashboards.release-notes-2.13.0.md)
- [Opensearch dashboards.release notes 2.14.0](../release-notes/opensearch-dashboards.release-notes-2.14.0.md)
- [Opensearch dashboards.release notes 2.2.0](../release-notes/opensearch-dashboards.release-notes-2.2.0.md)
- [Opensearch dashboards.release notes 2.2.1](../release-notes/opensearch-dashboards.release-notes-2.2.1.md)
- [Opensearch dashboards.release notes 2.3.0](../release-notes/opensearch-dashboards.release-notes-2.3.0.md)
Expand All @@ -172,6 +174,7 @@
- scripts
- [README](../scripts/README.md)
- [DOCS_README](DOCS_README.md)
- [Theme](theme.md)
- [CHANGELOG](../CHANGELOG.md)
- [CODE_OF_CONDUCT](../CODE_OF_CONDUCT.md)
- [COMMUNICATIONS](../COMMUNICATIONS.md)
Expand Down
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

0 comments on commit 089a2de

Please sign in to comment.