Add endpoint for presigned uploads
This commit is contained in:
@@ -589,6 +589,32 @@ paths:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/CreatePresignedUrlResponse'
|
||||
|
||||
/api/buckets/{bucketName}/objects/{objectKey}/presigned-upload:
|
||||
parameters:
|
||||
- $ref: '#/components/parameters/BucketName'
|
||||
- $ref: '#/components/parameters/ObjectKey'
|
||||
post:
|
||||
operationId: createPresignedUpload
|
||||
tags:
|
||||
- Management - Presigned URLs
|
||||
summary: Create presigned upload URL
|
||||
description: Creates an empty object and returns a presigned URL for uploading content
|
||||
security:
|
||||
- ApiKey: []
|
||||
requestBody:
|
||||
required: true
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/CreatePresignedUploadRequest'
|
||||
responses:
|
||||
'201':
|
||||
description: Presigned URL created
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/CreatePresignedUrlResponse'
|
||||
components:
|
||||
schemas:
|
||||
CreatePresignedUrlResponse:
|
||||
@@ -597,6 +623,24 @@ components:
|
||||
url:
|
||||
type: string
|
||||
example: /my-bucket/file.txt?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIOSFODNN7EXAMPLE%2F20230115%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20230115T103000Z&X-Amz-Expires=3600&X-Amz-SignedHeaders=host&X-Amz-Signature=abc123&hash=def456
|
||||
CreatePresignedUploadRequest:
|
||||
type: object
|
||||
required:
|
||||
- access_key
|
||||
properties:
|
||||
access_key:
|
||||
type: string
|
||||
example: "AKIAIOSFODNN7EXAMPLE"
|
||||
expires_in:
|
||||
type: integer
|
||||
minimum: 1
|
||||
maximum: 604800
|
||||
default: 3600
|
||||
example: 3600
|
||||
content_type:
|
||||
type: string
|
||||
default: "application/octet-stream"
|
||||
example: "image/jpeg"
|
||||
ObjectSummary:
|
||||
type: object
|
||||
properties:
|
||||
|
||||
Reference in New Issue
Block a user