Description:"Create, update and retrieve manifests.",
Methods:[]MethodDescriptor{
{
Method:"GET",
Description:"Fetch the manifest identified by `name` and `tag`.",
Requests:[]RequestDescriptor{
{
Headers:[]ParameterDescriptor{
hostHeader,
authHeader,
},
PathParameters:[]ParameterDescriptor{
nameParameterDescriptor,
tagParameterDescriptor,
},
Successes:[]ResponseDescriptor{
{
Description:"The manifest idenfied by `name` and `tag`. The contents can be used to identify and resolve resources required to run the specified image.",
StatusCode:http.StatusOK,
Body:BodyDescriptor{
ContentType:"application/json; charset=utf-8",
Format:manifestBody,
},
},
},
Failures:[]ResponseDescriptor{
{
Description:"The name or tag was invalid.",
StatusCode:http.StatusBadRequest,
ErrorCodes:[]ErrorCode{
ErrorCodeNameInvalid,
ErrorCodeTagInvalid,
},
Body:BodyDescriptor{
ContentType:"application/json; charset=utf-8",
Format:errorsBody,
},
},
{
StatusCode:http.StatusUnauthorized,
Description:"The client does not have access to the repository.",
Body:BodyDescriptor{
ContentType:"application/json; charset=utf-8",
Format:errorsBody,
},
ErrorCodes:[]ErrorCode{
ErrorCodeUnauthorized,
},
},
{
Description:"The named manifest is not known to the registry.",
StatusCode:http.StatusNotFound,
ErrorCodes:[]ErrorCode{
ErrorCodeNameUnknown,
ErrorCodeManifestUnknown,
},
Body:BodyDescriptor{
ContentType:"application/json; charset=utf-8",
Format:errorsBody,
},
},
},
},
},
},
{
Method:"PUT",
Description:"Put the manifest identified by `name` and `tag`.",
Requests:[]RequestDescriptor{
{
Headers:[]ParameterDescriptor{
hostHeader,
authHeader,
},
PathParameters:[]ParameterDescriptor{
nameParameterDescriptor,
tagParameterDescriptor,
},
Body:BodyDescriptor{
ContentType:"application/json; charset=utf-8",
Format:manifestBody,
},
Successes:[]ResponseDescriptor{
{
Description:"The manifest has been accepted by the registry and is stored under the specified `name` and `tag`.",
StatusCode:http.StatusAccepted,
Headers:[]ParameterDescriptor{
{
Name:"Location",
Type:"url",
Description:"The canonical location url of the uploaded manifest.",
Format:"<url>",
},
contentLengthZeroHeader,
},
},
},
Failures:[]ResponseDescriptor{
{
Name:"Invalid Manifest",
Description:"The received manifest was invalid in some way, as described by the error codes. The client should resolve the issue and retry the request.",
StatusCode:http.StatusBadRequest,
Body:BodyDescriptor{
ContentType:"application/json; charset=utf-8",
Format:errorsBody,
},
ErrorCodes:[]ErrorCode{
ErrorCodeNameInvalid,
ErrorCodeTagInvalid,
ErrorCodeManifestInvalid,
ErrorCodeManifestUnverified,
ErrorCodeBlobUnknown,
},
},
{
StatusCode:http.StatusUnauthorized,
Description:"The client does not have permission to push to the repository.",
Body:BodyDescriptor{
ContentType:"application/json; charset=utf-8",
Format:errorsBody,
},
ErrorCodes:[]ErrorCode{
ErrorCodeUnauthorized,
},
},
{
Name:"Missing Layer(s)",
Description:"One or more layers may be missing during a manifest upload. If so, the missing layers will be enumerated in the error response.",
StatusCode:http.StatusBadRequest,
ErrorCodes:[]ErrorCode{
ErrorCodeBlobUnknown,
},
Body:BodyDescriptor{
ContentType:"application/json; charset=utf-8",
Format:`{
"errors:"[{
"code":"BLOB_UNKNOWN",
"message":"blob unknown to registry",
"detail":{
"digest":<tarsum>
}
},
...
]
}`,
},
},
{
StatusCode:http.StatusUnauthorized,
Headers:[]ParameterDescriptor{
authChallengeHeader,
{
Name:"Content-Length",
Type:"integer",
Description:"Length of the JSON error response body.",
Format:"<length>",
},
},
ErrorCodes:[]ErrorCode{
ErrorCodeUnauthorized,
},
Body:BodyDescriptor{
ContentType:"application/json; charset=utf-8",
Format:errorsBody,
},
},
},
},
},
},
{
Method:"DELETE",
Description:"Delete the manifest identified by `name` and `tag`.",
Requests:[]RequestDescriptor{
{
Headers:[]ParameterDescriptor{
hostHeader,
authHeader,
},
PathParameters:[]ParameterDescriptor{
nameParameterDescriptor,
tagParameterDescriptor,
},
Successes:[]ResponseDescriptor{
{
StatusCode:http.StatusAccepted,
},
},
Failures:[]ResponseDescriptor{
{
Name:"Invalid Name or Tag",
Description:"The specified `name` or `tag` were invalid and the delete was unable to proceed.",
StatusCode:http.StatusBadRequest,
ErrorCodes:[]ErrorCode{
ErrorCodeNameInvalid,
ErrorCodeTagInvalid,
},
Body:BodyDescriptor{
ContentType:"application/json; charset=utf-8",
Format:errorsBody,
},
},
{
StatusCode:http.StatusUnauthorized,
Headers:[]ParameterDescriptor{
authChallengeHeader,
{
Name:"Content-Length",
Type:"integer",
Description:"Length of the JSON error response body.",
Format:"<length>",
},
},
ErrorCodes:[]ErrorCode{
ErrorCodeUnauthorized,
},
Body:BodyDescriptor{
ContentType:"application/json; charset=utf-8",
Format:errorsBody,
},
},
{
Name:"Unknown Manifest",
Description:"The specified `name` or `tag` 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.",
Description:"Fetch the blob identified by `name` and `digest`. Used to fetch layers by tarsum digest.",
Methods:[]MethodDescriptor{
{
Method:"GET",
Description:"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.",
Requests:[]RequestDescriptor{
{
Name:"Fetch Blob",
Headers:[]ParameterDescriptor{
hostHeader,
authHeader,
},
PathParameters:[]ParameterDescriptor{
nameParameterDescriptor,
digestPathParameter,
},
Successes:[]ResponseDescriptor{
{
Description:"The blob identified by `digest` is available. The blob content will be present in the body of the request.",
StatusCode:http.StatusOK,
Headers:[]ParameterDescriptor{
{
Name:"Content-Length",
Type:"integer",
Description:"The length of the requested blob content.",
Format:"<length>",
},
},
Body:BodyDescriptor{
ContentType:"application/octet-stream",
Format:"<blob binary data>",
},
},
{
Description:"The blob identified by `digest` is available at the provided location.",
StatusCode:http.StatusTemporaryRedirect,
Headers:[]ParameterDescriptor{
{
Name:"Location",
Type:"url",
Description:"The location where the layer should be accessible.",
Format:"<blob location>",
},
},
},
},
Failures:[]ResponseDescriptor{
{
Description:"There was a problem with the request that needs to be addressed by the client, such as an invalid `name` or `tag`.",
StatusCode:http.StatusBadRequest,
ErrorCodes:[]ErrorCode{
ErrorCodeNameInvalid,
ErrorCodeDigestInvalid,
},
Body:BodyDescriptor{
ContentType:"application/json; charset=utf-8",
Format:errorsBody,
},
},
unauthorizedResponse,
{
Description:"The blob, identified by `name` and `digest`, is unknown to the registry.",
StatusCode:http.StatusNotFound,
Body:BodyDescriptor{
ContentType:"application/json; charset=utf-8",
Format:errorsBody,
},
ErrorCodes:[]ErrorCode{
ErrorCodeNameUnknown,
ErrorCodeBlobUnknown,
},
},
},
},
{
Name:"Fetch Blob Part",
Description:"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.",
Headers:[]ParameterDescriptor{
hostHeader,
authHeader,
{
Name:"Range",
Type:"string",
Description:"HTTP Range header specifying blob chunk.",
Format:"bytes=<start>-<end>",
},
},
PathParameters:[]ParameterDescriptor{
nameParameterDescriptor,
digestPathParameter,
},
Successes:[]ResponseDescriptor{
{
Description:"The blob identified by `digest` is available. The specified chunk of blob content will be present in the body of the request.",
StatusCode:http.StatusPartialContent,
Headers:[]ParameterDescriptor{
{
Name:"Content-Length",
Type:"integer",
Description:"The length of the requested blob chunk.",
Format:"<length>",
},
{
Name:"Content-Range",
Type:"byte range",
Description:"Content range of blob chunk.",
Format:"bytes <start>-<end>/<size>",
},
},
Body:BodyDescriptor{
ContentType:"application/octet-stream",
Format:"<blob binary data>",
},
},
},
Failures:[]ResponseDescriptor{
{
Description:"There was a problem with the request that needs to be addressed by the client, such as an invalid `name` or `tag`.",
StatusCode:http.StatusBadRequest,
ErrorCodes:[]ErrorCode{
ErrorCodeNameInvalid,
ErrorCodeDigestInvalid,
},
Body:BodyDescriptor{
ContentType:"application/json; charset=utf-8",
Format:errorsBody,
},
},
unauthorizedResponse,
{
StatusCode:http.StatusNotFound,
ErrorCodes:[]ErrorCode{
ErrorCodeNameUnknown,
ErrorCodeBlobUnknown,
},
Body:BodyDescriptor{
ContentType:"application/json; charset=utf-8",
Format:errorsBody,
},
},
{
Description:"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.",
Description:"Initiate a blob upload. This endpoint can be used to create resumable uploads or monolithic uploads.",
Methods:[]MethodDescriptor{
{
Method:"POST",
Description:"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.",
Requests:[]RequestDescriptor{
{
Name:"Initiate Monolithic Blob Upload",
Description:"Upload a blob identified by the `digest` parameter in single request. This upload will not be resumable unless a recoverable error is returned.",
Headers:[]ParameterDescriptor{
hostHeader,
authHeader,
{
Name:"Content-Length",
Type:"integer",
Format:"<length of blob>",
},
},
PathParameters:[]ParameterDescriptor{
nameParameterDescriptor,
},
QueryParameters:[]ParameterDescriptor{
{
Name:"digest",
Type:"query",
Format:"<tarsum>",
Regexp:digest.DigestRegexp,
Description:`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.`,
},
},
Body:BodyDescriptor{
ContentType:"application/octect-stream",
Format:"<binary data>",
},
Successes:[]ResponseDescriptor{
{
Description:"The blob has been created in the registry and is available at the provided location.",
StatusCode:http.StatusCreated,
Headers:[]ParameterDescriptor{
{
Name:"Location",
Type:"url",
Format:"<blob location>",
},
contentLengthZeroHeader,
},
},
},
Failures:[]ResponseDescriptor{
{
Name:"Invalid Name or Digest",
StatusCode:http.StatusBadRequest,
ErrorCodes:[]ErrorCode{
ErrorCodeDigestInvalid,
ErrorCodeNameInvalid,
},
},
unauthorizedResponsePush,
},
},
{
Name:"Initiate Resumable Blob Upload",
Description:"Initiate a resumable blob upload with an empty request body.",
Headers:[]ParameterDescriptor{
hostHeader,
authHeader,
contentLengthZeroHeader,
},
PathParameters:[]ParameterDescriptor{
nameParameterDescriptor,
},
Successes:[]ResponseDescriptor{
{
Description:"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.",
StatusCode:http.StatusAccepted,
Headers:[]ParameterDescriptor{
contentLengthZeroHeader,
{
Name:"Location",
Type:"url",
Format:"/v2/<name>/blobs/uploads/<uuid>",
Description:"The location of the created upload. Clients should use the contents verbatim to complete the upload, adding parameters where required.",
},
{
Name:"Range",
Format:"0-0",
Description:"Range header indicating the progress of the upload. When starting an upload, it will return an empty range, since no content has been received.",
Description:"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.",
Methods:[]MethodDescriptor{
{
Method:"GET",
Description:"Retrieve status of upload identified by `uuid`. The primary purpose of this endpoint is to resolve the current status of a resumable upload.",
Requests:[]RequestDescriptor{
{
Description:"Retrieve the progress of the current upload, as reported by the `Range` header.",
Headers:[]ParameterDescriptor{
hostHeader,
authHeader,
},
PathParameters:[]ParameterDescriptor{
nameParameterDescriptor,
uuidParameterDescriptor,
},
Successes:[]ResponseDescriptor{
{
Name:"Upload Progress",
Description:"The upload is known and in progress. The last received offset is available in the `Range` header.",
StatusCode:http.StatusNoContent,
Headers:[]ParameterDescriptor{
{
Name:"Range",
Type:"header",
Format:"0-<offset>",
Description:"Range indicating the current progress of the upload.",
},
contentLengthZeroHeader,
},
},
},
Failures:[]ResponseDescriptor{
{
Description:"There was an error processing the upload and it must be restarted.",
StatusCode:http.StatusBadRequest,
ErrorCodes:[]ErrorCode{
ErrorCodeDigestInvalid,
ErrorCodeNameInvalid,
ErrorCodeBlobUploadInvalid,
},
Body:BodyDescriptor{
ContentType:"application/json; charset=utf-8",
Format:errorsBody,
},
},
unauthorizedResponse,
{
Description:"The upload is unknown to the registry. The upload must be restarted.",
StatusCode:http.StatusNotFound,
ErrorCodes:[]ErrorCode{
ErrorCodeBlobUploadUnknown,
},
Body:BodyDescriptor{
ContentType:"application/json; charset=utf-8",
Format:errorsBody,
},
},
},
},
},
},
{
Method:"PATCH",
Description:"Upload a chunk of data for the specified upload.",
Requests:[]RequestDescriptor{
{
Description:"Upload a chunk of data to specified upload without completing the upload.",
PathParameters:[]ParameterDescriptor{
nameParameterDescriptor,
uuidParameterDescriptor,
},
Headers:[]ParameterDescriptor{
hostHeader,
authHeader,
{
Name:"Content-Range",
Type:"header",
Format:"<start of range>-<end of range, inclusive>",
Required:true,
Description:"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.",
},
{
Name:"Content-Length",
Type:"integer",
Format:"<length of chunk>",
Description:"Length of the chunk being uploaded, corresponding the length of the request body.",
},
},
Body:BodyDescriptor{
ContentType:"application/octet-stream",
Format:"<binary chunk>",
},
Successes:[]ResponseDescriptor{
{
Name:"Chunk Accepted",
Description:"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.",
StatusCode:http.StatusNoContent,
Headers:[]ParameterDescriptor{
{
Name:"Location",
Type:"url",
Format:"/v2/<name>/blobs/uploads/<uuid>",
Description:"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.",
},
{
Name:"Range",
Type:"header",
Format:"0-<offset>",
Description:"Range indicating the current progress of the upload.",
},
contentLengthZeroHeader,
},
},
},
Failures:[]ResponseDescriptor{
{
Description:"There was an error processing the upload and it must be restarted.",
StatusCode:http.StatusBadRequest,
ErrorCodes:[]ErrorCode{
ErrorCodeDigestInvalid,
ErrorCodeNameInvalid,
ErrorCodeBlobUploadInvalid,
},
Body:BodyDescriptor{
ContentType:"application/json; charset=utf-8",
Format:errorsBody,
},
},
unauthorizedResponsePush,
{
Description:"The upload is unknown to the registry. The upload must be restarted.",
StatusCode:http.StatusNotFound,
ErrorCodes:[]ErrorCode{
ErrorCodeBlobUploadUnknown,
},
Body:BodyDescriptor{
ContentType:"application/json; charset=utf-8",
Format:errorsBody,
},
},
{
Description:"The `Content-Range` specification cannot be accepted, either because it does not overlap with the current progress or it is invalid.",
Description:"Complete the upload specified by `uuid`, optionally appending the body as the final chunk.",
Requests:[]RequestDescriptor{
{
// TODO(stevvooe): Break this down into three separate requests:
// 1. Complete an upload where all data has already been sent.
// 2. Complete an upload where the entire body is in the PUT.
// 3. Complete an upload where the final, partial chunk is the body.
Description:"Complete the upload, providing the _final_ chunk of data, if necessary. This method may take a body with all the data. If the `Content-Range` header is specified, it may include the final chunk. A request without a body will just complete the upload with previously uploaded content.",
Headers:[]ParameterDescriptor{
hostHeader,
authHeader,
{
Name:"Content-Range",
Type:"header",
Format:"<start of range>-<end of range, inclusive>",
Description:"Range of bytes identifying the block of content represented by the body. Start must the end offset retrieved via status check plus one. Note that this is a non-standard use of the `Content-Range` header. May be omitted if no data is provided.",
},
{
Name:"Content-Length",
Type:"integer",
Format:"<length of chunk>",
Description:"Length of the chunk being uploaded, corresponding to the length of the request body. May be zero if no data is provided.",
},
},
PathParameters:[]ParameterDescriptor{
nameParameterDescriptor,
uuidParameterDescriptor,
},
QueryParameters:[]ParameterDescriptor{
{
Name:"digest",
Type:"string",
Format:"<tarsum>",
Regexp:digest.DigestRegexp,
Required:true,
Description:`Digest of uploaded blob.`,
},
},
Body:BodyDescriptor{
ContentType:"application/octet-stream",
Format:"<binary chunk>",
},
Successes:[]ResponseDescriptor{
{
Name:"Upload Complete",
Description:"The upload has been completed and accepted by the registry. The canonical location will be available in the `Location` header.",
StatusCode:http.StatusNoContent,
Headers:[]ParameterDescriptor{
{
Name:"Location",
Type:"url",
Format:"<blob location>",
},
{
Name:"Content-Range",
Type:"header",
Format:"<start of range>-<end of range, inclusive>",
Description:"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.",
},
{
Name:"Content-Length",
Type:"integer",
Format:"<length of chunk>",
Description:"Length of the chunk being uploaded, corresponding the length of the request body.",
},
},
},
},
Failures:[]ResponseDescriptor{
{
Description:"There was an error processing the upload and it must be restarted.",
StatusCode:http.StatusBadRequest,
ErrorCodes:[]ErrorCode{
ErrorCodeDigestInvalid,
ErrorCodeNameInvalid,
ErrorCodeBlobUploadInvalid,
},
Body:BodyDescriptor{
ContentType:"application/json; charset=utf-8",
Format:errorsBody,
},
},
unauthorizedResponsePush,
{
Description:"The upload is unknown to the registry. The upload must be restarted.",
StatusCode:http.StatusNotFound,
ErrorCodes:[]ErrorCode{
ErrorCodeBlobUploadUnknown,
},
Body:BodyDescriptor{
ContentType:"application/json; charset=utf-8",
Format:errorsBody,
},
},
{
Description:"The `Content-Range` specification cannot be accepted, either because it does not overlap with the current progress or it is invalid. The contents of the `Range` header may be used to resolve the condition.",
Description:"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.",
},
{
Name:"Range",
Type:"header",
Format:"0-<offset>",
Description:"Range indicating the current progress of the upload.",
},
},
},
},
},
},
},
{
Method:"DELETE",
Description:"Cancel outstanding upload processes, releasing associated resources. If this is not called, the unfinished uploads will eventually timeout.",
Requests:[]RequestDescriptor{
{
Description:"Cancel the upload specified by `uuid`.",
PathParameters:[]ParameterDescriptor{
nameParameterDescriptor,
uuidParameterDescriptor,
},
Headers:[]ParameterDescriptor{
hostHeader,
authHeader,
contentLengthZeroHeader,
},
Successes:[]ResponseDescriptor{
{
Name:"Upload Deleted",
Description:"The upload has been successfully deleted.",
StatusCode:http.StatusNoContent,
Headers:[]ParameterDescriptor{
contentLengthZeroHeader,
},
},
},
Failures:[]ResponseDescriptor{
{
Description:"An error was encountered processing the delete. The client may ignore this error.",
StatusCode:http.StatusBadRequest,
ErrorCodes:[]ErrorCode{
ErrorCodeNameInvalid,
ErrorCodeBlobUploadInvalid,
},
Body:BodyDescriptor{
ContentType:"application/json; charset=utf-8",
Format:errorsBody,
},
},
unauthorizedResponse,
{
Description:"The upload is unknown to the registry. The client may ignore this error and assume the upload has been deleted.",
StatusCode:http.StatusNotFound,
ErrorCodes:[]ErrorCode{
ErrorCodeBlobUploadUnknown,
},
Body:BodyDescriptor{
ContentType:"application/json; charset=utf-8",
Format:errorsBody,
},
},
},
},
},
},
},
},
}
// ErrorDescriptors provides a list of HTTP API Error codes that may be
// encountered when interacting with the registry API.