From 5b7d8ef67f0700e70a02c984c85dc26358d34021 Mon Sep 17 00:00:00 2001 From: karkir0003 Date: Sat, 17 Jun 2023 11:22:00 -0400 Subject: [PATCH 1/8] open api yaml files coming back --- openapi/dataset_endpoints.yaml | 98 +++++++++++++++++++++++ openapi/s3_endpoints.yaml | 137 +++++++++++++++++++++++++++++++++ openapi/test_endpoints.yaml | 20 +++++ 3 files changed, 255 insertions(+) create mode 100644 openapi/dataset_endpoints.yaml create mode 100644 openapi/s3_endpoints.yaml create mode 100644 openapi/test_endpoints.yaml diff --git a/openapi/dataset_endpoints.yaml b/openapi/dataset_endpoints.yaml new file mode 100644 index 000000000..04bb5940e --- /dev/null +++ b/openapi/dataset_endpoints.yaml @@ -0,0 +1,98 @@ +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/s3_endpoints.yaml b/openapi/s3_endpoints.yaml new file mode 100644 index 000000000..16b78178b --- /dev/null +++ b/openapi/s3_endpoints.yaml @@ -0,0 +1,137 @@ +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 new file mode 100644 index 000000000..0b4f963b1 --- /dev/null +++ b/openapi/test_endpoints.yaml @@ -0,0 +1,20 @@ +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" From 87b95598e4dc8bb83401cd0dc630e8ad9c81c24f Mon Sep 17 00:00:00 2001 From: karkir0003 Date: Sat, 17 Jun 2023 11:23:43 -0400 Subject: [PATCH 2/8] open api validation --- .github/workflows/open-api-validation.yml | 39 +++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 .github/workflows/open-api-validation.yml diff --git a/.github/workflows/open-api-validation.yml b/.github/workflows/open-api-validation.yml new file mode 100644 index 000000000..d93887d68 --- /dev/null +++ b/.github/workflows/open-api-validation.yml @@ -0,0 +1,39 @@ +name: OpenAPI Schema Validation + +on: + push: + paths: + - "openapi/**" + pull_request: + paths: + - "openapi/**" + +jobs: + validate: + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [18.x] + + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Check file extensions + run: | + shopt -s globstar + for file in backend/openapi/**/*.yaml; do + if [[ ! "$file" =~ \.openapi\.yaml$ ]]; then + echo "Error: $file does not have the .openapi.yaml extension" + exit 1 + fi + done + - name: Validate OpenAPI files + run: | + yarn add swagger-cli + for file in backend/openapi/*.yaml + do + echo "Validating $file" + yarn swagger-cli validate $file --no-color || exit 1 + done \ No newline at end of file From 9cd3aaf5e2c46ba1c001834991578ff0058c06ac Mon Sep 17 00:00:00 2001 From: karkir0003 Date: Sat, 17 Jun 2023 11:27:36 -0400 Subject: [PATCH 3/8] typo fix in open api validation yml --- .github/workflows/open-api-validation.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/open-api-validation.yml b/.github/workflows/open-api-validation.yml index d93887d68..8256ec5b2 100644 --- a/.github/workflows/open-api-validation.yml +++ b/.github/workflows/open-api-validation.yml @@ -24,8 +24,8 @@ jobs: run: | shopt -s globstar for file in backend/openapi/**/*.yaml; do - if [[ ! "$file" =~ \.openapi\.yaml$ ]]; then - echo "Error: $file does not have the .openapi.yaml extension" + if [[ ! "$file" =~ \.yml$ ]]; then + echo "Error: $file does not have the .yml extension" exit 1 fi done From 395e3f1c4bbfcd6c56973aaa357a20056dff7b77 Mon Sep 17 00:00:00 2001 From: karkir0003 Date: Sat, 17 Jun 2023 11:28:49 -0400 Subject: [PATCH 4/8] directory fix --- .github/workflows/open-api-validation.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/open-api-validation.yml b/.github/workflows/open-api-validation.yml index 8256ec5b2..dbd8f3994 100644 --- a/.github/workflows/open-api-validation.yml +++ b/.github/workflows/open-api-validation.yml @@ -32,7 +32,7 @@ jobs: - name: Validate OpenAPI files run: | yarn add swagger-cli - for file in backend/openapi/*.yaml + for file in openapi/*.yaml do echo "Validating $file" yarn swagger-cli validate $file --no-color || exit 1 From 2c3cf7f4c1bc483e08dd4f020c8b8b9200e5bf3f Mon Sep 17 00:00:00 2001 From: karkir0003 Date: Sat, 17 Jun 2023 11:30:01 -0400 Subject: [PATCH 5/8] typo fix in script --- .github/workflows/open-api-validation.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/open-api-validation.yml b/.github/workflows/open-api-validation.yml index dbd8f3994..80c9ef0a1 100644 --- a/.github/workflows/open-api-validation.yml +++ b/.github/workflows/open-api-validation.yml @@ -23,8 +23,8 @@ jobs: - name: Check file extensions run: | shopt -s globstar - for file in backend/openapi/**/*.yaml; do - if [[ ! "$file" =~ \.yml$ ]]; then + for file in openapi/*.yaml; do + if [[ ! "$file" =~ \.yaml$ ]]; then echo "Error: $file does not have the .yml extension" exit 1 fi From fa62f1bab0182ef2d1e3ceda175995aaa1deb25b Mon Sep 17 00:00:00 2001 From: karkir0003 Date: Sat, 17 Jun 2023 11:36:09 -0400 Subject: [PATCH 6/8] trainspace endpoints yaml --- openapi/trainspace_endpoints.yaml | 86 +++++++++++++++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100644 openapi/trainspace_endpoints.yaml diff --git a/openapi/trainspace_endpoints.yaml b/openapi/trainspace_endpoints.yaml new file mode 100644 index 000000000..c16fad141 --- /dev/null +++ b/openapi/trainspace_endpoints.yaml @@ -0,0 +1,86 @@ +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" From 09e7076eec649191071ffbd2c79e771e00a803bf Mon Sep 17 00:00:00 2001 From: Faris Durrani Date: Sat, 17 Jun 2023 14:05:54 -0400 Subject: [PATCH 7/8] Improvements to redocly format (#821) * openapi root init * cont * cont * cont * cont * cont * cont * cont * contact info * license --- openapi/dataset_endpoints.yaml | 98 ------------- openapi/openapi.yaml | 58 ++++++++ openapi/paths/dataset/defaultDataset.yaml | 42 ++++++ .../dataset/getColumnsFromDatasetFile.yaml | 52 +++++++ .../s3/getExecutionsFilesPresignedUrls.yaml | 41 ++++++ openapi/paths/s3/getSignedUploadUrl.yaml | 51 +++++++ openapi/paths/s3/getUserDatasetFilesData.yaml | 42 ++++++ openapi/paths/test/none.yaml | 15 ++ .../paths/trainspace/create-trainspace.yaml | 41 ++++++ .../paths/trainspace/getTrainspaceData.yaml | 41 ++++++ openapi/s3_endpoints.yaml | 137 ------------------ openapi/test_endpoints.yaml | 20 --- openapi/trainspace_endpoints.yaml | 86 ----------- 13 files changed, 383 insertions(+), 341 deletions(-) delete mode 100644 openapi/dataset_endpoints.yaml create mode 100644 openapi/openapi.yaml create mode 100644 openapi/paths/dataset/defaultDataset.yaml create mode 100644 openapi/paths/dataset/getColumnsFromDatasetFile.yaml create mode 100644 openapi/paths/s3/getExecutionsFilesPresignedUrls.yaml create mode 100644 openapi/paths/s3/getSignedUploadUrl.yaml create mode 100644 openapi/paths/s3/getUserDatasetFilesData.yaml create mode 100644 openapi/paths/test/none.yaml create mode 100644 openapi/paths/trainspace/create-trainspace.yaml create mode 100644 openapi/paths/trainspace/getTrainspaceData.yaml delete mode 100644 openapi/s3_endpoints.yaml delete mode 100644 openapi/test_endpoints.yaml delete mode 100644 openapi/trainspace_endpoints.yaml 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" From 6f139efec07931c2bbcdfe54deddac85a006d851 Mon Sep 17 00:00:00 2001 From: Faris Durrani Date: Sat, 17 Jun 2023 14:23:22 -0400 Subject: [PATCH 8/8] Hotfixes for Redocly root (#823) * openapi root init * cont * cont * cont * cont * cont * cont * cont * contact info * license * hotfix * hotfix * added /api * added server url --- openapi/openapi.yaml | 18 +++++++++--------- openapi/paths/dataset/defaultDataset.yaml | 2 +- .../dataset/getColumnsFromDatasetFile.yaml | 2 +- .../s3/getExecutionsFilesPresignedUrls.yaml | 1 + openapi/paths/s3/getSignedUploadUrl.yaml | 1 + openapi/paths/s3/getUserDatasetFilesData.yaml | 1 + openapi/paths/test/none.yaml | 3 ++- .../paths/trainspace/create-trainspace.yaml | 1 + .../paths/trainspace/getTrainspaceData.yaml | 1 + 9 files changed, 18 insertions(+), 12 deletions(-) diff --git a/openapi/openapi.yaml b/openapi/openapi.yaml index efac395bc..5ece8720f 100644 --- a/openapi/openapi.yaml +++ b/openapi/openapi.yaml @@ -21,23 +21,23 @@ tags: - name: trainspace description: Everything about trainspace servers: - - url: https://example.com/api/v1 + - url: http://localhost:8000 paths: - /dataset/defaultDataset: + /api/dataset/defaultDataset: $ref: paths/dataset/defaultDataset.yaml - /dataset/getColumnsFromDatasetFile: + /api/dataset/getColumnsFromDatasetFile: $ref: paths/dataset/getColumnsFromDatasetFile.yaml - /s3/getExecutionsFilesPresignedUrls: + /api/s3/getExecutionsFilesPresignedUrls: $ref: paths/s3/getExecutionsFilesPresignedUrls.yaml - /s3/getSignedUploadUrl: + /api/s3/getSignedUploadUrl: $ref: paths/s3/getSignedUploadUrl.yaml - /s3/getUserDatasetFilesData: + /api/s3/getUserDatasetFilesData: $ref: paths/s3/getUserDatasetFilesData.yaml - /test: + /api/test: $ref: paths/test/none.yaml - /trainspace/create-trainspace: + /api/trainspace/create-trainspace: $ref: paths/trainspace/create-trainspace.yaml - /trainspace/getTrainspaceData: + /api/trainspace/getTrainspaceData: $ref: paths/trainspace/getTrainspaceData.yaml # components: # securitySchemes: diff --git a/openapi/paths/dataset/defaultDataset.yaml b/openapi/paths/dataset/defaultDataset.yaml index 8c6d399e2..f99b7708a 100644 --- a/openapi/paths/dataset/defaultDataset.yaml +++ b/openapi/paths/dataset/defaultDataset.yaml @@ -7,7 +7,7 @@ post: content: application/json: schema: - type: string + type: object required: - using_default_dataset properties: diff --git a/openapi/paths/dataset/getColumnsFromDatasetFile.yaml b/openapi/paths/dataset/getColumnsFromDatasetFile.yaml index 7195b5cb6..336aaa998 100644 --- a/openapi/paths/dataset/getColumnsFromDatasetFile.yaml +++ b/openapi/paths/dataset/getColumnsFromDatasetFile.yaml @@ -7,7 +7,7 @@ post: content: application/json: schema: - type: string + type: object required: - uid - data_source diff --git a/openapi/paths/s3/getExecutionsFilesPresignedUrls.yaml b/openapi/paths/s3/getExecutionsFilesPresignedUrls.yaml index a43cccdaf..6cddebcf3 100644 --- a/openapi/paths/s3/getExecutionsFilesPresignedUrls.yaml +++ b/openapi/paths/s3/getExecutionsFilesPresignedUrls.yaml @@ -1,4 +1,5 @@ post: + summary: Get S3 Presigned URLs for result files description: API Endpoint to use S3 Presigned URLs to retrieve result files from S3 given an execution id tags: - s3 diff --git a/openapi/paths/s3/getSignedUploadUrl.yaml b/openapi/paths/s3/getSignedUploadUrl.yaml index 39f070d97..95d07739c 100644 --- a/openapi/paths/s3/getSignedUploadUrl.yaml +++ b/openapi/paths/s3/getSignedUploadUrl.yaml @@ -1,4 +1,5 @@ post: + summary: Get Signed Upload URL description: Endpoint to upload files to S3 tags: - s3 diff --git a/openapi/paths/s3/getUserDatasetFilesData.yaml b/openapi/paths/s3/getUserDatasetFilesData.yaml index f261c07d2..3581217f0 100644 --- a/openapi/paths/s3/getUserDatasetFilesData.yaml +++ b/openapi/paths/s3/getUserDatasetFilesData.yaml @@ -1,4 +1,5 @@ post: + summary: Get User Dataset Files description: API Endpoint to retrieve all user dataset files uploaded in S3 tags: - s3 diff --git a/openapi/paths/test/none.yaml b/openapi/paths/test/none.yaml index 6cce90a07..695d483bc 100644 --- a/openapi/paths/test/none.yaml +++ b/openapi/paths/test/none.yaml @@ -1,5 +1,6 @@ get: - summary: A simple endpoint to test if our backend is alive + summary: Test Backend alive + description: A simple endpoint to test if our backend is alive tags: - test responses: diff --git a/openapi/paths/trainspace/create-trainspace.yaml b/openapi/paths/trainspace/create-trainspace.yaml index cafc08a9f..0cd402810 100644 --- a/openapi/paths/trainspace/create-trainspace.yaml +++ b/openapi/paths/trainspace/create-trainspace.yaml @@ -1,4 +1,5 @@ post: + summary: Create Trainspace 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 diff --git a/openapi/paths/trainspace/getTrainspaceData.yaml b/openapi/paths/trainspace/getTrainspaceData.yaml index 5c5c090ab..0911a3a3b 100644 --- a/openapi/paths/trainspace/getTrainspaceData.yaml +++ b/openapi/paths/trainspace/getTrainspaceData.yaml @@ -1,4 +1,5 @@ post: + summary: Get Trainspace Data description: API Endpoint to identify all trainspaces for a given user id. tags: - trainspace