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
|
| 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
options to get tag properties
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:
import { ContainerRegistryClient } from "@azure/container-registry";
import { DefaultAzureCredential } from "@azure/identity";
const endpoint = "https://myregistryname.azurecr.io";
const repositoryName = "library/hello-world";
const artifactTagOrDigest = "latest";
const client = new ContainerRegistryClient(endpoint, new DefaultAzureCredential());
const artifact = client.getArtifact(repositoryName, artifactTagOrDigest);
for await (const tag of artifact.listTagProperties()) {
console.log("tag: ", tag);
}
function listTagProperties(options?: ListTagPropertiesOptions): PagedAsyncIterableIterator<ArtifactTagProperties, ArtifactTagProperties[], PageSettings>
Parameters
- options
- ListTagPropertiesOptions
options to list tags
Returns
updateManifestProperties(UpdateManifestPropertiesOptions)
Updates the properties of the artifact's manifest.
Example usage:
import { ContainerRegistryClient } from "@azure/container-registry";
import { DefaultAzureCredential } from "@azure/identity";
const endpoint = "https://myregistryname.azurecr.io";
const repositoryName = "library/hello-world";
const artifactTagOrDigest = "latest";
const client = new ContainerRegistryClient(endpoint, new DefaultAzureCredential());
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:
import { ContainerRegistryClient } from "@azure/container-registry";
import { DefaultAzureCredential } from "@azure/identity";
const endpoint = "https://myregistryname.azurecr.io";
const repositoryName = "library/hello-world";
const artifactTagOrDigest = "latest";
const tag = "latest";
const client = new ContainerRegistryClient(endpoint, new DefaultAzureCredential());
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>