RegistryArtifact interface
Artifact je obecný termín pro položky uložené v registru kontejneru a může obsahovat image Dockeru nebo jiné typy artefaktů Open Container Initiative (OCI).
Rozhraní RegistryArtifact je pomocník, který seskupuje informace a operace o imagi nebo artefaktu v registru kontejneru.
Vlastnosti
| fully |
plně kvalifikovaný odkaz na artefakt. |
| registry |
Koncový bod služby Azure Container Registry. |
| repository |
Název úložiště |
Metody
| delete(Delete |
Odstraní tento artefakt registru odstraněním jeho manifestu. |
| delete |
Odstraní značku. Tím se odebere značka z artefaktu a jeho manifestu. |
| get |
Načte vlastnosti manifestu, který jednoznačně identifikuje tento artefakt. |
| get |
Načte vlastnosti zadané značky. |
| list |
Vrátí asynchronní iterátor pro výpis značek, které jednoznačně identifikují tento artefakt a vlastnosti každého z nich. Příklad použití syntaxe
|
| update |
Aktualizuje vlastnosti manifestu artefaktu. Příklad použití:
|
| update |
Aktualizuje vlastnosti dané značky. Příklad použití:
|
Podrobnosti vlastnosti
fullyQualifiedReference
plně kvalifikovaný odkaz na artefakt.
fullyQualifiedReference: string
Hodnota vlastnosti
string
registryEndpoint
Koncový bod služby Azure Container Registry.
registryEndpoint: string
Hodnota vlastnosti
string
repositoryName
Název úložiště
repositoryName: string
Hodnota vlastnosti
string
Podrobnosti metody
delete(DeleteArtifactOptions)
Odstraní tento artefakt registru odstraněním jeho manifestu.
function delete(options?: DeleteArtifactOptions): Promise<void>
Parametry
- options
- DeleteArtifactOptions
Návraty
Promise<void>
deleteTag(string, DeleteTagOptions)
Odstraní značku. Tím se odebere značka z artefaktu a jeho manifestu.
function deleteTag(tag: string, options?: DeleteTagOptions): Promise<void>
Parametry
- tag
-
string
název značky, která se má odstranit.
- options
- DeleteTagOptions
Návraty
Promise<void>
getManifestProperties(GetManifestPropertiesOptions)
Načte vlastnosti manifestu, který jednoznačně identifikuje tento artefakt.
function getManifestProperties(options?: GetManifestPropertiesOptions): Promise<ArtifactManifestProperties>
Parametry
- options
- GetManifestPropertiesOptions
Návraty
Promise<ArtifactManifestProperties>
getTagProperties(string, GetTagPropertiesOptions)
Načte vlastnosti zadané značky.
function getTagProperties(tag: string, options?: GetTagPropertiesOptions): Promise<ArtifactTagProperties>
Parametry
- tag
-
string
značku, která má načíst vlastnosti.
- options
- GetTagPropertiesOptions
Možnosti získání vlastností štítků
Návraty
Promise<ArtifactTagProperties>
listTagProperties(ListTagPropertiesOptions)
Vrátí asynchronní iterátor pro výpis značek, které jednoznačně identifikují tento artefakt a vlastnosti každého z nich.
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 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>
Parametry
- options
- ListTagPropertiesOptions
Možnosti pro seznam štítků
Návraty
updateManifestProperties(UpdateManifestPropertiesOptions)
Aktualizuje vlastnosti manifestu artefaktu.
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 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>
Parametry
- options
- UpdateManifestPropertiesOptions
Návraty
Promise<ArtifactManifestProperties>
updateTagProperties(string, UpdateTagPropertiesOptions)
Aktualizuje vlastnosti dané značky.
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 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>
Parametry
- tag
-
string
název značky pro aktualizaci vlastností
- options
- UpdateTagPropertiesOptions
Návraty
Promise<ArtifactTagProperties>