Skip to content

Commit

Permalink
Add OpenAPI specification for bulk create and bulk update saved objec…
Browse files Browse the repository at this point in the history
…t APIs (#6859) (#6863)

* ad doc for bulk create and bulk update



* Changeset file for PR #6859 created/updated

---------



(cherry picked from commit cf4e496)

Signed-off-by: Lu Yu <[email protected]>
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com>
  • Loading branch information
3 people authored May 30, 2024
1 parent e26844e commit 1863581
Show file tree
Hide file tree
Showing 2 changed files with 151 additions and 0 deletions.
2 changes: 2 additions & 0 deletions changelogs/fragments/6859.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
doc:
- Add OpenAPI specification for bulk create and bulk update saved object APIs ([#6859](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/6859))
149 changes: 149 additions & 0 deletions docs/openapi/saved_objects/saved_objects.yml
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,155 @@ paths:
application/json:
schema:
$ref: '#/components/schemas/400_bad_request'
/api/saved_objects/_bulk_create:
post:
tags:
- saved objects
summary: Bulk create saved objects
parameters:
- name: overwrite
in: query
schema:
type: boolean
description: If set to true, will overwrite the existing saved object with same type and id.
- name: workspaces
in: query
schema:
type: array
items:
type: string
description: Workspaces that the saved objects exist in.
requestBody:
required: true
description: Array of saved objects to create
content:
application/json:
schema:
type: array
items:
type: object
properties:
id:
type: string
description: Unique id of the saved object.
type:
type: string
required: true
description: The type of saved object.
attributes:
type: object
required: true
description: The metadata of the saved object to be created, and the object is not validated.
version:
type: string
migrationVersion:
type: object
description: The information about the migrations that have been applied to this saved object to be created.
references:
description: List of objects that describe other saved objects the created object references.
type: array
items:
type: object
properties:
id:
type: string
type:
type: string
name:
type: string
initialNamespaces:
description: Namespaces that this saved object exists in. This attribute is only used for multi-namespace saved object types.
type: array
items:
type: string
example:
- id: 67a9021c-c97e-4499-8150-9722ab44edd4
type: visualization
attributes:
title: 'vega-visualization'
fieldFormatMap: '{"hour_of_day":{}}'
fields: '[{"name":"@timestamp","type":"date","esTypes":["date"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true}]'
version: '1'
migrationVersion: {}
references:
- id: ef71d6c1-8e6b-418d-9f7c-e5d9bbde9cf7
type: data-source
name: dataSource
initialNamespaces:
- default
responses:
'200':
description: The bulk creation request is successful.
content:
application/json:
schema:
type: object
/api/saved_objects/_bulk_update:
post:
tags:
- saved objects
summary: Bulk update saved objects
requestBody:
required: true
description: Array of saved objects to update
content:
application/json:
schema:
type: array
items:
type: object
properties:
id:
type: string
description: Unique id of the saved object.
type:
type: string
required: true
description: The type of saved object.
attributes:
type: object
required: true
description: The metadata of the saved object to be created, and the object is not validated.
version:
type: string
references:
description: List of objects that describe other saved objects the created object references.
type: array
items:
type: object
properties:
id:
type: string
type:
type: string
name:
type: string
namespaces:
description: Namespaces that this saved object exists in. This attribute is only used for multi-namespace saved object types.
type: array
items:
type: string
example:
- id: 67a9021c-c97e-4499-8150-9722ab44edd4
type: visualization
attributes:
title: vega-visualization
fieldFormatMap: '{"hour_of_day":{}}'
fields: '[{"name":"@timestamp","type":"date","esTypes":["date"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true}]'
version: '1'
migrationVersion: {}
references:
- id: ef71d6c1-8e6b-418d-9f7c-e5d9bbde9cf7
type: data-source
name: dataSource
namespace: default
responses:
'200':
description: The bulk update request is successful.
content:
application/json:
schema:
type: object
components:
parameters:
type:
Expand Down

0 comments on commit 1863581

Please sign in to comment.