Add

From NovaOrdis Knowledge Base
Revision as of 04:29, 16 November 2016 by Ovidiu (talk | contribs) (→‎Adding Children Nodes)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

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