RegistryArtifact interface
Artifact
is the general term for items stored in a container registry,
and can include Docker images or other Open Container Initiative (OCI) artifact types.
The RegistryArtifact interface is a helper that groups information and operations about an image or artifact in a container registry.
Properties
fully |
fully qualified reference of the artifact. |
registry |
The Azure Container Registry endpoint. |
repository |
Repository name. |
Methods
delete(Delete |
Deletes this registry artifact by deleting its manifest. |
delete |
Deletes a tag. This removes the tag from the artifact and its manifest. |
get |
Retrieves the properties of the manifest that uniquely identifies this artifact. |
get |
Retrieves the properties of the specified tag. |
list |
Returns an async iterable iterator to list the tags that uniquely identify this artifact and the properties of each. Example using
Example using
Example using
|
update |
Updates the properties of the artifact's manifest. Example usage:
|
update |
Updates the properties of a given tag. Example usage:
|
Property Details
fullyQualifiedReference
fully qualified reference of the artifact.
fullyQualifiedReference: string
Property Value
string
registryEndpoint
The Azure Container Registry endpoint.
registryEndpoint: string
Property Value
string
repositoryName
Repository name.
repositoryName: string
Property Value
string
Method Details
delete(DeleteArtifactOptions)
Deletes this registry artifact by deleting its manifest.
function delete(options?: DeleteArtifactOptions): Promise<void>
Parameters
- options
- DeleteArtifactOptions
Returns
Promise<void>
deleteTag(string, DeleteTagOptions)
Deletes a tag. This removes the tag from the artifact and its manifest.
function deleteTag(tag: string, options?: DeleteTagOptions): Promise<void>
Parameters
- tag
-
string
the name of the tag to delete.
- options
- DeleteTagOptions
Returns
Promise<void>
getManifestProperties(GetManifestPropertiesOptions)
Retrieves the properties of the manifest that uniquely identifies this artifact.
function getManifestProperties(options?: GetManifestPropertiesOptions): Promise<ArtifactManifestProperties>
Parameters
- options
- GetManifestPropertiesOptions
Returns
Promise<ArtifactManifestProperties>
getTagProperties(string, GetTagPropertiesOptions)
Retrieves the properties of the specified tag.
function getTagProperties(tag: string, options?: GetTagPropertiesOptions): Promise<ArtifactTagProperties>
Parameters
- tag
-
string
the tag to retrieve properties.
- options
- GetTagPropertiesOptions
Returns
Promise<ArtifactTagProperties>
listTagProperties(ListTagPropertiesOptions)
Returns an async iterable iterator to list the tags that uniquely identify this artifact and the properties of each.
Example using for-await-of
syntax:
const client = new ContainerRegistryClient(url, credentials);
const repository = client.getRepository(repositoryName);
const artifact = repository.getArtifact(digest)
for await (const tag of artifact.listTagProperties()) {
console.log("tag: ", tag);
}
Example using iter.next()
:
const iter = artifact.listTagProperties();
let item = await iter.next();
while (!item.done) {
console.log("tag properties: ", item.value);
item = await iter.next();
}
Example using byPage()
:
const pages = artifact.listTagProperties().byPage({ maxPageSize: 2 });
let page = await pages.next();
let i = 1;
while (!page.done) {
if (page.value) {
console.log(`-- page ${i++}`);
for (const tagProperties of page.value) {
console.log(` repository name: ${tagProperties}`);
}
}
page = await pages.next();
}
function listTagProperties(options?: ListTagPropertiesOptions): PagedAsyncIterableIterator<ArtifactTagProperties, ArtifactTagProperties[], PageSettings>
Parameters
- options
- ListTagPropertiesOptions
Returns
updateManifestProperties(UpdateManifestPropertiesOptions)
Updates the properties of the artifact's manifest.
Example usage:
const client = new ContainerRegistryClient(url, credential);
const artifact = client.getArtifact(repositoryName, artifactTagOrDigest)
const updated = await artifact.updateManifestProperties({
canDelete: false,
canList: false,
canRead: false,
canWrite: false
});
function updateManifestProperties(options: UpdateManifestPropertiesOptions): Promise<ArtifactManifestProperties>
Parameters
- options
- UpdateManifestPropertiesOptions
Returns
Promise<ArtifactManifestProperties>
updateTagProperties(string, UpdateTagPropertiesOptions)
Updates the properties of a given tag.
Example usage:
const client = new ContainerRegistryClient(url, credential);
const artifact = client.getArtifact(repositoryName, artifactTagOrDigest)
const updated = await artifact.updateTagProperties(tag, {
canDelete: false,
canList: false,
canRead: false,
canWrite: false
});
function updateTagProperties(tag: string, options: UpdateTagPropertiesOptions): Promise<ArtifactTagProperties>
Parameters
- tag
-
string
name of the tag to update properties on
- options
- UpdateTagPropertiesOptions
Returns
Promise<ArtifactTagProperties>