1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172
|
.. _alter_cli:
alter
*****
.. rubric:: Description
The CLI command :code:`alter` enables the manipulation of node attributes in
an ecFlow suite, namely it allows to:
- add new node attributes
- remove existing node attributes
- update some characteristics of existing node attributes
- set/clear node flags
- sort node attributes
The arguments to the :code:`alter` command are specified as a sequence of space
separated options:
.. code-block:: shell
ecflow_client --alter <operation> <type> <name> <value> <path>
where
- :code:`<operation>`, determines what operation is performed (one of :code:`delete`, :code:`change`, :code:`add`, :code:`set_flag`, :code:`clear_flag`, or :code:`sort`)
- :code:`<type>`, specifies which type of attribute is being manipulated (the list of types possible depends on the type of command selected previously)
- :code:`<name>`, is the name of the attribute being manipulated (in the case where the attribute is unnamed, e.g. Repeat, Complete, Trigger, this option should be omitted)
- :code:`<value>`, is the value to be used in the operation (this option is not required for all commands, e.g. when deleting an attribute)
- :code:`<path> (<path> (...))`, one or more paths to the nodes where the operation is to be performed
See more details about each argument in the next section.
.. rubric:: Output of :code:`--help=alter`
The following help text is generated by :code:`ecflow_client --help=alter`
::
alter
-----
Alter the node according to the options.
arg1 = [ delete | change | add | set_flag | clear_flag | sort ]
arg2 = For delete:
[ variable | time | today | date | day | cron | event | meter | late | generic |
queue | label | trigger | complete | repeat | limit | inlimit | limit_path |
zombie | aviso | mirror ]
For change:
[ variable | clock_type | clock_gain | clock_date | clock_sync | event | meter |
label | trigger | complete | repeat | limit_max | limit_value | defstatus |
late | time | today | aviso | mirror ]
For add:
[ variable | time | today | date | day | zombie | event | meter | late | limit |
inlimit | label | aviso | mirror ]
For set_flag or clear_flag:
[ force_aborted | user_edit | task_aborted | edit_failed | ecfcmd_failed |
statuscmd_failed | killcmd_failed | no_script | killed | status | late |
message complete | queue_limit | task_waiting | locked | zombie | archived |
restored | threshold | log_error | checkpt_error ]
For sort:
[ event | meter | label | variable| limit | all ]
arg3 = [ <name> | <value> ]
arg4 = <new-value>
arg5 = <path> (<path> (...)) - at least one node path required.
*Important Notes*
* All paths must start with a leading '/' character.
* To update, create or remove server variables use '/' for path.
* When updating unnamed attributes (Repeat, Trigger, Complete, ...) the name/arg3 is not necessary.
* After changing the clock the suite needs to be re-queued for the change to take effect.
* When adding or updating node attributes (e.g. variable, meter, event, label, limits, late)
the name (arg3) and value (arg4) must be quoted.
* When sorting attributes, 'recursive' can be used as the value (arg3).
* When adding a meter, the value (arg4) is expected to be a comma-separated triplet
of numerical values the form "<min>,<max>,<value>" (n.b. no spaces are allowed).
* When adding an event, the non-optional value (arg4) must be either "set" or "clear".
* When adding or updating aviso and mirror attributes, the value (arg4) is expected to be
a quoted list of configuration options. For example:
* for aviso, "--remote_path /s1/f1/t2 --remote_host host --polling 20 --remote_port 3141 --ssl)"
* for mirror, "--listener '{ \"event\": \"mars\", \"request\": { \"class\": "od" } }'
--url http://aviso/ --schema /path/to/schema --polling 60"
* For both aviso and mirror, the special value "reload" forces reloading the configuration.
This is typically useful after updating variables used to configure these kind of attributes.
Usage:
ecflow_client --alter=add variable <variable-name> "value" / # add server variable
ecflow_client --alter=add variable <variable-name> "value" /path/to/node # add node variable
ecflow_client --alter=add time "+00:20" /path/to/node
ecflow_client --alter=add date "01.*.*" /path/to/node
ecflow_client --alter=add day "sunday" /path/to/node
ecflow_client --alter=add label <label-name> "label_value" /path/to/node
ecflow_client --alter=add event <event-name> "set"|"clear" /path/to/node
ecflow_client --alter=add meter <meter-name> "<min>,<max>,value" /path/to/node
ecflow_client --alter=add late "-s 00:01 -a 14:30 -c +00:01" /path/to/node
ecflow_client --alter=add limit mars "100" /path/to/node
ecflow_client --alter=add inlimit /path/to/node/withlimit:limit_name "10" /path/to/node
# zombie attributes have the following structure:
`zombie_type`:(`client_side_action` | `server_side_action`):`child`:`zombie_life_time`
zombie_type = "user" | "ecf" | "path" | "ecf_pid" | "ecf_passwd" | "ecf_pid_passwd"
client_side_action = "fob" | "fail" | "block"
server_side_action = "adopt" | "delete" | "kill"
child = "init" | "event" | "meter" | "label" | "wait" | "abort" | "complete" | "queue"
zombie_life_time = unsigned integer default: user(300), ecf(3600), path(900) minimum is 60
ecflow_client --alter=add zombie "ecf:fail::" /path/to/node # ask system zombies to fail
ecflow_client --alter=add zombie "user:fail::" /path/to/node # ask user generated zombies to fail
ecflow_client --alter=add zombie "path:fail::" /path/to/node # ask path zombies to fail
ecflow_client --alter=delete variable FRED /path/to/node # delete variable FRED
ecflow_client --alter=delete variable /path/to/node # delete *ALL* variables on the given snode
The client considers, for both user and child commands, the following environment variables:
ECF_HOST <string> [mandatory*]
The main server hostname; default value is 'localhost'
ECF_PORT <int> [mandatory*]
The main server port; default value is '3141'
ECF_SSL <any> [optional*]
Enable secure communication between client and server.
ECF_HOSTFILE <string> [optional]
File that lists alternate hosts to try, if connection to main host fails
ECF_HOSTFILE_POLICY <string> [optional]
The policy ('task' or 'all') to define which commands consider using alternate hosts.
The options marked with (*) must be specified in order for the client to communicate
with the server, either by setting the environment variables or by specifying the
command line options.
|