The ``arguments`` map contains the parameters required to carry out the
given command. The exact content and format of the map are command-specific.
-``service`` is a list of the servers at which the control command is
+The ``service`` list contains the servers at which the control command is
targeted. In the example above, the control command is targeted at the
DHCPv4 server. In most cases, the CA simply forwards this command to
the DHCPv4 server for processing via a UNIX domain socket. Sometimes,
If the command received by the CA does not include a ``service``
parameter or this list is empty, the CA simply processes this message on
its own. For example, a ``config-get`` command which includes no service
-parameter returns the Control Agent's own configuration. The
-``config-get`` command with a service value "dhcp4" is forwarded to the DHCPv4
-server and returns the DHCPv4 server's configuration.
+parameter returns the Control Agent's own configuration. The ``config-get``
+command with a service value "dhcp4" is forwarded to the DHCPv4 server and
+returns the DHCPv4 server's configuration.
The following list shows the mapping of the values carried within the
``service`` parameter to the servers to which the commands are
contains a description of the error encountered, but it often also
appears for successful outcomes. The exact text is command-specific, but
in general uses plain English to describe the outcome of the command.
-``arguments`` is a map of additional data values returned by the server
-which are specific to the command issued. The map may be present, but
-that depends on the specific command.
+The ``arguments`` map contains additional data values returned by the server
+which are specific to the command issued. The map may be present, but that
+depends on the specific command.
.. note::
to reload its original configuration from the file, possibly losing all
changes introduced using ``config-set`` or other commands.
-``config-reload`` does not take any parameters. An example command
+The ``config-reload`` command does not take any parameters. An example command
invocation looks like this:
::
"code": 240,
"name": "my-option",
"csv-format": true,
- "data": "data
- -00010203040506070809-00010203040506070809-00010203040506070809-00010203040506070809
- -00010203040506070809-00010203040506070809-00010203040506070809-00010203040506070809
- -00010203040506070809-00010203040506070809-00010203040506070809-00010203040506070809
+ "data": "data \
+ -00010203040506070809-00010203040506070809-00010203040506070809-00010203040506070809 \
+ -00010203040506070809-00010203040506070809-00010203040506070809-00010203040506070809 \
+ -00010203040506070809-00010203040506070809-00010203040506070809-00010203040506070809 \
-data",
"space": "dhcp4"
}
comment=0
echo "" >> $work_file
continue
- elif [ $comment -eq 0 -a $json -eq 0 -a $(echo "$line" | grep "^\s*{\|^\s*\".*{" | grep -v "}" | wc -l) -eq 1 ]; then
+ elif [ $comment -eq 0 -a $json -eq 0 -a $(echo "$line" | grep "^\s*{\|^\s*\".*{\|^\s*\[\s*$" | grep -v "}" | wc -l) -eq 1 ]; then
# if this is not a comment and the line starts with spaces followed by '{' or by '"' followed by "{"
json=1
# ignore any map name before top level map
- line=$(echo "$line" | sed "s/.*{/{/g")
+ line=$(echo "$line" | sed 's/.*{/{/g')
echo "" > $work_file
elif [ $comment -eq 0 -a $json -eq 1 -a $(echo "$line" | grep "^\s*[A-Za-z]\|^\s*\`" | wc -l) -eq 1 ]; then
# if the line is not a comment and the line starts with spaces followed by 'A-Za-z' or followed by "`" and the parser is processing a json structure
# 9. replace ' <DATA>' with ' "placeholder": "value"'
# 10. replace ' <DATA>' with ' "placeholder"'
if [ $(echo "$file" | grep "\.json" | wc -l) -eq 0 ]; then
- echo "$line" | cut -d "#" -f 1 | sed "s/\/\/ .*//g" | sed "s/<?.*?>//g" | sed "s/\[ <\([-A-Za-z0-9 ]*\)> \]/\[ \"<\1>\" \]/g" | sed "s/ <\(.*\)>:/ \"<\1>\":/g" | sed "s/: <\(.*\)>/: \"<\1>\"/g" | sed "s/ \.\.\./ \"placeholder\": \"value\"/g" | sed "s/, \.\.\. / /g" | sed "s/ <\(.*\)>/ \"placeholder\": \"value\"/g" | sed "s/ <\(.*\)>/ \"placeholder\"/g" >> $work_file
+ echo "$line" | cut -d "#" -f 1 | sed 's/\/\/ .*//g' | sed 's/<?.*?>//g' | sed 's/\[ <\([-A-Za-z0-9 ]*\)> \]/\[ \"<\1>\" \]/g' | sed 's/ <\(.*\)>:/ \"<\1>\":/g' | sed 's/: <\(.*\)>/: \"<\1>\"/g' | sed 's/ \.\.\./ \"placeholder\": \"value\"/g' | sed 's/, \.\.\. / /g' | sed 's/ <\(.*\)>/ \"placeholder\": \"value\"/g' | sed 's/ <\(.*\)>/ \"placeholder\"/g' >> $work_file
else
# if file is .rst the following replace in line are done:
# 1. delete everything after '#'
# 2. delete everything after //
# 3. ignore <?include?>
- echo "$line" | cut -d "#" -f 1 | sed "s/\/\/ .*//g" | sed "s/<?.*?>//g" >> $work_file
+ echo "$line" | cut -d "#" -f 1 | sed 's/\/\/ .*//g' | sed 's/<?.*?>//g' >> $work_file
fi
fi
fi
- done <<< $(cat $file | sed ':a;N;$!ba;s/,\s*\n\s*\.\.\.//g')
+ done <<< $(cat $file | sed ':a;N;$!ba;s/,\s*\n\s*\.\.\.//g' | sed ':a;N;$!ba;s/\s\\\n//g')
if [ $comment -eq 0 -a $json -eq 1 ]; then
# if the file ended but the parser is processing a json structure
cat $work_file | jq . > /dev/null