registry_data

用于跟踪注册表元数据的模块。

class RegistryData(image_name: str, *args, **kwargs)[源]

基类:PodmanResource

关于镜像的注册表元数据。

初始化 RegistryData 对象。

参数:

image_name – 镜像名称。

关键字参数:
  • client (APIClient) – 配置好的 Podman 服务连接。

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

has_platform(platform: str | Mapping[str, Any]) bool[源]

如果镜像支持指定平台,则返回 True。

Podman API 不支持“变体”,因此将其忽略。

参数:

platform – 平台名称,格式为 os[/arch[/variant]] 或 Mapping[str,Any]

返回:

如果平台可用,则为 True

抛出:
  • InvalidArgument – 当平台值无效时

  • APIError – 当服务报告错误时

pull(platform: str | None = None) Image[源]

返回通过标识符拉取的镜像。

参数:

platform – 要拉取镜像的平台。默认值:None(所有平台)。

reload(**kwargs) None

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

关键字参数:

compatible (bool) – 使用 Docker 兼容端点

property id

返回对象的标识符。

类型:

str

property short_id

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

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

类型:

str