13.5. 将文件下载到自定义文件类型存储库的主机


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

先决条件

流程

  1. 在 Satellite Web UI 中,导航到 Content > Products
  2. 按名称选择自定义产品。
  3. 按名称选择文件类型存储库。
  4. 确保选中 Unprotected 复选框,以访问通过 HTTP 发布的存储库。
  5. 复制发布存储库的 URL。

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"

    如果启用了 未保护,输出类似如下:

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

    如果没有启用 未受保护,输出类似如下:

    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. 在客户端中,为 HTTP 或 HTTPS 输入适当的格式的命令:

    对于 HTTP:

    # curl -O http://satellite.example.com/pulp/content/My_Organization_Label/Library/custom/My_File_Product_Label/My_Files_Label/my_file

    对于 HTTPS:

    # curl -O --cert ./_My-Organization-key-cert.pem_ --cacert katello-server-ca.crt https://satellite.example.com/pulp/content/My_Organization_Label/Library/custom/My_File_Product_Label/My_Files_Label/my_file
Red Hat logoGithubRedditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

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

让开源更具包容性

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

關於紅帽

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

© 2024 Red Hat, Inc.