Share via


ContainerRepository interface

A repository in a container registry is a logical grouping of images or artifacts that share the same name. For example, different versions of a hello-world application could have tags v1 and v2, and be grouped by the repository hello-world.

The ContainerRepository interface is a helper that groups information and operations about a repository in this container registry.

Properties

name

Repository name.

registryEndpoint

The Azure Container Registry endpoint.

Methods

delete(DeleteRepositoryOptions)

Deletes this repository and all artifacts that are part of its logical group.

getArtifact(string)

Returns an helper instance of RegistryArtifact for the given tag or digest.

getProperties(GetRepositoryPropertiesOptions)

Retrieves the properties of this repository.

listManifestProperties(ListManifestPropertiesOptions)

Returns an async iterable iterator to list manifest properties. This is useful for determining the collection of artifacts associated with this repository, as each artifact is uniquely identified by its manifest.

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 client = new ContainerRegistryClient(endpoint, new DefaultAzureCredential());
const repository = client.getRepository(repositoryName);

for await (const manifest of repository.listManifestProperties()) {
  console.log("manifest: ", manifest);
}
updateProperties(UpdateRepositoryPropertiesOptions)

Updates the properties of this repository.

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 client = new ContainerRegistryClient(endpoint, new DefaultAzureCredential());
const repository = client.getRepository(repositoryName);

const updated = await repository.updateProperties({
  canDelete: false,
  canList: false,
  canRead: false,
  canWrite: false,
});

Property Details

name

Repository name.

name: string

Property Value

string

registryEndpoint

The Azure Container Registry endpoint.

registryEndpoint: string

Property Value

string

Method Details

delete(DeleteRepositoryOptions)

Deletes this repository and all artifacts that are part of its logical group.

function delete(options?: DeleteRepositoryOptions): Promise<void>

Parameters

options
DeleteRepositoryOptions

optional configuration for the operation

Returns

Promise<void>

getArtifact(string)

Returns an helper instance of RegistryArtifact for the given tag or digest.

function getArtifact(tagOrDigest: string): RegistryArtifact

Parameters

tagOrDigest

string

the tag or digest of the artifact

Returns

getProperties(GetRepositoryPropertiesOptions)

Retrieves the properties of this repository.

function getProperties(options?: GetRepositoryPropertiesOptions): Promise<ContainerRepositoryProperties>

Parameters

options
GetRepositoryPropertiesOptions

The options for the operation.

Returns

listManifestProperties(ListManifestPropertiesOptions)

Returns an async iterable iterator to list manifest properties. This is useful for determining the collection of artifacts associated with this repository, as each artifact is uniquely identified by its manifest.

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 client = new ContainerRegistryClient(endpoint, new DefaultAzureCredential());
const repository = client.getRepository(repositoryName);

for await (const manifest of repository.listManifestProperties()) {
  console.log("manifest: ", manifest);
}
function listManifestProperties(options?: ListManifestPropertiesOptions): PagedAsyncIterableIterator<ArtifactManifestProperties, ArtifactManifestProperties[], PageSettings>

Parameters

options
ListManifestPropertiesOptions

The options for the operation.

Returns

updateProperties(UpdateRepositoryPropertiesOptions)

Updates the properties of this repository.

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 client = new ContainerRegistryClient(endpoint, new DefaultAzureCredential());
const repository = client.getRepository(repositoryName);

const updated = await repository.updateProperties({
  canDelete: false,
  canList: false,
  canRead: false,
  canWrite: false,
});
function updateProperties(options: UpdateRepositoryPropertiesOptions): Promise<ContainerRepositoryProperties>

Parameters

options
UpdateRepositoryPropertiesOptions

The options for the operation.

Returns