|
| 1 | +# Command line |
| 2 | + |
| 3 | +Since version 2.3.1, you can use the command line to register your components and productions. |
| 4 | + |
| 5 | +To use it, you have to use the following command : |
| 6 | +```bash |
| 7 | +iop |
| 8 | +``` |
| 9 | + |
| 10 | +output : |
| 11 | +```bash |
| 12 | +usage: python3 -m iop [-h] [-d DEFAULT] [-l] [-s START] [-k] [-S] [-r] [-M MIGRATE] [-e EXPORT] [-x] [-v] [-L] |
| 13 | +optional arguments: |
| 14 | + -h, --help display help and default production name |
| 15 | + -d DEFAULT, --default DEFAULT |
| 16 | + set the default production |
| 17 | + -l, --lists list productions |
| 18 | + -s START, --start START |
| 19 | + start a production |
| 20 | + -k, --kill kill a production (force stop) |
| 21 | + -S, --stop stop a production |
| 22 | + -r, --restart restart a production |
| 23 | + -M MIGRATE, --migrate MIGRATE |
| 24 | + migrate production and classes with settings file |
| 25 | + -e EXPORT, --export EXPORT |
| 26 | + export a production |
| 27 | + -x, --status status a production |
| 28 | + -v, --version display version |
| 29 | + -L, --log display log |
| 30 | + |
| 31 | +default production: PEX.Production |
| 32 | +``` |
| 33 | + |
| 34 | +## help |
| 35 | + |
| 36 | +The help command display the help and the default production name. |
| 37 | + |
| 38 | +```bash |
| 39 | +iop -h |
| 40 | +``` |
| 41 | + |
| 42 | +output : |
| 43 | +```bash |
| 44 | +usage: python3 -m iop [-h] [-d DEFAULT] [-l] [-s START] [-k] [-S] [-r] [-M MIGRATE] [-e EXPORT] [-x] [-v] [-L] |
| 45 | +... |
| 46 | +default production: PEX.Production |
| 47 | +``` |
| 48 | + |
| 49 | +## default |
| 50 | + |
| 51 | +The default command set the default production. |
| 52 | + |
| 53 | +With no argument, it display the default production. |
| 54 | + |
| 55 | +```bash |
| 56 | +iop -d |
| 57 | +``` |
| 58 | + |
| 59 | +output : |
| 60 | +```bash |
| 61 | +default production: PEX.Production |
| 62 | +``` |
| 63 | + |
| 64 | +With an argument, it set the default production. |
| 65 | + |
| 66 | +```bash |
| 67 | +iop -d PEX.Production |
| 68 | +``` |
| 69 | + |
| 70 | +## lists |
| 71 | + |
| 72 | +The lists command list productions. |
| 73 | + |
| 74 | +```bash |
| 75 | +iop -l |
| 76 | +``` |
| 77 | + |
| 78 | +output : |
| 79 | +```bash |
| 80 | +{ |
| 81 | + "PEX.Production": { |
| 82 | + "Status": "Stopped", |
| 83 | + "LastStartTime": "2023-05-31 11:13:51.000", |
| 84 | + "LastStopTime": "2023-05-31 11:13:54.153", |
| 85 | + "AutoStart": 0 |
| 86 | + } |
| 87 | +} |
| 88 | +``` |
| 89 | + |
| 90 | +## start |
| 91 | + |
| 92 | +The start command start a production. |
| 93 | + |
| 94 | +To exit the command, you have to press CTRL+C. |
| 95 | + |
| 96 | +```bash |
| 97 | +iop -s PEX.Production |
| 98 | +``` |
| 99 | + |
| 100 | +output : |
| 101 | +```bash |
| 102 | +2021-08-30 15:13:51.000 [PEX.Production] INFO: Starting production |
| 103 | +2021-08-30 15:13:51.000 [PEX.Production] INFO: Starting item Python.FileOperation |
| 104 | +2021-08-30 15:13:51.000 [PEX.Production] INFO: Starting item Python.EmailOperation |
| 105 | +... |
| 106 | +``` |
| 107 | + |
| 108 | +## kill |
| 109 | + |
| 110 | +The kill command kill a production (force stop). |
| 111 | + |
| 112 | +Kill command is the same as stop command but with a force stop. |
| 113 | + |
| 114 | +Kill command doesn't take an argument because only one production can be running. |
| 115 | + |
| 116 | +```bash |
| 117 | +iop -k |
| 118 | +``` |
| 119 | + |
| 120 | +## stop |
| 121 | + |
| 122 | +The stop command stop a production. |
| 123 | + |
| 124 | +Stop command doesn't take an argument because only one production can be running. |
| 125 | + |
| 126 | +```bash |
| 127 | +iop -S |
| 128 | +``` |
| 129 | + |
| 130 | +## restart |
| 131 | + |
| 132 | +The restart command restart a production. |
| 133 | + |
| 134 | +Restart command doesn't take an argument because only one production can be running. |
| 135 | + |
| 136 | +```bash |
| 137 | +iop -r |
| 138 | +``` |
| 139 | + |
| 140 | +## migrate |
| 141 | + |
| 142 | +The migrate command migrate a production and classes with settings file. |
| 143 | + |
| 144 | +Migrate command must take the absolute path of the settings file. |
| 145 | + |
| 146 | +Settings file must be in the same folder as the python code. |
| 147 | + |
| 148 | +```bash |
| 149 | +iop -M /tmp/settings.py |
| 150 | +``` |
| 151 | + |
| 152 | +## export |
| 153 | + |
| 154 | +The export command export a production. |
| 155 | + |
| 156 | +If no argument is given, the export command export the default production. |
| 157 | + |
| 158 | +```bash |
| 159 | +iop -e |
| 160 | +``` |
| 161 | + |
| 162 | +If an argument is given, the export command export the production given in argument. |
| 163 | + |
| 164 | +```bash |
| 165 | +iop -e PEX.Production |
| 166 | +``` |
| 167 | + |
| 168 | +output : |
| 169 | +```bash |
| 170 | +{ |
| 171 | + "Production": { |
| 172 | + "@Name": "PEX.Production", |
| 173 | + "@TestingEnabled": "true", |
| 174 | + "@LogGeneralTraceEvents": "false", |
| 175 | + "Description": "", |
| 176 | + "ActorPoolSize": "2", |
| 177 | + "Item": [ |
| 178 | + { |
| 179 | + "@Name": "Python.FileOperation", |
| 180 | + "@Category": "", |
| 181 | + "@ClassName": "Python.FileOperation", |
| 182 | + "@PoolSize": "1", |
| 183 | + "@Enabled": "true", |
| 184 | + "@Foreground": "false", |
| 185 | + "@Comment": "", |
| 186 | + "@LogTraceEvents": "true", |
| 187 | + "@Schedule": "", |
| 188 | + "Setting": [ |
| 189 | + { |
| 190 | + "@Target": "Adapter", |
| 191 | + "@Name": "Charset", |
| 192 | + "#text": "utf-8" |
| 193 | + }, |
| 194 | + { |
| 195 | + "@Target": "Adapter", |
| 196 | + "@Name": "FilePath", |
| 197 | + "#text": "/irisdev/app/output/" |
| 198 | + }, |
| 199 | + { |
| 200 | + "@Target": "Host", |
| 201 | + "@Name": "%settings", |
| 202 | + "#text": "path=/irisdev/app/output/" |
| 203 | + } |
| 204 | + ] |
| 205 | + } |
| 206 | + ] |
| 207 | + } |
| 208 | +} |
| 209 | +``` |
| 210 | + |
| 211 | +## status |
| 212 | + |
| 213 | +The status command status a production. |
| 214 | + |
| 215 | +Status command doesn't take an argument because only one production can be running. |
| 216 | + |
| 217 | +```bash |
| 218 | +iop -x |
| 219 | +``` |
| 220 | + |
| 221 | +output : |
| 222 | +```bash |
| 223 | +{ |
| 224 | + "Production": "PEX.Production", |
| 225 | + "Status": "stopped" |
| 226 | +} |
| 227 | +``` |
| 228 | + |
| 229 | +Status can be : |
| 230 | +- stopped |
| 231 | +- running |
| 232 | +- suspended |
| 233 | +- troubled |
| 234 | + |
| 235 | +## version |
| 236 | + |
| 237 | +The version command display the version. |
| 238 | + |
| 239 | +```bash |
| 240 | +iop -v |
| 241 | +``` |
| 242 | + |
| 243 | +output : |
| 244 | +```bash |
| 245 | +2.3.0 |
| 246 | +``` |
| 247 | + |
| 248 | +## log |
| 249 | + |
| 250 | +The log command display the log. |
| 251 | + |
| 252 | +To exit the command, you have to press CTRL+C. |
| 253 | + |
| 254 | +```bash |
| 255 | +iop -L |
| 256 | +``` |
| 257 | + |
| 258 | +output : |
| 259 | +```bash |
| 260 | +2021-08-30 15:13:51.000 [PEX.Production] INFO: Starting production |
| 261 | +2021-08-30 15:13:51.000 [PEX.Production] INFO: Starting item Python.FileOperation |
| 262 | +2021-08-30 15:13:51.000 [PEX.Production] INFO: Starting item Python.EmailOperation |
| 263 | +... |
| 264 | +``` |
0 commit comments