Skip to content

Commit

Permalink
refactor: fix lint spec error, add flow_framework.common file
Browse files Browse the repository at this point in the history
Signed-off-by: Junwei Dai <junweid@amazon.com>
  • Loading branch information
Junwei Dai committed Sep 5, 2024
1 parent 488c35a commit 67e89be
Show file tree
Hide file tree
Showing 2 changed files with 131 additions and 125 deletions.
129 changes: 4 additions & 125 deletions spec/namespaces/flow_framework.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -146,66 +146,12 @@ components:
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
$ref: '../schemas/flow_framework.common.yaml#/components/schemas/FlowFrameworkCreate'
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]
$ref: '../schemas/flow_framework.common.yaml#/components/schemas/FlowFrameworkUpdate'
responses:
flow_framework.create@201:
content:
Expand Down Expand Up @@ -247,78 +193,11 @@ components:
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.
$ref: '../schemas/flow_framework.common.yaml#/components/schemas/FlowFrameworkDeleteResponse'
flow_framework.get@200:
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
$ref: '../schemas/flow_framework.common.yaml#/components/schemas/FlowFrameworkGetResponse'
flow_framework.update@404:
description: Template Not Found Error
content:
Expand Down
127 changes: 127 additions & 0 deletions spec/schemas/flow_framework.common.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
openapi: 3.0.3
info:
title: Schemas of flow_framework.common category
description: Schemas of flow_framework.common category
version: 1.0.0
paths: { }
components:
schemas:
FlowFrameworkCreate:
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:
$ref: '#/components/schemas/version'
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
FlowFrameworkUpdate:
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:
$ref: '#/components/schemas/version'
minProperties: 1
FlowFrameworkDeleteResponse:
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:
$ref: '#/components/schemas/shards'
_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.
FlowFrameworkGetResponse:
type: object
properties:
name:
type: string
description:
type: string
use_case:
type: string
workflows:
type: object
user:
$ref: '#/components/schemas/user'
created_time:
type: integer
last_updated_time:
type: integer
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.
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.
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

0 comments on commit 67e89be

Please sign in to comment.