Skip to content

Commit

Permalink
Add OpenAPI specifications for resolve import errors api (#6885) (#6886)
Browse files Browse the repository at this point in the history
* Add OpenAPI specifications for resolve import errors api



* Changeset file for PR #6885 created/updated

---------



(cherry picked from commit ddd7377)

Signed-off-by: Yuanqi(Ella) Zhu <[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 Jun 2, 2024
1 parent 8ac9571 commit e44613d
Show file tree
Hide file tree
Showing 2 changed files with 129 additions and 2 deletions.
2 changes: 2 additions & 0 deletions changelogs/fragments/6885.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
doc:
- Add OpenAPI specifications for resolve import errors api ([#6885](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/6885))
129 changes: 127 additions & 2 deletions docs/openapi/saved_objects/saved_objects.yml
Original file line number Diff line number Diff line change
Expand Up @@ -595,14 +595,14 @@ paths:
description: The number of successful imports.
errors:
type: array
description: Indicates the import was unsuccessful and specifies the objects that failed to import.
items:
type: object
description: Indicates the import was unsuccessful and specifies the objects that failed to import.
successResults:
type: array
description: Indicates the objects that are successfully imported, with any metadata if applicable.
items:
type: object
description: Indicates the objects that are successfully imported, with any metadata if applicable.
examples:
importObjectSuccessResponse:
summary: Example of successful import
Expand Down Expand Up @@ -705,6 +705,131 @@ paths:
application/json:
schema:
$ref: '#/components/schemas/400_bad_request'
/api/saved_objects/_resolve_import_errors:
post:
tags:
- saved objects
summary: Resolve import errors from import objects API
parameters:
- in: query
name: createNewCopies
description: Creates copies of saved objects, regenerates each object ID, and resets the origin.
schema:
type: boolean
default: false
- in: query
name: dataSourceId
description: The ID of the data source to use for the import.
schema:
type: string
- in: query
name: workspace
description: Workspaces that the saved objects exist in.
schema:
oneOf:
- type: string
- type: array
requestBody:
required: true
description: The request body must include the multipart/form-data type.
content:
multipart/form-data:
schema:
type: object
properties:
file:
description: The same file given to the import API.
type: string
format: binary
retries:
description: The retry operations, which can specify how to resolve different types of errors.
type: array
items:
type: object
properties:
type:
type: string
description: The type of error to resolve.
id:
type: string
description: The ID of the saved object.
overwrite:
type: boolean
default: false
description: If set to true, will overwrite the existing saved object with the same type and ID.
destinationId:
type: string
description: Specifies the destination ID that the imported object should have, if different from the current ID.
replaceReferences:
description: A list of `type`, `from`, and `to` used to change the object references.
type: array
items:
type: object
properties:
type:
type: string
from:
type: string
to:
type: string
createNewCopy:
type: boolean
description: If set to true, will create a copy of the saved objects, regenerates each object ID, and resets the origin.
ignoreMissingReferences:
type: boolean
description: If set to true, will ignore missing references. When set to `false`, does nothing.
examples:
resolveImportErrorsRequest:
summary: Example of resolving import errors
value:
file: 'import.ndjson'
retries:
- type: index-pattern
id: 4b3a6220-1e02-11ef-891d-992edd5ce25b
overwrite: true
responses:
'200':
description: The resolve import errors request is successful.
content:
application/json:
schema:
type: object
properties:
success:
type: boolean
description: Indicates if the import was successful.
successCount:
type: integer
description: The number of successful imports.
errors:
type: array
description: Indicates the import was unsuccessful and specifies the objects that failed to import.
items:
type: object
successResults:
type: array
description: Indicates the objects that are successfully imported, with any metadata if applicable.
items:
type: object
examples:
resolveImportErrorSuccessResponse:
summary: Example of successful import
value:
success: true
successCount: 1
successResults:
- type: index-pattern
id: 4b3a6220-1e02-11ef-891d-992edd5ce25b
meta:
title: 'opensearch_dashboards_sample_data_ecommerce'
icon: indexPatternApp
overwrite: true
'400':
description: Bad request
content:
application/json:
schema:
$ref: '#/components/schemas/400_bad_request'
components:
parameters:
type:
Expand Down

0 comments on commit e44613d

Please sign in to comment.