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

fullyQualifiedReference

fully qualified reference of the artifact.

registryEndpoint

The Azure Container Registry endpoint.

repositoryName

Repository name.

Methods

delete(DeleteArtifactOptions)

Deletes this registry artifact by deleting its manifest.

deleteTag(string, DeleteTagOptions)

Deletes a tag. This removes the tag from the artifact and its manifest.

getManifestProperties(GetManifestPropertiesOptions)

Retrieves the properties of the manifest that uniquely identifies this artifact.

getTagProperties(string, GetTagPropertiesOptions)

Retrieves the properties of the specified tag.

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();
}
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
});
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
});

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

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.

Returns

Promise<void>

getManifestProperties(GetManifestPropertiesOptions)

Retrieves the properties of the manifest that uniquely identifies this artifact.

function getManifestProperties(options?: GetManifestPropertiesOptions): Promise<ArtifactManifestProperties>

Parameters

Returns

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.

Returns

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

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

Returns

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

Returns