@@ -43,11 +43,11 @@ Uploading an asset file via the STAC API involves three main steps:
4343
4444 <ApiCodeBlock url =" /storage-prefix/{presignedUrl} " method =" PUT " />
4545
46- You may upload parts in parallel. It is possible to retry a failed upload.
46+ You may upload parts in parallel. It is possible to retry a failed upload.
4747
48- ::: warning
49- Presigned URLs expire within three hours, so the upload must be completed before that.
50- :::
48+ ::: warning
49+ Presigned URLs expire within three hours, so the upload must be completed before that.
50+ :::
5151
5252<br />
5353
@@ -144,56 +144,56 @@ The following example illustrates best practices for handling errors during repe
144144
1451451 . ** Create Asset Upload**
146146
147- <ApiCodeBlock url =" https://data.geo.admin.ch/api/stac/v1/collections/{collection}/items/{item}/assets/{asset}/uploads " method =" POST " />
147+ <ApiCodeBlock url =" https://data.geo.admin.ch/api/stac/v1/collections/{collection}/items/{item}/assets/{asset}/uploads " method =" POST " />
148148
149- Possible Responses:
149+ Possible Responses:
150150
151- | HTTP Response | Action Required |
152- | ------------------------------------------------------------------- | ----------------------------------------------------------------------- |
153- | ` 201 OK ` | Continue to step 2. |
154- | ` 400 Bad Request - "Upload already in progress" ` | Abort the existing upload (see below), then restart step 1. |
155- | ` 400 Bad Request - other errors ` | Cancel upload. Analyze and correct your request before retrying. |
156- | ` 500 Internal Server Error ` | Cancel upload. Report to service administrator (retry usually useless). |
157- | ` 502 Bad Gateway ` , ` 503 Service Unavailable ` , ` 504 Gateway Timeout ` | Retry later. Adjust wait time based on upload rate (minimum 100ms). |
151+ | HTTP Response | Action Required |
152+ | ------------------------------------------------------------------- | ----------------------------------------------------------------------- |
153+ | ` 201 OK ` | Continue to step 2. |
154+ | ` 400 Bad Request - "Upload already in progress" ` | Abort the existing upload (see below), then restart step 1. |
155+ | ` 400 Bad Request - other errors ` | Cancel upload. Analyze and correct your request before retrying. |
156+ | ` 500 Internal Server Error ` | Cancel upload. Report to service administrator (retry usually useless). |
157+ | ` 502 Bad Gateway ` , ` 503 Service Unavailable ` , ` 504 Gateway Timeout ` | Retry later. Adjust wait time based on upload rate (minimum 100ms). |
158158
159- If the response is ` {"description": "Upload already in progress", "code": 400} ` , you should abort the upload.
159+ If the response is ` {"description": "Upload already in progress", "code": 400} ` , you should abort the upload.
160160
161- ** a.** Get the ` upload_id ` of the upload marked in progress via:
161+ ** a.** Get the ` upload_id ` of the upload marked in progress via:
162162
163- <ApiCodeBlock url =" https://data.geo.admin.ch/api/stac/v1/collections/{collection}/items/{item}/assets/{asset}/uploads?status=in-progress " method =" GET " />
163+ <ApiCodeBlock url =" https://data.geo.admin.ch/api/stac/v1/collections/{collection}/items/{item}/assets/{asset}/uploads?status=in-progress " method =" GET " />
164164
165- ** b.** Abort the upload:
165+ ** b.** Abort the upload:
166166
167- <ApiCodeBlock url =" https://data.geo.admin.ch/api/stac/v1/collections/{collection}/items/{item}/assets/{asset}/uploads/{upload_id}/abort " method =" POST " />
167+ <ApiCodeBlock url =" https://data.geo.admin.ch/api/stac/v1/collections/{collection}/items/{item}/assets/{asset}/uploads/{upload_id}/abort " method =" POST " />
168168
169- ** c.** Restart the asset upload.
169+ ** c.** Restart the asset upload.
170170
1711712 . ** Upload the parts via the presigned URL from step 1**
172172
173- <ApiCodeBlock url =" {presigned_url} " method =" PUT " />
173+ <ApiCodeBlock url =" {presigned_url} " method =" PUT " />
174174
175- Possible Responses:
175+ Possible Responses:
176176
177- | HTTP Response | Action Required |
178- | ------------------------------------------------------------------- | ----------------------------------------------------------------------- |
179- | ` 200 OK ` | Continue to step 3. |
180- | ` 400 Bad Request ` | Abort upload |
181- | ` 500 Internal Server Error ` | Cancel upload. Report to service administrator (retry usually useless). |
182- | ` 502 Bad Gateway ` , ` 503 Service Unavailable ` , ` 504 Gateway Timeout ` | Retry step 2 after a short wait (minimum 100ms). |
177+ | HTTP Response | Action Required |
178+ | ------------------------------------------------------------------- | ----------------------------------------------------------------------- |
179+ | ` 200 OK ` | Continue to step 3. |
180+ | ` 400 Bad Request ` | Abort upload |
181+ | ` 500 Internal Server Error ` | Cancel upload. Report to service administrator (retry usually useless). |
182+ | ` 502 Bad Gateway ` , ` 503 Service Unavailable ` , ` 504 Gateway Timeout ` | Retry step 2 after a short wait (minimum 100ms). |
183183
1841843 . ** Complete the upload**
185185
186- <ApiCodeBlock url =" https://data.geo.admin.ch/api/stac/v1/collections/{collection}/items/{item}/assets/{asset}/uploads/{upload_id}/complete " method =" POST " />
186+ <ApiCodeBlock url =" https://data.geo.admin.ch/api/stac/v1/collections/{collection}/items/{item}/assets/{asset}/uploads/{upload_id}/complete " method =" POST " />
187187
188- Possible Responses:
188+ Possible Responses:
189189
190- | HTTP Response | Action Required |
191- | ------------------------------------------------------------------- | ---------------------------------------------------------------------------------- |
192- | ` 200 OK ` | Upload successful. |
193- | ` 400 Bad Request ` | Cancel upload |
194- | ` 500 Internal Server Error ` | Cancel upload. Report to service administrator (retry usually useless). |
195- | ` 502 Bad Gateway ` , ` 503 Service Unavailable ` , ` 504 Gateway Timeout ` | Service is momentarily not available, wait a short moment, then retry the request. |
190+ | HTTP Response | Action Required |
191+ | ------------------------------------------------------------------- | ---------------------------------------------------------------------------------- |
192+ | ` 200 OK ` | Upload successful. |
193+ | ` 400 Bad Request ` | Cancel upload |
194+ | ` 500 Internal Server Error ` | Cancel upload. Report to service administrator (retry usually useless). |
195+ | ` 502 Bad Gateway ` , ` 503 Service Unavailable ` , ` 504 Gateway Timeout ` | Service is momentarily not available, wait a short moment, then retry the request. |
196196
197- The following figure shows the flow of a multipart upload process.
197+ The following figure shows the flow of a multipart upload process.
198198
199- <img src =" ../../static/service-stac-upload-process.svg " />
199+ <img src =" ../../static/service-stac-upload-process.svg " />
0 commit comments