diff --git a/openapi/dataset_endpoints.yaml b/openapi/dataset_endpoints.yaml deleted file mode 100644 index 04bb5940e..000000000 --- a/openapi/dataset_endpoints.yaml +++ /dev/null @@ -1,98 +0,0 @@ -openapi: "3.0.0" -info: - title: DLP API - description: API endpoints for the Deep Learning Playground Project - version: "1.0.0" -paths: - /api/dataset/defaultDataset: - post: - description: Endpoint to get user selected default dataset for training - requestBody: - content: - application/json: - schema: - type: string - required: - - using_default_dataset - properties: - using_default_dataset: - type: string - description: dataset selected for training - example: - using_default_dataset: "IRIS" - required: true - responses: - "200": - description: Dataset selected successfully - content: - application/json: - schema: - type: object - properties: - columns: - type: array - example: [col1, col2, col3] - "400": - description: Dataset wasn't selected properly. This is usually something wrong with your code - "401": - description: User is not authenticated - content: - application/json: - schema: - type: object - properties: - error: - type: string - example: "User is not authenticated" - /api/dataset/getColumnsFromDatasetFile: - post: - description: 'API Endpoint to retrieve columns from a user uploaded dataset file (eg: column names for a CSV file)' - requestBody: - content: - application/json: - schema: - type: string - required: - - uid - - data_source - - name - properties: - uid: - type: string - description: User Id - data_source: - type: string - description: 'What type of training was the user running (eg: TABULAR, PRETRAINED, OBJECT_DETECTION, IMAGE, etc)' - name: - type: string - description: Name of dataset file - example: - uid: '1234' - data_source: 'TABULAR' - name: 'data.csv' - required: true - responses: - "200": - description: Columns Fetched Successfully - content: - application/json: - schema: - type: object - properties: - columns: - type: array - example: [col1, col2, col3] - "400": - description: Dataset columns weren't selected properly. This is usually something wrong with your code - "401": - description: User is not authenticated - content: - application/json: - schema: - type: object - properties: - error: - type: string - example: "User is not authenticated" - - \ No newline at end of file diff --git a/openapi/openapi.yaml b/openapi/openapi.yaml new file mode 100644 index 000000000..efac395bc --- /dev/null +++ b/openapi/openapi.yaml @@ -0,0 +1,58 @@ +openapi: 3.1.0 +info: + version: 1.0.0 + title: Deep Learning Playground Backend API + contact: + email: dlp@datasciencegt.org + url: https://github.com/DSGT-DLP/Deep-Learning-Playground + license: + name: MIT + url: https://github.com/DSGT-DLP/Deep-Learning-Playground/blob/nextjs/LICENSE + description: > + Deep Learning Playground Backend API specifications + +tags: + - name: dataset + description: Everything about dataset + - name: s3 + description: Everything about s3 + - name: test + description: Test API endpoints + - name: trainspace + description: Everything about trainspace +servers: + - url: https://example.com/api/v1 +paths: + /dataset/defaultDataset: + $ref: paths/dataset/defaultDataset.yaml + /dataset/getColumnsFromDatasetFile: + $ref: paths/dataset/getColumnsFromDatasetFile.yaml + /s3/getExecutionsFilesPresignedUrls: + $ref: paths/s3/getExecutionsFilesPresignedUrls.yaml + /s3/getSignedUploadUrl: + $ref: paths/s3/getSignedUploadUrl.yaml + /s3/getUserDatasetFilesData: + $ref: paths/s3/getUserDatasetFilesData.yaml + /test: + $ref: paths/test/none.yaml + /trainspace/create-trainspace: + $ref: paths/trainspace/create-trainspace.yaml + /trainspace/getTrainspaceData: + $ref: paths/trainspace/getTrainspaceData.yaml +# components: +# securitySchemes: +# main_auth: +# type: oauth2 +# flows: +# implicit: +# authorizationUrl: http://example.com/api/oauth/dialog +# scopes: +# read:users: read users info +# write:users: modify or remove users +# api_key: +# type: apiKey +# in: header +# name: api_key +# basic_auth: +# type: http +# scheme: basic diff --git a/openapi/paths/dataset/defaultDataset.yaml b/openapi/paths/dataset/defaultDataset.yaml new file mode 100644 index 000000000..8c6d399e2 --- /dev/null +++ b/openapi/paths/dataset/defaultDataset.yaml @@ -0,0 +1,42 @@ +post: + summary: Default dataset + description: Endpoint to get user selected default dataset for training + tags: + - dataset + requestBody: + content: + application/json: + schema: + type: string + required: + - using_default_dataset + properties: + using_default_dataset: + type: string + description: dataset selected for training + example: + using_default_dataset: "IRIS" + required: true + responses: + "200": + description: Dataset selected successfully + content: + application/json: + schema: + type: object + properties: + columns: + type: array + example: [col1, col2, col3] + "400": + description: Dataset wasn't selected properly. This is usually something wrong with your code + "401": + description: User is not authenticated + content: + application/json: + schema: + type: object + properties: + error: + type: string + example: "User is not authenticated" diff --git a/openapi/paths/dataset/getColumnsFromDatasetFile.yaml b/openapi/paths/dataset/getColumnsFromDatasetFile.yaml new file mode 100644 index 000000000..7195b5cb6 --- /dev/null +++ b/openapi/paths/dataset/getColumnsFromDatasetFile.yaml @@ -0,0 +1,52 @@ +post: + summary: Get columns from dataset file + description: "API Endpoint to retrieve columns from a user uploaded dataset file (eg: column names for a CSV file)" + tags: + - dataset + requestBody: + content: + application/json: + schema: + type: string + required: + - uid + - data_source + - name + properties: + uid: + type: string + description: User Id + data_source: + type: string + description: "What type of training was the user running (eg: TABULAR, PRETRAINED, OBJECT_DETECTION, IMAGE, etc)" + name: + type: string + description: Name of dataset file + example: + uid: "1234" + data_source: "TABULAR" + name: "data.csv" + required: true + responses: + "200": + description: Columns Fetched Successfully + content: + application/json: + schema: + type: object + properties: + columns: + type: array + example: [col1, col2, col3] + "400": + description: Dataset columns weren't selected properly. This is usually something wrong with your code + "401": + description: User is not authenticated + content: + application/json: + schema: + type: object + properties: + error: + type: string + example: "User is not authenticated" diff --git a/openapi/paths/s3/getExecutionsFilesPresignedUrls.yaml b/openapi/paths/s3/getExecutionsFilesPresignedUrls.yaml new file mode 100644 index 000000000..a43cccdaf --- /dev/null +++ b/openapi/paths/s3/getExecutionsFilesPresignedUrls.yaml @@ -0,0 +1,41 @@ +post: + description: API Endpoint to use S3 Presigned URLs to retrieve result files from S3 given an execution id + tags: + - s3 + requestBody: + content: + application/json: + schema: + type: object + required: + - exec_id + properties: + exec_id: + type: string + description: The execution id + example: + exec_id: "1234" + required: true + responses: + "200": + description: Result files for your execution fetched successfully + content: + application/json: + schema: + type: object + properties: + message: + type: string + example: "Result file fetch successful" + "400": + description: Result file fetch didn't go through successfully. This is usually something wrong with your code + "401": + description: User is not authenticated + content: + application/json: + schema: + type: object + properties: + error: + type: string + example: "User is not authenticated" diff --git a/openapi/paths/s3/getSignedUploadUrl.yaml b/openapi/paths/s3/getSignedUploadUrl.yaml new file mode 100644 index 000000000..39f070d97 --- /dev/null +++ b/openapi/paths/s3/getSignedUploadUrl.yaml @@ -0,0 +1,51 @@ +post: + description: Endpoint to upload files to S3 + tags: + - s3 + requestBody: + content: + application/json: + schema: + type: object + required: + - version + - filename + - file + properties: + version: + type: integer + description: The file version + filename: + type: string + description: The name of the file + file: + type: object + description: the file + example: + version: 2 + filename: "file" + file: { "col1": [val1, val2], "col2": [val3, val4] } + required: true + responses: + "200": + description: Data uploaded successfully + content: + application/json: + schema: + type: object + properties: + message: + type: string + example: "Upload successful" + "400": + description: Upload didn't go through successfully. This is usually something wrong with your code + "401": + description: User is not authenticated + content: + application/json: + schema: + type: object + properties: + error: + type: string + example: "User is not authenticated" diff --git a/openapi/paths/s3/getUserDatasetFilesData.yaml b/openapi/paths/s3/getUserDatasetFilesData.yaml new file mode 100644 index 000000000..f261c07d2 --- /dev/null +++ b/openapi/paths/s3/getUserDatasetFilesData.yaml @@ -0,0 +1,42 @@ +post: + description: API Endpoint to retrieve all user dataset files uploaded in S3 + tags: + - s3 + requestBody: + content: + application/json: + schema: + type: object + required: + - uid + - data_source + properties: + uid: + type: string + description: User ID + data_source: + type: string + description: "What type of training was the user running (eg: TABULAR, PRETRAINED, OBJECT_DETECTION, IMAGE, etc)" + responses: + "200": + description: User Dataset files for user fetched successfully + content: + application/json: + schema: + type: object + properties: + message: + type: string + example: "User Dataset file fetch successful" + "400": + description: User Dataset files for user wasn't fetched successfully. This is usually something wrong with your code + "401": + description: User is not authenticated + content: + application/json: + schema: + type: object + properties: + error: + type: string + example: "User is not authenticated" diff --git a/openapi/paths/test/none.yaml b/openapi/paths/test/none.yaml new file mode 100644 index 000000000..6cce90a07 --- /dev/null +++ b/openapi/paths/test/none.yaml @@ -0,0 +1,15 @@ +get: + summary: A simple endpoint to test if our backend is alive + tags: + - test + responses: + 200: + description: Test Backend alive + content: + application/json: + schema: + type: object + properties: + Status: + type: string + example: "Backend is alive" diff --git a/openapi/paths/trainspace/create-trainspace.yaml b/openapi/paths/trainspace/create-trainspace.yaml new file mode 100644 index 000000000..cafc08a9f --- /dev/null +++ b/openapi/paths/trainspace/create-trainspace.yaml @@ -0,0 +1,41 @@ +post: + description: API Endpoint to create a "trainspace". Trainspace is a new concept/data structure we introduce to track user's training requests. Concept similar to execution_id. + tags: + - trainspace + requestBody: + content: + application/json: + schema: + type: object + required: + - uid + properties: + uid: + type: string + description: User ID + example: + uid: "1234" + required: true + responses: + "200": + description: Trainspace created successfully + content: + application/json: + schema: + type: object + properties: + message: + type: string + example: "Trainspace Creation successful" + "400": + description: Trainspace Creation didn't go through successfully. This is usually something wrong with your code + "401": + description: User is not authenticated + content: + application/json: + schema: + type: object + properties: + error: + type: string + example: "User is not authenticated" diff --git a/openapi/paths/trainspace/getTrainspaceData.yaml b/openapi/paths/trainspace/getTrainspaceData.yaml new file mode 100644 index 000000000..5c5c090ab --- /dev/null +++ b/openapi/paths/trainspace/getTrainspaceData.yaml @@ -0,0 +1,41 @@ +post: + description: API Endpoint to identify all trainspaces for a given user id. + tags: + - trainspace + requestBody: + content: + application/json: + schema: + type: object + required: + - uid + properties: + uid: + type: string + description: User ID + example: + uid: "1234" + required: true + responses: + "200": + description: Able to query and retrieve trainspace objects belonging to a user + content: + application/json: + schema: + type: object + properties: + message: + type: string + example: "Trainspace Retrieval Successful" + "400": + description: Trainspace Retrieval didn't go through successfully. This is usually something wrong with your code + "401": + description: User is not authenticated + content: + application/json: + schema: + type: object + properties: + error: + type: string + example: "User is not authenticated" diff --git a/openapi/s3_endpoints.yaml b/openapi/s3_endpoints.yaml deleted file mode 100644 index 16b78178b..000000000 --- a/openapi/s3_endpoints.yaml +++ /dev/null @@ -1,137 +0,0 @@ -openapi: "3.0.0" -info: - title: DLP API - description: API endpoints for the Deep Learning Playground Project - version: "1.0.0" -paths: - /api/s3/getSignedUploadUrl: - post: - description: Endpoint to upload files to S3 - requestBody: - content: - application/json: - schema: - type: object - required: - - version - - filename - - file - properties: - version: - type: integer - description: The file version - filename: - type: string - description: The name of the file - file: - type: object - description: the file - example: - version: 2 - filename: "file" - file: { "col1": [val1, val2], "col2": [val3, val4] } - required: true - responses: - "200": - description: Data uploaded successfully - content: - application/json: - schema: - type: object - properties: - message: - type: string - example: "Upload successful" - "400": - description: Upload didn't go through successfully. This is usually something wrong with your code - "401": - description: User is not authenticated - content: - application/json: - schema: - type: object - properties: - error: - type: string - example: "User is not authenticated" - /api/s3/getExecutionsFilesPresignedUrls: - post: - description: API Endpoint to use S3 Presigned URLs to retrieve result files from S3 given an execution id - requestBody: - content: - application/json: - schema: - type: object - required: - - exec_id - properties: - exec_id: - type: string - description: The execution id - example: - exec_id: '1234' - required: true - responses: - "200": - description: Result files for your execution fetched successfully - content: - application/json: - schema: - type: object - properties: - message: - type: string - example: "Result file fetch successful" - "400": - description: Result file fetch didn't go through successfully. This is usually something wrong with your code - "401": - description: User is not authenticated - content: - application/json: - schema: - type: object - properties: - error: - type: string - example: "User is not authenticated" - /api/s3/getUserDatasetFilesData: - post: - description: API Endpoint to retrieve all user dataset files uploaded in S3 - requestBody: - content: - application/json: - schema: - type: object - required: - - uid - - data_source - properties: - uid: - type: string - description: User ID - data_source: - type: string - description: 'What type of training was the user running (eg: TABULAR, PRETRAINED, OBJECT_DETECTION, IMAGE, etc)' - responses: - "200": - description: User Dataset files for user fetched successfully - content: - application/json: - schema: - type: object - properties: - message: - type: string - example: "User Dataset file fetch successful" - "400": - description: User Dataset files for user wasn't fetched successfully. This is usually something wrong with your code - "401": - description: User is not authenticated - content: - application/json: - schema: - type: object - properties: - error: - type: string - example: "User is not authenticated" diff --git a/openapi/test_endpoints.yaml b/openapi/test_endpoints.yaml deleted file mode 100644 index 0b4f963b1..000000000 --- a/openapi/test_endpoints.yaml +++ /dev/null @@ -1,20 +0,0 @@ -openapi: "3.0.0" -info: - title: DLP API - description: API endpoints for the Deep Learning Playground Project - version: "1.0.0" -paths: - /api/test: - get: - summary: A simple endpoint to test if our backend is alive - responses: - 200: - description: Test Backend alive - content: - application/json: - schema: - type: object - properties: - Status: - type: string - example: "Backend is alive" diff --git a/openapi/trainspace_endpoints.yaml b/openapi/trainspace_endpoints.yaml deleted file mode 100644 index c16fad141..000000000 --- a/openapi/trainspace_endpoints.yaml +++ /dev/null @@ -1,86 +0,0 @@ -openapi: "3.0.0" -info: - title: DLP API - description: API endpoints for the Deep Learning Playground Project - version: "1.0.0" -paths: - /api/trainspace/create-trainspace: - post: - description: API Endpoint to create a "trainspace". Trainspace is a new concept/data structure we introduce to track user's training requests. Concept similar to execution_id. - requestBody: - content: - application/json: - schema: - type: object - required: - - uid - properties: - uid: - type: string - description: User ID - example: - uid: '1234' - required: true - responses: - "200": - description: Trainspace created successfully - content: - application/json: - schema: - type: object - properties: - message: - type: string - example: "Trainspace Creation successful" - "400": - description: Trainspace Creation didn't go through successfully. This is usually something wrong with your code - "401": - description: User is not authenticated - content: - application/json: - schema: - type: object - properties: - error: - type: string - example: "User is not authenticated" - /api/trainspace/getTrainspaceData: - post: - description: API Endpoint to identify all trainspaces for a given user id. - requestBody: - content: - application/json: - schema: - type: object - required: - - uid - properties: - uid: - type: string - description: User ID - example: - uid: '1234' - required: true - responses: - "200": - description: Able to query and retrieve trainspace objects belonging to a user - content: - application/json: - schema: - type: object - properties: - message: - type: string - example: "Trainspace Retrieval Successful" - "400": - description: Trainspace Retrieval didn't go through successfully. This is usually something wrong with your code - "401": - description: User is not authenticated - content: - application/json: - schema: - type: object - properties: - error: - type: string - example: "User is not authenticated"