public class RegistryClient extends Object
| Constructor and Description |
|---|
RegistryClient(Authorization authorization,
String serverUrl,
String imageName) |
| Modifier and Type | Method and Description |
|---|---|
BlobDescriptor |
checkBlob(DescriptorDigest blobDigest) |
RegistryAuthenticator |
getRegistryAuthenticator() |
Void |
pullBlob(DescriptorDigest blobDigest,
OutputStream destinationOutputStream)
Downloads the BLOB to a file.
|
ManifestTemplate |
pullManifest(String imageTag) |
<T extends ManifestTemplate> |
pullManifest(String imageTag,
Class<T> manifestTemplateClass)
Pulls the image manifest for a specific tag.
|
boolean |
pushBlob(DescriptorDigest blobDigest,
Blob blob)
Pushes the BLOB, or skips if the BLOB already exists on the registry.
|
void |
pushManifest(BuildableManifestTemplate manifestTemplate,
String imageTag)
Pushes the image manifest for a specific tag.
|
RegistryClient |
setTimer(Timer parentTimer) |
static void |
setUserAgentSuffix(String userAgentSuffix)
Sets a suffix to append to
User-Agent headers. |
public RegistryClient(@Nullable Authorization authorization, String serverUrl, String imageName)
public RegistryClient setTimer(Timer parentTimer)
public static void setUserAgentSuffix(@Nullable String userAgentSuffix)
User-Agent headers.@Nullable public RegistryAuthenticator getRegistryAuthenticator() throws IOException, RegistryException
RegistryAuthenticator to authenticate pulls/pushes with the registry, or
null if no token authentication is necessaryIOExceptionRegistryExceptionpublic <T extends ManifestTemplate> T pullManifest(String imageTag, Class<T> manifestTemplateClass) throws IOException, RegistryException
imageTag - the tag to pull onmanifestTemplateClass - the specific version of manifest template to pull, or ManifestTemplate to pull either V22ManifestTemplate or V21ManifestTemplateIOExceptionRegistryExceptionpublic ManifestTemplate pullManifest(String imageTag) throws IOException, RegistryException
IOExceptionRegistryExceptionpublic void pushManifest(BuildableManifestTemplate manifestTemplate, String imageTag) throws IOException, RegistryException
IOExceptionRegistryException@Nullable public BlobDescriptor checkBlob(DescriptorDigest blobDigest) throws IOException, RegistryException
BlobDescriptor if the BLOB exists on the registry, or null
if it doesn'tIOExceptionRegistryExceptionpublic Void pullBlob(DescriptorDigest blobDigest, OutputStream destinationOutputStream) throws RegistryException, IOException
blobDigest - the digest of the BLOB to downloaddestinationOutputStream - the OutputStream to write the BLOB toBlob backed by the file at destPath. The file at destPath
must exist for Blob to be valid.RegistryExceptionIOExceptionpublic boolean pushBlob(DescriptorDigest blobDigest, Blob blob) throws IOException, RegistryException
blobDigest - the digest of the BLOB, used for existence-checkblob - the BLOB to pushtrue if the BLOB already exists on the registry and pushing was skipped; false
if the BLOB was pushedIOExceptionRegistryExceptionCopyright © 2018. All rights reserved.