Skip to content

Commit 97c8a43

Browse files
committed
chore(autorag+automl): RESTful refactor of S3 BFF endpoints
1 parent f5c2c10 commit 97c8a43

2 files changed

Lines changed: 12 additions & 13 deletions

File tree

packages/automl/api/openapi/automl.yaml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -180,8 +180,8 @@ paths:
180180
- 'displayName': Extracted from 'openshift.io/display-name' annotation if present
181181
- 'description': Extracted from 'openshift.io/description' annotation if present
182182
183-
/api/v1/s3/file:
184-
summary: Path used to get or upload a file in S3.
183+
/api/v1/s3/files/{key}:
184+
summary: Endpoints for working with a specific file from an S3-compatible connection.
185185
description: >-
186186
The REST endpoint/path used to retrieve or upload files in S3 storage.
187187
GET returns an arbitrary file with transfer-encoding: chunked for efficient streaming.
@@ -225,7 +225,7 @@ paths:
225225
type: string
226226
example: my-bucket
227227
- name: key
228-
in: query
228+
in: path
229229
required: true
230230
description: The S3 object key to retrieve
231231
schema:
@@ -318,7 +318,7 @@ paths:
318318
pattern: '^\S(.*\S)?$'
319319
example: my-bucket
320320
- name: key
321-
in: query
321+
in: path
322322
required: true
323323
description: >-
324324
Requested S3 object key for the upload. If an object already exists at this key,
@@ -380,8 +380,8 @@ paths:
380380
Returns 409 if the object key chosen after collision resolution still conflicts at upload time
381381
(e.g. concurrent writer); the client should retry the upload.
382382
383-
/api/v1/s3/file/schema:
384-
summary: Path used to get the schema (column names and types) of a CSV file from S3.
383+
/api/v1/s3/files/{key}/schema:
384+
summary: Endpoint to get the schema (column names and types) of a CSV file from an S3-compatible connection.
385385
description: >-
386386
The REST endpoint/path used to retrieve the schema of a CSV file from S3 storage.
387387
Reads the header and a minimum of 100 data rows to determine column names and infer data types.
@@ -448,7 +448,7 @@ paths:
448448
type: string
449449
example: my-bucket
450450
- name: key
451-
in: query
451+
in: path
452452
required: true
453453
description: The S3 object key (CSV file) to retrieve schema from
454454
schema:

packages/autorag/api/openapi/autorag.yaml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -151,8 +151,8 @@ paths:
151151
# S3 Endpoints
152152
# =============================================================================
153153

154-
/api/v1/s3/file:
155-
summary: Path used to get or upload a file in S3.
154+
/api/v1/s3/files/{key}:
155+
summary: Endpoints for working with a specific file from an S3-compatible connection.
156156
description: >-
157157
The REST endpoint/path used to retrieve or upload files in S3 storage.
158158
Uses the credentials from a specified Kubernetes secret to access the S3 bucket.
@@ -192,7 +192,7 @@ paths:
192192
pattern: '^\S(.*\S)?$'
193193
example: my-bucket
194194
- name: key
195-
in: query
195+
in: path
196196
required: true
197197
description: The S3 object key to retrieve
198198
schema:
@@ -275,7 +275,7 @@ paths:
275275
pattern: '^\S(.*\S)?$'
276276
example: my-bucket
277277
- name: key
278-
in: query
278+
in: path
279279
required: true
280280
description: The S3 object key where the file will be uploaded
281281
schema:
@@ -337,9 +337,8 @@ paths:
337337
Returns 409 if the object key chosen after collision resolution still conflicts at upload time
338338
(e.g. concurrent writer); the client should retry the upload.
339339
340-
# TODO [ Gustavo ] Ongoing discussion on what this endpoint and the other S3/file endpoint should be structured as
341340
/api/v1/s3/files:
342-
summary: Endpoints for dealing with multiple files within an S3-compatible connection
341+
summary: Endpoints for working with files from an S3-compatible connection.
343342
get:
344343
operationId: getS3Files
345344
summary: Get files from S3

0 commit comments

Comments
 (0)