ContainerRegistryClient class
The client class used to interact with the Container Registry service.
Constructors
| Container |
Creates an instance of a ContainerRegistryClient to interact with an Azure Container Registry that has anonymous pull access enabled. Only operations that support anonymous access are enabled. Other service methods will throw errors. Example usage:
|
| Container |
Creates an instance of a ContainerRegistryClient. Example usage:
|
Properties
| endpoint | The Azure Container Registry endpoint. |
Methods
| delete |
Deletes the repository identified by the given name and all associated artifacts. |
| get |
Returns an instance of RegistryArtifact for calling service methods related to the artifact specified by |
| get |
Returns an instance of ContainerRepository for calling service methods related to the repository specified by |
| list |
Returns an async iterable iterator to list names of repositories in this registry. Example usage:
|
Constructor Details
ContainerRegistryClient(string, ContainerRegistryClientOptions)
Creates an instance of a ContainerRegistryClient to interact with an Azure Container Registry that has anonymous pull access enabled. Only operations that support anonymous access are enabled. Other service methods will throw errors.
Example usage:
import { ContainerRegistryClient, KnownContainerRegistryAudience } from "@azure/container-registry";
const endpoint = "https://myregistryname.azurecr.io";
// Create a new ContainerRegistryClient for anonymous access
const client = new ContainerRegistryClient(endpoint, {
audience: KnownContainerRegistryAudience.AzureResourceManagerPublicCloud,
});
new ContainerRegistryClient(endpoint: string, options?: ContainerRegistryClientOptions)
Parameters
- endpoint
-
string
the URL endpoint of the container registry
- options
- ContainerRegistryClientOptions
optional configuration used to send requests to the service
ContainerRegistryClient(string, TokenCredential, ContainerRegistryClientOptions)
Creates an instance of a ContainerRegistryClient.
Example usage:
import { ContainerRegistryClient, KnownContainerRegistryAudience } from "@azure/container-registry";
import { DefaultAzureCredential } from "@azure/identity";
const endpoint = "https://myregistryname.azurecr.io";
// Create a ContainerRegistryClient that will authenticate through Active Directory
const client = new ContainerRegistryClient(endpoint, new DefaultAzureCredential(), {
audience: KnownContainerRegistryAudience.AzureResourceManagerPublicCloud,
});
new ContainerRegistryClient(endpoint: string, credential: TokenCredential, options?: ContainerRegistryClientOptions)
Parameters
- endpoint
-
string
the URL endpoint of the container registry
- credential
- TokenCredential
used to authenticate requests to the service
- options
- ContainerRegistryClientOptions
optional configuration used to send requests to the service
Property Details
endpoint
The Azure Container Registry endpoint.
endpoint: string
Property Value
string
Method Details
deleteRepository(string, DeleteRepositoryOptions)
Deletes the repository identified by the given name and all associated artifacts.
function deleteRepository(repositoryName: string, options?: DeleteRepositoryOptions): Promise<void>
Parameters
- repositoryName
-
string
the name of repository to delete
- options
- DeleteRepositoryOptions
optional configuration for the operation
Returns
Promise<void>
getArtifact(string, string)
Returns an instance of RegistryArtifact for calling service methods related to the artifact specified by repositoryName and tagOrDigest.
function getArtifact(repositoryName: string, tagOrDigest: string): RegistryArtifact
Parameters
- repositoryName
-
string
the name of repository
- tagOrDigest
-
string
tag or digest of the artifact to retrieve
Returns
getRepository(string)
Returns an instance of ContainerRepository for calling service methods related to the repository specified by repositoryName.
function getRepository(repositoryName: string): ContainerRepository
Parameters
- repositoryName
-
string
the name of repository
Returns
listRepositoryNames(ListRepositoriesOptions)
Returns an async iterable iterator to list names of repositories in this registry.
Example usage:
import { ContainerRegistryClient, KnownContainerRegistryAudience } from "@azure/container-registry";
import { DefaultAzureCredential } from "@azure/identity";
const endpoint = "https://myregistryname.azurecr.io";
const client = new ContainerRegistryClient(endpoint, new DefaultAzureCredential(), {
audience: KnownContainerRegistryAudience.AzureResourceManagerPublicCloud,
});
const iterator = client.listRepositoryNames();
for await (const repository of iterator) {
console.log(` repository: ${repository}`);
}
function listRepositoryNames(options?: ListRepositoriesOptions): PagedAsyncIterableIterator<string, RepositoryPageResponse, PageSettings>
Parameters
- options
- ListRepositoriesOptions
The options for the request