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 TypeMethodDescriptionReturn a new registry as insecure but with same settingsstatic Registry.Builderbuilder()Return a new builder for this registrybooleancanMount(OCI<?> other, ContainerRef sourceRef, ContainerRef targetRef) Return whether this OCI instance supports mounting blobs from the given source OCI instance.Return a new registry with the given registry URL but with same settingsvoiddeleteBlob(ContainerRef containerRef) Delete a blobvoiddeleteManifest(ContainerRef containerRef) Delete a manifestfetchBlob(ContainerRef containerRef) Fetch blob and return it as input streamvoidfetchBlob(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 descriptorGet the executor service for concurrent operations.getIndex(ContainerRef containerRef) Retrieve an indexgetManifest(ContainerRef containerRef) Retrieve a manifestgetReferrers(ContainerRef containerRef, @Nullable ArtifactType artifactType) Get the referrers of a containerGet the registries configuration@Nullable StringGet the registry URLGet the tags for a refGet the HTTP scheme depending on the insecure flaggetTags(ContainerRef containerRef) Get the tags for a refgetTags(ContainerRef containerRef, int n, @Nullable String last) Get the tags for a refbooleanReturn if this registry is insecurebooleanmountBlob(ContainerRef sourceRef, ContainerRef targetRef) Mount a blob from another repository in the same OCI target.Probe a descriptor.voidpullArtifact(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 layerpushBlob(ContainerRef ref, long size, Supplier<InputStream> stream, Map<String, String> annotations) Push a blob from input stream with known digest and sizePush a blob from filepushIndex(ContainerRef containerRef, Index index) Push an indexpushManifest(ContainerRef containerRef, Manifest manifest) Push a manifestMethods inherited from class land.oras.OCI
attachArtifact, attachArtifact, collectLayers, isIndexMediaType, isManifestMediaType, pullConfig, pushArtifact, pushArtifact, pushArtifact, pushBlob, pushBlob, pushConfig, pushLayer, pushLayers
-
Method Details
-
canMount
Description copied from class:OCIReturn whether this OCI instance supports mounting blobs from the given source OCI instance.- Specified by:
canMountin classOCI<ContainerRef>- Parameters:
other- The source OCI instance to check compatibility withsourceRef- The source referencetargetRef- The target reference- Returns:
trueif mounting fromotheris supported
-
mountBlob
Description copied from class:OCIMount a blob from another repository in the same OCI target.- Specified by:
mountBlobin classOCI<ContainerRef>- Parameters:
sourceRef- The source reference containing the source repository or layout pathtargetRef- The target reference containing the digest to mount- Returns:
trueif the blob is successfully mounted,falseotherwise (not supported by registry)
-
getRegistriesConf
Get the registries configuration- Returns:
- The registries configuration
-
builder
Return a new builder for this registry- Returns:
- The builder
-
isInsecure
public boolean isInsecure()Return if this registry is insecure- Returns:
- True if insecure
-
getScheme
Get the HTTP scheme depending on the insecure flag- Returns:
- The scheme
-
copy
Return a new registry with the given registry URL but with same settings- Parameters:
newRegistry- The new target registry URL to use in the new registry- Returns:
- The new registry
-
asInsecure
Return a new registry as insecure but with same settings- Returns:
- The new registry
-
getRegistry
Get the registry URL- Returns:
- The registry URL
-
getExecutorService
Description copied from class:OCIGet the executor service for concurrent operations. This is used for concurrent pushing and pulling of layers.- Specified by:
getExecutorServicein classOCI<ContainerRef>- Returns:
- The executor service
-
getTags
Description copied from class:OCIGet the tags for a ref- Specified by:
getTagsin classOCI<ContainerRef>- Parameters:
containerRef- The ref- Returns:
- The tags
-
getTags
Description copied from class:OCIGet the tags for a ref- Specified by:
getTagsin classOCI<ContainerRef>- Parameters:
containerRef- The refn- The number of tags to return. If n is less than or equal to 0, return all tagslast- The last tag index, to iterate. If null, start from the beginning- Returns:
- The tags
-
getRepositories
Description copied from class:OCIGet the tags for a ref- Specified by:
getRepositoriesin classOCI<ContainerRef>- Returns:
- The repositories
-
getReferrers
Description copied from class:OCIGet the referrers of a container- Specified by:
getReferrersin classOCI<ContainerRef>- Parameters:
containerRef- The refartifactType- The optional artifact type- Returns:
- The referrers
-
deleteManifest
Delete a manifest- Parameters:
containerRef- The artifact
-
pushManifest
Description copied from class:OCIPush a manifest- Specified by:
pushManifestin classOCI<ContainerRef>- Parameters:
containerRef- The refmanifest- The manifest- Returns:
- The location
-
pushIndex
Description copied from class:OCIPush an index- Specified by:
pushIndexin classOCI<ContainerRef>- Parameters:
containerRef- The refindex- The index- Returns:
- The index
-
deleteBlob
Delete a blob- Parameters:
containerRef- The container
-
pullArtifact
Description copied from class:OCIPull an artifact- Specified by:
pullArtifactin 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:OCIPush an artifact- Specified by:
pushArtifactin classOCI<ContainerRef>- Parameters:
containerRef- The containerartifactType- The artifact type. Can be nullannotations- The annotationsconfig- The configpaths- The paths- Returns:
- The manifest
-
pushBlob
Description copied from class:OCIPush a blob from file- Specified by:
pushBlobin classOCI<ContainerRef>- Parameters:
containerRef- The containerblob- The blobannotations- The annotations- Returns:
- The layer
-
pushBlob
public Layer pushBlob(ContainerRef ref, long size, Supplier<InputStream> stream, Map<String, String> annotations) Description copied from class:OCIPush a blob from input stream with known digest and size- Specified by:
pushBlobin classOCI<ContainerRef>- Parameters:
ref- The container ref with digestsize- The size of the blobstream- The input stream of the blobannotations- The annotations- Returns:
- The layer
-
pushBlob
Description copied from class:OCIPush the blob for the given layer- Specified by:
pushBlobin 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:
getBlobin classOCI<ContainerRef>- Parameters:
containerRef- The container- Returns:
- The blob as bytes
-
fetchBlob
Description copied from class:OCIFetch blob and save it to file- Specified by:
fetchBlobin classOCI<ContainerRef>- Parameters:
containerRef- The refpath- The path to save the blob
-
fetchBlob
Description copied from class:OCIFetch blob and return it as input stream- Specified by:
fetchBlobin classOCI<ContainerRef>- Parameters:
containerRef- The ref- Returns:
- The input stream
-
fetchBlobDescriptor
Description copied from class:OCIFetch blob and return it's descriptor- Specified by:
fetchBlobDescriptorin classOCI<ContainerRef>- Parameters:
containerRef- The ref- Returns:
- The descriptor
-
getManifest
Description copied from class:OCIRetrieve a manifest- Specified by:
getManifestin classOCI<ContainerRef>- Parameters:
containerRef- The ref- Returns:
- The manifest
-
getIndex
Description copied from class:OCIRetrieve an index- Specified by:
getIndexin classOCI<ContainerRef>- Parameters:
containerRef- The ref- Returns:
- The index
-
getDescriptor
Description copied from class:OCIRetrieve a descriptor- Specified by:
getDescriptorin classOCI<ContainerRef>- Parameters:
containerRef- The ref- Returns:
- The descriptor
-
probeDescriptor
Description copied from class:OCIProbe a descriptor. Typically used to get digest, size and media type without the content- Specified by:
probeDescriptorin classOCI<ContainerRef>- Parameters:
ref- The ref- Returns:
- The descriptor
-
getBlobStream
Get blob as stream to avoid loading into memory- Parameters:
containerRef- The container ref- Returns:
- The input stream
-