You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Ensures new uploads and resumed upload statuses always return an offset of 0. This allows future clients which support resumable upload to not attempt resumable upload on this version which does not support it.
- Add PATCH support for streaming data on upload.
- Add messaging to specification that PATCH with content range is currently not supported.
- Update PUT blob to only support full data or no data, no more last chunk messaging as it was not supported.
closesdistribution#470
Signed-off-by: Derek McGowan <[email protected]> (github: dmcgowan)
|`uuid`|path|A uuid identifying the upload. This field can accept characters that match `[a-zA-Z0-9-_.=]+`.|
2203
+
2204
+
2205
+
2206
+
2207
+
###### On Success: Data Accepted
2208
+
2209
+
```
2210
+
204 No Content
2211
+
Location: /v2/<name>/blobs/uploads/<uuid>
2212
+
Range: 0-<offset>
2213
+
Content-Length: 0
2214
+
Docker-Upload-UUID: <uuid>
2215
+
```
2216
+
2217
+
The stream of data has been accepted and the current progress is available in the range header. The updated upload location is available in the `Location` header.
2218
+
2219
+
The following headers will be returned with the response:
2220
+
2221
+
|Name|Description|
2222
+
|----|-----------|
2223
+
|`Location`|The location of the upload. Clients should assume this changes after each request. Clients should use the contents verbatim to complete the upload, adding parameters where required.|
2224
+
|`Range`|Range indicating the current progress of the upload.|
2225
+
|`Content-Length`|The `Content-Length` header must be zero and the body must be empty.|
2226
+
|`Docker-Upload-UUID`|Identifies the docker upload uuid for the current request.|
2227
+
2228
+
2229
+
2230
+
2231
+
###### On Failure: Bad Request
2232
+
2233
+
```
2234
+
400 Bad Request
2235
+
Content-Type: application/json; charset=utf-8
2236
+
2237
+
{
2238
+
"errors:" [
2239
+
{
2240
+
"code": <error code>,
2241
+
"message": "<error message>",
2242
+
"detail": ...
2243
+
},
2244
+
...
2245
+
]
2246
+
}
2247
+
```
2248
+
2249
+
There was an error processing the upload and it must be restarted.
2250
+
2251
+
2252
+
2253
+
The error codes that may be included in the response body are enumerated below:
2254
+
2255
+
|Code|Message|Description|
2256
+
-------|----|------|------------
2257
+
|`DIGEST_INVALID`| provided digest did not match uploaded content | When a blob is uploaded, the registry will check that the content matches the digest provided by the client. The error may include a detail structure with the key "digest", including the invalid digest string. This error may also be returned when a manifest includes an invalid layer digest. |
2258
+
|`NAME_INVALID`| invalid repository name | Invalid repository name encountered either during manifest validation or any API operation. |
2259
+
|`BLOB_UPLOAD_INVALID`| blob upload invalid | The blob upload encountered an error and can no longer proceed. |
2260
+
2261
+
2262
+
2263
+
###### On Failure: Unauthorized
2264
+
2265
+
```
2266
+
401 Unauthorized
2267
+
WWW-Authenticate: <scheme> realm="<realm>", ..."
2268
+
Content-Length: <length>
2269
+
Content-Type: application/json; charset=utf-8
2270
+
2271
+
{
2272
+
"errors:" [
2273
+
{
2274
+
"code": "UNAUTHORIZED",
2275
+
"message": "access to the requested resource is not authorized",
2276
+
"detail": ...
2277
+
},
2278
+
...
2279
+
]
2280
+
}
2281
+
```
2282
+
2283
+
The client does not have access to push to the repository.
2284
+
2285
+
The following headers will be returned on the response:
|`Content-Length`|Length of the JSON error response body.|
2291
+
2292
+
2293
+
2294
+
The error codes that may be included in the response body are enumerated below:
2295
+
2296
+
|Code|Message|Description|
2297
+
-------|----|------|------------
2298
+
|`UNAUTHORIZED`| access to the requested resource is not authorized | The access controller denied access for the operation on a resource. Often this will be accompanied by a 401 Unauthorized response status. |
2299
+
2300
+
2301
+
2302
+
###### On Failure: Not Found
2303
+
2304
+
```
2305
+
404 Not Found
2306
+
Content-Type: application/json; charset=utf-8
2307
+
2308
+
{
2309
+
"errors:" [
2310
+
{
2311
+
"code": <error code>,
2312
+
"message": "<error message>",
2313
+
"detail": ...
2314
+
},
2315
+
...
2316
+
]
2317
+
}
2318
+
```
2319
+
2320
+
The upload is unknown to the registry. The upload must be restarted.
2321
+
2322
+
2323
+
2324
+
The error codes that may be included in the response body are enumerated below:
2325
+
2326
+
|Code|Message|Description|
2327
+
-------|----|------|------------
2328
+
|`BLOB_UPLOAD_UNKNOWN`| blob upload unknown to registry | If a blob upload has been cancelled or was never started, this error code may be returned. |
Upload a chunk of data to specified upload without completing the upload.
2345
+
Upload a chunk of data to specified upload without completing the upload. The data will be uploaded to the specified Content Range.
2191
2346
2192
2347
2193
2348
The following parameters should be specified on the request:
@@ -2350,14 +2505,13 @@ Complete the upload specified by `uuid`, optionally appending the body as the fi
2350
2505
PUT /v2/<name>/blobs/uploads/<uuid>?digest=<digest>
2351
2506
Host: <registry host>
2352
2507
Authorization: <scheme> <token>
2353
-
Content-Range: <start of range>-<end of range, inclusive>
2354
-
Content-Length: <length of chunk>
2508
+
Content-Length: <length of data>
2355
2509
Content-Type: application/octet-stream
2356
2510
2357
-
<binary chunk>
2511
+
<binary data>
2358
2512
```
2359
2513
2360
-
Complete the upload, providing the _final_ chunk of data, if necessary. This method may take a body with all the data. If the `Content-Range` header is specified, it may include the final chunk. A request without a body will just complete the upload with previously uploaded content.
2514
+
Complete the upload, providing all the data in the body, if necessary. A request without a body will just complete the upload with previously uploaded content.
2361
2515
2362
2516
2363
2517
The following parameters should be specified on the request:
@@ -2366,8 +2520,7 @@ The following parameters should be specified on the request:
2366
2520
|----|----|-----------|
2367
2521
|`Host`|header|Standard HTTP Host Header. Should be set to the registry host.|
|`Content-Range`|header|Range of bytes identifying the block of content represented by the body. Start must the end offset retrieved via status check plus one. Note that this is a non-standard use of the `Content-Range` header. May be omitted if no data is provided.|
2370
-
|`Content-Length`|header|Length of the chunk being uploaded, corresponding to the length of the request body. May be zero if no data is provided.|
2523
+
|`Content-Length`|header|Length of the data being uploaded, corresponding to the length of the request body. May be zero if no data is provided.|
2371
2524
|`name`|path|Name of the target repository.|
2372
2525
|`uuid`|path|A uuid identifying the upload. This field can accept characters that match `[a-zA-Z0-9-_.=]+`.|
2373
2526
|`digest`|query|Digest of uploaded blob.|
@@ -2500,25 +2653,6 @@ The error codes that may be included in the response body are enumerated below:
2500
2653
2501
2654
2502
2655
2503
-
###### On Failure: Requested Range Not Satisfiable
2504
-
2505
-
```
2506
-
416 Requested Range Not Satisfiable
2507
-
Location: /v2/<name>/blobs/uploads/<uuid>
2508
-
Range: 0-<offset>
2509
-
```
2510
-
2511
-
The `Content-Range` specification cannot be accepted, either because it does not overlap with the current progress or it is invalid. The contents of the `Range` header may be used to resolve the condition.
2512
-
2513
-
The following headers will be returned on the response:
2514
-
2515
-
|Name|Description|
2516
-
|----|-----------|
2517
-
|`Location`|The location of the upload. Clients should assume this changes after each request. Clients should use the contents verbatim to complete the upload, adding parameters where required.|
2518
-
|`Range`|Range indicating the current progress of the upload.|
0 commit comments