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. |
registry |
The Azure Container Registry endpoint. |
Methods
delete(Delete |
Deletes this repository and all artifacts that are part of its logical group. |
get |
Returns an helper instance of RegistryArtifact for the given tag or digest. |
get |
Retrieves the properties of this repository. |
list |
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
Example using
Example using
|
update |
Updates the properties of this repository. Example usage:
|
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
Returns
Promise<ContainerRepositoryProperties>
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:
const client = new ContainerRegistryClient(url, credential);
const repository = client.getRepository(repositoryName)
for await (const manifest of repository.listManifestProperties()) {
console.log("manifest: ", manifest);
}
Example using iter.next()
:
const iter = repository.listManifestProperties();
let item = await iter.next();
while (!item.done) {
console.log("manifest properties: ", item.value);
item = await iter.next();
}
Example using byPage()
:
const pages = repository.listManifestProperties().byPage({ maxPageSize: 2 });
let page = await pages.next();
let i = 1;
while (!page.done) {
if (page.value) {
console.log(`-- page ${i++}`);
for (const manifestProperties of page.value) {
console.log(` manifest properties: ${manifestProperties}`);
}
}
page = await pages.next();
}
function listManifestProperties(options?: ListManifestPropertiesOptions): PagedAsyncIterableIterator<ArtifactManifestProperties, ArtifactManifestProperties[], PageSettings>
Parameters
- options
- ListManifestPropertiesOptions
Returns
updateProperties(UpdateRepositoryPropertiesOptions)
Updates the properties of this repository.
Example usage:
const client = new ContainerRegistryClient(url, credential);
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
Returns
Promise<ContainerRepositoryProperties>