Add: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
 
(12 intermediate revisions by the same user not shown)
Line 1: Line 1:
=Internal=
=Internal=


* [[WildFly CLI Concepts#Common_Operations|CLI Concepts]]
* [[WildFly CLI Concepts#add_operation|CLI Concepts]]


=Overview=
=Overview=
Line 25: Line 25:
<font color=red>TODO</font>
<font color=red>TODO</font>


=Adding Hierarchical Data=
=Adding Children Nodes=
 
Specify the hierarchical structure as argument to <tt>add(...)</tt>.
 
The children management nodes for the node being added with add() are specified as follows:
 
<pre>
...:add(child-node-name-1=node-content-1, child-node-name-2=node-content-2, ...)
</pre>
 
A set of attributes of a child node can be specified as follows:
 
<pre>
child-node-name={"attribute-name1"=>"attribute-value-1", "attribute-name-2"=>"attribute-value-2", ...}
</pre>
 
In the particular case the child node has just a single attribute named "value", this is specified as follows:
 
<pre>
child-node-name="some-node-value"
</pre>
 
Usage example of the syntax described above:
 
<pre>
/subsystem=logging/file-handler=MYHANDLER:add(file={"path"=>"myfile.log", "relative-to"=>"jboss.server.log.dir"}, suffix=".yyyy-MM-dd")
</pre>
 
This results in:
 
<pre>
<server ...>
    ...
    <profile>
        <subsystem xmlns="urn:jboss:domain:logging:1.5">
            ...
            <file-handler name="MYHANDLER">
                <file relative-to="jboss.server.log.dir" path="myfile.log"/>
                <suffix value=".yyyy-MM-dd"/>
            </file-handler>
            ...
        </subsystem>
        ...
    </profile>
  ...
</server>
</pre>
 
=Adding Attributes to a Newly Added Management Node=
 
Use the <tt>:write-attribute(...)</tt> operation:
 
<blockquote style="background-color: #f9f9f9; border: solid thin lightgrey;">
:[[Write-attribute#Syntax|:write-attribute(...)]]
</blockquote>
 
=Examples=
 
* [[WildFly_Logging_Subsystem_CLI_Configuration#Adding_a_Periodic_Rotating_File_Log_Handler|Adding a WildFly Logging System Log Handler]]

Latest revision as of 04:29, 16 November 2016

Internal

Overview

Adds a resource of given type.

Syntax

/path/<resource-type>:<resource-value>:add(...)

Adding a Node without Content

Use add() without any argument:

/path/<resource-type>:<resource-value>:add()

Example:

TODO

Adding Children Nodes

Specify the hierarchical structure as argument to add(...).

The children management nodes for the node being added with add() are specified as follows:

...:add(child-node-name-1=node-content-1, child-node-name-2=node-content-2, ...)

A set of attributes of a child node can be specified as follows:

child-node-name={"attribute-name1"=>"attribute-value-1", "attribute-name-2"=>"attribute-value-2", ...}

In the particular case the child node has just a single attribute named "value", this is specified as follows:

child-node-name="some-node-value"

Usage example of the syntax described above:

/subsystem=logging/file-handler=MYHANDLER:add(file={"path"=>"myfile.log", "relative-to"=>"jboss.server.log.dir"}, suffix=".yyyy-MM-dd")

This results in:

<server ...>
    ...
    <profile>
        <subsystem xmlns="urn:jboss:domain:logging:1.5">
            ...
            <file-handler name="MYHANDLER">
                <file relative-to="jboss.server.log.dir" path="myfile.log"/>
                <suffix value=".yyyy-MM-dd"/>
            </file-handler>
             ...
        </subsystem>
        ...
    </profile>
   ...
</server>

Adding Attributes to a Newly Added Management Node

Use the :write-attribute(...) operation:

:write-attribute(...)

Examples