Skip to content

Commit

Permalink
Allow multipart requests to cloud storages
Browse files Browse the repository at this point in the history
  • Loading branch information
SpecLad committed Mar 28, 2023
1 parent d194003 commit 7bf6885
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cvat/apps/engine/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -2091,6 +2091,10 @@ class CloudStorageViewSet(viewsets.GenericViewSet, mixins.ListModelMixin,
lookup_fields = {'owner': 'owner__username', 'name': 'display_name'}
iam_organization_field = 'organization'

# Multipart support is necessary here, as CloudStorageWriteSerializer
# contains a file field (secret_key).
parser_classes = _UPLOAD_PARSER_CLASSES

def get_serializer_class(self):
if self.request.method in ('POST', 'PATCH'):
return CloudStorageWriteSerializer
Expand Down
6 changes: 6 additions & 0 deletions cvat/schema.yml
Original file line number Diff line number Diff line change
Expand Up @@ -518,6 +518,9 @@ paths:
manifests:
- manifest.jsonl
summary: Create GCS
multipart/form-data:
schema:
$ref: '#/components/schemas/CloudStorageWriteRequest'
required: true
security:
- sessionAuth: []
Expand Down Expand Up @@ -647,6 +650,9 @@ paths:
manifests:
- manifest.jsonl
summary: Create GCS
multipart/form-data:
schema:
$ref: '#/components/schemas/PatchedCloudStorageWriteRequest'
security:
- sessionAuth: []
csrfAuth: []
Expand Down

0 comments on commit 7bf6885

Please sign in to comment.