搜索

7.8.2. 读取部署内容

download PDF

您可以使用 read-content 操作读取受管部署中文件的内容。不提供任何参数来返回整个部署,或使用 path 参数提供特定文件的路径。例如:

/deployment=helloworld.war:read-content(path=META-INF/MANIFEST.MF)

这会返回一个文件流,它可显示在管理 CLI 中或保存到文件系统中

{
    "outcome" => "success",
    "result" => {"uuid" => "24ba8e06-21bd-4505-b4d4-bdfb16451b95"},
    "response-headers" => {"attached-streams" => [{
        "uuid" => "24ba8e06-21bd-4505-b4d4-bdfb16451b95",
        "mime-type" => "text/plain"
    }]}
}

7.8.2.1. 显示文件的内容

使用 附加 display 命令读取 MANIFEST.MF 文件的内容。

attachment display --operation=/deployment=helloworld.war:read-content(path=META-INF/MANIFEST.MF)

这会将 MANIFEST.MF 文件的内容从 helloworld.war 部署 显示到管理 CLI。

ATTACHMENT 8af87836-2abd-423a-8e44-e731cc57bd80:
Manifest-Version: 1.0
Implementation-Title: Quickstart: helloworld
Implementation-Version: 7.3.0.GA
Java-Version: 1.8.0_131
Built-By: username
Scm-Connection: scm:git:git@github.com:jboss/jboss-parent-pom.git/quic
 kstart-parent/helloworld
Specification-Vendor: JBoss by Red Hat
...
Red Hat logoGithubRedditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

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

让开源更具包容性

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

關於紅帽

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

© 2024 Red Hat, Inc.