Skip to content

Commit

Permalink
[a] Add support for POST to manifest endpoint (#5918)
Browse files Browse the repository at this point in the history
  • Loading branch information
dsotirho-ucsc committed Mar 27, 2024
1 parent f0576a3 commit da860a5
Show file tree
Hide file tree
Showing 6 changed files with 2,800 additions and 81 deletions.
22 changes: 11 additions & 11 deletions lambdas/service/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@
# changes and reset the minor version to zero. Otherwise, increment only
# the minor version for backwards compatible changes. A backwards
# compatible change is one that does not require updates to clients.
'version': '4.0'
'version': '4.1'
},
'tags': [
{
Expand Down Expand Up @@ -1279,8 +1279,8 @@ def manifest_route(*, fetch: bool, initiate: bool):
# want to complicate the API with this detail
('/fetch' if fetch else '')
+ ('/manifest/files' if initiate else '/manifest/files/{token}'),
# The initial PUT request is idempotent.
methods=['PUT' if initiate else 'GET'],
# The initial request is idempotent.
methods=['POST', 'PUT'] if initiate else ['GET'],
interactive=fetch,
cors=True,
path_spec=None if initiate else {
Expand Down Expand Up @@ -1308,9 +1308,9 @@ def manifest_route(*, fetch: bool, initiate: bool):
- a 302 redirect to the URL of an already prepared manifest.
This endpoint is not suitable for interactive use via the
Swagger UI. Please use [PUT /fetch/manifest/files][1] instead.
Swagger UI. Please use [POST /fetch/manifest/files][1] instead.
[1]: #operations-Manifests-put_fetch_manifest_files
[1]: #operations-Manifests-post_fetch_manifest_files
''') + parameter_hoisting_note if initiate and not fetch else fd('''
Check on the status of an ongoing manifest preparation job,
returning either
Expand All @@ -1328,12 +1328,12 @@ def manifest_route(*, fetch: bool, initiate: bool):
''') if not initiate and not fetch else fd('''
Create a manifest preparation job, returning a 200 status
response whose JSON body emulates the HTTP headers that would be
found in a response to an equivalent request to the [PUT
found in a response to an equivalent request to the [POST
/manifest/files][1] endpoint.
Whenever client-side JavaScript code is used in a web
application to request the preparation of a manifest from Azul,
this endpoint should be used instead of [PUT
this endpoint should be used instead of [POST
/manifest/files][1]. This way, the client can use XHR to make
the request, retaining full control over the handling of
redirects and enabling the client to bypass certain limitations
Expand All @@ -1343,7 +1343,7 @@ def manifest_route(*, fetch: bool, initiate: bool):
upper limit on the number of consecutive redirects, before the
manifest generation job is done.
[1]: #operations-Manifests-put_manifest_files
[1]: #operations-Manifests-post_manifest_files
''') + parameter_hoisting_note if initiate and fetch else fd('''
Check on the status of an ongoing manifest preparation job,
returning a 200 status response whose JSON body emulates the
Expand Down Expand Up @@ -1465,7 +1465,7 @@ def manifest_route(*, fetch: bool, initiate: bool):
'410': {
'description': fd('''
The manifest preparation job has expired. Request a
new preparation using the `PUT /manifest/files`
new preparation using the `POST /manifest/files`
endpoint.
''')
}
Expand All @@ -1481,9 +1481,9 @@ def manifest_route(*, fetch: bool, initiate: bool):
For a detailed description of these properties see the
documentation for the respective response headers
documented under ''') + (fd('''
[PUT /manifest/files][1].
[POST /manifest/files][1].
[1]: #operations-Manifests-put_manifest_files
[1]: #operations-Manifests-post_manifest_files
''') if initiate else fd('''
[GET /manifest/files/{token}][1].
Expand Down
Loading

0 comments on commit da860a5

Please sign in to comment.