次の方法で共有


ContainerRepository interface

コンテナー レジストリ内の repository は、同じ名前を共有するイメージまたは成果物の論理的なグループです。 たとえば、hello-world アプリケーションの異なるバージョンでは、タグを v1 して v2し、リポジトリ hello-worldでグループ化できます。

ContainerRepository インターフェイスは、このコンテナー レジストリ内のリポジトリに関する情報と操作をグループ化するヘルパーです。

プロパティ

name

リポジトリ名。

registryEndpoint

Azure Container Registry エンドポイント。

メソッド

delete(DeleteRepositoryOptions)

このリポジトリとその論理グループの一部であるすべての成果物を削除します。

getArtifact(string)

指定したタグまたはダイジェストの RegistryArtifact のヘルパー インスタンスを返します。

getProperties(GetRepositoryPropertiesOptions)

このリポジトリのプロパティを取得します。

listManifestProperties(ListManifestPropertiesOptions)

マニフェスト プロパティを一覧表示する非同期反復可能な反復子を返します。 これは、各成果物がそのマニフェストによって一意に識別されるため、このリポジトリに関連付けられている成果物のコレクションを決定する場合に便利です。

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)

このリポジトリのプロパティを更新します。

使用例:

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

プロパティの詳細

name

リポジトリ名。

name: string

プロパティ値

string

registryEndpoint

Azure Container Registry エンドポイント。

registryEndpoint: string

プロパティ値

string

メソッドの詳細

delete(DeleteRepositoryOptions)

このリポジトリとその論理グループの一部であるすべての成果物を削除します。

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

パラメーター

options
DeleteRepositoryOptions

操作の省略可能な構成

戻り値

Promise<void>

getArtifact(string)

指定したタグまたはダイジェストの RegistryArtifact のヘルパー インスタンスを返します。

function getArtifact(tagOrDigest: string): RegistryArtifact

パラメーター

tagOrDigest

string

アーティファクトのタグまたはダイジェスト

戻り値

getProperties(GetRepositoryPropertiesOptions)

このリポジトリのプロパティを取得します。

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

パラメーター

options
GetRepositoryPropertiesOptions

操作のオプション。

戻り値

listManifestProperties(ListManifestPropertiesOptions)

マニフェスト プロパティを一覧表示する非同期反復可能な反復子を返します。 これは、各成果物がそのマニフェストによって一意に識別されるため、このリポジトリに関連付けられている成果物のコレクションを決定する場合に便利です。

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>

パラメーター

options
ListManifestPropertiesOptions

操作のオプション。

戻り値

updateProperties(UpdateRepositoryPropertiesOptions)

このリポジトリのプロパティを更新します。

使用例:

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>

パラメーター

options
UpdateRepositoryPropertiesOptions

操作のオプション。

戻り値