搜索

14.5. 从自定义文件类型存储库下载文件到主机

download PDF

您可以使用 curl -O 通过 HTTPS 下载文件,如果选择了 Unprotected 选项,则可以通过 HTTP 将文件下载到客户端。

先决条件

流程

  1. 在 Satellite Web UI 中,进入到 Content > Products
  2. 按名称选择自定义产品。
  3. 按名称选择文件类型存储库。
  4. 确保选中 Unprotected 复选框,以访问通过 HTTP 发布的存储库。
  5. 复制 Published At URL。
  6. 在客户端上,从 Satellite 服务器下载该文件:

    • 对于 HTTPS:

      # curl \
      --cacert ./_katello-server-ca.crt \
      --cert ./_My_Organization_key-cert.pem \
      --remote-name \
      https://satellite.example.com/pulp/content/My_Organization_Label/Library/custom/My_Product_Label/My_Repository_Label/My_File
    • 对于 HTTP:

      # curl \
      --remote-name \
      http://satellite.example.com/pulp/content/My_Organization_Label/Library/custom/My_Product_Label/My_Repository_Label/My_File

CLI 过程

  1. 列出文件类型存储库。

    # hammer repository list --content-type file
    ---|------------|-------------------|--------------|----
    ID | NAME       | PRODUCT           | CONTENT TYPE | URL
    ---|------------|-------------------|--------------|----
    7  | My_Files   | My_File_Product   | file         |
    ---|------------|-------------------|--------------|----
  2. 显示存储库信息。

    # hammer repository info \
    --name "My_Files" \
    --organization-id My_Organization_ID \
    --product "My_File_Product"

    如果启用了 Unprotected,输出类似如下:

    Publish Via HTTP: yes
    Published At:       https://satellite.example.com/pulp/content/My_Organization_Label/Library/custom/My_File_Product_Label/My_Files_Label/

    如果没有启用 Unprotected,输出类似如下:

    Publish Via HTTP: no
    Published At:       https://satellite.example.com/pulp/content/My_Organization_Label/Library/custom/My_File_Product_Label/My_Files_Label/
  3. 在客户端上,从 Satellite 服务器下载该文件:

    • 对于 HTTPS:

      # curl \
      --cacert ./_katello-server-ca.crt \
      --cert ./_My_Organization_key-cert.pem \
      --remote-name \
      https://satellite.example.com/pulp/content/My_Organization_Label/Library/custom/My_Product_Label/My_Repository_Label/My_File
    • 对于 HTTP:

      # curl \
      --remote-name \
      http://satellite.example.com/pulp/content/My_Organization_Label/Library/custom/My_Product_Label/My_Repository_Label/My_File
Red Hat logoGithubRedditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

© 2024 Red Hat, Inc.