Add: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
Line 26: Line 26:


=Adding Hierarchical Data=
=Adding Hierarchical Data=
Specify the hierarchical structure as argument to <tt>add(...)</tt>.
The sub-nodes are specified as:
<pre>
sub-node-name-1={"attribute1"=>"attribute-value1","attribute2=>"attribute-value2",...},sub-node-name-2={...},...
</pre>
Example, adding a logging handler:
<pre>
/subsystem=logging/file-handler=MYHANDLER:add(file={"path"=>"myfile.log", "relative-to"=>"jboss.server.log.dir"})
</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"/>
            </file-handler>
            ...
        </subsystem>
        ...
    </profile>
  ...
</server>
</pre>

Revision as of 03:28, 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 Hierarchical Data

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

The sub-nodes are specified as:

sub-node-name-1={"attribute1"=>"attribute-value1","attribute2=>"attribute-value2",...},sub-node-name-2={...},...

Example, adding a logging handler:

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

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"/>
            </file-handler>
             ...
        </subsystem>
        ...
    </profile>
   ...
</server>