From 7dad80b97d0b37bfd45d10f6c12ff8ab21707caf Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 29 May 2024 23:25:41 +0000 Subject: [PATCH] Add openAPI doc for saved_object find api (#6856) * Add openAPI doc for saved_object find api Signed-off-by: Yuanqi(Ella) Zhu * Changeset file for PR #6856 created/updated --------- Signed-off-by: Yuanqi(Ella) Zhu Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com> (cherry picked from commit 026dd38c7d1518849a19174721b19539642c5b74) Signed-off-by: github-actions[bot] --- changelogs/fragments/6856.yml | 2 + docs/openapi/saved_objects/saved_objects.yml | 115 ++++++++++++++++++- 2 files changed, 116 insertions(+), 1 deletion(-) create mode 100644 changelogs/fragments/6856.yml diff --git a/changelogs/fragments/6856.yml b/changelogs/fragments/6856.yml new file mode 100644 index 000000000000..c3897a3f81fd --- /dev/null +++ b/changelogs/fragments/6856.yml @@ -0,0 +1,2 @@ +doc: +- Add openAPI doc for saved_object find api ([#6856](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/6856)) \ No newline at end of file diff --git a/docs/openapi/saved_objects/saved_objects.yml b/docs/openapi/saved_objects/saved_objects.yml index 3d50114c2c2c..de5634890719 100644 --- a/docs/openapi/saved_objects/saved_objects.yml +++ b/docs/openapi/saved_objects/saved_objects.yml @@ -93,12 +93,125 @@ paths: application/json: schema: $ref: '#/components/schemas/400_bad_request' + /api/saved_objects/_find: + get: + tags: + - saved objects + summary: Find saved objects through query. + parameters: + - in: query + name: type + description: The type of saved objects to find. + required: true + schema: + oneOf: + - type: string + - type: array + example: dashboard + - in: query + name: per_page + description: The number of saved objects to return per page. + schema: + type: integer + minimum: 0 + default: 20 + example: 50 + - in: query + name: page + description: The page of objects to return. + schema: + type: integer + minimum: 0 + default: 1 + example: 1 + - in: query + name: search + description: The search query that filters the saved objects. + schema: + type: string + example: "open*" + - in: query + name: default_search_operator + description: The default operator for the search query. + schema: + type: string + enum: + - AND + - OR + default: OR + example: OR + - in: query + name: search_fields + description: The fields to search on by the query. + schema: + oneOf: + - type: string + - type: array + example: title + - in: query + name: sort_field + description: Sorts the response by selected field. + schema: + type: string + example: _score + - in: query + name: has_reference + description: Filters the saved objects that have a reference with the type and ID combination. + schema: + type: object + properties: + type: + type: string + id: + type: string + example: { "type": "visualization", "id": "37cc8650-b882-11e8-a6d9-e546fe2bba5f" } + - in: query + name: fields + description: The fields to return in the response. + schema: + oneOf: + - type: string + - type: array + example: title + - in: query + name: filter + description: A filter string that you can filter the saved object with attributes. + schema: + type: string + example: 'visualization.attributes.title:*' + - in: query + name: namespace + description: Namespaces that this saved object exists in. This attribute is only used for multi-namespace saved object types. + schema: + oneOf: + - type: string + - type: array + - in: query + name: workspace + description: Workspaces that this saved object exists in. + schema: + oneOf: + - type: string + - type: array + responses: + '200': + description: The saved objects are successfully found. + content: + application/json: + schema: + type: object + '400': + description: Bad request + content: + application/json: + schema: + $ref: '#/components/schemas/400_bad_request' components: parameters: type: name: type in: path - description: The type of SavedObject to retrieve + description: The type of SavedObject to retrieve. required: true schema: type: string