From ac6a7dc9018ba4d3af66f950a70c43b73da1a84c Mon Sep 17 00:00:00 2001
From: Andrew Prokhorenkov <aprokh@uchicago.edu>
Date: Tue, 19 Nov 2024 10:21:17 -0600
Subject: [PATCH] doc: update swagger

---
 docs/swagger/swagger.yaml | 134 ++++++++++++++++++++++++++++++++++----
 1 file changed, 121 insertions(+), 13 deletions(-)

diff --git a/docs/swagger/swagger.yaml b/docs/swagger/swagger.yaml
index b2be0b5..fd00d4b 100644
--- a/docs/swagger/swagger.yaml
+++ b/docs/swagger/swagger.yaml
@@ -13,7 +13,9 @@ components:
       properties:
         loc:
           items:
-            type: string
+            anyOf:
+            - type: string
+            - type: integer
           title: Location
           type: array
         msg:
@@ -31,7 +33,7 @@ components:
 info:
   title: argo wrapper
   version: 0.1.0
-openapi: 3.0.2
+openapi: 3.1.0
 paths:
   /cancel/{workflow_name}:
     post:
@@ -48,7 +50,11 @@ paths:
         '200':
           content:
             application/json:
-              schema: {}
+              schema:
+                anyOf:
+                - type: string
+                - {}
+                title: Response Cancel Workflow Cancel  Workflow Name  Post
           description: Successful Response
         '422':
           content:
@@ -60,18 +66,31 @@ paths:
   /logs/{workflow_name}:
     get:
       description: returns the list of workflows the user has ran
-      operationId: get_workflows_logs__workflow_name__get
+      operationId: get_workflow_logs_logs__workflow_name__get
       parameters:
       - in: path
         name: workflow_name
         required: true
         schema:
           title: Workflow Name
+          type: string
+      - in: query
+        name: uid
+        required: true
+        schema:
+          title: Uid
+          type: string
       responses:
         '200':
           content:
             application/json:
-              schema: {}
+              schema:
+                anyOf:
+                - items:
+                    type: object
+                  type: array
+                - {}
+                title: Response Get Workflow Logs Logs  Workflow Name  Get
           description: Successful Response
         '422':
           content:
@@ -79,11 +98,45 @@ paths:
               schema:
                 $ref: '#/components/schemas/HTTPValidationError'
           description: Validation Error
-      summary: Get Workflows
+      summary: Get Workflow Logs
+  /retry/{workflow_name}:
+    post:
+      description: retries a currently failed workflow
+      operationId: retry_workflow_retry__workflow_name__post
+      parameters:
+      - in: path
+        name: workflow_name
+        required: true
+        schema:
+          title: Workflow Name
+          type: string
+      - in: query
+        name: uid
+        required: true
+        schema:
+          title: Uid
+          type: string
+      responses:
+        '200':
+          content:
+            application/json:
+              schema:
+                anyOf:
+                - type: string
+                - {}
+                title: Response Retry Workflow Retry  Workflow Name  Post
+          description: Successful Response
+        '422':
+          content:
+            application/json:
+              schema:
+                $ref: '#/components/schemas/HTTPValidationError'
+          description: Validation Error
+      summary: Retry Workflow
   /status/{workflow_name}:
     get:
-      description: returns current status of a workflow
-      operationId: get_workflow_status_status__workflow_name__get
+      description: returns details of a workflow
+      operationId: get_workflow_details_status__workflow_name__get
       parameters:
       - in: path
         name: workflow_name
@@ -91,11 +144,22 @@ paths:
         schema:
           title: Workflow Name
           type: string
+      - in: query
+        name: uid
+        required: true
+        schema:
+          title: Uid
+          type: string
       responses:
         '200':
           content:
             application/json:
-              schema: {}
+              schema:
+                anyOf:
+                - type: object
+                - type: string
+                - {}
+                title: Response Get Workflow Details Status  Workflow Name  Get
           description: Successful Response
         '422':
           content:
@@ -103,7 +167,7 @@ paths:
               schema:
                 $ref: '#/components/schemas/HTTPValidationError'
           description: Validation Error
-      summary: Get Workflow Status
+      summary: Get Workflow Details
   /submit:
     post:
       description: route to submit workflow
@@ -111,13 +175,19 @@ paths:
       requestBody:
         content:
           application/json:
-            schema: {}
+            schema:
+              title: Request Body
+              type: object
         required: true
       responses:
         '200':
           content:
             application/json:
-              schema: {}
+              schema:
+                anyOf:
+                - type: string
+                - {}
+                title: Response Submit Workflow Submit Post
           description: Successful Response
         '422':
           content:
@@ -141,10 +211,48 @@ paths:
     get:
       description: returns the list of workflows the user has ran
       operationId: get_workflows_workflows_get
+      parameters:
+      - in: query
+        name: team_projects
+        required: false
+        schema:
+          anyOf:
+          - items:
+              type: string
+            type: array
+          - type: 'null'
+          title: Team Projects
       responses:
         '200':
           content:
             application/json:
-              schema: {}
+              schema:
+                anyOf:
+                - items:
+                    type: object
+                  type: array
+                - {}
+                title: Response Get Workflows Workflows Get
           description: Successful Response
+        '422':
+          content:
+            application/json:
+              schema:
+                $ref: '#/components/schemas/HTTPValidationError'
+          description: Validation Error
       summary: Get Workflows
+  /workflows/user-monthly:
+    get:
+      description: 'Query Argo service to see how many successful run user already
+
+        have in the current calendar month. Return workflow numbers and workflow cap'
+      operationId: get_user_monthly_workflow_workflows_user_monthly_get
+      responses:
+        '200':
+          content:
+            application/json:
+              schema:
+                title: Response Get User Monthly Workflow Workflows User Monthly Get
+                type: object
+          description: Successful Response
+      summary: Get User Monthly Workflow