Sdílet prostřednictvím


ContainerRepository interface

repository v registru kontejneru je logické seskupení imagí nebo artefaktů, které sdílejí stejný název. Například různé verze aplikace hello-world mohou mít značky v1 a v2a být seskupené podle úložiště hello-world.

Rozhraní ContainerRepository je pomocník, který seskupuje informace a operace o úložišti v tomto registru kontejneru.

Vlastnosti

name

Název úložiště

registryEndpoint

Koncový bod služby Azure Container Registry.

Metody

delete(DeleteRepositoryOptions)

Odstraní toto úložiště a všechny artefakty, které jsou součástí logické skupiny.

getArtifact(string)

Vrátí pomocnou instanci RegistryArtifact pro danou značku nebo hodnotu digest.

getProperties(GetRepositoryPropertiesOptions)

Načte vlastnosti tohoto úložiště.

listManifestProperties(ListManifestPropertiesOptions)

Vrátí asynchronní iterátor pro výpis vlastností manifestu. To je užitečné při určování kolekce artefaktů přidružených k tomuto úložišti, protože každý artefakt je jednoznačně identifikován jeho manifestem.

Příklad použití syntaxe for-await-of:

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)

Aktualizuje vlastnosti tohoto úložiště.

Příklad použití:

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

Podrobnosti vlastnosti

name

Název úložiště

name: string

Hodnota vlastnosti

string

registryEndpoint

Koncový bod služby Azure Container Registry.

registryEndpoint: string

Hodnota vlastnosti

string

Podrobnosti metody

delete(DeleteRepositoryOptions)

Odstraní toto úložiště a všechny artefakty, které jsou součástí logické skupiny.

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

Parametry

options
DeleteRepositoryOptions

volitelná konfigurace operace

Návraty

Promise<void>

getArtifact(string)

Vrátí pomocnou instanci RegistryArtifact pro danou značku nebo hodnotu digest.

function getArtifact(tagOrDigest: string): RegistryArtifact

Parametry

tagOrDigest

string

značka nebo hodnota hash artefaktu

Návraty

getProperties(GetRepositoryPropertiesOptions)

Načte vlastnosti tohoto úložiště.

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

Parametry

options
GetRepositoryPropertiesOptions

Možnosti operace.

Návraty

listManifestProperties(ListManifestPropertiesOptions)

Vrátí asynchronní iterátor pro výpis vlastností manifestu. To je užitečné při určování kolekce artefaktů přidružených k tomuto úložišti, protože každý artefakt je jednoznačně identifikován jeho manifestem.

Příklad použití syntaxe for-await-of:

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>

Parametry

options
ListManifestPropertiesOptions

Možnosti operace.

Návraty

updateProperties(UpdateRepositoryPropertiesOptions)

Aktualizuje vlastnosti tohoto úložiště.

Příklad použití:

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>

Parametry

options
UpdateRepositoryPropertiesOptions

Možnosti operace.

Návraty