import type { OperationOptions } from "@azure/core-client"; import type { PagedAsyncIterableIterator } from "@azure/core-paging"; import type { ArtifactTagProperties, ArtifactManifestProperties, ArtifactTagOrder, TagPageResponse } from "./models.js"; import type { GeneratedClient } from "./generated/index.js"; /** * Options for the `delete` method of `RegistryArtifact`. */ export interface DeleteArtifactOptions extends OperationOptions { } /** * Options for the `deleteTag` method of `RegistryArtifact`. */ export interface DeleteTagOptions extends OperationOptions { } /** * Options for the `getManifestProperties` method of `RegistryArtifact`. */ export interface GetManifestPropertiesOptions extends OperationOptions { } /** * Options for the `getTagProperties` method of `RegistryArtifact`. */ export interface GetTagPropertiesOptions extends OperationOptions { } /** * Options for the `updateTagProperties` method of `RegistryArtifact`. */ export interface UpdateTagPropertiesOptions extends OperationOptions { /** Whether or not this tag can be deleted */ canDelete?: boolean; /** Whether or not this tag can be written to */ canWrite?: boolean; /** Whether or not to include this tag when listing tags */ canList?: boolean; /** Whether or not this tag can be read */ canRead?: boolean; } /** * Options for the `updateManifestProperties` method of `RegistryArtifact`. */ export interface UpdateManifestPropertiesOptions extends OperationOptions { /** Whether or not this manifest can be deleted */ canDelete?: boolean; /** Whether or not this manifest can be written to */ canWrite?: boolean; /** Whether or not to include this manifest when listing manifest properties */ canList?: boolean; /** Whether or not this manifest can be read */ canRead?: boolean; } /** * Options for the `listTagProperties` method of `RegistryArtifact`. */ export interface ListTagPropertiesOptions extends OperationOptions { /** order in which the tags are returned */ order?: ArtifactTagOrder; } /** * `Artifact` is the general term for items stored in a container registry, * and can include Docker images or other Open Container Initiative (OCI) artifact types. * * The {@link RegistryArtifact} interface is a helper that groups information and operations about an image * or artifact in a container registry. * */ export interface RegistryArtifact { /** * The Azure Container Registry endpoint. */ readonly registryEndpoint: string; /** * Repository name. */ readonly repositoryName: string; /** * fully qualified reference of the artifact. */ readonly fullyQualifiedReference: string; /** * Deletes this registry artifact by deleting its manifest. * @param options - */ delete(options?: DeleteArtifactOptions): Promise; /** * Deletes a tag. This removes the tag from the artifact and its manifest. * @param tag - the name of the tag to delete. * @param options - */ deleteTag(tag: string, options?: DeleteTagOptions): Promise; /** * Retrieves the properties of the manifest that uniquely identifies this artifact. * @param options - */ getManifestProperties(options?: GetManifestPropertiesOptions): Promise; /** * Updates the properties of the artifact's manifest. * * Example usage: * * ```ts snippet:RegistryArtifactUpdateManifestProperties * 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, * }); * ``` * @param options - */ updateManifestProperties(options: UpdateManifestPropertiesOptions): Promise; /** * Retrieves the properties of the specified tag. * @param tag - the tag to retrieve properties. * @param options - options to get tag properties */ getTagProperties(tag: string, options?: GetTagPropertiesOptions): Promise; /** * Updates the properties of a given tag. * * Example usage: * * ```ts snippet:RegistryArtifactUpdateTagProperties * 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, * }); * ``` * @param tag - name of the tag to update properties on * @param options - */ updateTagProperties(tag: string, options: UpdateTagPropertiesOptions): Promise; /** * Returns an async iterable iterator to list the tags that uniquely identify this artifact and the properties of each. * * Example using `for-await-of` syntax: * * ```ts snippet:RegistryArtifactListTagProperties * 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); * } * ``` * * @param options - options to list tags */ listTagProperties(options?: ListTagPropertiesOptions): PagedAsyncIterableIterator; } /** * The client class used to interact with the Container Registry service. * @internal */ export declare class RegistryArtifactImpl { private tagOrDigest; private client; /** * The Azure Container Registry endpoint. */ readonly registryEndpoint: string; /** * Repository name. */ readonly repositoryName: string; /** * Name of the form 'registry-login-server/repository-name\@digest' or * 'registry-login-server/repository-name:tag' */ readonly fullyQualifiedReference: string; private digest?; /** * Creates an instance of a RegistryArtifact. * @param registryEndpoint - the URL to the Container Registry endpoint * @param repositoryName - the name of the repository * @param tagOrDigest - the tag or digest of this artifact * @param client - the generated client that interacts with service */ constructor(registryEndpoint: string, repositoryName: string, tagOrDigest: string, client: GeneratedClient); /** * digest of this artifact. */ private getDigest; /** * Deletes this registry artifact by deleting its manifest. * @param options - */ delete(options?: DeleteArtifactOptions): Promise; /** * Deletes a tag. This removes the tag from the artifact and its manifest. * @param tag - the name of the tag to delete. * @param options - */ deleteTag(tag: string, options?: DeleteTagOptions): Promise; /** * Retrieves the properties of the manifest that uniquely identifies this artifact. * @param options - */ getManifestProperties(options?: GetManifestPropertiesOptions): Promise; /** * Updates the properties of the artifact's manifest. * * Example usage: * * ```ts snippet:RegistryArtifactUpdateManifestProperties * 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, * }); * ``` * @param options - options to update manifest properties */ updateManifestProperties(options: UpdateManifestPropertiesOptions): Promise; /** * Retrieves the properties of the specified tag. * @param tag - the tag to retrieve properties. * @param options - options to get tag properties */ getTagProperties(tag: string, options?: GetTagPropertiesOptions): Promise; /** * Updates the properties of a given tag. * * Example usage: * * ```ts snippet:RegistryArtifactUpdateTagProperties * 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, * }); * ``` * @param tag - name of the tag to update properties on * @param options - options to update tag properties */ updateTagProperties(tag: string, options: UpdateTagPropertiesOptions): Promise; /** * Returns an async iterable iterator to list the tags that uniquely identify this artifact and the properties of each. * * Example using `for-await-of` syntax: * * ```ts snippet:RegistryArtifactListTagProperties * 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); * } * ``` * * @param options - options to list tags */ listTagProperties(options?: ListTagPropertiesOptions): PagedAsyncIterableIterator; private listTagsItems; private listTagsPage; } //# sourceMappingURL=registryArtifact.d.ts.map