-
Notifications
You must be signed in to change notification settings - Fork 61
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
Add flow_framework namespace specs #553
Merged
Merged
Changes from 17 commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
e6a0c9e
add flow framework create
62e0fd9
add flow framework delete
a451624
add flow framework put and get
accea08
add changelog info
1c133f1
fix mistype error
a5910b3
refactor:
10a88a6
refactor:
d5446bb
refactor:
bcdc900
refactor:
bc8e404
refactor:
d772954
refactor:
b99a822
refactor:
a96e1ad
Update tests/default/flow_framework/workflow.yaml
junweid62 ceb229f
refactor:
f84cb79
add use_case parameter, add reprovision to .cspell
4d7d28e
refactor: fix eslint
03ed38a
refactor: remove comment
fb4174d
refactor: fix lint spec error
97860be
refactor: fix lint spec error
488c35a
refactor: fix lint spec error
67e89be
refactor: fix lint spec error, add flow_framework.common file
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -191,4 +191,5 @@ urldecode | |
vectory | ||
whoamiprotected | ||
wordnet | ||
Yrtsd | ||
Yrtsd | ||
reprovision |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,323 @@ | ||
openapi: 3.1.0 | ||
info: | ||
title: OpenSearch Flow Framework API | ||
description: OpenSearch Flow Framework API. | ||
version: 1.0.0 | ||
paths: | ||
/_plugins/_flow_framework/workflow: | ||
post: | ||
operationId: flow_framework.create.0 | ||
x-operation-group: flow_framework.create | ||
x-version-added: '2.12' | ||
description: Create a workflow. | ||
externalDocs: | ||
url: https://opensearch.org/docs/latest/automating-configurations/api/create-workflow/ | ||
parameters: | ||
- $ref: '#/components/parameters/flow_framework.create::query.provision' | ||
- $ref: '#/components/parameters/flow_framework.create::query.reprovision' | ||
- $ref: '#/components/parameters/flow_framework.create::query.use_case' | ||
- $ref: '#/components/parameters/flow_framework.create::query.validation' | ||
requestBody: | ||
$ref: '#/components/requestBodies/flow_framework.create' | ||
responses: | ||
'201': | ||
$ref: '#/components/responses/flow_framework.create@201' | ||
'403': | ||
$ref: '../schemas/flow_framework._errors.yaml#/components/schemas/FlowFrameworkAPIDisabledException' | ||
'400': | ||
description: Bad Request - Multiple possible reasons | ||
oneOf: | ||
- $ref: '../schemas/flow_framework._errors.yaml#/components/schemas/BadRequestError' | ||
- $ref: '../schemas/flow_framework._errors.yaml#/components/schemas/ConflictError' | ||
- $ref: '../schemas/flow_framework._errors.yaml#/components/schemas/MissingParameterError' | ||
- $ref: '../schemas/flow_framework._errors.yaml#/components/schemas/ParameterConflictError' | ||
- $ref: '../schemas/flow_framework._errors.yaml#/components/schemas/MaxWorkflowsLimitError' | ||
- $ref: '../schemas/flow_framework._errors.yaml#/components/schemas/WorkflowSaveError' | ||
/_plugins/_flow_framework/workflow/{workflow_id}: | ||
delete: | ||
operationId: flow_framework.delete.0 | ||
x-operation-group: flow_framework.delete | ||
x-version-added: '2.12' | ||
description: Delete a workflow. | ||
externalDocs: | ||
url: https://opensearch.org/docs/latest/automating-configurations/api/delete-workflow/ | ||
parameters: | ||
- $ref: '#/components/parameters/flow_framework.delete::query.clear_status' | ||
- $ref: '#/components/parameters/flow_framework.delete::path.workflow_id' | ||
responses: | ||
'200': | ||
$ref: '#/components/responses/flow_framework.delete@200' | ||
'400': | ||
$ref: '../schemas/flow_framework._errors.yaml#/components/schemas/WorkFlowIdNullError' | ||
'403': | ||
$ref: '../schemas/flow_framework._errors.yaml#/components/schemas/FlowFrameworkAPIDisabledException' | ||
'404': | ||
$ref: '../schemas/flow_framework._errors.yaml#/components/schemas/TemplateNotFoundError' | ||
put: | ||
operationId: flow_framework.update.0 | ||
x-operation-group: flow_framework.update | ||
x-version-added: '2.12' | ||
description: Update a workflow. You can only update a complete workflow if it has not yet been provisioned. | ||
externalDocs: | ||
url: https://opensearch.org/docs/latest/automating-configurations/api/create-workflow/ | ||
parameters: | ||
- $ref: '#/components/parameters/flow_framework.update::path.workflow_id' | ||
- $ref: '#/components/parameters/flow_framework.update::query.update_fields' | ||
requestBody: | ||
$ref: '#/components/requestBodies/flow_framework.update' | ||
responses: | ||
'201': | ||
$ref: '#/components/responses/flow_framework.update@201' | ||
description: It returns the workflow_id | ||
'404': | ||
$ref: '../schemas/flow_framework._errors.yaml#/components/schemas/TemplateNotFoundError' | ||
get: | ||
operationId: flow_framework.get.0 | ||
x-operation-group: flow_framework.get | ||
x-version-added: '2.12' | ||
externalDocs: | ||
url: https://opensearch.org/docs/latest/automating-configurations/api/get-workflow/ | ||
description: Get a workflow. | ||
parameters: | ||
- $ref: '#/components/parameters/flow_framework.get::path.workflow_id' | ||
responses: | ||
'200': | ||
$ref: '#/components/responses/flow_framework.get' | ||
'404': | ||
$ref: '../schemas/flow_framework._errors.yaml#/components/schemas/TemplateNotFoundError' | ||
components: | ||
parameters: | ||
flow_framework.get::path.workflow_id: | ||
name: workflow_id | ||
in: path | ||
required: true | ||
schema: | ||
type: string | ||
flow_framework.update::path.workflow_id: | ||
name: workflow_id | ||
in: path | ||
required: true | ||
schema: | ||
type: string | ||
flow_framework.delete::path.workflow_id: | ||
name: workflow_id | ||
in: path | ||
required: true | ||
schema: | ||
type: string | ||
flow_framework.create::query.provision: | ||
in: query | ||
name: provision | ||
schema: | ||
description: Provision the workflow as part of the request | ||
type: boolean | ||
default: false | ||
flow_framework.create::query.reprovision: | ||
x-version-added: '2.17' | ||
in: query | ||
name: reprovision | ||
schema: | ||
type: boolean | ||
default: false | ||
flow_framework.create::query.use_case: | ||
description: To use a workflow template, specify it in the use_case query parameter when creating a workflow. | ||
externalDocs: | ||
url: https://opensearch.org/docs/latest/automating-configurations/workflow-templates/#supported-workflow-templates | ||
in: query | ||
name: use_case | ||
schema: | ||
type: string | ||
flow_framework.create::query.validation: | ||
in: query | ||
name: validation | ||
schema: | ||
description: Validate the workflow. Valid values are all (validate the template) and none (do not validate the template). Default is all. | ||
type: string | ||
default: all | ||
flow_framework.update::query.update_fields: | ||
in: query | ||
name: update_fields | ||
schema: | ||
description: Update only the fields included in the request body. | ||
type: boolean | ||
default: false | ||
flow_framework.delete::query.clear_status: | ||
in: query | ||
name: clear_status | ||
schema: | ||
description: Delete the workflow state (without deprovisioning resources) after deleting the template. OpenSearch deletes the workflow state only if the provisioning status is not IN_PROGRESS. Default is false. | ||
type: boolean | ||
default: false | ||
requestBodies: | ||
flow_framework.create: | ||
content: | ||
application/json: | ||
schema: | ||
type: object | ||
properties: | ||
name: | ||
type: string | ||
description: The name of the workflow. | ||
description: | ||
type: string | ||
description: A description of the workflow. | ||
use_case: | ||
type: string | ||
description: A use case, which can be used with the Search Workflow API to find related workflows. | ||
version: | ||
type: object | ||
description: A key-value map with two fields, template, which identifies the template version, and compatibility, which identifies a list of minimum required OpenSearch versions. | ||
properties: | ||
template: | ||
type: string | ||
description: The template version of the workflow. | ||
compatibility: | ||
type: array | ||
items: | ||
type: string | ||
description: A list of minimum required OpenSearch versions. | ||
workflows: | ||
type: object | ||
description: A map of workflows. Presently, only the provision key is supported. The value for the workflow key is a key-value map that includes fields for user_params and lists of nodes and edges. | ||
required: | ||
- name | ||
flow_framework.update: | ||
content: | ||
application/json: | ||
schema: | ||
type: object | ||
properties: | ||
name: | ||
type: string | ||
description: The name of the workflow. | ||
description: | ||
type: string | ||
description: A description of the workflow. | ||
use_case: | ||
type: string | ||
description: A use case, which can be used with the Search Workflow API to find related workflows. | ||
version: | ||
type: object | ||
description: A key-value map with two fields, template, which identifies the template version, and compatibility, which identifies a list of minimum required OpenSearch versions. | ||
properties: | ||
template: | ||
type: string | ||
description: The template version of the workflow. | ||
compatibility: | ||
type: array | ||
items: | ||
type: string | ||
description: A list of minimum required OpenSearch versions. | ||
oneOf: | ||
- required: [name] | ||
- required: [description] | ||
- required: [use_case] | ||
- required: [version] | ||
responses: | ||
flow_framework.create@201: | ||
content: | ||
application/json: | ||
schema: | ||
type: object | ||
properties: | ||
workflow_id: | ||
type: string | ||
description: The ID of the workflow to be updated. Required for the PUT method. | ||
required: | ||
- workflow_id | ||
flow_framework.update@201: | ||
content: | ||
application/json: | ||
schema: | ||
type: object | ||
properties: | ||
workflow_id: | ||
type: string | ||
description: The ID of the workflow to be updated. Required for the PUT method. | ||
required: | ||
- workflow_id | ||
flow_framework.delete@200: | ||
content: | ||
application/json: | ||
schema: | ||
type: object | ||
properties: | ||
_index: | ||
type: string | ||
description: The name of the index where the document was stored. | ||
_id: | ||
type: string | ||
description: The unique identifier of the deleted document. | ||
_version: | ||
type: integer | ||
description: The version of the document after the deletion. | ||
result: | ||
type: string | ||
description: The result of the deletion operation. | ||
enum: [deleted, not_found] | ||
_shards: | ||
type: object | ||
properties: | ||
total: | ||
type: integer | ||
description: The total number of shards involved in the deletion. | ||
successful: | ||
type: integer | ||
description: The number of shards where the deletion was successful. | ||
failed: | ||
type: integer | ||
description: The number of shards where the deletion failed. | ||
_seq_no: | ||
type: integer | ||
description: The sequence number assigned to the document after the deletion. | ||
_primary_term: | ||
type: integer | ||
description: The primary term assigned to the document after the deletion. | ||
flow_framework.get: | ||
content: | ||
application/json: | ||
schema: | ||
type: object | ||
properties: | ||
name: | ||
type: string | ||
description: | ||
type: string | ||
use_case: | ||
type: string | ||
workflows: | ||
type: object | ||
user: | ||
type: object | ||
properties: | ||
name: | ||
type: string | ||
backend_roles: | ||
type: array | ||
items: | ||
type: string | ||
roles: | ||
type: array | ||
items: | ||
type: string | ||
custom_attribute_names: | ||
type: array | ||
items: | ||
type: string | ||
user_requested_tenant: | ||
type: string | ||
nullable: true | ||
created_time: | ||
type: integer | ||
last_updated_time: | ||
type: integer | ||
flow_framework.update@404: | ||
content: | ||
application/json: { } | ||
flow_framework.create@400: | ||
content: | ||
application/json: { } | ||
flow_framework.delete@400: | ||
content: | ||
description: Workflow ID can not be null | ||
application/json: { } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I still think you're missing
use_case
: https://opensearch.org/docs/latest/automating-configurations/workflow-templates/