3.6.10. 使用管理 CLI 配置属性
前提条件
write-attribute 操作是用来写入或修改资源属性的全局操作。您可以使用这个操作来进行持久性修改并修改管理的服务器实例的配置设置。请求属性包含下列参数。
请求属性
name- 需要设置值的所选资源属性的名称。
value- 所选资源里属性的值。如果底层模型支持 null 值的话可以为 null。
过程 3.21. 使用管理 CLI 配置资源属性
运行
write-attribute操作在管理 CLI 里,使用write-attribute操作修改资源属性的值。这个擦作可以运行在资源的子节点或管理 CLI 的根节点上(指定完整资源路径)。
例 3.16. 用 write-attribute 操作禁用部署扫描器。
write-attribute 操作来禁用部署扫描器。这个操作从根节点运行,使用 Tab Completion 来协助填充正确的资源路径。
[standalone@localhost:9999 /] /subsystem=deployment-scanner/scanner=default:write-attribute(name=scan-enabled,value=false)
{"outcome" => "success"}
read-attribute 操作确认。
[standalone@localhost:9999 /] /subsystem=deployment-scanner/scanner=default:read-attribute(name=scan-enabled)
{
"outcome" => "success",
"result" => false
}
read-resource 操作列出节点的所有可用资源属性可以确认资源。在下列例子里,这个特定的配置展示了 scan-enabled 属性被设置为 false。
[standalone@localhost:9999 /] /subsystem=deployment-scanner/scanner=default:read-resource
{
"outcome" => "success",
"result" => {
"auto-deploy-exploded" => false,
"auto-deploy-xml" => true,
"auto-deploy-zipped" => true,
"deployment-timeout" => 600,
"path" => "deployments",
"relative-to" => "jboss.server.base.dir",
"scan-enabled" => false,
"scan-interval" => 5000
}
}
更新了资源属性

Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.