github.com/mika/distribution@v2.2.2-0.20160108133430-a75790e3d8e0+incompatible/docs/spec/api.md (about) 1 <!--[metadata]> 2 +++ 3 title = "HTTP API V2" 4 description = "Specification for the Registry API." 5 keywords = ["registry, on-prem, images, tags, repository, distribution, api, advanced"] 6 [menu.main] 7 parent="smn_registry_ref" 8 +++ 9 <![end-metadata]--> 10 11 # Docker Registry HTTP API V2 12 13 ## Introduction 14 15 The _Docker Registry HTTP API_ is the protocol to facilitate distribution of 16 images to the docker engine. It interacts with instances of the docker 17 registry, which is a service to manage information about docker images and 18 enable their distribution. The specification covers the operation of version 2 19 of this API, known as _Docker Registry HTTP API V2_. 20 21 While the V1 registry protocol is usable, there are several problems with the 22 architecture that have led to this new version. The main driver of this 23 specification these changes to the docker the image format, covered in 24 [docker/docker#8093](https://github.com/docker/docker/issues/8093). The new, self-contained image manifest simplifies image 25 definition and improves security. This specification will build on that work, 26 leveraging new properties of the manifest format to improve performance, 27 reduce bandwidth usage and decrease the likelihood of backend corruption. 28 29 For relevant details and history leading up to this specification, please see 30 the following issues: 31 32 - [docker/docker#8093](https://github.com/docker/docker/issues/8093) 33 - [docker/docker#9015](https://github.com/docker/docker/issues/9015) 34 - [docker/docker-registry#612](https://github.com/docker/docker-registry/issues/612) 35 36 ### Scope 37 38 This specification covers the URL layout and protocols of the interaction 39 between docker registry and docker core. This will affect the docker core 40 registry API and the rewrite of docker-registry. Docker registry 41 implementations may implement other API endpoints, but they are not covered by 42 this specification. 43 44 This includes the following features: 45 46 - Namespace-oriented URI Layout 47 - PUSH/PULL registry server for V2 image manifest format 48 - Resumable layer PUSH support 49 - V2 Client library implementation 50 51 While authentication and authorization support will influence this 52 specification, details of the protocol will be left to a future specification. 53 Relevant header definitions and error codes are present to provide an 54 indication of what a client may encounter. 55 56 #### Future 57 58 There are features that have been discussed during the process of cutting this 59 specification. The following is an incomplete list: 60 61 - Immutable image references 62 - Multiple architecture support 63 - Migration from v2compatibility representation 64 65 These may represent features that are either out of the scope of this 66 specification, the purview of another specification or have been deferred to a 67 future version. 68 69 ### Use Cases 70 71 For the most part, the use cases of the former registry API apply to the new 72 version. Differentiating use cases are covered below. 73 74 #### Image Verification 75 76 A docker engine instance would like to run verified image named 77 "library/ubuntu", with the tag "latest". The engine contacts the registry, 78 requesting the manifest for "library/ubuntu:latest". An untrusted registry 79 returns a manifest. Before proceeding to download the individual layers, the 80 engine verifies the manifest's signature, ensuring that the content was 81 produced from a trusted source and no tampering has occured. After each layer 82 is downloaded, the engine verifies the digest of the layer, ensuring that the 83 content matches that specified by the manifest. 84 85 #### Resumable Push 86 87 Company X's build servers lose connectivity to docker registry before 88 completing an image layer transfer. After connectivity returns, the build 89 server attempts to re-upload the image. The registry notifies the build server 90 that the upload has already been partially attempted. The build server 91 responds by only sending the remaining data to complete the image file. 92 93 #### Resumable Pull 94 95 Company X is having more connectivity problems but this time in their 96 deployment datacenter. When downloading an image, the connection is 97 interrupted before completion. The client keeps the partial data and uses http 98 `Range` requests to avoid downloading repeated data. 99 100 #### Layer Upload De-duplication 101 102 Company Y's build system creates two identical docker layers from build 103 processes A and B. Build process A completes uploading the layer before B. 104 When process B attempts to upload the layer, the registry indicates that its 105 not necessary because the layer is already known. 106 107 If process A and B upload the same layer at the same time, both operations 108 will proceed and the first to complete will be stored in the registry (Note: 109 we may modify this to prevent dogpile with some locking mechanism). 110 111 ### Changes 112 113 The V2 specification has been written to work as a living document, specifying 114 only what is certain and leaving what is not specified open or to future 115 changes. Only non-conflicting additions should be made to the API and accepted 116 changes should avoid preventing future changes from happening. 117 118 This section should be updated when changes are made to the specification, 119 indicating what is different. Optionally, we may start marking parts of the 120 specification to correspond with the versions enumerated here. 121 122 Each set of changes is given a letter corresponding to a set of modifications 123 that were applied to the baseline specification. These are merely for 124 reference and shouldn't be used outside the specification other than to 125 identify a set of modifications. 126 127 <dl> 128 <dt>f</dt> 129 <dd> 130 <ul> 131 <li>Specify the delete API for layers and manifests.</li> 132 </ul> 133 </dd> 134 135 <dt>e</dt> 136 <dd> 137 <ul> 138 <li>Added support for listing registry contents.</li> 139 <li>Added pagination to tags API.</li> 140 <li>Added common approach to support pagination.</li> 141 </ul> 142 </dd> 143 144 <dt>d</dt> 145 <dd> 146 <ul> 147 <li>Allow repository name components to be one character.</li> 148 <li>Clarified that single component names are allowed.</li> 149 </ul> 150 </dd> 151 152 <dt>c</dt> 153 <dd> 154 <ul> 155 <li>Added section covering digest format.</li> 156 <li>Added more clarification that manifest cannot be deleted by tag.</li> 157 </ul> 158 </dd> 159 160 <dt>b</dt> 161 <dd> 162 <ul> 163 <li>Added capability of doing streaming upload to PATCH blob upload.</li> 164 <li>Updated PUT blob upload to no longer take final chunk, now requires entire data or no data.</li> 165 <li>Removed `416 Requested Range Not Satisfiable` response status from PUT blob upload.</li> 166 </ul> 167 </dd> 168 169 <dt>a</dt> 170 <dd> 171 <ul> 172 <li>Added support for immutable manifest references in manifest endpoints.</li> 173 <li>Deleting a manifest by tag has been deprecated.</li> 174 <li>Specified `Docker-Content-Digest` header for appropriate entities.</li> 175 <li>Added error code for unsupported operations.</li> 176 </ul> 177 </dd> 178 </dl> 179 180 ## Overview 181 182 This section covers client flows and details of the API endpoints. The URI 183 layout of the new API is structured to support a rich authentication and 184 authorization model by leveraging namespaces. All endpoints will be prefixed 185 by the API version and the repository name: 186 187 /v2/<name>/ 188 189 For example, an API endpoint that will work with the `library/ubuntu` 190 repository, the URI prefix will be: 191 192 /v2/library/ubuntu/ 193 194 This scheme provides rich access control over various operations and methods 195 using the URI prefix and http methods that can be controlled in variety of 196 ways. 197 198 Classically, repository names have always been two path components where each 199 path component is less than 30 characters. The V2 registry API does not 200 enforce this. The rules for a repository name are as follows: 201 202 1. A repository name is broken up into _path components_. A component of a 203 repository name must be at least one lowercase, alpha-numeric characters, 204 optionally separated by periods, dashes or underscores. More strictly, it 205 must match the regular expression `[a-z0-9]+(?:[._-][a-z0-9]+)*`. 206 2. If a repository name has two or more path components, they must be 207 separated by a forward slash ("/"). 208 3. The total length of a repository name, including slashes, must be less the 209 256 characters. 210 211 These name requirements _only_ apply to the registry API and should accept a 212 superset of what is supported by other docker ecosystem components. 213 214 All endpoints should support aggressive http caching, compression and range 215 headers, where appropriate. The new API attempts to leverage HTTP semantics 216 where possible but may break from standards to implement targeted features. 217 218 For detail on individual endpoints, please see the [_Detail_](#detail) 219 section. 220 221 ### Errors 222 223 Actionable failure conditions, covered in detail in their relevant sections, 224 are reported as part of 4xx responses, in a json response body. One or more 225 errors will be returned in the following format: 226 227 { 228 "errors:" [{ 229 "code": <error identifier>, 230 "message": <message describing condition>, 231 "detail": <unstructured> 232 }, 233 ... 234 ] 235 } 236 237 The `code` field will be a unique identifier, all caps with underscores by 238 convention. The `message` field will be a human readable string. The optional 239 `detail` field may contain arbitrary json data providing information the 240 client can use to resolve the issue. 241 242 While the client can take action on certain error codes, the registry may add 243 new error codes over time. All client implementations should treat unknown 244 error codes as `UNKNOWN`, allowing future error codes to be added without 245 breaking API compatibility. For the purposes of the specification error codes 246 will only be added and never removed. 247 248 For a complete account of all error codes, please see the _Detail_ section. 249 250 ### API Version Check 251 252 A minimal endpoint, mounted at `/v2/` will provide version support information 253 based on its response statuses. The request format is as follows: 254 255 GET /v2/ 256 257 If a `200 OK` response is returned, the registry implements the V2(.1) 258 registry API and the client may proceed safely with other V2 operations. 259 Optionally, the response may contain information about the supported paths in 260 the response body. The client should be prepared to ignore this data. 261 262 If a `401 Unauthorized` response is returned, the client should take action 263 based on the contents of the "WWW-Authenticate" header and try the endpoint 264 again. Depending on access control setup, the client may still have to 265 authenticate against different resources, even if this check succeeds. 266 267 If `404 Not Found` response status, or other unexpected status, is returned, 268 the client should proceed with the assumption that the registry does not 269 implement V2 of the API. 270 271 When a `200 OK` or `401 Unauthorized` response is returned, the 272 "Docker-Distribution-API-Version" header should be set to "registry/2.0". 273 Clients may require this header value to determine if the endpoint serves this 274 API. When this header is omitted, clients may fallback to an older API version. 275 276 ### Content Digests 277 278 This API design is driven heavily by [content addressability](http://en.wikipedia.org/wiki/Content-addressable_storage). 279 The core of this design is the concept of a content addressable identifier. It 280 uniquely identifies content by taking a collision-resistant hash of the bytes. 281 Such an identifier can be independently calculated and verified by selection 282 of a common _algorithm_. If such an identifier can be communicated in a secure 283 manner, one can retrieve the content from an insecure source, calculate it 284 independently and be certain that the correct content was obtained. Put simply, 285 the identifier is a property of the content. 286 287 To disambiguate from other concepts, we call this identifier a _digest_. A 288 _digest_ is a serialized hash result, consisting of a _algorithm_ and _hex_ 289 portion. The _algorithm_ identifies the methodology used to calculate the 290 digest. The _hex_ portion is the hex-encoded result of the hash. 291 292 We define a _digest_ string to match the following grammar: 293 ``` 294 digest := algorithm ":" hex 295 algorithm := /[A-Fa-f0-9_+.-]+/ 296 hex := /[A-Fa-f0-9]+/ 297 ``` 298 299 Some examples of _digests_ include the following: 300 301 digest | description | 302 ----------------------------------------------------------------------------------|------------------------------------------------ 303 sha256:6c3c624b58dbbcd3c0dd82b4c53f04194d1247c6eebdaab7c610cf7d66709b3b | Common sha256 based digest | 304 305 While the _algorithm_ does allow one to implement a wide variety of 306 algorithms, compliant implementations should use sha256. Heavy processing of 307 input before calculating a hash is discouraged to avoid degrading the 308 uniqueness of the _digest_ but some canonicalization may be performed to 309 ensure consistent identifiers. 310 311 Let's use a simple example in pseudo-code to demonstrate a digest calculation: 312 ``` 313 let C = 'a small string' 314 let B = sha256(C) 315 let D = 'sha256:' + EncodeHex(B) 316 let ID(C) = D 317 ``` 318 319 Above, we have bytestring `C` passed into a function, `SHA256`, that returns a 320 bytestring `B`, which is the hash of `C`. `D` gets the algorithm concatenated 321 with the hex encoding of `B`. We then define the identifier of `C` to `ID(C)` 322 as equal to `D`. A digest can be verified by independently calculating `D` and 323 comparing it with identifier `ID(C)`. 324 325 #### Digest Header 326 327 To provide verification of http content, any response may include a `Docker- 328 Content-Digest` header. This will include the digest of the target entity 329 returned in the response. For blobs, this is the entire blob content. For 330 manifests, this is the manifest body without the signature content, also known 331 as the JWS payload. Note that the commonly used canonicalization for digest 332 calculation may be dependent on the mediatype of the content, such as with 333 manifests. 334 335 The client may choose to ignore the header or may verify it to ensure content 336 integrity and transport security. This is most important when fetching by a 337 digest. To ensure security, the content should be verified against the digest 338 used to fetch the content. At times, the returned digest may differ from that 339 used to initiate a request. Such digests are considered to be from different 340 _domains_, meaning they have different values for _algorithm_. In such a case, 341 the client may choose to verify the digests in both domains or ignore the 342 server's digest. To maintain security, the client _must_ always verify the 343 content against the _digest_ used to fetch the content. 344 345 > __IMPORTANT:__ If a _digest_ is used to fetch content, the client should use 346 > the same digest used to fetch the content to verify it. The header `Docker- 347 > Content-Digest` should not be trusted over the "local" digest. 348 349 ### Pulling An Image 350 351 An "image" is a combination of a JSON manifest and individual layer files. The 352 process of pulling an image centers around retrieving these two components. 353 354 The first step in pulling an image is to retrieve the manifest. For reference, 355 the relevant manifest fields for the registry are the following: 356 357 field | description | 358 ----------|------------------------------------------------| 359 name | The name of the image. | 360 tag | The tag for this version of the image. | 361 fsLayers | A list of layer descriptors (including digest) | 362 signature | A JWS used to verify the manifest content | 363 364 For more information about the manifest format, please see 365 [docker/docker#8093](https://github.com/docker/docker/issues/8093). 366 367 When the manifest is in hand, the client must verify the signature to ensure 368 the names and layers are valid. Once confirmed, the client will then use the 369 digests to download the individual layers. Layers are stored in as blobs in 370 the V2 registry API, keyed by their digest. 371 372 #### Pulling an Image Manifest 373 374 The image manifest can be fetched with the following url: 375 376 ``` 377 GET /v2/<name>/manifests/<reference> 378 ``` 379 380 The `name` and `reference` parameter identify the image and are required. The 381 reference may include a tag or digest. 382 383 A `404 Not Found` response will be returned if the image is unknown to the 384 registry. If the image exists and the response is successful, the image 385 manifest will be returned, with the following format (see docker/docker#8093 386 for details): 387 388 { 389 "name": <name>, 390 "tag": <tag>, 391 "fsLayers": [ 392 { 393 "blobSum": <digest> 394 }, 395 ... 396 ] 397 ], 398 "history": <v1 images>, 399 "signature": <JWS> 400 } 401 402 The client should verify the returned manifest signature for authenticity 403 before fetching layers. 404 405 ##### Existing Manifests 406 407 The image manifest can be checked for existence with the following url: 408 409 ``` 410 HEAD /v2/<name>/manifests/<reference> 411 ``` 412 413 The `name` and `reference` parameter identify the image and are required. The 414 reference may include a tag or digest. 415 416 A `404 Not Found` response will be returned if the image is unknown to the 417 registry. If the image exists and the response is successful the response will 418 be as follows: 419 420 ``` 421 200 OK 422 Content-Length: <length of manifest> 423 Docker-Content-Digest: <digest> 424 ``` 425 426 427 #### Pulling a Layer 428 429 Layers are stored in the blob portion of the registry, keyed by digest. 430 Pulling a layer is carried out by a standard http request. The URL is as 431 follows: 432 433 GET /v2/<name>/blobs/<digest> 434 435 Access to a layer will be gated by the `name` of the repository but is 436 identified uniquely in the registry by `digest`. 437 438 This endpoint may issue a 307 (302 for <HTTP 1.1) redirect to another service 439 for downloading the layer and clients should be prepared to handle redirects. 440 441 This endpoint should support aggressive HTTP caching for image layers. Support 442 for Etags, modification dates and other cache control headers should be 443 included. To allow for incremental downloads, `Range` requests should be 444 supported, as well. 445 446 ### Pushing An Image 447 448 Pushing an image works in the opposite order as a pull. After assembling the 449 image manifest, the client must first push the individual layers. When the 450 layers are fully pushed into the registry, the client should upload the signed 451 manifest. 452 453 The details of each step of the process are covered in the following sections. 454 455 #### Pushing a Layer 456 457 All layer uploads use two steps to manage the upload process. The first step 458 starts the upload in the registry service, returning a url to carry out the 459 second step. The second step uses the upload url to transfer the actual data. 460 Uploads are started with a POST request which returns a url that can be used 461 to push data and check upload status. 462 463 The `Location` header will be used to communicate the upload location after 464 each request. While it won't change in the this specification, clients should 465 use the most recent value returned by the API. 466 467 ##### Starting An Upload 468 469 To begin the process, a POST request should be issued in the following format: 470 471 ``` 472 POST /v2/<name>/blobs/uploads/ 473 ``` 474 475 The parameters of this request are the image namespace under which the layer 476 will be linked. Responses to this request are covered below. 477 478 ##### Existing Layers 479 480 The existence of a layer can be checked via a `HEAD` request to the blob store 481 API. The request should be formatted as follows: 482 483 ``` 484 HEAD /v2/<name>/blobs/<digest> 485 ``` 486 487 If the layer with the digest specified in `digest` is available, a 200 OK 488 response will be received, with no actual body content (this is according to 489 http specification). The response will look as follows: 490 491 ``` 492 200 OK 493 Content-Length: <length of blob> 494 Docker-Content-Digest: <digest> 495 ``` 496 497 When this response is received, the client can assume that the layer is 498 already available in the registry under the given name and should take no 499 further action to upload the layer. Note that the binary digests may differ 500 for the existing registry layer, but the digests will be guaranteed to match. 501 502 ##### Uploading the Layer 503 504 If the POST request is successful, a `202 Accepted` response will be returned 505 with the upload URL in the `Location` header: 506 507 ``` 508 202 Accepted 509 Location: /v2/<name>/blobs/uploads/<uuid> 510 Range: bytes=0-<offset> 511 Content-Length: 0 512 Docker-Upload-UUID: <uuid> 513 ``` 514 515 The rest of the upload process can be carried out with the returned url, 516 called the "Upload URL" from the `Location` header. All responses to the 517 upload url, whether sending data or getting status, will be in this format. 518 Though the URI format (`/v2/<name>/blobs/uploads/<uuid>`) for the `Location` 519 header is specified, clients should treat it as an opaque url and should never 520 try to assemble the it. While the `uuid` parameter may be an actual UUID, this 521 proposal imposes no constraints on the format and clients should never impose 522 any. 523 524 If clients need to correlate local upload state with remote upload state, the 525 contents of the `Docker-Upload-UUID` header should be used. Such an id can be 526 used to key the last used location header when implementing resumable uploads. 527 528 ##### Upload Progress 529 530 The progress and chunk coordination of the upload process will be coordinated 531 through the `Range` header. While this is a non-standard use of the `Range` 532 header, there are examples of [similar approaches](https://developers.google.com/youtube/v3/guides/using_resumable_upload_protocol) in APIs with heavy use. 533 For an upload that just started, for an example with a 1000 byte layer file, 534 the `Range` header would be as follows: 535 536 ``` 537 Range: bytes=0-0 538 ``` 539 540 To get the status of an upload, issue a GET request to the upload URL: 541 542 ``` 543 GET /v2/<name>/blobs/uploads/<uuid> 544 Host: <registry host> 545 ``` 546 547 The response will be similar to the above, except will return 204 status: 548 549 ``` 550 204 No Content 551 Location: /v2/<name>/blobs/uploads/<uuid> 552 Range: bytes=0-<offset> 553 Docker-Upload-UUID: <uuid> 554 ``` 555 556 Note that the HTTP `Range` header byte ranges are inclusive and that will be 557 honored, even in non-standard use cases. 558 559 ##### Monolithic Upload 560 561 A monolithic upload is simply a chunked upload with a single chunk and may be 562 favored by clients that would like to avoided the complexity of chunking. To 563 carry out a "monolithic" upload, one can simply put the entire content blob to 564 the provided URL: 565 566 ``` 567 PUT /v2/<name>/blobs/uploads/<uuid>?digest=<digest> 568 Content-Length: <size of layer> 569 Content-Type: application/octet-stream 570 571 <Layer Binary Data> 572 ``` 573 574 The "digest" parameter must be included with the PUT request. Please see the 575 _Completed Upload_ section for details on the parameters and expected 576 responses. 577 578 Additionally, the upload can be completed with a single `POST` request to 579 the uploads endpoint, including the "size" and "digest" parameters: 580 581 ``` 582 POST /v2/<name>/blobs/uploads/?digest=<digest> 583 Content-Length: <size of layer> 584 Content-Type: application/octet-stream 585 586 <Layer Binary Data> 587 ``` 588 589 On the registry service, this should allocate a download, accept and verify 590 the data and return the same response as the final chunk of an upload. If the 591 POST request fails collecting the data in any way, the registry should attempt 592 to return an error response to the client with the `Location` header providing 593 a place to continue the download. 594 595 The single `POST` method is provided for convenience and most clients should 596 implement `POST` + `PUT` to support reliable resume of uploads. 597 598 ##### Chunked Upload 599 600 To carry out an upload of a chunk, the client can specify a range header and 601 only include that part of the layer file: 602 603 ``` 604 PATCH /v2/<name>/blobs/uploads/<uuid> 605 Content-Length: <size of chunk> 606 Content-Range: <start of range>-<end of range> 607 Content-Type: application/octet-stream 608 609 <Layer Chunk Binary Data> 610 ``` 611 612 There is no enforcement on layer chunk splits other than that the server must 613 receive them in order. The server may enforce a minimum chunk size. If the 614 server cannot accept the chunk, a `416 Requested Range Not Satisfiable` 615 response will be returned and will include a `Range` header indicating the 616 current status: 617 618 ``` 619 416 Requested Range Not Satisfiable 620 Location: /v2/<name>/blobs/uploads/<uuid> 621 Range: 0-<last valid range> 622 Content-Length: 0 623 Docker-Upload-UUID: <uuid> 624 ``` 625 626 If this response is received, the client should resume from the "last valid 627 range" and upload the subsequent chunk. A 416 will be returned under the 628 following conditions: 629 630 - Invalid Content-Range header format 631 - Out of order chunk: the range of the next chunk must start immediately after 632 the "last valid range" from the previous response. 633 634 When a chunk is accepted as part of the upload, a `202 Accepted` response will 635 be returned, including a `Range` header with the current upload status: 636 637 ``` 638 202 Accepted 639 Location: /v2/<name>/blobs/uploads/<uuid> 640 Range: bytes=0-<offset> 641 Content-Length: 0 642 Docker-Upload-UUID: <uuid> 643 ``` 644 645 ##### Completed Upload 646 647 For an upload to be considered complete, the client must submit a `PUT` 648 request on the upload endpoint with a digest parameter. If it is not provided, 649 the upload will not be considered complete. The format for the final chunk 650 will be as follows: 651 652 ``` 653 PUT /v2/<name>/blob/uploads/<uuid>?digest=<digest> 654 Content-Length: <size of chunk> 655 Content-Range: <start of range>-<end of range> 656 Content-Type: application/octet-stream 657 658 <Last Layer Chunk Binary Data> 659 ``` 660 661 Optionally, if all chunks have already been uploaded, a `PUT` request with a 662 `digest` parameter and zero-length body may be sent to complete and validated 663 the upload. Multiple "digest" parameters may be provided with different 664 digests. The server may verify none or all of them but _must_ notify the 665 client if the content is rejected. 666 667 When the last chunk is received and the layer has been validated, the client 668 will receive a `201 Created` response: 669 670 ``` 671 201 Created 672 Location: /v2/<name>/blobs/<digest> 673 Content-Length: 0 674 Docker-Content-Digest: <digest> 675 ``` 676 677 The `Location` header will contain the registry URL to access the accepted 678 layer file. The `Docker-Content-Digest` header returns the canonical digest of 679 the uploaded blob which may differ from the provided digest. Most clients may 680 ignore the value but if it is used, the client should verify the value against 681 the uploaded blob data. 682 683 ###### Digest Parameter 684 685 The "digest" parameter is designed as an opaque parameter to support 686 verification of a successful transfer. For example, a HTTP URI parameter 687 might be as follows: 688 689 ``` 690 sha256:6c3c624b58dbbcd3c0dd82b4c53f04194d1247c6eebdaab7c610cf7d66709b3b 691 ``` 692 693 Given this parameter, the registry will verify that the provided content does 694 match this digest. 695 696 ##### Canceling an Upload 697 698 An upload can be cancelled by issuing a DELETE request to the upload endpoint. 699 The format will be as follows: 700 701 ``` 702 DELETE /v2/<name>/blobs/uploads/<uuid> 703 ``` 704 705 After this request is issued, the upload uuid will no longer be valid and the 706 registry server will dump all intermediate data. While uploads will time out 707 if not completed, clients should issue this request if they encounter a fatal 708 error but still have the ability to issue an http request. 709 710 ##### Errors 711 712 If an 502, 503 or 504 error is received, the client should assume that the 713 download can proceed due to a temporary condition, honoring the appropriate 714 retry mechanism. Other 5xx errors should be treated as terminal. 715 716 If there is a problem with the upload, a 4xx error will be returned indicating 717 the problem. After receiving a 4xx response (except 416, as called out above), 718 the upload will be considered failed and the client should take appropriate 719 action. 720 721 Note that the upload url will not be available forever. If the upload uuid is 722 unknown to the registry, a `404 Not Found` response will be returned and the 723 client must restart the upload process. 724 725 ### Deleting a Layer 726 727 A layer may be deleted from the registry via its `name` and `digest`. A 728 delete may be issued with the following request format: 729 730 DELETE /v2/<name>/blobs/<digest> 731 732 If the blob exists and has been successfully deleted, the following response 733 will be issued: 734 735 202 Accepted 736 Content-Length: None 737 738 If the blob had already been deleted or did not exist, a `404 Not Found` 739 response will be issued instead. 740 741 If a layer is deleted which is referenced by a manifest in the registry, 742 then the complete images will not be resolvable. 743 744 #### Pushing an Image Manifest 745 746 Once all of the layers for an image are uploaded, the client can upload the 747 image manifest. An image can be pushed using the following request format: 748 749 PUT /v2/<name>/manifests/<reference> 750 751 { 752 "name": <name>, 753 "tag": <tag>, 754 "fsLayers": [ 755 { 756 "blobSum": <digest> 757 }, 758 ... 759 ] 760 ], 761 "history": <v1 images>, 762 "signature": <JWS>, 763 ... 764 } 765 766 The `name` and `reference` fields of the response body must match those specified in 767 the URL. The `reference` field may be a "tag" or a "digest". 768 769 If there is a problem with pushing the manifest, a relevant 4xx response will 770 be returned with a JSON error message. Please see the _PUT Manifest section 771 for details on possible error codes that may be returned. 772 773 If one or more layers are unknown to the registry, `BLOB_UNKNOWN` errors are 774 returned. The `detail` field of the error response will have a `digest` field 775 identifying the missing blob. An error is returned for each unknown blob. The 776 response format is as follows: 777 778 { 779 "errors:" [{ 780 "code": "BLOB_UNKNOWN", 781 "message": "blob unknown to registry", 782 "detail": { 783 "digest": <digest> 784 } 785 }, 786 ... 787 ] 788 } 789 790 ### Listing Repositories 791 792 Images are stored in collections, known as a _repository_, which is keyed by a 793 `name`, as seen throughout the API specification. A registry instance may 794 contain several repositories. The list of available repositories is made 795 available through the _catalog_. 796 797 The catalog for a given registry can be retrieved with the following request: 798 799 ``` 800 GET /v2/_catalog 801 ``` 802 803 The response will be in the following format: 804 805 ``` 806 200 OK 807 Content-Type: application/json 808 809 { 810 "repositories": [ 811 <name>, 812 ... 813 ] 814 } 815 ``` 816 817 Note that the contents of the response are specific to the registry 818 implementation. Some registries may opt to provide a full catalog output, 819 limit it based on the user's access level or omit upstream results, if 820 providing mirroring functionality. Subsequently, the presence of a repository 821 in the catalog listing only means that the registry *may* provide access to 822 the repository at the time of the request. Conversely, a missing entry does 823 *not* mean that the registry does not have the repository. More succinctly, 824 the presence of a repository only guarantees that it is there but not that it 825 is _not_ there. 826 827 For registries with a large number of repositories, this response may be quite 828 large. If such a response is expected, one should use pagination. A registry 829 may also limit the amount of responses returned even if pagination was not 830 explicitly requested. In this case the `Link` header will be returned along 831 with the results, and subsequent results can be obtained by following the link 832 as if pagination had been initially requested. 833 834 For details of the `Link` header, please see the _Pagination_ section. 835 836 #### Pagination 837 838 Paginated catalog results can be retrieved by adding an `n` parameter to the 839 request URL, declaring that the response should be limited to `n` results. 840 Starting a paginated flow begins as follows: 841 842 ``` 843 GET /v2/_catalog?n=<integer> 844 ``` 845 846 The above specifies that a catalog response should be returned, from the start of 847 the result set, ordered lexically, limiting the number of results to `n`. The 848 response to such a request would look as follows: 849 850 ``` 851 200 OK 852 Content-Type: application/json 853 Link: <<url>?n=<n from the request>&last=<last repository in response>>; rel="next" 854 855 { 856 "repositories": [ 857 <name>, 858 ... 859 ] 860 } 861 ``` 862 863 The above includes the _first_ `n` entries from the result set. To get the 864 _next_ `n` entries, one can create a URL where the argument `last` has the 865 value from `repositories[len(repositories)-1]`. If there are indeed more 866 results, the URL for the next block is encoded in an 867 [RFC5988](https://tools.ietf.org/html/rfc5988) `Link` header, as a "next" 868 relation. The presence of the `Link` header communicates to the client that 869 the entire result set has not been returned and another request must be 870 issued. If the header is not present, the client can assume that all results 871 have been recieved. 872 873 > __NOTE:__ In the request template above, note that the brackets 874 > are required. For example, if the url is 875 > `http://example.com/v2/_catalog?n=20&last=b`, the value of the header would 876 > be `<http://example.com/v2/_catalog?n=20&last=b>; rel="next"`. Please see 877 > [RFC5988](https://tools.ietf.org/html/rfc5988) for details. 878 879 Compliant client implementations should always use the `Link` header 880 value when proceeding through results linearly. The client may construct URLs 881 to skip forward in the catalog. 882 883 To get the next result set, a client would issue the request as follows, using 884 the URL encoded in the described `Link` header: 885 886 ``` 887 GET /v2/_catalog?n=<n from the request>&last=<last repository value from previous response> 888 ``` 889 890 The above process should then be repeated until the `Link` header is no longer 891 set. 892 893 The catalog result set is represented abstractly as a lexically sorted list, 894 where the position in that list can be specified by the query term `last`. The 895 entries in the response start _after_ the term specified by `last`, up to `n` 896 entries. 897 898 The behavior of `last` is quite simple when demonstrated with an example. Let 899 us say the registry has the following repositories: 900 901 ``` 902 a 903 b 904 c 905 d 906 ``` 907 908 If the value of `n` is 2, _a_ and _b_ will be returned on the first response. 909 The `Link` header returned on the response will have `n` set to 2 and last set 910 to _b_: 911 912 ``` 913 Link: <<url>?n=2&last=b>; rel="next" 914 ``` 915 916 The client can then issue the request with above value from the `Link` header, 917 receiving the values _c_ and _d_. Note that n may change on second to last 918 response or be omitted fully, if the server may so choose. 919 920 ### Listing Image Tags 921 922 It may be necessary to list all of the tags under a given repository. The tags 923 for an image repository can be retrieved with the following request: 924 925 GET /v2/<name>/tags/list 926 927 The response will be in the following format: 928 929 200 OK 930 Content-Type: application/json 931 932 { 933 "name": <name>, 934 "tags": [ 935 <tag>, 936 ... 937 ] 938 } 939 940 For repositories with a large number of tags, this response may be quite 941 large. If such a response is expected, one should use the pagination. 942 943 #### Pagination 944 945 Paginated tag results can be retrieved by adding the appropriate parameters to 946 the request URL described above. The behavior of tag pagination is identical 947 to that specified for catalog pagination. We cover a simple flow to highlight 948 any differences. 949 950 Starting a paginated flow may begin as follows: 951 952 ``` 953 GET /v2/<name>/tags/list?n=<integer> 954 ``` 955 956 The above specifies that a tags response should be returned, from the start of 957 the result set, ordered lexically, limiting the number of results to `n`. The 958 response to such a request would look as follows: 959 960 ``` 961 200 OK 962 Content-Type: application/json 963 Link: <<url>?n=<n from the request>&last=<last tag value from previous response>>; rel="next" 964 965 { 966 "name": <name>, 967 "tags": [ 968 <tag>, 969 ... 970 ] 971 } 972 ``` 973 974 To get the next result set, a client would issue the request as follows, using 975 the value encoded in the [RFC5988](https://tools.ietf.org/html/rfc5988) `Link` 976 header: 977 978 ``` 979 GET /v2/<name>/tags/list?n=<n from the request>&last=<last tag value from previous response> 980 ``` 981 982 The above process should then be repeated until the `Link` header is no longer 983 set in the response. The behavior of the `last` parameter, the provided 984 response result, lexical ordering and encoding of the `Link` header are 985 identical to that of catalog pagination. 986 987 ### Deleting an Image 988 989 An image may be deleted from the registry via its `name` and `reference`. A 990 delete may be issued with the following request format: 991 992 DELETE /v2/<name>/manifests/<reference> 993 994 For deletes, `reference` *must* be a digest or the delete will fail. If the 995 image exists and has been successfully deleted, the following response will be 996 issued: 997 998 202 Accepted 999 Content-Length: None 1000 1001 If the image had already been deleted or did not exist, a `404 Not Found` 1002 response will be issued instead. 1003 1004 ## Detail 1005 1006 > **Note**: This section is still under construction. For the purposes of 1007 > implementation, if any details below differ from the described request flows 1008 > above, the section below should be corrected. When they match, this note 1009 > should be removed. 1010 1011 The behavior of the endpoints are covered in detail in this section, organized 1012 by route and entity. All aspects of the request and responses are covered, 1013 including headers, parameters and body formats. Examples of requests and their 1014 corresponding responses, with success and failure, are enumerated. 1015 1016 > **Note**: The sections on endpoint detail are arranged with an example 1017 > request, a description of the request, followed by information about that 1018 > request. 1019 1020 A list of methods and URIs are covered in the table below: 1021 1022 |Method|Path|Entity|Description| 1023 |------|----|------|-----------| 1024 | GET | `/v2/` | Base | Check that the endpoint implements Docker Registry API V2. | 1025 | GET | `/v2/<name>/tags/list` | Tags | Fetch the tags under the repository identified by `name`. | 1026 | GET | `/v2/<name>/manifests/<reference>` | Manifest | Fetch the manifest identified by `name` and `reference` where `reference` can be a tag or digest. | 1027 | PUT | `/v2/<name>/manifests/<reference>` | Manifest | Put the manifest identified by `name` and `reference` where `reference` can be a tag or digest. | 1028 | DELETE | `/v2/<name>/manifests/<reference>` | Manifest | Delete the manifest identified by `name` and `reference`. Note that a manifest can _only_ be deleted by `digest`. | 1029 | GET | `/v2/<name>/blobs/<digest>` | Blob | Retrieve the blob from the registry identified by `digest`. A `HEAD` request can also be issued to this endpoint to obtain resource information without receiving all data. | 1030 | DELETE | `/v2/<name>/blobs/<digest>` | Blob | Delete the blob identified by `name` and `digest` | 1031 | POST | `/v2/<name>/blobs/uploads/` | Initiate Blob Upload | Initiate a resumable blob upload. If successful, an upload location will be provided to complete the upload. Optionally, if the `digest` parameter is present, the request body will be used to complete the upload in a single request. | 1032 | GET | `/v2/<name>/blobs/uploads/<uuid>` | Blob Upload | Retrieve status of upload identified by `uuid`. The primary purpose of this endpoint is to resolve the current status of a resumable upload. | 1033 | PATCH | `/v2/<name>/blobs/uploads/<uuid>` | Blob Upload | Upload a chunk of data for the specified upload. | 1034 | PUT | `/v2/<name>/blobs/uploads/<uuid>` | Blob Upload | Complete the upload specified by `uuid`, optionally appending the body as the final chunk. | 1035 | DELETE | `/v2/<name>/blobs/uploads/<uuid>` | Blob Upload | Cancel outstanding upload processes, releasing associated resources. If this is not called, the unfinished uploads will eventually timeout. | 1036 | GET | `/v2/_catalog` | Catalog | Retrieve a sorted, json list of repositories available in the registry. | 1037 1038 1039 The detail for each endpoint is covered in the following sections. 1040 1041 ### Errors 1042 1043 The error codes encountered via the API are enumerated in the following table: 1044 1045 |Code|Message|Description| 1046 |----|-------|-----------| 1047 `BLOB_UNKNOWN` | blob unknown to registry | This error may be returned when a blob is unknown to the registry in a specified repository. This can be returned with a standard get or if a manifest references an unknown layer during upload. 1048 `BLOB_UPLOAD_INVALID` | blob upload invalid | The blob upload encountered an error and can no longer proceed. 1049 `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. 1050 `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. 1051 `MANIFEST_BLOB_UNKNOWN` | blob unknown to registry | This error may be returned when a manifest blob is unknown to the registry. 1052 `MANIFEST_INVALID` | manifest invalid | During upload, manifests undergo several checks ensuring validity. If those checks fail, this error may be returned, unless a more specific error is included. The detail will contain information the failed validation. 1053 `MANIFEST_UNKNOWN` | manifest unknown | This error is returned when the manifest, identified by name and tag is unknown to the repository. 1054 `MANIFEST_UNVERIFIED` | manifest failed signature verification | During manifest upload, if the manifest fails signature verification, this error will be returned. 1055 `NAME_INVALID` | invalid repository name | Invalid repository name encountered either during manifest validation or any API operation. 1056 `NAME_UNKNOWN` | repository name not known to registry | This is returned if the name used during an operation is unknown to the registry. 1057 `SIZE_INVALID` | provided length did not match content length | When a layer is uploaded, the provided size will be checked against the uploaded content. If they do not match, this error will be returned. 1058 `TAG_INVALID` | manifest tag did not match URI | During a manifest upload, if the tag in the manifest does not match the uri tag, this error will be returned. 1059 `UNAUTHORIZED` | authentication required | The access controller was unable to authenticate the client. Often this will be accompanied by a Www-Authenticate HTTP response header indicating how to authenticate. 1060 `DENIED` | requested access to the resource is denied | The access controller denied access for the operation on a resource. 1061 `UNSUPPORTED` | The operation is unsupported. | The operation was unsupported due to a missing implementation or invalid set of parameters. 1062 1063 1064 1065 ### Base 1066 1067 Base V2 API route. Typically, this can be used for lightweight version checks and to validate registry authentication. 1068 1069 1070 1071 #### GET Base 1072 1073 Check that the endpoint implements Docker Registry API V2. 1074 1075 1076 1077 ``` 1078 GET /v2/ 1079 Host: <registry host> 1080 Authorization: <scheme> <token> 1081 ``` 1082 1083 1084 1085 1086 The following parameters should be specified on the request: 1087 1088 |Name|Kind|Description| 1089 |----|----|-----------| 1090 |`Host`|header|Standard HTTP Host Header. Should be set to the registry host.| 1091 |`Authorization`|header|An RFC7235 compliant authorization header.| 1092 1093 1094 1095 1096 ###### On Success: OK 1097 1098 ``` 1099 200 OK 1100 ``` 1101 1102 The API implements V2 protocol and is accessible. 1103 1104 1105 1106 1107 ###### On Failure: Not Found 1108 1109 ``` 1110 404 Not Found 1111 ``` 1112 1113 The registry does not implement the V2 API. 1114 1115 1116 1117 ###### On Failure: Authentication Required 1118 1119 ``` 1120 401 Unauthorized 1121 WWW-Authenticate: <scheme> realm="<realm>", ..." 1122 Content-Length: <length> 1123 Content-Type: application/json; charset=utf-8 1124 1125 { 1126 "errors:" [ 1127 { 1128 "code": <error code>, 1129 "message": "<error message>", 1130 "detail": ... 1131 }, 1132 ... 1133 ] 1134 } 1135 ``` 1136 1137 The client is not authenticated. 1138 1139 The following headers will be returned on the response: 1140 1141 |Name|Description| 1142 |----|-----------| 1143 |`WWW-Authenticate`|An RFC7235 compliant authentication challenge header.| 1144 |`Content-Length`|Length of the JSON response body.| 1145 1146 1147 1148 The error codes that may be included in the response body are enumerated below: 1149 1150 |Code|Message|Description| 1151 |----|-------|-----------| 1152 | `UNAUTHORIZED` | authentication required | The access controller was unable to authenticate the client. Often this will be accompanied by a Www-Authenticate HTTP response header indicating how to authenticate. | 1153 1154 1155 1156 1157 1158 ### Tags 1159 1160 Retrieve information about tags. 1161 1162 1163 1164 #### GET Tags 1165 1166 Fetch the tags under the repository identified by `name`. 1167 1168 1169 ##### Tags 1170 1171 ``` 1172 GET /v2/<name>/tags/list 1173 Host: <registry host> 1174 Authorization: <scheme> <token> 1175 ``` 1176 1177 Return all tags for the repository 1178 1179 1180 The following parameters should be specified on the request: 1181 1182 |Name|Kind|Description| 1183 |----|----|-----------| 1184 |`Host`|header|Standard HTTP Host Header. Should be set to the registry host.| 1185 |`Authorization`|header|An RFC7235 compliant authorization header.| 1186 |`name`|path|Name of the target repository.| 1187 1188 1189 1190 1191 ###### On Success: OK 1192 1193 ``` 1194 200 OK 1195 Content-Length: <length> 1196 Content-Type: application/json; charset=utf-8 1197 1198 { 1199 "name": <name>, 1200 "tags": [ 1201 <tag>, 1202 ... 1203 ] 1204 } 1205 ``` 1206 1207 A list of tags for the named repository. 1208 1209 The following headers will be returned with the response: 1210 1211 |Name|Description| 1212 |----|-----------| 1213 |`Content-Length`|Length of the JSON response body.| 1214 1215 1216 1217 1218 ###### On Failure: Authentication Required 1219 1220 ``` 1221 401 Unauthorized 1222 WWW-Authenticate: <scheme> realm="<realm>", ..." 1223 Content-Length: <length> 1224 Content-Type: application/json; charset=utf-8 1225 1226 { 1227 "errors:" [ 1228 { 1229 "code": <error code>, 1230 "message": "<error message>", 1231 "detail": ... 1232 }, 1233 ... 1234 ] 1235 } 1236 ``` 1237 1238 The client is not authenticated. 1239 1240 The following headers will be returned on the response: 1241 1242 |Name|Description| 1243 |----|-----------| 1244 |`WWW-Authenticate`|An RFC7235 compliant authentication challenge header.| 1245 |`Content-Length`|Length of the JSON response body.| 1246 1247 1248 1249 The error codes that may be included in the response body are enumerated below: 1250 1251 |Code|Message|Description| 1252 |----|-------|-----------| 1253 | `UNAUTHORIZED` | authentication required | The access controller was unable to authenticate the client. Often this will be accompanied by a Www-Authenticate HTTP response header indicating how to authenticate. | 1254 1255 1256 1257 ###### On Failure: No Such Repository Error 1258 1259 ``` 1260 404 Not Found 1261 Content-Length: <length> 1262 Content-Type: application/json; charset=utf-8 1263 1264 { 1265 "errors:" [ 1266 { 1267 "code": <error code>, 1268 "message": "<error message>", 1269 "detail": ... 1270 }, 1271 ... 1272 ] 1273 } 1274 ``` 1275 1276 The repository is not known to the registry. 1277 1278 The following headers will be returned on the response: 1279 1280 |Name|Description| 1281 |----|-----------| 1282 |`Content-Length`|Length of the JSON response body.| 1283 1284 1285 1286 The error codes that may be included in the response body are enumerated below: 1287 1288 |Code|Message|Description| 1289 |----|-------|-----------| 1290 | `NAME_UNKNOWN` | repository name not known to registry | This is returned if the name used during an operation is unknown to the registry. | 1291 1292 1293 1294 ###### On Failure: Access Denied 1295 1296 ``` 1297 403 Forbidden 1298 Content-Length: <length> 1299 Content-Type: application/json; charset=utf-8 1300 1301 { 1302 "errors:" [ 1303 { 1304 "code": <error code>, 1305 "message": "<error message>", 1306 "detail": ... 1307 }, 1308 ... 1309 ] 1310 } 1311 ``` 1312 1313 The client does not have required access to the repository. 1314 1315 The following headers will be returned on the response: 1316 1317 |Name|Description| 1318 |----|-----------| 1319 |`Content-Length`|Length of the JSON response body.| 1320 1321 1322 1323 The error codes that may be included in the response body are enumerated below: 1324 1325 |Code|Message|Description| 1326 |----|-------|-----------| 1327 | `DENIED` | requested access to the resource is denied | The access controller denied access for the operation on a resource. | 1328 1329 1330 1331 ##### Tags Paginated 1332 1333 ``` 1334 GET /v2/<name>/tags/list?n=<integer>&last=<integer> 1335 ``` 1336 1337 Return a portion of the tags for the specified repository. 1338 1339 1340 The following parameters should be specified on the request: 1341 1342 |Name|Kind|Description| 1343 |----|----|-----------| 1344 |`name`|path|Name of the target repository.| 1345 |`n`|query|Limit the number of entries in each response. It not present, all entries will be returned.| 1346 |`last`|query|Result set will include values lexically after last.| 1347 1348 1349 1350 1351 ###### On Success: OK 1352 1353 ``` 1354 200 OK 1355 Content-Length: <length> 1356 Link: <<url>?n=<last n value>&last=<last entry from response>>; rel="next" 1357 Content-Type: application/json; charset=utf-8 1358 1359 { 1360 "name": <name>, 1361 "tags": [ 1362 <tag>, 1363 ... 1364 ], 1365 } 1366 ``` 1367 1368 A list of tags for the named repository. 1369 1370 The following headers will be returned with the response: 1371 1372 |Name|Description| 1373 |----|-----------| 1374 |`Content-Length`|Length of the JSON response body.| 1375 |`Link`|RFC5988 compliant rel='next' with URL to next result set, if available| 1376 1377 1378 1379 1380 ###### On Failure: Authentication Required 1381 1382 ``` 1383 401 Unauthorized 1384 WWW-Authenticate: <scheme> realm="<realm>", ..." 1385 Content-Length: <length> 1386 Content-Type: application/json; charset=utf-8 1387 1388 { 1389 "errors:" [ 1390 { 1391 "code": <error code>, 1392 "message": "<error message>", 1393 "detail": ... 1394 }, 1395 ... 1396 ] 1397 } 1398 ``` 1399 1400 The client is not authenticated. 1401 1402 The following headers will be returned on the response: 1403 1404 |Name|Description| 1405 |----|-----------| 1406 |`WWW-Authenticate`|An RFC7235 compliant authentication challenge header.| 1407 |`Content-Length`|Length of the JSON response body.| 1408 1409 1410 1411 The error codes that may be included in the response body are enumerated below: 1412 1413 |Code|Message|Description| 1414 |----|-------|-----------| 1415 | `UNAUTHORIZED` | authentication required | The access controller was unable to authenticate the client. Often this will be accompanied by a Www-Authenticate HTTP response header indicating how to authenticate. | 1416 1417 1418 1419 ###### On Failure: No Such Repository Error 1420 1421 ``` 1422 404 Not Found 1423 Content-Length: <length> 1424 Content-Type: application/json; charset=utf-8 1425 1426 { 1427 "errors:" [ 1428 { 1429 "code": <error code>, 1430 "message": "<error message>", 1431 "detail": ... 1432 }, 1433 ... 1434 ] 1435 } 1436 ``` 1437 1438 The repository is not known to the registry. 1439 1440 The following headers will be returned on the response: 1441 1442 |Name|Description| 1443 |----|-----------| 1444 |`Content-Length`|Length of the JSON response body.| 1445 1446 1447 1448 The error codes that may be included in the response body are enumerated below: 1449 1450 |Code|Message|Description| 1451 |----|-------|-----------| 1452 | `NAME_UNKNOWN` | repository name not known to registry | This is returned if the name used during an operation is unknown to the registry. | 1453 1454 1455 1456 ###### On Failure: Access Denied 1457 1458 ``` 1459 403 Forbidden 1460 Content-Length: <length> 1461 Content-Type: application/json; charset=utf-8 1462 1463 { 1464 "errors:" [ 1465 { 1466 "code": <error code>, 1467 "message": "<error message>", 1468 "detail": ... 1469 }, 1470 ... 1471 ] 1472 } 1473 ``` 1474 1475 The client does not have required access to the repository. 1476 1477 The following headers will be returned on the response: 1478 1479 |Name|Description| 1480 |----|-----------| 1481 |`Content-Length`|Length of the JSON response body.| 1482 1483 1484 1485 The error codes that may be included in the response body are enumerated below: 1486 1487 |Code|Message|Description| 1488 |----|-------|-----------| 1489 | `DENIED` | requested access to the resource is denied | The access controller denied access for the operation on a resource. | 1490 1491 1492 1493 1494 1495 ### Manifest 1496 1497 Create, update, delete and retrieve manifests. 1498 1499 1500 1501 #### GET Manifest 1502 1503 Fetch the manifest identified by `name` and `reference` where `reference` can be a tag or digest. 1504 1505 1506 1507 ``` 1508 GET /v2/<name>/manifests/<reference> 1509 Host: <registry host> 1510 Authorization: <scheme> <token> 1511 ``` 1512 1513 1514 1515 1516 The following parameters should be specified on the request: 1517 1518 |Name|Kind|Description| 1519 |----|----|-----------| 1520 |`Host`|header|Standard HTTP Host Header. Should be set to the registry host.| 1521 |`Authorization`|header|An RFC7235 compliant authorization header.| 1522 |`name`|path|Name of the target repository.| 1523 |`reference`|path|Tag or digest of the target manifest.| 1524 1525 1526 1527 1528 ###### On Success: OK 1529 1530 ``` 1531 200 OK 1532 Docker-Content-Digest: <digest> 1533 Content-Type: application/json; charset=utf-8 1534 1535 { 1536 "name": <name>, 1537 "tag": <tag>, 1538 "fsLayers": [ 1539 { 1540 "blobSum": "<digest>" 1541 }, 1542 ... 1543 ] 1544 ], 1545 "history": <v1 images>, 1546 "signature": <JWS> 1547 } 1548 ``` 1549 1550 The manifest identified by `name` and `reference`. The contents can be used to identify and resolve resources required to run the specified image. 1551 1552 The following headers will be returned with the response: 1553 1554 |Name|Description| 1555 |----|-----------| 1556 |`Docker-Content-Digest`|Digest of the targeted content for the request.| 1557 1558 1559 1560 1561 ###### On Failure: Bad Request 1562 1563 ``` 1564 400 Bad Request 1565 Content-Type: application/json; charset=utf-8 1566 1567 { 1568 "errors:" [ 1569 { 1570 "code": <error code>, 1571 "message": "<error message>", 1572 "detail": ... 1573 }, 1574 ... 1575 ] 1576 } 1577 ``` 1578 1579 The name or reference was invalid. 1580 1581 1582 1583 The error codes that may be included in the response body are enumerated below: 1584 1585 |Code|Message|Description| 1586 |----|-------|-----------| 1587 | `NAME_INVALID` | invalid repository name | Invalid repository name encountered either during manifest validation or any API operation. | 1588 | `TAG_INVALID` | manifest tag did not match URI | During a manifest upload, if the tag in the manifest does not match the uri tag, this error will be returned. | 1589 1590 1591 1592 ###### On Failure: Authentication Required 1593 1594 ``` 1595 401 Unauthorized 1596 WWW-Authenticate: <scheme> realm="<realm>", ..." 1597 Content-Length: <length> 1598 Content-Type: application/json; charset=utf-8 1599 1600 { 1601 "errors:" [ 1602 { 1603 "code": <error code>, 1604 "message": "<error message>", 1605 "detail": ... 1606 }, 1607 ... 1608 ] 1609 } 1610 ``` 1611 1612 The client is not authenticated. 1613 1614 The following headers will be returned on the response: 1615 1616 |Name|Description| 1617 |----|-----------| 1618 |`WWW-Authenticate`|An RFC7235 compliant authentication challenge header.| 1619 |`Content-Length`|Length of the JSON response body.| 1620 1621 1622 1623 The error codes that may be included in the response body are enumerated below: 1624 1625 |Code|Message|Description| 1626 |----|-------|-----------| 1627 | `UNAUTHORIZED` | authentication required | The access controller was unable to authenticate the client. Often this will be accompanied by a Www-Authenticate HTTP response header indicating how to authenticate. | 1628 1629 1630 1631 ###### On Failure: No Such Repository Error 1632 1633 ``` 1634 404 Not Found 1635 Content-Length: <length> 1636 Content-Type: application/json; charset=utf-8 1637 1638 { 1639 "errors:" [ 1640 { 1641 "code": <error code>, 1642 "message": "<error message>", 1643 "detail": ... 1644 }, 1645 ... 1646 ] 1647 } 1648 ``` 1649 1650 The repository is not known to the registry. 1651 1652 The following headers will be returned on the response: 1653 1654 |Name|Description| 1655 |----|-----------| 1656 |`Content-Length`|Length of the JSON response body.| 1657 1658 1659 1660 The error codes that may be included in the response body are enumerated below: 1661 1662 |Code|Message|Description| 1663 |----|-------|-----------| 1664 | `NAME_UNKNOWN` | repository name not known to registry | This is returned if the name used during an operation is unknown to the registry. | 1665 1666 1667 1668 ###### On Failure: Access Denied 1669 1670 ``` 1671 403 Forbidden 1672 Content-Length: <length> 1673 Content-Type: application/json; charset=utf-8 1674 1675 { 1676 "errors:" [ 1677 { 1678 "code": <error code>, 1679 "message": "<error message>", 1680 "detail": ... 1681 }, 1682 ... 1683 ] 1684 } 1685 ``` 1686 1687 The client does not have required access to the repository. 1688 1689 The following headers will be returned on the response: 1690 1691 |Name|Description| 1692 |----|-----------| 1693 |`Content-Length`|Length of the JSON response body.| 1694 1695 1696 1697 The error codes that may be included in the response body are enumerated below: 1698 1699 |Code|Message|Description| 1700 |----|-------|-----------| 1701 | `DENIED` | requested access to the resource is denied | The access controller denied access for the operation on a resource. | 1702 1703 1704 1705 1706 #### PUT Manifest 1707 1708 Put the manifest identified by `name` and `reference` where `reference` can be a tag or digest. 1709 1710 1711 1712 ``` 1713 PUT /v2/<name>/manifests/<reference> 1714 Host: <registry host> 1715 Authorization: <scheme> <token> 1716 Content-Type: application/json; charset=utf-8 1717 1718 { 1719 "name": <name>, 1720 "tag": <tag>, 1721 "fsLayers": [ 1722 { 1723 "blobSum": "<digest>" 1724 }, 1725 ... 1726 ] 1727 ], 1728 "history": <v1 images>, 1729 "signature": <JWS> 1730 } 1731 ``` 1732 1733 1734 1735 1736 The following parameters should be specified on the request: 1737 1738 |Name|Kind|Description| 1739 |----|----|-----------| 1740 |`Host`|header|Standard HTTP Host Header. Should be set to the registry host.| 1741 |`Authorization`|header|An RFC7235 compliant authorization header.| 1742 |`name`|path|Name of the target repository.| 1743 |`reference`|path|Tag or digest of the target manifest.| 1744 1745 1746 1747 1748 ###### On Success: Created 1749 1750 ``` 1751 201 Created 1752 Location: <url> 1753 Content-Length: 0 1754 Docker-Content-Digest: <digest> 1755 ``` 1756 1757 The manifest has been accepted by the registry and is stored under the specified `name` and `tag`. 1758 1759 The following headers will be returned with the response: 1760 1761 |Name|Description| 1762 |----|-----------| 1763 |`Location`|The canonical location url of the uploaded manifest.| 1764 |`Content-Length`|The `Content-Length` header must be zero and the body must be empty.| 1765 |`Docker-Content-Digest`|Digest of the targeted content for the request.| 1766 1767 1768 1769 1770 ###### On Failure: Invalid Manifest 1771 1772 ``` 1773 400 Bad Request 1774 Content-Type: application/json; charset=utf-8 1775 1776 { 1777 "errors:" [ 1778 { 1779 "code": <error code>, 1780 "message": "<error message>", 1781 "detail": ... 1782 }, 1783 ... 1784 ] 1785 } 1786 ``` 1787 1788 The received manifest was invalid in some way, as described by the error codes. The client should resolve the issue and retry the request. 1789 1790 1791 1792 The error codes that may be included in the response body are enumerated below: 1793 1794 |Code|Message|Description| 1795 |----|-------|-----------| 1796 | `NAME_INVALID` | invalid repository name | Invalid repository name encountered either during manifest validation or any API operation. | 1797 | `TAG_INVALID` | manifest tag did not match URI | During a manifest upload, if the tag in the manifest does not match the uri tag, this error will be returned. | 1798 | `MANIFEST_INVALID` | manifest invalid | During upload, manifests undergo several checks ensuring validity. If those checks fail, this error may be returned, unless a more specific error is included. The detail will contain information the failed validation. | 1799 | `MANIFEST_UNVERIFIED` | manifest failed signature verification | During manifest upload, if the manifest fails signature verification, this error will be returned. | 1800 | `BLOB_UNKNOWN` | blob unknown to registry | This error may be returned when a blob is unknown to the registry in a specified repository. This can be returned with a standard get or if a manifest references an unknown layer during upload. | 1801 1802 1803 1804 ###### On Failure: Authentication Required 1805 1806 ``` 1807 401 Unauthorized 1808 WWW-Authenticate: <scheme> realm="<realm>", ..." 1809 Content-Length: <length> 1810 Content-Type: application/json; charset=utf-8 1811 1812 { 1813 "errors:" [ 1814 { 1815 "code": <error code>, 1816 "message": "<error message>", 1817 "detail": ... 1818 }, 1819 ... 1820 ] 1821 } 1822 ``` 1823 1824 The client is not authenticated. 1825 1826 The following headers will be returned on the response: 1827 1828 |Name|Description| 1829 |----|-----------| 1830 |`WWW-Authenticate`|An RFC7235 compliant authentication challenge header.| 1831 |`Content-Length`|Length of the JSON response body.| 1832 1833 1834 1835 The error codes that may be included in the response body are enumerated below: 1836 1837 |Code|Message|Description| 1838 |----|-------|-----------| 1839 | `UNAUTHORIZED` | authentication required | The access controller was unable to authenticate the client. Often this will be accompanied by a Www-Authenticate HTTP response header indicating how to authenticate. | 1840 1841 1842 1843 ###### On Failure: No Such Repository Error 1844 1845 ``` 1846 404 Not Found 1847 Content-Length: <length> 1848 Content-Type: application/json; charset=utf-8 1849 1850 { 1851 "errors:" [ 1852 { 1853 "code": <error code>, 1854 "message": "<error message>", 1855 "detail": ... 1856 }, 1857 ... 1858 ] 1859 } 1860 ``` 1861 1862 The repository is not known to the registry. 1863 1864 The following headers will be returned on the response: 1865 1866 |Name|Description| 1867 |----|-----------| 1868 |`Content-Length`|Length of the JSON response body.| 1869 1870 1871 1872 The error codes that may be included in the response body are enumerated below: 1873 1874 |Code|Message|Description| 1875 |----|-------|-----------| 1876 | `NAME_UNKNOWN` | repository name not known to registry | This is returned if the name used during an operation is unknown to the registry. | 1877 1878 1879 1880 ###### On Failure: Access Denied 1881 1882 ``` 1883 403 Forbidden 1884 Content-Length: <length> 1885 Content-Type: application/json; charset=utf-8 1886 1887 { 1888 "errors:" [ 1889 { 1890 "code": <error code>, 1891 "message": "<error message>", 1892 "detail": ... 1893 }, 1894 ... 1895 ] 1896 } 1897 ``` 1898 1899 The client does not have required access to the repository. 1900 1901 The following headers will be returned on the response: 1902 1903 |Name|Description| 1904 |----|-----------| 1905 |`Content-Length`|Length of the JSON response body.| 1906 1907 1908 1909 The error codes that may be included in the response body are enumerated below: 1910 1911 |Code|Message|Description| 1912 |----|-------|-----------| 1913 | `DENIED` | requested access to the resource is denied | The access controller denied access for the operation on a resource. | 1914 1915 1916 1917 ###### On Failure: Missing Layer(s) 1918 1919 ``` 1920 400 Bad Request 1921 Content-Type: application/json; charset=utf-8 1922 1923 { 1924 "errors:" [{ 1925 "code": "BLOB_UNKNOWN", 1926 "message": "blob unknown to registry", 1927 "detail": { 1928 "digest": "<digest>" 1929 } 1930 }, 1931 ... 1932 ] 1933 } 1934 ``` 1935 1936 One or more layers may be missing during a manifest upload. If so, the missing layers will be enumerated in the error response. 1937 1938 1939 1940 The error codes that may be included in the response body are enumerated below: 1941 1942 |Code|Message|Description| 1943 |----|-------|-----------| 1944 | `BLOB_UNKNOWN` | blob unknown to registry | This error may be returned when a blob is unknown to the registry in a specified repository. This can be returned with a standard get or if a manifest references an unknown layer during upload. | 1945 1946 1947 1948 ###### On Failure: Not allowed 1949 1950 ``` 1951 405 Method Not Allowed 1952 ``` 1953 1954 Manifest put is not allowed because the registry is configured as a pull-through cache or for some other reason 1955 1956 1957 1958 The error codes that may be included in the response body are enumerated below: 1959 1960 |Code|Message|Description| 1961 |----|-------|-----------| 1962 | `UNSUPPORTED` | The operation is unsupported. | The operation was unsupported due to a missing implementation or invalid set of parameters. | 1963 1964 1965 1966 1967 #### DELETE Manifest 1968 1969 Delete the manifest identified by `name` and `reference`. Note that a manifest can _only_ be deleted by `digest`. 1970 1971 1972 1973 ``` 1974 DELETE /v2/<name>/manifests/<reference> 1975 Host: <registry host> 1976 Authorization: <scheme> <token> 1977 ``` 1978 1979 1980 1981 1982 The following parameters should be specified on the request: 1983 1984 |Name|Kind|Description| 1985 |----|----|-----------| 1986 |`Host`|header|Standard HTTP Host Header. Should be set to the registry host.| 1987 |`Authorization`|header|An RFC7235 compliant authorization header.| 1988 |`name`|path|Name of the target repository.| 1989 |`reference`|path|Tag or digest of the target manifest.| 1990 1991 1992 1993 1994 ###### On Success: Accepted 1995 1996 ``` 1997 202 Accepted 1998 ``` 1999 2000 2001 2002 2003 2004 2005 ###### On Failure: Invalid Name or Reference 2006 2007 ``` 2008 400 Bad Request 2009 Content-Type: application/json; charset=utf-8 2010 2011 { 2012 "errors:" [ 2013 { 2014 "code": <error code>, 2015 "message": "<error message>", 2016 "detail": ... 2017 }, 2018 ... 2019 ] 2020 } 2021 ``` 2022 2023 The specified `name` or `reference` were invalid and the delete was unable to proceed. 2024 2025 2026 2027 The error codes that may be included in the response body are enumerated below: 2028 2029 |Code|Message|Description| 2030 |----|-------|-----------| 2031 | `NAME_INVALID` | invalid repository name | Invalid repository name encountered either during manifest validation or any API operation. | 2032 | `TAG_INVALID` | manifest tag did not match URI | During a manifest upload, if the tag in the manifest does not match the uri tag, this error will be returned. | 2033 2034 2035 2036 ###### On Failure: Authentication Required 2037 2038 ``` 2039 401 Unauthorized 2040 WWW-Authenticate: <scheme> realm="<realm>", ..." 2041 Content-Length: <length> 2042 Content-Type: application/json; charset=utf-8 2043 2044 { 2045 "errors:" [ 2046 { 2047 "code": <error code>, 2048 "message": "<error message>", 2049 "detail": ... 2050 }, 2051 ... 2052 ] 2053 } 2054 ``` 2055 2056 The client is not authenticated. 2057 2058 The following headers will be returned on the response: 2059 2060 |Name|Description| 2061 |----|-----------| 2062 |`WWW-Authenticate`|An RFC7235 compliant authentication challenge header.| 2063 |`Content-Length`|Length of the JSON response body.| 2064 2065 2066 2067 The error codes that may be included in the response body are enumerated below: 2068 2069 |Code|Message|Description| 2070 |----|-------|-----------| 2071 | `UNAUTHORIZED` | authentication required | The access controller was unable to authenticate the client. Often this will be accompanied by a Www-Authenticate HTTP response header indicating how to authenticate. | 2072 2073 2074 2075 ###### On Failure: No Such Repository Error 2076 2077 ``` 2078 404 Not Found 2079 Content-Length: <length> 2080 Content-Type: application/json; charset=utf-8 2081 2082 { 2083 "errors:" [ 2084 { 2085 "code": <error code>, 2086 "message": "<error message>", 2087 "detail": ... 2088 }, 2089 ... 2090 ] 2091 } 2092 ``` 2093 2094 The repository is not known to the registry. 2095 2096 The following headers will be returned on the response: 2097 2098 |Name|Description| 2099 |----|-----------| 2100 |`Content-Length`|Length of the JSON response body.| 2101 2102 2103 2104 The error codes that may be included in the response body are enumerated below: 2105 2106 |Code|Message|Description| 2107 |----|-------|-----------| 2108 | `NAME_UNKNOWN` | repository name not known to registry | This is returned if the name used during an operation is unknown to the registry. | 2109 2110 2111 2112 ###### On Failure: Access Denied 2113 2114 ``` 2115 403 Forbidden 2116 Content-Length: <length> 2117 Content-Type: application/json; charset=utf-8 2118 2119 { 2120 "errors:" [ 2121 { 2122 "code": <error code>, 2123 "message": "<error message>", 2124 "detail": ... 2125 }, 2126 ... 2127 ] 2128 } 2129 ``` 2130 2131 The client does not have required access to the repository. 2132 2133 The following headers will be returned on the response: 2134 2135 |Name|Description| 2136 |----|-----------| 2137 |`Content-Length`|Length of the JSON response body.| 2138 2139 2140 2141 The error codes that may be included in the response body are enumerated below: 2142 2143 |Code|Message|Description| 2144 |----|-------|-----------| 2145 | `DENIED` | requested access to the resource is denied | The access controller denied access for the operation on a resource. | 2146 2147 2148 2149 ###### On Failure: Unknown Manifest 2150 2151 ``` 2152 404 Not Found 2153 Content-Type: application/json; charset=utf-8 2154 2155 { 2156 "errors:" [ 2157 { 2158 "code": <error code>, 2159 "message": "<error message>", 2160 "detail": ... 2161 }, 2162 ... 2163 ] 2164 } 2165 ``` 2166 2167 The specified `name` or `reference` are unknown to the registry and the delete was unable to proceed. Clients can assume the manifest was already deleted if this response is returned. 2168 2169 2170 2171 The error codes that may be included in the response body are enumerated below: 2172 2173 |Code|Message|Description| 2174 |----|-------|-----------| 2175 | `NAME_UNKNOWN` | repository name not known to registry | This is returned if the name used during an operation is unknown to the registry. | 2176 | `MANIFEST_UNKNOWN` | manifest unknown | This error is returned when the manifest, identified by name and tag is unknown to the repository. | 2177 2178 2179 2180 ###### On Failure: Not allowed 2181 2182 ``` 2183 405 Method Not Allowed 2184 ``` 2185 2186 Manifest delete is not allowed because the registry is configured as a pull-through cache or `delete` has been disabled. 2187 2188 2189 2190 The error codes that may be included in the response body are enumerated below: 2191 2192 |Code|Message|Description| 2193 |----|-------|-----------| 2194 | `UNSUPPORTED` | The operation is unsupported. | The operation was unsupported due to a missing implementation or invalid set of parameters. | 2195 2196 2197 2198 2199 2200 ### Blob 2201 2202 Operations on blobs identified by `name` and `digest`. Used to fetch or delete layers by digest. 2203 2204 2205 2206 #### GET Blob 2207 2208 Retrieve the blob from the registry identified by `digest`. A `HEAD` request can also be issued to this endpoint to obtain resource information without receiving all data. 2209 2210 2211 ##### Fetch Blob 2212 2213 ``` 2214 GET /v2/<name>/blobs/<digest> 2215 Host: <registry host> 2216 Authorization: <scheme> <token> 2217 ``` 2218 2219 2220 2221 2222 The following parameters should be specified on the request: 2223 2224 |Name|Kind|Description| 2225 |----|----|-----------| 2226 |`Host`|header|Standard HTTP Host Header. Should be set to the registry host.| 2227 |`Authorization`|header|An RFC7235 compliant authorization header.| 2228 |`name`|path|Name of the target repository.| 2229 |`digest`|path|Digest of desired blob.| 2230 2231 2232 2233 2234 ###### On Success: OK 2235 2236 ``` 2237 200 OK 2238 Content-Length: <length> 2239 Docker-Content-Digest: <digest> 2240 Content-Type: application/octet-stream 2241 2242 <blob binary data> 2243 ``` 2244 2245 The blob identified by `digest` is available. The blob content will be present in the body of the request. 2246 2247 The following headers will be returned with the response: 2248 2249 |Name|Description| 2250 |----|-----------| 2251 |`Content-Length`|The length of the requested blob content.| 2252 |`Docker-Content-Digest`|Digest of the targeted content for the request.| 2253 2254 ###### On Success: Temporary Redirect 2255 2256 ``` 2257 307 Temporary Redirect 2258 Location: <blob location> 2259 Docker-Content-Digest: <digest> 2260 ``` 2261 2262 The blob identified by `digest` is available at the provided location. 2263 2264 The following headers will be returned with the response: 2265 2266 |Name|Description| 2267 |----|-----------| 2268 |`Location`|The location where the layer should be accessible.| 2269 |`Docker-Content-Digest`|Digest of the targeted content for the request.| 2270 2271 2272 2273 2274 ###### On Failure: Bad Request 2275 2276 ``` 2277 400 Bad Request 2278 Content-Type: application/json; charset=utf-8 2279 2280 { 2281 "errors:" [ 2282 { 2283 "code": <error code>, 2284 "message": "<error message>", 2285 "detail": ... 2286 }, 2287 ... 2288 ] 2289 } 2290 ``` 2291 2292 There was a problem with the request that needs to be addressed by the client, such as an invalid `name` or `tag`. 2293 2294 2295 2296 The error codes that may be included in the response body are enumerated below: 2297 2298 |Code|Message|Description| 2299 |----|-------|-----------| 2300 | `NAME_INVALID` | invalid repository name | Invalid repository name encountered either during manifest validation or any API operation. | 2301 | `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. | 2302 2303 2304 2305 ###### On Failure: Not Found 2306 2307 ``` 2308 404 Not Found 2309 Content-Type: application/json; charset=utf-8 2310 2311 { 2312 "errors:" [ 2313 { 2314 "code": <error code>, 2315 "message": "<error message>", 2316 "detail": ... 2317 }, 2318 ... 2319 ] 2320 } 2321 ``` 2322 2323 The blob, identified by `name` and `digest`, is unknown to the registry. 2324 2325 2326 2327 The error codes that may be included in the response body are enumerated below: 2328 2329 |Code|Message|Description| 2330 |----|-------|-----------| 2331 | `NAME_UNKNOWN` | repository name not known to registry | This is returned if the name used during an operation is unknown to the registry. | 2332 | `BLOB_UNKNOWN` | blob unknown to registry | This error may be returned when a blob is unknown to the registry in a specified repository. This can be returned with a standard get or if a manifest references an unknown layer during upload. | 2333 2334 2335 2336 ###### On Failure: Authentication Required 2337 2338 ``` 2339 401 Unauthorized 2340 WWW-Authenticate: <scheme> realm="<realm>", ..." 2341 Content-Length: <length> 2342 Content-Type: application/json; charset=utf-8 2343 2344 { 2345 "errors:" [ 2346 { 2347 "code": <error code>, 2348 "message": "<error message>", 2349 "detail": ... 2350 }, 2351 ... 2352 ] 2353 } 2354 ``` 2355 2356 The client is not authenticated. 2357 2358 The following headers will be returned on the response: 2359 2360 |Name|Description| 2361 |----|-----------| 2362 |`WWW-Authenticate`|An RFC7235 compliant authentication challenge header.| 2363 |`Content-Length`|Length of the JSON response body.| 2364 2365 2366 2367 The error codes that may be included in the response body are enumerated below: 2368 2369 |Code|Message|Description| 2370 |----|-------|-----------| 2371 | `UNAUTHORIZED` | authentication required | The access controller was unable to authenticate the client. Often this will be accompanied by a Www-Authenticate HTTP response header indicating how to authenticate. | 2372 2373 2374 2375 ###### On Failure: No Such Repository Error 2376 2377 ``` 2378 404 Not Found 2379 Content-Length: <length> 2380 Content-Type: application/json; charset=utf-8 2381 2382 { 2383 "errors:" [ 2384 { 2385 "code": <error code>, 2386 "message": "<error message>", 2387 "detail": ... 2388 }, 2389 ... 2390 ] 2391 } 2392 ``` 2393 2394 The repository is not known to the registry. 2395 2396 The following headers will be returned on the response: 2397 2398 |Name|Description| 2399 |----|-----------| 2400 |`Content-Length`|Length of the JSON response body.| 2401 2402 2403 2404 The error codes that may be included in the response body are enumerated below: 2405 2406 |Code|Message|Description| 2407 |----|-------|-----------| 2408 | `NAME_UNKNOWN` | repository name not known to registry | This is returned if the name used during an operation is unknown to the registry. | 2409 2410 2411 2412 ###### On Failure: Access Denied 2413 2414 ``` 2415 403 Forbidden 2416 Content-Length: <length> 2417 Content-Type: application/json; charset=utf-8 2418 2419 { 2420 "errors:" [ 2421 { 2422 "code": <error code>, 2423 "message": "<error message>", 2424 "detail": ... 2425 }, 2426 ... 2427 ] 2428 } 2429 ``` 2430 2431 The client does not have required access to the repository. 2432 2433 The following headers will be returned on the response: 2434 2435 |Name|Description| 2436 |----|-----------| 2437 |`Content-Length`|Length of the JSON response body.| 2438 2439 2440 2441 The error codes that may be included in the response body are enumerated below: 2442 2443 |Code|Message|Description| 2444 |----|-------|-----------| 2445 | `DENIED` | requested access to the resource is denied | The access controller denied access for the operation on a resource. | 2446 2447 2448 2449 ##### Fetch Blob Part 2450 2451 ``` 2452 GET /v2/<name>/blobs/<digest> 2453 Host: <registry host> 2454 Authorization: <scheme> <token> 2455 Range: bytes=<start>-<end> 2456 ``` 2457 2458 This endpoint may also support RFC7233 compliant range requests. Support can be detected by issuing a HEAD request. If the header `Accept-Range: bytes` is returned, range requests can be used to fetch partial content. 2459 2460 2461 The following parameters should be specified on the request: 2462 2463 |Name|Kind|Description| 2464 |----|----|-----------| 2465 |`Host`|header|Standard HTTP Host Header. Should be set to the registry host.| 2466 |`Authorization`|header|An RFC7235 compliant authorization header.| 2467 |`Range`|header|HTTP Range header specifying blob chunk.| 2468 |`name`|path|Name of the target repository.| 2469 |`digest`|path|Digest of desired blob.| 2470 2471 2472 2473 2474 ###### On Success: Partial Content 2475 2476 ``` 2477 206 Partial Content 2478 Content-Length: <length> 2479 Content-Range: bytes <start>-<end>/<size> 2480 Content-Type: application/octet-stream 2481 2482 <blob binary data> 2483 ``` 2484 2485 The blob identified by `digest` is available. The specified chunk of blob content will be present in the body of the request. 2486 2487 The following headers will be returned with the response: 2488 2489 |Name|Description| 2490 |----|-----------| 2491 |`Content-Length`|The length of the requested blob chunk.| 2492 |`Content-Range`|Content range of blob chunk.| 2493 2494 2495 2496 2497 ###### On Failure: Bad Request 2498 2499 ``` 2500 400 Bad Request 2501 Content-Type: application/json; charset=utf-8 2502 2503 { 2504 "errors:" [ 2505 { 2506 "code": <error code>, 2507 "message": "<error message>", 2508 "detail": ... 2509 }, 2510 ... 2511 ] 2512 } 2513 ``` 2514 2515 There was a problem with the request that needs to be addressed by the client, such as an invalid `name` or `tag`. 2516 2517 2518 2519 The error codes that may be included in the response body are enumerated below: 2520 2521 |Code|Message|Description| 2522 |----|-------|-----------| 2523 | `NAME_INVALID` | invalid repository name | Invalid repository name encountered either during manifest validation or any API operation. | 2524 | `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. | 2525 2526 2527 2528 ###### On Failure: Not Found 2529 2530 ``` 2531 404 Not Found 2532 Content-Type: application/json; charset=utf-8 2533 2534 { 2535 "errors:" [ 2536 { 2537 "code": <error code>, 2538 "message": "<error message>", 2539 "detail": ... 2540 }, 2541 ... 2542 ] 2543 } 2544 ``` 2545 2546 2547 2548 2549 2550 The error codes that may be included in the response body are enumerated below: 2551 2552 |Code|Message|Description| 2553 |----|-------|-----------| 2554 | `NAME_UNKNOWN` | repository name not known to registry | This is returned if the name used during an operation is unknown to the registry. | 2555 | `BLOB_UNKNOWN` | blob unknown to registry | This error may be returned when a blob is unknown to the registry in a specified repository. This can be returned with a standard get or if a manifest references an unknown layer during upload. | 2556 2557 2558 2559 ###### On Failure: Requested Range Not Satisfiable 2560 2561 ``` 2562 416 Requested Range Not Satisfiable 2563 ``` 2564 2565 The range specification cannot be satisfied for the requested content. This can happen when the range is not formatted correctly or if the range is outside of the valid size of the content. 2566 2567 2568 2569 ###### On Failure: Authentication Required 2570 2571 ``` 2572 401 Unauthorized 2573 WWW-Authenticate: <scheme> realm="<realm>", ..." 2574 Content-Length: <length> 2575 Content-Type: application/json; charset=utf-8 2576 2577 { 2578 "errors:" [ 2579 { 2580 "code": <error code>, 2581 "message": "<error message>", 2582 "detail": ... 2583 }, 2584 ... 2585 ] 2586 } 2587 ``` 2588 2589 The client is not authenticated. 2590 2591 The following headers will be returned on the response: 2592 2593 |Name|Description| 2594 |----|-----------| 2595 |`WWW-Authenticate`|An RFC7235 compliant authentication challenge header.| 2596 |`Content-Length`|Length of the JSON response body.| 2597 2598 2599 2600 The error codes that may be included in the response body are enumerated below: 2601 2602 |Code|Message|Description| 2603 |----|-------|-----------| 2604 | `UNAUTHORIZED` | authentication required | The access controller was unable to authenticate the client. Often this will be accompanied by a Www-Authenticate HTTP response header indicating how to authenticate. | 2605 2606 2607 2608 ###### On Failure: No Such Repository Error 2609 2610 ``` 2611 404 Not Found 2612 Content-Length: <length> 2613 Content-Type: application/json; charset=utf-8 2614 2615 { 2616 "errors:" [ 2617 { 2618 "code": <error code>, 2619 "message": "<error message>", 2620 "detail": ... 2621 }, 2622 ... 2623 ] 2624 } 2625 ``` 2626 2627 The repository is not known to the registry. 2628 2629 The following headers will be returned on the response: 2630 2631 |Name|Description| 2632 |----|-----------| 2633 |`Content-Length`|Length of the JSON response body.| 2634 2635 2636 2637 The error codes that may be included in the response body are enumerated below: 2638 2639 |Code|Message|Description| 2640 |----|-------|-----------| 2641 | `NAME_UNKNOWN` | repository name not known to registry | This is returned if the name used during an operation is unknown to the registry. | 2642 2643 2644 2645 ###### On Failure: Access Denied 2646 2647 ``` 2648 403 Forbidden 2649 Content-Length: <length> 2650 Content-Type: application/json; charset=utf-8 2651 2652 { 2653 "errors:" [ 2654 { 2655 "code": <error code>, 2656 "message": "<error message>", 2657 "detail": ... 2658 }, 2659 ... 2660 ] 2661 } 2662 ``` 2663 2664 The client does not have required access to the repository. 2665 2666 The following headers will be returned on the response: 2667 2668 |Name|Description| 2669 |----|-----------| 2670 |`Content-Length`|Length of the JSON response body.| 2671 2672 2673 2674 The error codes that may be included in the response body are enumerated below: 2675 2676 |Code|Message|Description| 2677 |----|-------|-----------| 2678 | `DENIED` | requested access to the resource is denied | The access controller denied access for the operation on a resource. | 2679 2680 2681 2682 2683 #### DELETE Blob 2684 2685 Delete the blob identified by `name` and `digest` 2686 2687 2688 2689 ``` 2690 DELETE /v2/<name>/blobs/<digest> 2691 Host: <registry host> 2692 Authorization: <scheme> <token> 2693 ``` 2694 2695 2696 2697 2698 The following parameters should be specified on the request: 2699 2700 |Name|Kind|Description| 2701 |----|----|-----------| 2702 |`Host`|header|Standard HTTP Host Header. Should be set to the registry host.| 2703 |`Authorization`|header|An RFC7235 compliant authorization header.| 2704 |`name`|path|Name of the target repository.| 2705 |`digest`|path|Digest of desired blob.| 2706 2707 2708 2709 2710 ###### On Success: Accepted 2711 2712 ``` 2713 202 Accepted 2714 Content-Length: 0 2715 Docker-Content-Digest: <digest> 2716 ``` 2717 2718 2719 2720 The following headers will be returned with the response: 2721 2722 |Name|Description| 2723 |----|-----------| 2724 |`Content-Length`|0| 2725 |`Docker-Content-Digest`|Digest of the targeted content for the request.| 2726 2727 2728 2729 2730 ###### On Failure: Invalid Name or Digest 2731 2732 ``` 2733 400 Bad Request 2734 ``` 2735 2736 2737 2738 2739 2740 The error codes that may be included in the response body are enumerated below: 2741 2742 |Code|Message|Description| 2743 |----|-------|-----------| 2744 | `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. | 2745 | `NAME_INVALID` | invalid repository name | Invalid repository name encountered either during manifest validation or any API operation. | 2746 2747 2748 2749 ###### On Failure: Not Found 2750 2751 ``` 2752 404 Not Found 2753 Content-Type: application/json; charset=utf-8 2754 2755 { 2756 "errors:" [ 2757 { 2758 "code": <error code>, 2759 "message": "<error message>", 2760 "detail": ... 2761 }, 2762 ... 2763 ] 2764 } 2765 ``` 2766 2767 The blob, identified by `name` and `digest`, is unknown to the registry. 2768 2769 2770 2771 The error codes that may be included in the response body are enumerated below: 2772 2773 |Code|Message|Description| 2774 |----|-------|-----------| 2775 | `NAME_UNKNOWN` | repository name not known to registry | This is returned if the name used during an operation is unknown to the registry. | 2776 | `BLOB_UNKNOWN` | blob unknown to registry | This error may be returned when a blob is unknown to the registry in a specified repository. This can be returned with a standard get or if a manifest references an unknown layer during upload. | 2777 2778 2779 2780 ###### On Failure: Method Not Allowed 2781 2782 ``` 2783 405 Method Not Allowed 2784 Content-Type: application/json; charset=utf-8 2785 2786 { 2787 "errors:" [ 2788 { 2789 "code": <error code>, 2790 "message": "<error message>", 2791 "detail": ... 2792 }, 2793 ... 2794 ] 2795 } 2796 ``` 2797 2798 Blob delete is not allowed because the registry is configured as a pull-through cache or `delete` has been disabled 2799 2800 2801 2802 The error codes that may be included in the response body are enumerated below: 2803 2804 |Code|Message|Description| 2805 |----|-------|-----------| 2806 | `UNSUPPORTED` | The operation is unsupported. | The operation was unsupported due to a missing implementation or invalid set of parameters. | 2807 2808 2809 2810 ###### On Failure: Authentication Required 2811 2812 ``` 2813 401 Unauthorized 2814 WWW-Authenticate: <scheme> realm="<realm>", ..." 2815 Content-Length: <length> 2816 Content-Type: application/json; charset=utf-8 2817 2818 { 2819 "errors:" [ 2820 { 2821 "code": <error code>, 2822 "message": "<error message>", 2823 "detail": ... 2824 }, 2825 ... 2826 ] 2827 } 2828 ``` 2829 2830 The client is not authenticated. 2831 2832 The following headers will be returned on the response: 2833 2834 |Name|Description| 2835 |----|-----------| 2836 |`WWW-Authenticate`|An RFC7235 compliant authentication challenge header.| 2837 |`Content-Length`|Length of the JSON response body.| 2838 2839 2840 2841 The error codes that may be included in the response body are enumerated below: 2842 2843 |Code|Message|Description| 2844 |----|-------|-----------| 2845 | `UNAUTHORIZED` | authentication required | The access controller was unable to authenticate the client. Often this will be accompanied by a Www-Authenticate HTTP response header indicating how to authenticate. | 2846 2847 2848 2849 ###### On Failure: No Such Repository Error 2850 2851 ``` 2852 404 Not Found 2853 Content-Length: <length> 2854 Content-Type: application/json; charset=utf-8 2855 2856 { 2857 "errors:" [ 2858 { 2859 "code": <error code>, 2860 "message": "<error message>", 2861 "detail": ... 2862 }, 2863 ... 2864 ] 2865 } 2866 ``` 2867 2868 The repository is not known to the registry. 2869 2870 The following headers will be returned on the response: 2871 2872 |Name|Description| 2873 |----|-----------| 2874 |`Content-Length`|Length of the JSON response body.| 2875 2876 2877 2878 The error codes that may be included in the response body are enumerated below: 2879 2880 |Code|Message|Description| 2881 |----|-------|-----------| 2882 | `NAME_UNKNOWN` | repository name not known to registry | This is returned if the name used during an operation is unknown to the registry. | 2883 2884 2885 2886 ###### On Failure: Access Denied 2887 2888 ``` 2889 403 Forbidden 2890 Content-Length: <length> 2891 Content-Type: application/json; charset=utf-8 2892 2893 { 2894 "errors:" [ 2895 { 2896 "code": <error code>, 2897 "message": "<error message>", 2898 "detail": ... 2899 }, 2900 ... 2901 ] 2902 } 2903 ``` 2904 2905 The client does not have required access to the repository. 2906 2907 The following headers will be returned on the response: 2908 2909 |Name|Description| 2910 |----|-----------| 2911 |`Content-Length`|Length of the JSON response body.| 2912 2913 2914 2915 The error codes that may be included in the response body are enumerated below: 2916 2917 |Code|Message|Description| 2918 |----|-------|-----------| 2919 | `DENIED` | requested access to the resource is denied | The access controller denied access for the operation on a resource. | 2920 2921 2922 2923 2924 2925 ### Initiate Blob Upload 2926 2927 Initiate a blob upload. This endpoint can be used to create resumable uploads or monolithic uploads. 2928 2929 2930 2931 #### POST Initiate Blob Upload 2932 2933 Initiate a resumable blob upload. If successful, an upload location will be provided to complete the upload. Optionally, if the `digest` parameter is present, the request body will be used to complete the upload in a single request. 2934 2935 2936 ##### Initiate Monolithic Blob Upload 2937 2938 ``` 2939 POST /v2/<name>/blobs/uploads/?digest=<digest> 2940 Host: <registry host> 2941 Authorization: <scheme> <token> 2942 Content-Length: <length of blob> 2943 Content-Type: application/octect-stream 2944 2945 <binary data> 2946 ``` 2947 2948 Upload a blob identified by the `digest` parameter in single request. This upload will not be resumable unless a recoverable error is returned. 2949 2950 2951 The following parameters should be specified on the request: 2952 2953 |Name|Kind|Description| 2954 |----|----|-----------| 2955 |`Host`|header|Standard HTTP Host Header. Should be set to the registry host.| 2956 |`Authorization`|header|An RFC7235 compliant authorization header.| 2957 |`Content-Length`|header|| 2958 |`name`|path|Name of the target repository.| 2959 |`digest`|query|Digest of uploaded blob. If present, the upload will be completed, in a single request, with contents of the request body as the resulting blob.| 2960 2961 2962 2963 2964 ###### On Success: Created 2965 2966 ``` 2967 201 Created 2968 Location: <blob location> 2969 Content-Length: 0 2970 Docker-Upload-UUID: <uuid> 2971 ``` 2972 2973 The blob has been created in the registry and is available at the provided location. 2974 2975 The following headers will be returned with the response: 2976 2977 |Name|Description| 2978 |----|-----------| 2979 |`Location`|| 2980 |`Content-Length`|The `Content-Length` header must be zero and the body must be empty.| 2981 |`Docker-Upload-UUID`|Identifies the docker upload uuid for the current request.| 2982 2983 2984 2985 2986 ###### On Failure: Invalid Name or Digest 2987 2988 ``` 2989 400 Bad Request 2990 ``` 2991 2992 2993 2994 2995 2996 The error codes that may be included in the response body are enumerated below: 2997 2998 |Code|Message|Description| 2999 |----|-------|-----------| 3000 | `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. | 3001 | `NAME_INVALID` | invalid repository name | Invalid repository name encountered either during manifest validation or any API operation. | 3002 3003 3004 3005 ###### On Failure: Not allowed 3006 3007 ``` 3008 405 Method Not Allowed 3009 ``` 3010 3011 Blob upload is not allowed because the registry is configured as a pull-through cache or for some other reason 3012 3013 3014 3015 The error codes that may be included in the response body are enumerated below: 3016 3017 |Code|Message|Description| 3018 |----|-------|-----------| 3019 | `UNSUPPORTED` | The operation is unsupported. | The operation was unsupported due to a missing implementation or invalid set of parameters. | 3020 3021 3022 3023 ###### On Failure: Authentication Required 3024 3025 ``` 3026 401 Unauthorized 3027 WWW-Authenticate: <scheme> realm="<realm>", ..." 3028 Content-Length: <length> 3029 Content-Type: application/json; charset=utf-8 3030 3031 { 3032 "errors:" [ 3033 { 3034 "code": <error code>, 3035 "message": "<error message>", 3036 "detail": ... 3037 }, 3038 ... 3039 ] 3040 } 3041 ``` 3042 3043 The client is not authenticated. 3044 3045 The following headers will be returned on the response: 3046 3047 |Name|Description| 3048 |----|-----------| 3049 |`WWW-Authenticate`|An RFC7235 compliant authentication challenge header.| 3050 |`Content-Length`|Length of the JSON response body.| 3051 3052 3053 3054 The error codes that may be included in the response body are enumerated below: 3055 3056 |Code|Message|Description| 3057 |----|-------|-----------| 3058 | `UNAUTHORIZED` | authentication required | The access controller was unable to authenticate the client. Often this will be accompanied by a Www-Authenticate HTTP response header indicating how to authenticate. | 3059 3060 3061 3062 ###### On Failure: No Such Repository Error 3063 3064 ``` 3065 404 Not Found 3066 Content-Length: <length> 3067 Content-Type: application/json; charset=utf-8 3068 3069 { 3070 "errors:" [ 3071 { 3072 "code": <error code>, 3073 "message": "<error message>", 3074 "detail": ... 3075 }, 3076 ... 3077 ] 3078 } 3079 ``` 3080 3081 The repository is not known to the registry. 3082 3083 The following headers will be returned on the response: 3084 3085 |Name|Description| 3086 |----|-----------| 3087 |`Content-Length`|Length of the JSON response body.| 3088 3089 3090 3091 The error codes that may be included in the response body are enumerated below: 3092 3093 |Code|Message|Description| 3094 |----|-------|-----------| 3095 | `NAME_UNKNOWN` | repository name not known to registry | This is returned if the name used during an operation is unknown to the registry. | 3096 3097 3098 3099 ###### On Failure: Access Denied 3100 3101 ``` 3102 403 Forbidden 3103 Content-Length: <length> 3104 Content-Type: application/json; charset=utf-8 3105 3106 { 3107 "errors:" [ 3108 { 3109 "code": <error code>, 3110 "message": "<error message>", 3111 "detail": ... 3112 }, 3113 ... 3114 ] 3115 } 3116 ``` 3117 3118 The client does not have required access to the repository. 3119 3120 The following headers will be returned on the response: 3121 3122 |Name|Description| 3123 |----|-----------| 3124 |`Content-Length`|Length of the JSON response body.| 3125 3126 3127 3128 The error codes that may be included in the response body are enumerated below: 3129 3130 |Code|Message|Description| 3131 |----|-------|-----------| 3132 | `DENIED` | requested access to the resource is denied | The access controller denied access for the operation on a resource. | 3133 3134 3135 3136 ##### Initiate Resumable Blob Upload 3137 3138 ``` 3139 POST /v2/<name>/blobs/uploads/ 3140 Host: <registry host> 3141 Authorization: <scheme> <token> 3142 Content-Length: 0 3143 ``` 3144 3145 Initiate a resumable blob upload with an empty request body. 3146 3147 3148 The following parameters should be specified on the request: 3149 3150 |Name|Kind|Description| 3151 |----|----|-----------| 3152 |`Host`|header|Standard HTTP Host Header. Should be set to the registry host.| 3153 |`Authorization`|header|An RFC7235 compliant authorization header.| 3154 |`Content-Length`|header|The `Content-Length` header must be zero and the body must be empty.| 3155 |`name`|path|Name of the target repository.| 3156 3157 3158 3159 3160 ###### On Success: Accepted 3161 3162 ``` 3163 202 Accepted 3164 Content-Length: 0 3165 Location: /v2/<name>/blobs/uploads/<uuid> 3166 Range: 0-0 3167 Docker-Upload-UUID: <uuid> 3168 ``` 3169 3170 The upload has been created. The `Location` header must be used to complete the upload. The response should be identical to a `GET` request on the contents of the returned `Location` header. 3171 3172 The following headers will be returned with the response: 3173 3174 |Name|Description| 3175 |----|-----------| 3176 |`Content-Length`|The `Content-Length` header must be zero and the body must be empty.| 3177 |`Location`|The location of the created upload. Clients should use the contents verbatim to complete the upload, adding parameters where required.| 3178 |`Range`|Range header indicating the progress of the upload. When starting an upload, it will return an empty range, since no content has been received.| 3179 |`Docker-Upload-UUID`|Identifies the docker upload uuid for the current request.| 3180 3181 3182 3183 3184 ###### On Failure: Invalid Name or Digest 3185 3186 ``` 3187 400 Bad Request 3188 ``` 3189 3190 3191 3192 3193 3194 The error codes that may be included in the response body are enumerated below: 3195 3196 |Code|Message|Description| 3197 |----|-------|-----------| 3198 | `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. | 3199 | `NAME_INVALID` | invalid repository name | Invalid repository name encountered either during manifest validation or any API operation. | 3200 3201 3202 3203 ###### On Failure: Authentication Required 3204 3205 ``` 3206 401 Unauthorized 3207 WWW-Authenticate: <scheme> realm="<realm>", ..." 3208 Content-Length: <length> 3209 Content-Type: application/json; charset=utf-8 3210 3211 { 3212 "errors:" [ 3213 { 3214 "code": <error code>, 3215 "message": "<error message>", 3216 "detail": ... 3217 }, 3218 ... 3219 ] 3220 } 3221 ``` 3222 3223 The client is not authenticated. 3224 3225 The following headers will be returned on the response: 3226 3227 |Name|Description| 3228 |----|-----------| 3229 |`WWW-Authenticate`|An RFC7235 compliant authentication challenge header.| 3230 |`Content-Length`|Length of the JSON response body.| 3231 3232 3233 3234 The error codes that may be included in the response body are enumerated below: 3235 3236 |Code|Message|Description| 3237 |----|-------|-----------| 3238 | `UNAUTHORIZED` | authentication required | The access controller was unable to authenticate the client. Often this will be accompanied by a Www-Authenticate HTTP response header indicating how to authenticate. | 3239 3240 3241 3242 ###### On Failure: No Such Repository Error 3243 3244 ``` 3245 404 Not Found 3246 Content-Length: <length> 3247 Content-Type: application/json; charset=utf-8 3248 3249 { 3250 "errors:" [ 3251 { 3252 "code": <error code>, 3253 "message": "<error message>", 3254 "detail": ... 3255 }, 3256 ... 3257 ] 3258 } 3259 ``` 3260 3261 The repository is not known to the registry. 3262 3263 The following headers will be returned on the response: 3264 3265 |Name|Description| 3266 |----|-----------| 3267 |`Content-Length`|Length of the JSON response body.| 3268 3269 3270 3271 The error codes that may be included in the response body are enumerated below: 3272 3273 |Code|Message|Description| 3274 |----|-------|-----------| 3275 | `NAME_UNKNOWN` | repository name not known to registry | This is returned if the name used during an operation is unknown to the registry. | 3276 3277 3278 3279 ###### On Failure: Access Denied 3280 3281 ``` 3282 403 Forbidden 3283 Content-Length: <length> 3284 Content-Type: application/json; charset=utf-8 3285 3286 { 3287 "errors:" [ 3288 { 3289 "code": <error code>, 3290 "message": "<error message>", 3291 "detail": ... 3292 }, 3293 ... 3294 ] 3295 } 3296 ``` 3297 3298 The client does not have required access to the repository. 3299 3300 The following headers will be returned on the response: 3301 3302 |Name|Description| 3303 |----|-----------| 3304 |`Content-Length`|Length of the JSON response body.| 3305 3306 3307 3308 The error codes that may be included in the response body are enumerated below: 3309 3310 |Code|Message|Description| 3311 |----|-------|-----------| 3312 | `DENIED` | requested access to the resource is denied | The access controller denied access for the operation on a resource. | 3313 3314 3315 3316 3317 3318 ### Blob Upload 3319 3320 Interact with blob uploads. Clients should never assemble URLs for this endpoint and should only take it through the `Location` header on related API requests. The `Location` header and its parameters should be preserved by clients, using the latest value returned via upload related API calls. 3321 3322 3323 3324 #### GET Blob Upload 3325 3326 Retrieve status of upload identified by `uuid`. The primary purpose of this endpoint is to resolve the current status of a resumable upload. 3327 3328 3329 3330 ``` 3331 GET /v2/<name>/blobs/uploads/<uuid> 3332 Host: <registry host> 3333 Authorization: <scheme> <token> 3334 ``` 3335 3336 Retrieve the progress of the current upload, as reported by the `Range` header. 3337 3338 3339 The following parameters should be specified on the request: 3340 3341 |Name|Kind|Description| 3342 |----|----|-----------| 3343 |`Host`|header|Standard HTTP Host Header. Should be set to the registry host.| 3344 |`Authorization`|header|An RFC7235 compliant authorization header.| 3345 |`name`|path|Name of the target repository.| 3346 |`uuid`|path|A uuid identifying the upload. This field can accept characters that match `[a-zA-Z0-9-_.=]+`.| 3347 3348 3349 3350 3351 ###### On Success: Upload Progress 3352 3353 ``` 3354 204 No Content 3355 Range: 0-<offset> 3356 Content-Length: 0 3357 Docker-Upload-UUID: <uuid> 3358 ``` 3359 3360 The upload is known and in progress. The last received offset is available in the `Range` header. 3361 3362 The following headers will be returned with the response: 3363 3364 |Name|Description| 3365 |----|-----------| 3366 |`Range`|Range indicating the current progress of the upload.| 3367 |`Content-Length`|The `Content-Length` header must be zero and the body must be empty.| 3368 |`Docker-Upload-UUID`|Identifies the docker upload uuid for the current request.| 3369 3370 3371 3372 3373 ###### On Failure: Bad Request 3374 3375 ``` 3376 400 Bad Request 3377 Content-Type: application/json; charset=utf-8 3378 3379 { 3380 "errors:" [ 3381 { 3382 "code": <error code>, 3383 "message": "<error message>", 3384 "detail": ... 3385 }, 3386 ... 3387 ] 3388 } 3389 ``` 3390 3391 There was an error processing the upload and it must be restarted. 3392 3393 3394 3395 The error codes that may be included in the response body are enumerated below: 3396 3397 |Code|Message|Description| 3398 |----|-------|-----------| 3399 | `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. | 3400 | `NAME_INVALID` | invalid repository name | Invalid repository name encountered either during manifest validation or any API operation. | 3401 | `BLOB_UPLOAD_INVALID` | blob upload invalid | The blob upload encountered an error and can no longer proceed. | 3402 3403 3404 3405 ###### On Failure: Not Found 3406 3407 ``` 3408 404 Not Found 3409 Content-Type: application/json; charset=utf-8 3410 3411 { 3412 "errors:" [ 3413 { 3414 "code": <error code>, 3415 "message": "<error message>", 3416 "detail": ... 3417 }, 3418 ... 3419 ] 3420 } 3421 ``` 3422 3423 The upload is unknown to the registry. The upload must be restarted. 3424 3425 3426 3427 The error codes that may be included in the response body are enumerated below: 3428 3429 |Code|Message|Description| 3430 |----|-------|-----------| 3431 | `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. | 3432 3433 3434 3435 ###### On Failure: Authentication Required 3436 3437 ``` 3438 401 Unauthorized 3439 WWW-Authenticate: <scheme> realm="<realm>", ..." 3440 Content-Length: <length> 3441 Content-Type: application/json; charset=utf-8 3442 3443 { 3444 "errors:" [ 3445 { 3446 "code": <error code>, 3447 "message": "<error message>", 3448 "detail": ... 3449 }, 3450 ... 3451 ] 3452 } 3453 ``` 3454 3455 The client is not authenticated. 3456 3457 The following headers will be returned on the response: 3458 3459 |Name|Description| 3460 |----|-----------| 3461 |`WWW-Authenticate`|An RFC7235 compliant authentication challenge header.| 3462 |`Content-Length`|Length of the JSON response body.| 3463 3464 3465 3466 The error codes that may be included in the response body are enumerated below: 3467 3468 |Code|Message|Description| 3469 |----|-------|-----------| 3470 | `UNAUTHORIZED` | authentication required | The access controller was unable to authenticate the client. Often this will be accompanied by a Www-Authenticate HTTP response header indicating how to authenticate. | 3471 3472 3473 3474 ###### On Failure: No Such Repository Error 3475 3476 ``` 3477 404 Not Found 3478 Content-Length: <length> 3479 Content-Type: application/json; charset=utf-8 3480 3481 { 3482 "errors:" [ 3483 { 3484 "code": <error code>, 3485 "message": "<error message>", 3486 "detail": ... 3487 }, 3488 ... 3489 ] 3490 } 3491 ``` 3492 3493 The repository is not known to the registry. 3494 3495 The following headers will be returned on the response: 3496 3497 |Name|Description| 3498 |----|-----------| 3499 |`Content-Length`|Length of the JSON response body.| 3500 3501 3502 3503 The error codes that may be included in the response body are enumerated below: 3504 3505 |Code|Message|Description| 3506 |----|-------|-----------| 3507 | `NAME_UNKNOWN` | repository name not known to registry | This is returned if the name used during an operation is unknown to the registry. | 3508 3509 3510 3511 ###### On Failure: Access Denied 3512 3513 ``` 3514 403 Forbidden 3515 Content-Length: <length> 3516 Content-Type: application/json; charset=utf-8 3517 3518 { 3519 "errors:" [ 3520 { 3521 "code": <error code>, 3522 "message": "<error message>", 3523 "detail": ... 3524 }, 3525 ... 3526 ] 3527 } 3528 ``` 3529 3530 The client does not have required access to the repository. 3531 3532 The following headers will be returned on the response: 3533 3534 |Name|Description| 3535 |----|-----------| 3536 |`Content-Length`|Length of the JSON response body.| 3537 3538 3539 3540 The error codes that may be included in the response body are enumerated below: 3541 3542 |Code|Message|Description| 3543 |----|-------|-----------| 3544 | `DENIED` | requested access to the resource is denied | The access controller denied access for the operation on a resource. | 3545 3546 3547 3548 3549 #### PATCH Blob Upload 3550 3551 Upload a chunk of data for the specified upload. 3552 3553 3554 ##### Stream upload 3555 3556 ``` 3557 PATCH /v2/<name>/blobs/uploads/<uuid> 3558 Host: <registry host> 3559 Authorization: <scheme> <token> 3560 Content-Type: application/octet-stream 3561 3562 <binary data> 3563 ``` 3564 3565 Upload a stream of data to upload without completing the upload. 3566 3567 3568 The following parameters should be specified on the request: 3569 3570 |Name|Kind|Description| 3571 |----|----|-----------| 3572 |`Host`|header|Standard HTTP Host Header. Should be set to the registry host.| 3573 |`Authorization`|header|An RFC7235 compliant authorization header.| 3574 |`name`|path|Name of the target repository.| 3575 |`uuid`|path|A uuid identifying the upload. This field can accept characters that match `[a-zA-Z0-9-_.=]+`.| 3576 3577 3578 3579 3580 ###### On Success: Data Accepted 3581 3582 ``` 3583 204 No Content 3584 Location: /v2/<name>/blobs/uploads/<uuid> 3585 Range: 0-<offset> 3586 Content-Length: 0 3587 Docker-Upload-UUID: <uuid> 3588 ``` 3589 3590 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. 3591 3592 The following headers will be returned with the response: 3593 3594 |Name|Description| 3595 |----|-----------| 3596 |`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.| 3597 |`Range`|Range indicating the current progress of the upload.| 3598 |`Content-Length`|The `Content-Length` header must be zero and the body must be empty.| 3599 |`Docker-Upload-UUID`|Identifies the docker upload uuid for the current request.| 3600 3601 3602 3603 3604 ###### On Failure: Bad Request 3605 3606 ``` 3607 400 Bad Request 3608 Content-Type: application/json; charset=utf-8 3609 3610 { 3611 "errors:" [ 3612 { 3613 "code": <error code>, 3614 "message": "<error message>", 3615 "detail": ... 3616 }, 3617 ... 3618 ] 3619 } 3620 ``` 3621 3622 There was an error processing the upload and it must be restarted. 3623 3624 3625 3626 The error codes that may be included in the response body are enumerated below: 3627 3628 |Code|Message|Description| 3629 |----|-------|-----------| 3630 | `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. | 3631 | `NAME_INVALID` | invalid repository name | Invalid repository name encountered either during manifest validation or any API operation. | 3632 | `BLOB_UPLOAD_INVALID` | blob upload invalid | The blob upload encountered an error and can no longer proceed. | 3633 3634 3635 3636 ###### On Failure: Not Found 3637 3638 ``` 3639 404 Not Found 3640 Content-Type: application/json; charset=utf-8 3641 3642 { 3643 "errors:" [ 3644 { 3645 "code": <error code>, 3646 "message": "<error message>", 3647 "detail": ... 3648 }, 3649 ... 3650 ] 3651 } 3652 ``` 3653 3654 The upload is unknown to the registry. The upload must be restarted. 3655 3656 3657 3658 The error codes that may be included in the response body are enumerated below: 3659 3660 |Code|Message|Description| 3661 |----|-------|-----------| 3662 | `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. | 3663 3664 3665 3666 ###### On Failure: Authentication Required 3667 3668 ``` 3669 401 Unauthorized 3670 WWW-Authenticate: <scheme> realm="<realm>", ..." 3671 Content-Length: <length> 3672 Content-Type: application/json; charset=utf-8 3673 3674 { 3675 "errors:" [ 3676 { 3677 "code": <error code>, 3678 "message": "<error message>", 3679 "detail": ... 3680 }, 3681 ... 3682 ] 3683 } 3684 ``` 3685 3686 The client is not authenticated. 3687 3688 The following headers will be returned on the response: 3689 3690 |Name|Description| 3691 |----|-----------| 3692 |`WWW-Authenticate`|An RFC7235 compliant authentication challenge header.| 3693 |`Content-Length`|Length of the JSON response body.| 3694 3695 3696 3697 The error codes that may be included in the response body are enumerated below: 3698 3699 |Code|Message|Description| 3700 |----|-------|-----------| 3701 | `UNAUTHORIZED` | authentication required | The access controller was unable to authenticate the client. Often this will be accompanied by a Www-Authenticate HTTP response header indicating how to authenticate. | 3702 3703 3704 3705 ###### On Failure: No Such Repository Error 3706 3707 ``` 3708 404 Not Found 3709 Content-Length: <length> 3710 Content-Type: application/json; charset=utf-8 3711 3712 { 3713 "errors:" [ 3714 { 3715 "code": <error code>, 3716 "message": "<error message>", 3717 "detail": ... 3718 }, 3719 ... 3720 ] 3721 } 3722 ``` 3723 3724 The repository is not known to the registry. 3725 3726 The following headers will be returned on the response: 3727 3728 |Name|Description| 3729 |----|-----------| 3730 |`Content-Length`|Length of the JSON response body.| 3731 3732 3733 3734 The error codes that may be included in the response body are enumerated below: 3735 3736 |Code|Message|Description| 3737 |----|-------|-----------| 3738 | `NAME_UNKNOWN` | repository name not known to registry | This is returned if the name used during an operation is unknown to the registry. | 3739 3740 3741 3742 ###### On Failure: Access Denied 3743 3744 ``` 3745 403 Forbidden 3746 Content-Length: <length> 3747 Content-Type: application/json; charset=utf-8 3748 3749 { 3750 "errors:" [ 3751 { 3752 "code": <error code>, 3753 "message": "<error message>", 3754 "detail": ... 3755 }, 3756 ... 3757 ] 3758 } 3759 ``` 3760 3761 The client does not have required access to the repository. 3762 3763 The following headers will be returned on the response: 3764 3765 |Name|Description| 3766 |----|-----------| 3767 |`Content-Length`|Length of the JSON response body.| 3768 3769 3770 3771 The error codes that may be included in the response body are enumerated below: 3772 3773 |Code|Message|Description| 3774 |----|-------|-----------| 3775 | `DENIED` | requested access to the resource is denied | The access controller denied access for the operation on a resource. | 3776 3777 3778 3779 ##### Chunked upload 3780 3781 ``` 3782 PATCH /v2/<name>/blobs/uploads/<uuid> 3783 Host: <registry host> 3784 Authorization: <scheme> <token> 3785 Content-Range: <start of range>-<end of range, inclusive> 3786 Content-Length: <length of chunk> 3787 Content-Type: application/octet-stream 3788 3789 <binary chunk> 3790 ``` 3791 3792 Upload a chunk of data to specified upload without completing the upload. The data will be uploaded to the specified Content Range. 3793 3794 3795 The following parameters should be specified on the request: 3796 3797 |Name|Kind|Description| 3798 |----|----|-----------| 3799 |`Host`|header|Standard HTTP Host Header. Should be set to the registry host.| 3800 |`Authorization`|header|An RFC7235 compliant authorization header.| 3801 |`Content-Range`|header|Range of bytes identifying the desired 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.| 3802 |`Content-Length`|header|Length of the chunk being uploaded, corresponding the length of the request body.| 3803 |`name`|path|Name of the target repository.| 3804 |`uuid`|path|A uuid identifying the upload. This field can accept characters that match `[a-zA-Z0-9-_.=]+`.| 3805 3806 3807 3808 3809 ###### On Success: Chunk Accepted 3810 3811 ``` 3812 204 No Content 3813 Location: /v2/<name>/blobs/uploads/<uuid> 3814 Range: 0-<offset> 3815 Content-Length: 0 3816 Docker-Upload-UUID: <uuid> 3817 ``` 3818 3819 The chunk 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. 3820 3821 The following headers will be returned with the response: 3822 3823 |Name|Description| 3824 |----|-----------| 3825 |`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.| 3826 |`Range`|Range indicating the current progress of the upload.| 3827 |`Content-Length`|The `Content-Length` header must be zero and the body must be empty.| 3828 |`Docker-Upload-UUID`|Identifies the docker upload uuid for the current request.| 3829 3830 3831 3832 3833 ###### On Failure: Bad Request 3834 3835 ``` 3836 400 Bad Request 3837 Content-Type: application/json; charset=utf-8 3838 3839 { 3840 "errors:" [ 3841 { 3842 "code": <error code>, 3843 "message": "<error message>", 3844 "detail": ... 3845 }, 3846 ... 3847 ] 3848 } 3849 ``` 3850 3851 There was an error processing the upload and it must be restarted. 3852 3853 3854 3855 The error codes that may be included in the response body are enumerated below: 3856 3857 |Code|Message|Description| 3858 |----|-------|-----------| 3859 | `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. | 3860 | `NAME_INVALID` | invalid repository name | Invalid repository name encountered either during manifest validation or any API operation. | 3861 | `BLOB_UPLOAD_INVALID` | blob upload invalid | The blob upload encountered an error and can no longer proceed. | 3862 3863 3864 3865 ###### On Failure: Not Found 3866 3867 ``` 3868 404 Not Found 3869 Content-Type: application/json; charset=utf-8 3870 3871 { 3872 "errors:" [ 3873 { 3874 "code": <error code>, 3875 "message": "<error message>", 3876 "detail": ... 3877 }, 3878 ... 3879 ] 3880 } 3881 ``` 3882 3883 The upload is unknown to the registry. The upload must be restarted. 3884 3885 3886 3887 The error codes that may be included in the response body are enumerated below: 3888 3889 |Code|Message|Description| 3890 |----|-------|-----------| 3891 | `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. | 3892 3893 3894 3895 ###### On Failure: Requested Range Not Satisfiable 3896 3897 ``` 3898 416 Requested Range Not Satisfiable 3899 ``` 3900 3901 The `Content-Range` specification cannot be accepted, either because it does not overlap with the current progress or it is invalid. 3902 3903 3904 3905 ###### On Failure: Authentication Required 3906 3907 ``` 3908 401 Unauthorized 3909 WWW-Authenticate: <scheme> realm="<realm>", ..." 3910 Content-Length: <length> 3911 Content-Type: application/json; charset=utf-8 3912 3913 { 3914 "errors:" [ 3915 { 3916 "code": <error code>, 3917 "message": "<error message>", 3918 "detail": ... 3919 }, 3920 ... 3921 ] 3922 } 3923 ``` 3924 3925 The client is not authenticated. 3926 3927 The following headers will be returned on the response: 3928 3929 |Name|Description| 3930 |----|-----------| 3931 |`WWW-Authenticate`|An RFC7235 compliant authentication challenge header.| 3932 |`Content-Length`|Length of the JSON response body.| 3933 3934 3935 3936 The error codes that may be included in the response body are enumerated below: 3937 3938 |Code|Message|Description| 3939 |----|-------|-----------| 3940 | `UNAUTHORIZED` | authentication required | The access controller was unable to authenticate the client. Often this will be accompanied by a Www-Authenticate HTTP response header indicating how to authenticate. | 3941 3942 3943 3944 ###### On Failure: No Such Repository Error 3945 3946 ``` 3947 404 Not Found 3948 Content-Length: <length> 3949 Content-Type: application/json; charset=utf-8 3950 3951 { 3952 "errors:" [ 3953 { 3954 "code": <error code>, 3955 "message": "<error message>", 3956 "detail": ... 3957 }, 3958 ... 3959 ] 3960 } 3961 ``` 3962 3963 The repository is not known to the registry. 3964 3965 The following headers will be returned on the response: 3966 3967 |Name|Description| 3968 |----|-----------| 3969 |`Content-Length`|Length of the JSON response body.| 3970 3971 3972 3973 The error codes that may be included in the response body are enumerated below: 3974 3975 |Code|Message|Description| 3976 |----|-------|-----------| 3977 | `NAME_UNKNOWN` | repository name not known to registry | This is returned if the name used during an operation is unknown to the registry. | 3978 3979 3980 3981 ###### On Failure: Access Denied 3982 3983 ``` 3984 403 Forbidden 3985 Content-Length: <length> 3986 Content-Type: application/json; charset=utf-8 3987 3988 { 3989 "errors:" [ 3990 { 3991 "code": <error code>, 3992 "message": "<error message>", 3993 "detail": ... 3994 }, 3995 ... 3996 ] 3997 } 3998 ``` 3999 4000 The client does not have required access to the repository. 4001 4002 The following headers will be returned on the response: 4003 4004 |Name|Description| 4005 |----|-----------| 4006 |`Content-Length`|Length of the JSON response body.| 4007 4008 4009 4010 The error codes that may be included in the response body are enumerated below: 4011 4012 |Code|Message|Description| 4013 |----|-------|-----------| 4014 | `DENIED` | requested access to the resource is denied | The access controller denied access for the operation on a resource. | 4015 4016 4017 4018 4019 #### PUT Blob Upload 4020 4021 Complete the upload specified by `uuid`, optionally appending the body as the final chunk. 4022 4023 4024 4025 ``` 4026 PUT /v2/<name>/blobs/uploads/<uuid>?digest=<digest> 4027 Host: <registry host> 4028 Authorization: <scheme> <token> 4029 Content-Length: <length of data> 4030 Content-Type: application/octet-stream 4031 4032 <binary data> 4033 ``` 4034 4035 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. 4036 4037 4038 The following parameters should be specified on the request: 4039 4040 |Name|Kind|Description| 4041 |----|----|-----------| 4042 |`Host`|header|Standard HTTP Host Header. Should be set to the registry host.| 4043 |`Authorization`|header|An RFC7235 compliant authorization header.| 4044 |`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.| 4045 |`name`|path|Name of the target repository.| 4046 |`uuid`|path|A uuid identifying the upload. This field can accept characters that match `[a-zA-Z0-9-_.=]+`.| 4047 |`digest`|query|Digest of uploaded blob.| 4048 4049 4050 4051 4052 ###### On Success: Upload Complete 4053 4054 ``` 4055 204 No Content 4056 Location: <blob location> 4057 Content-Range: <start of range>-<end of range, inclusive> 4058 Content-Length: 0 4059 Docker-Content-Digest: <digest> 4060 ``` 4061 4062 The upload has been completed and accepted by the registry. The canonical location will be available in the `Location` header. 4063 4064 The following headers will be returned with the response: 4065 4066 |Name|Description| 4067 |----|-----------| 4068 |`Location`|The canonical location of the blob for retrieval| 4069 |`Content-Range`|Range of bytes identifying the desired block of content represented by the body. Start must match the end of offset retrieved via status check. Note that this is a non-standard use of the `Content-Range` header.| 4070 |`Content-Length`|The `Content-Length` header must be zero and the body must be empty.| 4071 |`Docker-Content-Digest`|Digest of the targeted content for the request.| 4072 4073 4074 4075 4076 ###### On Failure: Bad Request 4077 4078 ``` 4079 400 Bad Request 4080 Content-Type: application/json; charset=utf-8 4081 4082 { 4083 "errors:" [ 4084 { 4085 "code": <error code>, 4086 "message": "<error message>", 4087 "detail": ... 4088 }, 4089 ... 4090 ] 4091 } 4092 ``` 4093 4094 There was an error processing the upload and it must be restarted. 4095 4096 4097 4098 The error codes that may be included in the response body are enumerated below: 4099 4100 |Code|Message|Description| 4101 |----|-------|-----------| 4102 | `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. | 4103 | `NAME_INVALID` | invalid repository name | Invalid repository name encountered either during manifest validation or any API operation. | 4104 | `BLOB_UPLOAD_INVALID` | blob upload invalid | The blob upload encountered an error and can no longer proceed. | 4105 | `UNSUPPORTED` | The operation is unsupported. | The operation was unsupported due to a missing implementation or invalid set of parameters. | 4106 4107 4108 4109 ###### On Failure: Not Found 4110 4111 ``` 4112 404 Not Found 4113 Content-Type: application/json; charset=utf-8 4114 4115 { 4116 "errors:" [ 4117 { 4118 "code": <error code>, 4119 "message": "<error message>", 4120 "detail": ... 4121 }, 4122 ... 4123 ] 4124 } 4125 ``` 4126 4127 The upload is unknown to the registry. The upload must be restarted. 4128 4129 4130 4131 The error codes that may be included in the response body are enumerated below: 4132 4133 |Code|Message|Description| 4134 |----|-------|-----------| 4135 | `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. | 4136 4137 4138 4139 ###### On Failure: Authentication Required 4140 4141 ``` 4142 401 Unauthorized 4143 WWW-Authenticate: <scheme> realm="<realm>", ..." 4144 Content-Length: <length> 4145 Content-Type: application/json; charset=utf-8 4146 4147 { 4148 "errors:" [ 4149 { 4150 "code": <error code>, 4151 "message": "<error message>", 4152 "detail": ... 4153 }, 4154 ... 4155 ] 4156 } 4157 ``` 4158 4159 The client is not authenticated. 4160 4161 The following headers will be returned on the response: 4162 4163 |Name|Description| 4164 |----|-----------| 4165 |`WWW-Authenticate`|An RFC7235 compliant authentication challenge header.| 4166 |`Content-Length`|Length of the JSON response body.| 4167 4168 4169 4170 The error codes that may be included in the response body are enumerated below: 4171 4172 |Code|Message|Description| 4173 |----|-------|-----------| 4174 | `UNAUTHORIZED` | authentication required | The access controller was unable to authenticate the client. Often this will be accompanied by a Www-Authenticate HTTP response header indicating how to authenticate. | 4175 4176 4177 4178 ###### On Failure: No Such Repository Error 4179 4180 ``` 4181 404 Not Found 4182 Content-Length: <length> 4183 Content-Type: application/json; charset=utf-8 4184 4185 { 4186 "errors:" [ 4187 { 4188 "code": <error code>, 4189 "message": "<error message>", 4190 "detail": ... 4191 }, 4192 ... 4193 ] 4194 } 4195 ``` 4196 4197 The repository is not known to the registry. 4198 4199 The following headers will be returned on the response: 4200 4201 |Name|Description| 4202 |----|-----------| 4203 |`Content-Length`|Length of the JSON response body.| 4204 4205 4206 4207 The error codes that may be included in the response body are enumerated below: 4208 4209 |Code|Message|Description| 4210 |----|-------|-----------| 4211 | `NAME_UNKNOWN` | repository name not known to registry | This is returned if the name used during an operation is unknown to the registry. | 4212 4213 4214 4215 ###### On Failure: Access Denied 4216 4217 ``` 4218 403 Forbidden 4219 Content-Length: <length> 4220 Content-Type: application/json; charset=utf-8 4221 4222 { 4223 "errors:" [ 4224 { 4225 "code": <error code>, 4226 "message": "<error message>", 4227 "detail": ... 4228 }, 4229 ... 4230 ] 4231 } 4232 ``` 4233 4234 The client does not have required access to the repository. 4235 4236 The following headers will be returned on the response: 4237 4238 |Name|Description| 4239 |----|-----------| 4240 |`Content-Length`|Length of the JSON response body.| 4241 4242 4243 4244 The error codes that may be included in the response body are enumerated below: 4245 4246 |Code|Message|Description| 4247 |----|-------|-----------| 4248 | `DENIED` | requested access to the resource is denied | The access controller denied access for the operation on a resource. | 4249 4250 4251 4252 4253 #### DELETE Blob Upload 4254 4255 Cancel outstanding upload processes, releasing associated resources. If this is not called, the unfinished uploads will eventually timeout. 4256 4257 4258 4259 ``` 4260 DELETE /v2/<name>/blobs/uploads/<uuid> 4261 Host: <registry host> 4262 Authorization: <scheme> <token> 4263 Content-Length: 0 4264 ``` 4265 4266 Cancel the upload specified by `uuid`. 4267 4268 4269 The following parameters should be specified on the request: 4270 4271 |Name|Kind|Description| 4272 |----|----|-----------| 4273 |`Host`|header|Standard HTTP Host Header. Should be set to the registry host.| 4274 |`Authorization`|header|An RFC7235 compliant authorization header.| 4275 |`Content-Length`|header|The `Content-Length` header must be zero and the body must be empty.| 4276 |`name`|path|Name of the target repository.| 4277 |`uuid`|path|A uuid identifying the upload. This field can accept characters that match `[a-zA-Z0-9-_.=]+`.| 4278 4279 4280 4281 4282 ###### On Success: Upload Deleted 4283 4284 ``` 4285 204 No Content 4286 Content-Length: 0 4287 ``` 4288 4289 The upload has been successfully deleted. 4290 4291 The following headers will be returned with the response: 4292 4293 |Name|Description| 4294 |----|-----------| 4295 |`Content-Length`|The `Content-Length` header must be zero and the body must be empty.| 4296 4297 4298 4299 4300 ###### On Failure: Bad Request 4301 4302 ``` 4303 400 Bad Request 4304 Content-Type: application/json; charset=utf-8 4305 4306 { 4307 "errors:" [ 4308 { 4309 "code": <error code>, 4310 "message": "<error message>", 4311 "detail": ... 4312 }, 4313 ... 4314 ] 4315 } 4316 ``` 4317 4318 An error was encountered processing the delete. The client may ignore this error. 4319 4320 4321 4322 The error codes that may be included in the response body are enumerated below: 4323 4324 |Code|Message|Description| 4325 |----|-------|-----------| 4326 | `NAME_INVALID` | invalid repository name | Invalid repository name encountered either during manifest validation or any API operation. | 4327 | `BLOB_UPLOAD_INVALID` | blob upload invalid | The blob upload encountered an error and can no longer proceed. | 4328 4329 4330 4331 ###### On Failure: Not Found 4332 4333 ``` 4334 404 Not Found 4335 Content-Type: application/json; charset=utf-8 4336 4337 { 4338 "errors:" [ 4339 { 4340 "code": <error code>, 4341 "message": "<error message>", 4342 "detail": ... 4343 }, 4344 ... 4345 ] 4346 } 4347 ``` 4348 4349 The upload is unknown to the registry. The client may ignore this error and assume the upload has been deleted. 4350 4351 4352 4353 The error codes that may be included in the response body are enumerated below: 4354 4355 |Code|Message|Description| 4356 |----|-------|-----------| 4357 | `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. | 4358 4359 4360 4361 ###### On Failure: Authentication Required 4362 4363 ``` 4364 401 Unauthorized 4365 WWW-Authenticate: <scheme> realm="<realm>", ..." 4366 Content-Length: <length> 4367 Content-Type: application/json; charset=utf-8 4368 4369 { 4370 "errors:" [ 4371 { 4372 "code": <error code>, 4373 "message": "<error message>", 4374 "detail": ... 4375 }, 4376 ... 4377 ] 4378 } 4379 ``` 4380 4381 The client is not authenticated. 4382 4383 The following headers will be returned on the response: 4384 4385 |Name|Description| 4386 |----|-----------| 4387 |`WWW-Authenticate`|An RFC7235 compliant authentication challenge header.| 4388 |`Content-Length`|Length of the JSON response body.| 4389 4390 4391 4392 The error codes that may be included in the response body are enumerated below: 4393 4394 |Code|Message|Description| 4395 |----|-------|-----------| 4396 | `UNAUTHORIZED` | authentication required | The access controller was unable to authenticate the client. Often this will be accompanied by a Www-Authenticate HTTP response header indicating how to authenticate. | 4397 4398 4399 4400 ###### On Failure: No Such Repository Error 4401 4402 ``` 4403 404 Not Found 4404 Content-Length: <length> 4405 Content-Type: application/json; charset=utf-8 4406 4407 { 4408 "errors:" [ 4409 { 4410 "code": <error code>, 4411 "message": "<error message>", 4412 "detail": ... 4413 }, 4414 ... 4415 ] 4416 } 4417 ``` 4418 4419 The repository is not known to the registry. 4420 4421 The following headers will be returned on the response: 4422 4423 |Name|Description| 4424 |----|-----------| 4425 |`Content-Length`|Length of the JSON response body.| 4426 4427 4428 4429 The error codes that may be included in the response body are enumerated below: 4430 4431 |Code|Message|Description| 4432 |----|-------|-----------| 4433 | `NAME_UNKNOWN` | repository name not known to registry | This is returned if the name used during an operation is unknown to the registry. | 4434 4435 4436 4437 ###### On Failure: Access Denied 4438 4439 ``` 4440 403 Forbidden 4441 Content-Length: <length> 4442 Content-Type: application/json; charset=utf-8 4443 4444 { 4445 "errors:" [ 4446 { 4447 "code": <error code>, 4448 "message": "<error message>", 4449 "detail": ... 4450 }, 4451 ... 4452 ] 4453 } 4454 ``` 4455 4456 The client does not have required access to the repository. 4457 4458 The following headers will be returned on the response: 4459 4460 |Name|Description| 4461 |----|-----------| 4462 |`Content-Length`|Length of the JSON response body.| 4463 4464 4465 4466 The error codes that may be included in the response body are enumerated below: 4467 4468 |Code|Message|Description| 4469 |----|-------|-----------| 4470 | `DENIED` | requested access to the resource is denied | The access controller denied access for the operation on a resource. | 4471 4472 4473 4474 4475 4476 ### Catalog 4477 4478 List a set of available repositories in the local registry cluster. Does not provide any indication of what may be available upstream. Applications can only determine if a repository is available but not if it is not available. 4479 4480 4481 4482 #### GET Catalog 4483 4484 Retrieve a sorted, json list of repositories available in the registry. 4485 4486 4487 ##### Catalog Fetch Complete 4488 4489 ``` 4490 GET /v2/_catalog 4491 ``` 4492 4493 Request an unabridged list of repositories available. 4494 4495 4496 4497 4498 4499 ###### On Success: OK 4500 4501 ``` 4502 200 OK 4503 Content-Length: <length> 4504 Content-Type: application/json; charset=utf-8 4505 4506 { 4507 "repositories": [ 4508 <name>, 4509 ... 4510 ] 4511 } 4512 ``` 4513 4514 Returns the unabridged list of repositories as a json response. 4515 4516 The following headers will be returned with the response: 4517 4518 |Name|Description| 4519 |----|-----------| 4520 |`Content-Length`|Length of the JSON response body.| 4521 4522 4523 4524 ##### Catalog Fetch Paginated 4525 4526 ``` 4527 GET /v2/_catalog?n=<integer>&last=<integer> 4528 ``` 4529 4530 Return the specified portion of repositories. 4531 4532 4533 The following parameters should be specified on the request: 4534 4535 |Name|Kind|Description| 4536 |----|----|-----------| 4537 |`n`|query|Limit the number of entries in each response. It not present, all entries will be returned.| 4538 |`last`|query|Result set will include values lexically after last.| 4539 4540 4541 4542 4543 ###### On Success: OK 4544 4545 ``` 4546 200 OK 4547 Content-Length: <length> 4548 Link: <<url>?n=<last n value>&last=<last entry from response>>; rel="next" 4549 Content-Type: application/json; charset=utf-8 4550 4551 { 4552 "repositories": [ 4553 <name>, 4554 ... 4555 ] 4556 "next": "<url>?last=<name>&n=<last value of n>" 4557 } 4558 ``` 4559 4560 4561 4562 The following headers will be returned with the response: 4563 4564 |Name|Description| 4565 |----|-----------| 4566 |`Content-Length`|Length of the JSON response body.| 4567 |`Link`|RFC5988 compliant rel='next' with URL to next result set, if available| 4568 4569 4570 4571 4572