Package land.oras
Class Registry
A registry is the main entry point for interacting with a container registry
-
Nested Class Summary
Nested Classes -
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
copy
(Registry targetRegistry, ContainerRef sourceContainer, ContainerRef targetContainer) Copy an artifact from one container to anothervoid
deleteBlob
(ContainerRef containerRef) Delete a blobvoid
deleteManifest
(ContainerRef containerRef) Delete a manifestfetchBlob
(ContainerRef containerRef) Fetch blob and return it as input streamvoid
fetchBlob
(ContainerRef containerRef, Path path) Fetch blob and save it to filefetchBlobDescriptor
(ContainerRef containerRef) Fetch blob and return it's descriptorbyte[]
getBlob
(ContainerRef containerRef) Get the blob for the given digest.getBlobStream
(ContainerRef containerRef) Get blob as stream to avoid loading into memorygetDescriptor
(ContainerRef containerRef) Retrieve a descriptorgetIndex
(ContainerRef containerRef) Retrieve an indexgetManifest
(ContainerRef containerRef) Retrieve a manifestgetReferrers
(ContainerRef containerRef, @Nullable ArtifactType artifactType) Get the referrers of a containerGet the HTTP scheme depending on the insecure flaggetTags
(ContainerRef containerRef) Get the tags of a containervoid
pullArtifact
(ContainerRef containerRef, Path path, boolean overwrite) Pull an artifactpushArtifact
(ContainerRef containerRef, ArtifactType artifactType, Annotations annotations, @Nullable Config config, LocalPath... paths) Push an artifactpushBlob
(ContainerRef containerRef, byte[] data) Push the blob for the given layerPush a blob from filepushIndex
(ContainerRef containerRef, Index index) Push a manifestpushManifest
(ContainerRef containerRef, Manifest manifest) Push a manifestMethods inherited from class land.oras.OCI
attachArtifact, attachArtifact, pushArtifact, pushArtifact, pushArtifact, pushBlob, pushBlob, pushConfig, pushLayers
-
Method Details
-
getScheme
Get the HTTP scheme depending on the insecure flag- Returns:
- The scheme
-
getTags
Get the tags of a container- Parameters:
containerRef
- The container- Returns:
- The tags
-
getReferrers
Get the referrers of a container- Parameters:
containerRef
- The containerartifactType
- The optional artifact type- Returns:
- The referrers
-
deleteManifest
Delete a manifest- Parameters:
containerRef
- The artifact
-
pushManifest
Description copied from class:OCI
Push a manifest- Specified by:
pushManifest
in classOCI<ContainerRef>
- Parameters:
containerRef
- The refmanifest
- The manifest- Returns:
- The location
-
pushIndex
Push a manifest- Parameters:
containerRef
- The containerindex
- The index- Returns:
- The location
-
deleteBlob
Delete a blob- Parameters:
containerRef
- The container
-
pullArtifact
Description copied from class:OCI
Pull an artifact- Specified by:
pullArtifact
in classOCI<ContainerRef>
- Parameters:
containerRef
- The reference of the artifactpath
- The path to save the artifactoverwrite
- Overwrite the artifact if it exists
-
pushArtifact
public Manifest pushArtifact(ContainerRef containerRef, ArtifactType artifactType, Annotations annotations, @Nullable Config config, LocalPath... paths) Description copied from class:OCI
Push an artifact- Specified by:
pushArtifact
in classOCI<ContainerRef>
- Parameters:
containerRef
- The containerartifactType
- The artifact type. Can be nullannotations
- The annotationsconfig
- The configpaths
- The paths- Returns:
- The manifest
-
copy
public void copy(Registry targetRegistry, ContainerRef sourceContainer, ContainerRef targetContainer) Copy an artifact from one container to another- Parameters:
targetRegistry
- The target registrysourceContainer
- The source containertargetContainer
- The target container
-
pushBlob
Description copied from class:OCI
Push a blob from file- Specified by:
pushBlob
in classOCI<ContainerRef>
- Parameters:
containerRef
- The containerblob
- The blobannotations
- The annotations- Returns:
- The layer
-
pushBlob
Description copied from class:OCI
Push the blob for the given layer- Specified by:
pushBlob
in classOCI<ContainerRef>
- Parameters:
containerRef
- The container refdata
- The data- Returns:
- The layer
-
getBlob
Get the blob for the given digest. Not be suitable for large blobs- Specified by:
getBlob
in classOCI<ContainerRef>
- Parameters:
containerRef
- The container- Returns:
- The blob as bytes
-
fetchBlob
Description copied from class:OCI
Fetch blob and save it to file- Specified by:
fetchBlob
in classOCI<ContainerRef>
- Parameters:
containerRef
- The refpath
- The path to save the blob
-
fetchBlob
Description copied from class:OCI
Fetch blob and return it as input stream- Specified by:
fetchBlob
in classOCI<ContainerRef>
- Parameters:
containerRef
- The ref- Returns:
- The input stream
-
fetchBlobDescriptor
Description copied from class:OCI
Fetch blob and return it's descriptor- Specified by:
fetchBlobDescriptor
in classOCI<ContainerRef>
- Parameters:
containerRef
- The ref- Returns:
- The descriptor
-
getManifest
Description copied from class:OCI
Retrieve a manifest- Specified by:
getManifest
in classOCI<ContainerRef>
- Parameters:
containerRef
- The ref- Returns:
- The manifest
-
getIndex
Description copied from class:OCI
Retrieve an index- Specified by:
getIndex
in classOCI<ContainerRef>
- Parameters:
containerRef
- The ref- Returns:
- The index
-
getDescriptor
Description copied from class:OCI
Retrieve a descriptor- Specified by:
getDescriptor
in classOCI<ContainerRef>
- Parameters:
containerRef
- The ref- Returns:
- The descriptor
-
getBlobStream
Get blob as stream to avoid loading into memory- Parameters:
containerRef
- The container ref- Returns:
- The input stream
-