清单

清单资源的模型和管理器。

class Manifest(attrs: Mapping[str, Any] | None = None, client: APIClient | None = None, collection: Manager | None = None, podman_client: PodmanClient | None = None)[source]

基类:PodmanResource

由 Podman 服务管理的清单的详细信息和配置。

初始化 PodmanResource 的基类。

参数:
  • attrs – Podman 服务资源属性的映射。

  • client – Podman 服务的配置连接。

  • collection – 此类资源的管理器,为了兼容性命名为 collection

  • podman_client – 配置为连接到 Podman 对象的 PodmanClient()。

add(images: list[Image | str], **kwargs) None[source]

将镜像添加到清单列表。

参数:

images – 要添加到清单的镜像列表。

关键字参数:
  • all (bool)

  • annotation (dict[str, str])

  • arch (str)

  • features (list[str])

  • os (str)

  • os_version (str)

  • variant (str)

抛出:
  • ImageNotFound – 当找不到镜像时

  • APIError – 当服务报告错误时

push(destination: str, all: bool | None = None, **kwargs) None[source]

将清单列表或镜像索引推送到注册表。

参数:
  • destination – 推送目标。

  • all – 推送所有镜像。

关键字参数:

str] (auth_config (Mapping[str,) – 覆盖已配置的凭据。必须包含用户名和密码键。

抛出:
  • NotFound – 当找不到清单时

  • APIError – 当服务报告错误时

reload() None[source]

从服务刷新此对象的数据。

remove(digest: str) None[source]

从清单列表中删除镜像摘要。

参数:

digest – 要删除的镜像摘要。如果提供了完整的镜像引用,将解析出摘要。

抛出:
  • ImageNotFound – 当找不到镜像时

  • APIError – 当服务报告错误时

property id

返回清单列表的标识符。

类型:

str

property media_type

返回此清单的媒体/MIME 类型。

类型:

Optional[str]

property name

返回清单列表的人类可读标识符。

类型:

str

property names

返回清单的标识符。

类型:

list[str]

property quoted_name

名称作为路径参数引用。

类型:

str

property short_id

返回截断的标识符。当包含在 id 中时,保留“sha256”。

不尝试确保返回的值对所有资源都具有语义意义。

类型:

str

property version

返回此清单的模式版本类型。

类型:

int

class ManifestsManager(client: APIClient | None = None, podman_client: PodmanClient | None = None)[source]

基类:Manager

清单资源的专用管理器。

初始化 Manager() 对象。

参数:
  • client – 配置为连接到 Podman 服务的 APIClient()。

  • podman_client – 配置为连接到 Podman 对象的 PodmanClient()。

create(name: str, images: list[Image | str] | None = None, all: bool | None = None) Manifest[source]

创建清单。

参数:
  • name – 清单列表的名称。

  • images – 要包含在清单中的镜像或镜像标识符。

  • all – 当为 True 时,添加给定镜像的所有内容。

抛出:
  • ValueError – 未提供名称时

  • NotFoundImage – 给定镜像不存在时

exists(key: str) bool[source]

如果资源存在则返回 True。

仅限 Podman。

备注

此方法不提供任何互斥机制。

get(key: str) Manifest[source]

按名称返回清单。

为了使 Manifest 与其他 PodmanResource 保持一致,我们使用检索 Manifest 的键作为其名称。

参数:

key – 要搜索的清单名称

抛出:
  • NotFound – 未找到清单时

  • APIError – 当服务报告错误时

list(**kwargs) list[Manifest][source]

未实现。

prepare_model(attrs: PodmanResource | Mapping[str, Any]) PodmanResourceType

从一组属性创建模型。

remove(name: Manifest | str) dict[str, Any][source]

从 Podman 服务中删除清单列表。

property resource

prepare_model() 将创建 Manifest 类。

类型:

Type[Manifest]