Debian Codegraph @

upstream/debian-unstable/man8/libdnf5-actions.8

raw
1 .\" Man page generated from reStructuredText
2 .\" by the Docutils 0.22.4 manpage writer.
3 .
4 .
5 .nr rst2man-indent-level 0
6 .
7 .de1 rstReportMargin
8 \\$1 \\n[an-margin]
9 level \\n[rst2man-indent-level]
10 level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
11 -
12 \\n[rst2man-indent0]
13 \\n[rst2man-indent1]
14 \\n[rst2man-indent2]
15 ..
16 .de1 INDENT
17 .\" .rstReportMargin pre:
18 . RS \\$1
19 . nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
20 . nr rst2man-indent-level +1
21 .\" .rstReportMargin post:
22 ..
23 .de UNINDENT
24 . RE
25 .\" indent \\n[an-margin]
26 .\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
27 .nr rst2man-indent-level -1
28 .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
29 .in \\n[rst2man-indent\\n[rst2man-indent-level]]u
30 ..
31 .TH "LIBDNF5-ACTIONS" "8" "May 09, 2026" "" "dnf5"
32 .SH NAME
33 libdnf5-actions \- Actions Plugin
34 .SH DESCRIPTION
35 .sp
36 This plugin allows defining actions to be executed through libdnf5 callback hooks.
37 Each action is hooked to one specific callback. Actions for \fBgoal_resolved\fP, \fBpre_transaction\fP, and
38 \fBpost_transaction\fP callbacks may define a (glob\-like) filtering rule on the package
39 NEVRA or package files, as well as whether the package is incoming or outgoing.
40 .SH CONFIGURATION
41 .sp
42 The plugin does not extend the standard configuration. However, it reads \(dqactions\(dq files.
43 .sp
44 The actions files are read from the \fB<libdnf5_plugins_config_dir>/actions.d/\fP directory. Only files
45 with a \(dq.actions\(dq extension are read. Action files are read in lexical order (sorted by filename)
46 by comparing character values, ignoring locale.
47 .SH ACTIONS FILE FORMAT
48 .sp
49 Empty lines and lines that start with a \(aq#\(aq character (comment line) are ignored.
50 .sp
51 Each non\-comment line defines an action and consists of five items separated by colons: \fBcallback_name:package_filter:direction:options:command\fP\&.
52 .sp
53 \fBcallback_name\fP
54 .INDENT 0.0
55 .INDENT 3.5
56 .INDENT 0.0
57 .IP \(bu 2
58 \fBpre_base_setup\fP
59 .IP \(bu 2
60 \fBpost_base_setup\fP
61 .IP \(bu 2
62 \fBrepos_configured\fP (added in version 1.0.0)
63 .IP \(bu 2
64 \fBrepos_loaded\fP (added in version 1.0.0)
65 .IP \(bu 2
66 \fBpre_add_cmdline_packages\fP (added in version 1.0.0)
67 .IP \(bu 2
68 \fBpost_add_cmdline_packages\fP (added in version 1.0.0)
69 .IP \(bu 2
70 \fBgoal_resolved\fP (added in version 1.3.0)
71 .IP \(bu 2
72 \fBpre_transaction\fP
73 .IP \(bu 2
74 \fBpost_transaction\fP
75 .UNINDENT
76 .UNINDENT
77 .UNINDENT
78 .INDENT 0.0
79 .TP
80 .B \fBpackage_filter\fP
81 A (glob\-like) filtering rule applied on the package NEVRA (also in the shortened forms) or package files.
82 .sp
83 An empty filter means executing the command once with no information about the package.
84 The \(dq*\(dq filter means executing the command for each package in the transaction that matches the \fBdirection\fP filter.
85 The filter can be non\-empty only for \fBgoal_resolved\fP, \fBpre_transaction\fP, and \fBpost_transaction\fP callbacks.
86 .TP
87 .B \fBdirection\fP
88 Filters packages by their direction (coming into the system/going out of the system) in a transaction.
89 If empty, the filter is not applied.
90 The filter can only be non\-empty when combined with a non\-empty \fBpackage_filter\fP\&.
91 .INDENT 7.0
92 .IP \(bu 2
93 \fBin\fP \- packages coming to the system (downgrade, install, reinstall, upgrade)
94 .IP \(bu 2
95 \fBout\fP \- packages going out of the system (upgraded, downgraded, reinstalled, removed, replaced/obsoleted)
96 .UNINDENT
97 .TP
98 .B \fBoptions\fP
99 Options are separated by spaces. A space within an option can be written using escaping.
100 .INDENT 7.0
101 .IP \(bu 2
102 \fBenabled=<value>\fP \- the \fB<value>\fP specifies when the action is enabled (added in version 0.3.0)
103 .INDENT 2.0
104 .IP \(bu 2
105 \fB1\fP \- action is always enabled
106 .IP \(bu 2
107 \fBhost\-only\fP \- the action is only enabled for operations on the host
108 .IP \(bu 2
109 \fBinstallroot\-only\fP \- the action is only enabled for operations in the alternative \(dqinstallroot\(dq
110 .UNINDENT
111 .IP \(bu 2
112 \fBmode=<value>\fP \- the \fB<value>\fP specifies the action plugin communication mode (added in version 1.2.0)
113 .INDENT 2.0
114 .IP \(bu 2
115 .INDENT 2.0
116 .TP
117 .B \fBplain\fP \- the original and default communication mode. Data is only passed to the process via arguments
118 when it is started. The process can send data to the actions plugin by writing to standard
119 output.
120 .UNINDENT
121 .IP \(bu 2
122 .INDENT 2.0
123 .TP
124 .B \fBjson\fP \- this mode establishes a bidirectional communication channel between the actions plugin and
125 the process, using a request\-response model. The process writes requests to standard output
126 and reads responses from standard input. All communication is handled in JSON format (added
127 in version 1.2.0).
128 .UNINDENT
129 .UNINDENT
130 .IP \(bu 2
131 \fBraise_error=<value>\fP \- the \fB<value>\fP specifies how action process errors are handled. What happens if
132 the action process did not start, ended with a non\-zero exit code, ended abnormally (received a signal),
133 or an error occurred during communication (syntax error, communication interrupt, failed to process the output
134 line in plain communication mode). If the option is not present, \fBraise_error=0\fP for backward compatibility
135 (added in version 1.4.0).
136 .INDENT 2.0
137 .IP \(bu 2
138 \fB0\fP \- the errors are logged
139 .IP \(bu 2
140 \fB1\fP \- an exception is thrown
141 .UNINDENT
142 .UNINDENT
143 .TP
144 .B \fBcommand\fP
145 Any executable file with arguments.
146 .sp
147 Arguments are separated by spaces. A space within an argument can be written using escaping.
148 Escaping can also be used to prevent substitution and to pass special characters: \ea, \eb, \ef, \en, \er, \et, \ev.
149 Unescaping of arguments is done after substitution.
150 .sp
151 The following variables in the command will be substituted:
152 .INDENT 7.0
153 .IP \(bu 2
154 \fB${pid}\fP \- process ID
155 .IP \(bu 2
156 \fB${plugin.version}\fP \- version of the actions plugin (added in version 0.3.0)
157 .IP \(bu 2
158 \fB${conf.<option_name>}\fP \- option from base configuration
159 .IP \(bu 2
160 \fB${conf.<repoid_pattern>.<option_name>[=<value_pattern>]}\fP \- list of \(dqrepoid.option=value\(dq pairs (added in version 1.1.0)
161 .IP \(bu 2
162 \fB${var.<variable_name>}\fP \- variable
163 .IP \(bu 2
164 \fB${tmp.<actions_plugin_variable_name>}\fP \- variable exists only in actions plugin context
165 .IP \(bu 2
166 \fB${pkg.<package_attribute_name>}\fP \- value of the package attribute
167 .INDENT 2.0
168 .IP \(bu 2
169 \fB${pkg.name}\fP \- package name
170 .IP \(bu 2
171 \fB${pkg.arch}\fP \- package arch
172 .IP \(bu 2
173 \fB${pkg.version}\fP \- package version
174 .IP \(bu 2
175 \fB${pkg.release}\fP \- package release
176 .IP \(bu 2
177 \fB${pkg.epoch}\fP \- package epoch
178 .IP \(bu 2
179 \fB${pkg.na}\fP \- package name.architecture
180 .IP \(bu 2
181 \fB${pkg.evr}\fP \- package epoch\-version\-release
182 .IP \(bu 2
183 \fB${pkg.nevra}\fP \- package nevra (0 epoch is hidden)
184 .IP \(bu 2
185 \fB${pkg.full_nevra}\fP \- package full nevra (epoch is always present) name\-epoch:version\-release.arch
186 .IP \(bu 2
187 \fB${pkg.repo_id}\fP \- package repository id
188 .IP \(bu 2
189 \fB${pkg.license}\fP \- package license
190 .IP \(bu 2
191 \fB${pkg.location}\fP \- package relative path/location from repodata
192 .IP \(bu 2
193 \fB${pkg.vendor}\fP \- package vendor
194 .IP \(bu 2
195 \fB${pkg.action}\fP \- action performed on the package:
196 .INDENT 2.0
197 .IP \(bu 2
198 \fBI\fP \- newly installed package
199 .IP \(bu 2
200 \fBU\fP \- package installed as an upgrade
201 .IP \(bu 2
202 \fBD\fP \- package installed as a downgrade
203 .IP \(bu 2
204 \fBR\fP \- package used for reinstallation
205 .IP \(bu 2
206 \fBE\fP \- erased (removed) package from the system
207 .IP \(bu 2
208 \fBO\fP \- replaced package (was obsoleted/upgraded/downgraded/reinstalled/removed)
209 .IP \(bu 2
210 \fB?\fP \- package with changed installation reason
211 .UNINDENT
212 .UNINDENT
213 .UNINDENT
214 .sp
215 The command will be evaluated for each package that matched the \fBpackage_filter\fP and
216 the \fBdirection\fP\&. However, after variable substitution, any duplicate commands will be
217 removed and each command will only be executed once per transaction.
218 The commands are executed in sequence. There is no parallelism. Argument substitution is performed
219 after the previous command has completed. This allows the substitution to use the results of the previous commands.
220 The order of execution of the commands follows the order in the action files, but may differ from the order of
221 packages in the transaction. In other words, when you define several action lines for the same
222 \fBpackage_filter\fP and \fBdirection\fP these lines will be executed in the order they were defined in the action
223 file when the \fBpackage_filter\fP and \fBdirection\fP matches a package. However, the order
224 of when a particular \fBpackage_filter\fP is invoked depends on the position
225 of the corresponding package in the transaction.
226 .sp
227 The \fBrepoid.option=value\fP pairs in the list are separated by the \(aq,\(aq character.
228 The \(aq,\(aq character in the value is replaced by the escape sequence \fB\(dq\ex2C\(dq\fP\&.
229 If \fBvalue_pattern\fP is used, only pairs with the matching value are listed.
230 The \fBrepoid_pattern\fP and \fBvalue_pattern\fP can contain globs.
231 .UNINDENT
232 .SH ACTION PROCESS STANDARD OUTPUT FORMAT IN "PLAIN" COMMUNICATION MODE
233 .sp
234 The standard output of each executed action (command) is captured and processed.
235 Each line of output can change the value of a base configuration option, the value
236 of a configuration option in matching repositories, or a variable.
237 It can also set or unset one actions plugin variable. The value of this variable is available
238 for the following commands using the \fB${tmp.<actions_plugin_variable_name>}\fP substitution.
239 .sp
240 Actions should change the repositories configuration in the \fBrepos_configured\fP hook.
241 At this point, the repositories configuration is loaded but not yet applied.
242 .sp
243 Since version 1.4.0, the output line can write a message to the logger, throw a stop exception
244 and an error exception.
245 .SS Output line format
246 .INDENT 0.0
247 .IP \(bu 2
248 \fBtmp.<actions_plugin_variable_name>=<value>\fP \- sets the value of action plugins variable <actions_plugin_variable_name>
249 .IP \(bu 2
250 \fBtmp.<actions_plugin_variable_name>\fP \- removes the action plugins variable if it exists
251 .IP \(bu 2
252 \fBconf.<option_name>=<value>\fP \- sets the value of option <option_name> in the base configuration
253 .IP \(bu 2
254 \fBconf.<repoid_pattern>.<option_name>=<value>\fP \- sets the value of option <option_name> in the matching repositories (added in version 1.1.0)
255 .IP \(bu 2
256 \fBvar.<variable_name>=<value>\fP \- sets value of the variable <variable_name>
257 .IP \(bu 2
258 \fBstop=<message>\fP \- throws a stop exception with <message> (added in version 1.4.0)
259 .IP \(bu 2
260 \fBerror=<message>\fP \- the error <message> is logged or throws an error exception with <message> if \fBraise_error=1\fP
261 (added in version 1.4.0)
262 .IP \(bu 2
263 \fBlog.<level>=<message>\fP \- writes <message> to the logger with priority <level> (added in version 1.4.0)
264 .INDENT 2.0
265 .INDENT 3.5
266 Levels: \fBCRITICAL\fP, \fBERROR\fP, \fBWARNING\fP, \fBNOTICE\fP, \fBINFO\fP, \fBDEBUG\fP, \fBTRACE\fP
267 .UNINDENT
268 .UNINDENT
269 .UNINDENT
270 .SH MESSAGES IN "JSON" COMMUNICATION MODE
271 .sp
272 The \(dqjson\(dq communication mode establishes a bidirectional communication channel between the actions plugin and the process, using a request\-response model. The process writes requests to standard output and reads responses from the actions plugin from standard input. All communication is handled in JSON format.
273 .sp
274 \fIFormat of a request message from the process:\fP
275 .INDENT 0.0
276 .INDENT 3.5
277 .sp
278 .EX
279 {\(dqop\(dq:\(dq<operation>\(dq, \(dqdomain\(dq:\(dq<domain>\(dq, \(dqargs\(dq:{}}
280 .EE
281 .UNINDENT
282 .UNINDENT
283 .sp
284 \fIFormat of a response:\fP
285 .INDENT 0.0
286 .INDENT 3.5
287 .sp
288 .EX
289 {\(dqop\(dq:\(dqreply\(dq, \(dqrequested_op\(dq:\(dq<operation_from_request>\(dq, \(dqdomain\(dq:\(dq<domain_from_request>\(dq,
290 \(dqstatus\(dq:\(dqOK\(dq, \(dqreturn\(dq:{}}
291 .EE
292 .UNINDENT
293 .UNINDENT
294 .sp
295 \fIFormat of a response with an error message:\fP
296 .INDENT 0.0
297 .INDENT 3.5
298 .sp
299 .EX
300 {\(dqop\(dq:\(dqreply\(dq, \(dqrequested_op\(dq:\(dq<operation_from_request>\(dq, \(dqdomain\(dq:\(dq<domain_from_request>\(dq,
301 \(dqstatus\(dq:\(dqERROR\(dq, \(dqmessage\(dq:\(dq<error message>\(dq}
302 .EE
303 .UNINDENT
304 .UNINDENT
305 .SS Supported <operation> values
306 .INDENT 0.0
307 .IP \(bu 2
308 \fBget\fP \- request to get values
309 .IP \(bu 2
310 \fBset\fP \- request to set a value
311 .IP \(bu 2
312 \fBnew\fP \- creates a new repository configuration
313 .IP \(bu 2
314 \fBlog\fP \- writes a message to the logger (added in version 1.4.0)
315 .IP \(bu 2
316 \fBstop\fP \- throws a stop exception with a message (added in version 1.4.0)
317 .IP \(bu 2
318 \fBerror\fP \- the error message is logged or throws an error exception with a message if \fBraise_error=1\fP (added in version 1.4.0)
319 .UNINDENT
320 .SS Description of the \fBget\fP operation
321 .sp
322 The \fBget\fP operation is defined for several \fB<domain>\fP\&.
323 .INDENT 0.0
324 .IP \(bu 2
325 \fBconf\fP \- request to read the value of a configuration (global or repository configuration)
326 .IP \(bu 2
327 \fBvars\fP \- request to read the value of variables
328 .IP \(bu 2
329 \fBactions_vars\fP \- request to read the value of action plugin variables \- these variables exist only in the actions plugin context
330 .IP \(bu 2
331 \fBactions_attrs\fP \- allows getting the process ID and the version of the actions plugin
332 .IP \(bu 2
333 \fBpackages\fP \- request to list available and installed packages
334 .IP \(bu 2
335 \fBtrans_packages\fP \- request to list packages in the transaction
336 .IP \(bu 2
337 \fBcmdline_packages_paths\fP \- request to list command\-line packages
338 .UNINDENT
339 .SS Reading a configuration value
340 .sp
341 \fIRequest format:\fP
342 .INDENT 0.0
343 .INDENT 3.5
344 .sp
345 .EX
346 {\(dqop\(dq:\(dqget\(dq, \(dqdomain\(dq:\(dqconf\(dq, \(dqargs\(dq:{\(dqkey\(dq:\(dq<name>\(dq}}
347
348 {\(dqop\(dq:\(dqget\(dq, \(dqdomain\(dq:\(dqconf\(dq, \(dqargs\(dq:{\(dqkey\(dq:\(dq<repo_id>.<name>\(dq}}
349 .EE
350 .UNINDENT
351 .UNINDENT
352 .sp
353 \fIResponse format:\fP
354 .INDENT 0.0
355 .INDENT 3.5
356 .sp
357 .EX
358 {\(dqop\(dq:\(dqreply\(dq, \(dqrequested_op\(dq:\(dqget\(dq, \(dqdomain\(dq:\(dqconf\(dq, \(dqstatus\(dq:\(dqOK\(dq,
359 \(dqreturn\(dq:{\(dqkeys_val\(dq:[{\(dqkey\(dq:\(dq<name>\(dq, \(dqvalue\(dq:\(dq<value>\(dq}]}}
360
361 {\(dqop\(dq:\(dqreply\(dq, \(dqrequested_op\(dq:\(dqget\(dq, \(dqdomain\(dq:\(dqconf\(dq, \(dqstatus\(dq:\(dqOK\(dq,
362 \(dqreturn\(dq:{\(dqkeys_val\(dq:[{\(dqkey\(dq:\(dq<repo_id>.<name>\(dq, \(dqvalue\(dq:\(dq<value>\(dq}]}}
363
364 {\(dqop\(dq:\(dqreply\(dq, \(dqrequested_op\(dq:\(dqget\(dq, \(dqdomain\(dq:\(dqconf\(dq, \(dqstatus\(dq:\(dqERROR\(dq,
365 \(dqmessage\(dq:\(dq<error message>\(dq}
366 .EE
367 .UNINDENT
368 .UNINDENT
369 .sp
370 \fIDescription:\fP
371 .INDENT 0.0
372 .IP \(bu 2
373 \fB<name>\fP \- the name of a global configuration option or a repository configuration option if \fB<repo_id>\fP is specified
374 .IP \(bu 2
375 \fB<repo_id>\fP \- the repository ID; in a request, it can contain globs, in which case the value of the configuration option is read for all matching repositories
376 .IP \(bu 2
377 \fB<value>\fP \- the read value of the configuration option
378 .IP \(bu 2
379 \fB<error message>\fP \- error message
380 .UNINDENT
381 .sp
382 When using \fB<repo_id>\fP, the number of \fBkeys_val\fP items in the response depends on the number of matching repositories.
383 .sp
384 \fIExample:\fP
385 .INDENT 0.0
386 .INDENT 3.5
387 .sp
388 .EX
389 {\(dqop\(dq:\(dqget\(dq, \(dqdomain\(dq:\(dqconf\(dq, \(dqargs\(dq:{\(dqkey\(dq:\(dqcountme\(dq}}
390 {\(dqop\(dq:\(dqreply\(dq, \(dqrequested_op\(dq:\(dqget\(dq, \(dqdomain\(dq:\(dqconf\(dq, \(dqstatus\(dq:\(dqOK\(dq,
391 \(dqreturn\(dq:{\(dqkeys_val\(dq:[{\(dqkey\(dq:\(dqcountme\(dq, \(dqvalue\(dq:\(dq0\(dq}]}}
392
393 {\(dqop\(dq: \(dqget\(dq, \(dqdomain\(dq: \(dqconf\(dq, \(dqargs\(dq: {\(dqkey\(dq: \(dq*.enabled\(dq}}
394 {\(dqop\(dq: \(dqreply\(dq, \(dqrequested_op\(dq: \(dqget\(dq, \(dqdomain\(dq: \(dqconf\(dq, \(dqstatus\(dq: \(dqOK\(dq,
395 \(dqreturn\(dq: {
396 \(dqkeys_val\(dq: [{\(dqkey\(dq: \(dqdnf\-ci\-fedora.enabled\(dq, \(dqvalue\(dq: \(dq1\(dq},
397 {\(dqkey\(dq: \(dqdnf\-ci\-fedora\-updates.enabled\(dq, \(dqvalue\(dq: \(dq1\(dq},
398 {\(dqkey\(dq: \(dqdnf\-ci\-thirdparty.enabled\(dq, \(dqvalue\(dq: \(dq0\(dq},
399 {\(dqkey\(dq: \(dqtest\-repo.enabled\(dq, \(dqvalue\(dq: \(dq0\(dq}]}}
400 .EE
401 .UNINDENT
402 .UNINDENT
403 .SS Reading a variable value
404 .sp
405 \fIRequest format:\fP
406 .INDENT 0.0
407 .INDENT 3.5
408 .sp
409 .EX
410 {\(dqop\(dq:\(dqget\(dq, \(dqdomain\(dq:\(dqvars\(dq, \(dqargs\(dq:{\(dqname\(dq:\(dq<name>\(dq}}
411 .EE
412 .UNINDENT
413 .UNINDENT
414 .sp
415 \fIResponse format:\fP
416 .INDENT 0.0
417 .INDENT 3.5
418 .sp
419 .EX
420 {\(dqop\(dq:\(dqreply\(dq, \(dqrequested_op\(dq:\(dqget\(dq, \(dqdomain\(dq:\(dqvars\(dq, \(dqstatus\(dq:\(dqOK\(dq,
421 \(dqreturn\(dq:{\(dqvars\(dq:[{\(dqname\(dq:\(dq<name>\(dq, \(dqvalue\(dq:\(dq<value>\(dq}]}}
422 .EE
423 .UNINDENT
424 .UNINDENT
425 .sp
426 \fIDescription:\fP
427 .INDENT 0.0
428 .IP \(bu 2
429 \fB<name>\fP \- the name of the variable; in a request, it can contain globs, in which case the value of all matching variables will be read
430 .IP \(bu 2
431 \fB<value>\fP \- the read value of the variable
432 .UNINDENT
433 .sp
434 The number of \fBvars\fP items in the response depends on the number of matching variables.
435 .sp
436 \fIExample:\fP
437 .INDENT 0.0
438 .INDENT 3.5
439 .sp
440 .EX
441 {\(dqop\(dq:\(dqget\(dq, \(dqdomain\(dq:\(dqvars\(dq, \(dqargs\(dq:{\(dqname\(dq:\(dqtest_var*\(dq}}
442 {\(dqop\(dq:\(dqreply\(dq, \(dqrequested_op\(dq:\(dqget\(dq, \(dqdomain\(dq:\(dqvars\(dq, \(dqstatus\(dq:\(dqOK\(dq,
443 \(dqreturn\(dq:{\(dqvars\(dq:[{\(dqname\(dq:\(dqtest_var1\(dq, \(dqvalue\(dq:\(dqvalue1\(dq}]}}
444
445 {\(dqop\(dq:\(dqget\(dq, \(dqdomain\(dq:\(dqvars\(dq, \(dqargs\(dq:{\(dqname\(dq:\(dqnonexist_var\(dq}}
446 {\(dqop\(dq:\(dqreply\(dq, \(dqrequested_op\(dq:\(dqget\(dq, \(dqdomain\(dq:\(dqvars\(dq, \(dqstatus\(dq:\(dqOK\(dq,
447 \(dqreturn\(dq:{\(dqvars\(dq:[]}}
448 .EE
449 .UNINDENT
450 .UNINDENT
451 .SS Reading an action variable value
452 .sp
453 \fIRequest format:\fP
454 .INDENT 0.0
455 .INDENT 3.5
456 .sp
457 .EX
458 {\(dqop\(dq:\(dqget\(dq, \(dqdomain\(dq:\(dqactions_vars\(dq, \(dqargs\(dq:{\(dqname\(dq:\(dq<name>\(dq}}
459 .EE
460 .UNINDENT
461 .UNINDENT
462 .sp
463 \fIResponse format:\fP
464 .INDENT 0.0
465 .INDENT 3.5
466 .sp
467 .EX
468 {\(dqop\(dq:\(dqreply\(dq, \(dqrequested_op\(dq:\(dqget\(dq, \(dqdomain\(dq:\(dqactions_vars\(dq, \(dqstatus\(dq:\(dqOK\(dq,
469 \(dqreturn\(dq:{\(dqactions_vars\(dq:[{\(dqname\(dq:\(dq<name>\(dq, \(dqvalue\(dq:\(dq<value>\(dq}]}}
470 .EE
471 .UNINDENT
472 .UNINDENT
473 .sp
474 \fIDescription:\fP
475 .INDENT 0.0
476 .IP \(bu 2
477 \fB<name>\fP \- the name of the action variable; in a request, it can contain globs, in which case the value of all matching action variables will be read
478 .IP \(bu 2
479 \fB<value>\fP \- the read value of the action variable
480 .UNINDENT
481 .sp
482 The number of \fBactions_vars\fP items in the response depends on the number of matching action variables.
483 .sp
484 \fIExample:\fP
485 .INDENT 0.0
486 .INDENT 3.5
487 .sp
488 .EX
489 {\(dqop\(dq:\(dqget\(dq, \(dqdomain\(dq:\(dqactions_vars\(dq, \(dqargs\(dq:{\(dqname\(dq:\(dqtest_actions_var*\(dq}}
490 {\(dqop\(dq:\(dqreply\(dq, \(dqrequested_op\(dq:\(dqget\(dq, \(dqdomain\(dq:\(dqactions_vars\(dq, \(dqstatus\(dq:\(dqOK\(dq,
491 \(dqreturn\(dq:{\(dqactions_vars\(dq:[{\(dqname\(dq:\(dqtest_actions_var1\(dq, \(dqvalue\(dq:\(dqvalue1\(dq}]}}
492
493 {\(dqop\(dq:\(dqget\(dq, \(dqdomain\(dq:\(dqactions_vars\(dq, \(dqargs\(dq:{\(dqname\(dq:\(dqnonexist_var\(dq}}
494 {\(dqop\(dq:\(dqreply\(dq, \(dqrequested_op\(dq:\(dqget\(dq, \(dqdomain\(dq:\(dqactions_vars\(dq, \(dqstatus\(dq:\(dqOK\(dq,
495 \(dqreturn\(dq:{\(dqactions_vars\(dq:[]}}
496 .EE
497 .UNINDENT
498 .UNINDENT
499 .SS Reading an action attribute value
500 .sp
501 \fIRequest format:\fP
502 .INDENT 0.0
503 .INDENT 3.5
504 .sp
505 .EX
506 {\(dqop\(dq:\(dqget\(dq, \(dqdomain\(dq:\(dqactions_attrs\(dq, \(dqargs\(dq:{\(dqkey\(dq:\(dq<name>\(dq}}
507 .EE
508 .UNINDENT
509 .UNINDENT
510 .sp
511 \fIResponse format:\fP
512 .INDENT 0.0
513 .INDENT 3.5
514 .sp
515 .EX
516 {\(dqop\(dq:\(dqreply\(dq, \(dqrequested_op\(dq:\(dqget\(dq, \(dqdomain\(dq:\(dqactions_attrs\(dq, \(dqstatus\(dq:\(dqOK\(dq,
517 \(dqreturn\(dq:{\(dqactions_attrs\(dq:[{\(dqkey\(dq:\(dq<name>\(dq, \(dqvalue\(dq:\(dq<value>\(dq}]}}
518 .EE
519 .UNINDENT
520 .UNINDENT
521 .sp
522 \fIDescription:\fP
523 .INDENT 0.0
524 .IP \(bu 2
525 \fB<name>\fP \- the name of the action attribute; in a request, it can contain globs, in which case the value of all matching actions plugin attributes will be read. Currently, two attributes are supported: \fBpid\fP and \fBversion\fP\&.
526 .INDENT 2.0
527 .IP \(bu 2
528 \fBpid\fP \- the process ID of the actions plugin
529 .IP \(bu 2
530 \fBversion\fP \- the version of the actions plugin, a string in the format \fBMAJOR.MINOR.MICRO\fP
531 .UNINDENT
532 .IP \(bu 2
533 \fB<value>\fP \- the read value of the action attribute
534 .UNINDENT
535 .sp
536 The number of \fBactions_attrs\fP items in the response depends on the number of matching action attributes.
537 .sp
538 \fIExample:\fP
539 .INDENT 0.0
540 .INDENT 3.5
541 .sp
542 .EX
543 {\(dqop\(dq:\(dqget\(dq, \(dqdomain\(dq:\(dqactions_attrs\(dq, \(dqargs\(dq:{\(dqkey\(dq:\(dq*\(dq}}
544 {\(dqop\(dq:\(dqreply\(dq, \(dqrequested_op\(dq:\(dqget\(dq, \(dqdomain\(dq:\(dqactions_attrs\(dq, \(dqstatus\(dq:\(dqOK\(dq,
545 \(dqreturn\(dq:{
546 \(dqactions_attrs\(dq:[{\(dqkey\(dq:\(dqpid\(dq, \(dqvalue\(dq:\(dq523\(dq},
547 {\(dqkey\(dq:\(dqversion\(dq, \(dqvalue\(dq:\(dq1.4.0\(dq}]}}
548
549 {\(dqop\(dq:\(dqget\(dq, \(dqdomain\(dq:\(dqactions_attrs\(dq, \(dqargs\(dq:{\(dqkey\(dq:\(dqnonexist_attribute\(dq}}
550 {\(dqop\(dq:\(dqreply\(dq, \(dqrequested_op\(dq:\(dqget\(dq, \(dqdomain\(dq:\(dqactions_attrs\(dq, \(dqstatus\(dq:\(dqOK\(dq,
551 \(dqreturn\(dq:{\(dqactions_attrs\(dq:[]}}
552 .EE
553 .UNINDENT
554 .UNINDENT
555 .SS Getting available, installed, and transaction packages
556 .sp
557 The \fBpackages\fP domain is used to get available and installed packages.
558 The \fBtrans_packages\fP domain is used to get packages in the transaction.
559 The \fBtrans_packages\fP domain can only be used in \fBgoal_resolved\fP, \fBpre_transaction\fP, and \fBpost_transaction\fP callbacks.
560 .sp
561 \fIRequest format:\fP
562 .INDENT 0.0
563 .INDENT 3.5
564 .sp
565 .EX
566 {\(dqop\(dq:\(dqget\(dq, \(dqdomain\(dq:\(dqpackages\(dq, \(dqargs\(dq:{\(dqoutput\(dq:[\(dq<pkg_attr>\(dq]}}
567
568 {\(dqop\(dq:\(dqget\(dq, \(dqdomain\(dq:\(dqpackages\(dq, \(dqargs\(dq:{\(dqoutput\(dq:[\(dq<pkg_attr>\(dq],
569 \(dqparams\(dq:[{\(dqkey\(dq:\(dq<param_name>\(dq}]}}
570
571 {\(dqop\(dq:\(dqget\(dq, \(dqdomain\(dq:\(dqpackages\(dq, \(dqargs\(dq:{\(dqoutput\(dq:[\(dq<pkg_attr>\(dq],
572 \(dqfilters\(dq:[{\(dqkey\(dq:\(dq<filter_name>\(dq, \(dqvalue\(dq:\(dq<value>\(dq, \(dqoperator\(dq:\(dq<cmp_operator>\(dq}]}}
573
574 {\(dqop\(dq:\(dqget\(dq, \(dqdomain\(dq:\(dqpackages\(dq, \(dqargs\(dq:{\(dqoutput\(dq:[\(dq<pkg_attr>\(dq],
575 \(dqparams\(dq:[{\(dqkey\(dq:\(dq<param_name>\(dq}],
576 \(dqfilters\(dq:[{\(dqkey\(dq:\(dq<filter_name>\(dq, \(dqvalue\(dq:\(dq<value>\(dq, \(dqoperator\(dq:\(dq<cmp_operator>\(dq}]}}
577
578 {\(dqop\(dq:\(dqget\(dq, \(dqdomain\(dq:\(dqtrans_packages\(dq, \(dqargs\(dq:{\(dqoutput\(dq:[\(dq<pkg_attr>\(dq]}}
579
580 {\(dqop\(dq:\(dqget\(dq, \(dqdomain\(dq:\(dqtrans_packages\(dq, \(dqargs\(dq:{\(dqoutput\(dq:[\(dq<pkg_attr>\(dq],
581 \(dqparams\(dq:[{\(dqkey\(dq:\(dq<param_name>\(dq}]}}
582
583 {\(dqop\(dq:\(dqget\(dq, \(dqdomain\(dq:\(dqtrans_packages\(dq, \(dqargs\(dq:{\(dqoutput\(dq:[\(dq<pkg_attr>\(dq],
584 \(dqfilters\(dq:[{\(dqkey\(dq:\(dq<filter_name>\(dq, \(dqvalue\(dq:\(dq<value>\(dq, \(dqoperator\(dq:\(dq<cmp_operator>\(dq}]}}
585
586 {\(dqop\(dq:\(dqget\(dq, \(dqdomain\(dq:\(dqtrans_packages\(dq, \(dqargs\(dq:{\(dqoutput\(dq:[\(dq<pkg_attr>\(dq],
587 \(dqparams\(dq:[{\(dqkey\(dq:\(dq<param_name>\(dq}],
588 \(dqfilters\(dq:[{\(dqkey\(dq:\(dq<filter_name>\(dq, \(dqvalue\(dq:\(dq<value>\(dq, \(dqoperator\(dq:\(dq<cmp_operator>\(dq}]}}
589 .EE
590 .UNINDENT
591 .UNINDENT
592 .sp
593 \fIResponse format:\fP
594 .INDENT 0.0
595 .INDENT 3.5
596 .sp
597 .EX
598 {\(dqop\(dq:\(dqreply\(dq, \(dqrequested_op\(dq:\(dqget\(dq, \(dqdomain\(dq:\(dqpackages\(dq, \(dqstatus\(dq:\(dqOK\(dq,
599 \(dqreturn\(dq:{\(dqpackages\(dq:[{\(dq<pkg_attr>\(dq:\(dq<attr_value>\(dq}]}}
600
601 {\(dqop\(dq:\(dqreply\(dq, \(dqrequested_op\(dq:\(dqget\(dq, \(dqdomain\(dq:\(dqtrans_packages\(dq, \(dqstatus\(dq:\(dqOK\(dq,
602 \(dqreturn\(dq:{\(dqtrans_packages\(dq:[{\(dq<pkg_attr>\(dq:\(dq<attr_value>\(dq}]}}
603
604 {\(dqop\(dq:\(dqreply\(dq, \(dqrequested_op\(dq:\(dqget\(dq, \(dqdomain\(dq:\(dqpackages\(dq, \(dqstatus\(dq:\(dqERROR\(dq,
605 \(dqmessage\(dq:\(dq<error message>\(dq}
606
607 {\(dqop\(dq:\(dqreply\(dq, \(dqrequested_op\(dq:\(dqget\(dq, \(dqdomain\(dq:\(dqtrans_packages\(dq, \(dqstatus\(dq:\(dqERROR\(dq,
608 \(dqmessage\(dq:\(dq<error message>\(dq}
609 .EE
610 .UNINDENT
611 .UNINDENT
612 .sp
613 \fIDescription:\fP
614 .INDENT 0.0
615 .IP \(bu 2
616 \fB<pkg_attr>\fP \- package attribute to return; the array can contain multiple attributes
617 .sp
618 General attributes
619 .INDENT 2.0
620 .IP \(bu 2
621 \fBname\fP \- package name
622 .IP \(bu 2
623 \fBarch\fP \- package arch
624 .IP \(bu 2
625 \fBversion\fP \- package version
626 .IP \(bu 2
627 \fBrelease\fP \- package release
628 .IP \(bu 2
629 \fBepoch\fP \- package epoch
630 .IP \(bu 2
631 \fBna\fP \- package name.architecture
632 .IP \(bu 2
633 \fBevr\fP \- package epoch\-version\-release
634 .IP \(bu 2
635 \fBnevra\fP \- package nevra (0 epoch is hidden)
636 .IP \(bu 2
637 \fBfull_nevra\fP \- package full nevra (epoch is always present) name\-epoch:version\-release.arch
638 .IP \(bu 2
639 \fBdownload_size\fP \- filesize of package
640 .IP \(bu 2
641 \fBinstall_size\fP \- size the package should occupy after installing on disk
642 .IP \(bu 2
643 \fBrepo_id\fP \- package repository id
644 .IP \(bu 2
645 \fBlicense\fP \- package license
646 .IP \(bu 2
647 \fBlocation\fP \- package relative path/location from repodata
648 .IP \(bu 2
649 \fBvendor\fP \- package vendor
650 .UNINDENT
651 .sp
652 Attributes usable only with the \fBtrans_packages\fP domain
653 .INDENT 2.0
654 .IP \(bu 2
655 \fBaction\fP \- action performed on the package
656 .INDENT 2.0
657 .IP \(bu 2
658 \fBI\fP \- newly installed package
659 .IP \(bu 2
660 \fBU\fP \- package installed as an upgrade
661 .IP \(bu 2
662 \fBD\fP \- package installed as a downgrade
663 .IP \(bu 2
664 \fBR\fP \- package used for reinstallation
665 .IP \(bu 2
666 \fBE\fP \- erased (removed) package from the system
667 .IP \(bu 2
668 \fBO\fP \- replaced package (was obsoleted/upgraded/downgraded/reinstalled/removed)
669 .IP \(bu 2
670 \fB?\fP \- package with changed installation reason
671 .UNINDENT
672 .IP \(bu 2
673 \fBdirection\fP \- package direction in transaction
674 .UNINDENT
675 .INDENT 2.0
676 .INDENT 3.5
677 .INDENT 0.0
678 .IP \(bu 2
679 \fBIN\fP \- packages coming to the system (downgrade, install, reinstall, upgrade)
680 .IP \(bu 2
681 \fBOUT\fP \- packages going out of the system (upgraded, downgraded, reinstalled, removed, replaced/obsoleted)
682 .UNINDENT
683 .UNINDENT
684 .UNINDENT
685 .IP \(bu 2
686 \fB<param_name>\fP \- one of \fBIGNORE_EXCLUDES\fP, \fBIGNORE_MODULAR_EXCLUDES\fP, \fBIGNORE_REGULAR_EXCLUDES\fP, \fBIGNORE_REGULAR_CONFIG_EXCLUDES\fP, \fBIGNORE_REGULAR_USER_EXCLUDES\fP
687 .IP \(bu 2
688 \fB<filter_name>\fP \- name of package attribute to filter; the array can contain multiple attributes
689 .sp
690 General attributes
691 .INDENT 2.0
692 .IP \(bu 2
693 \fBname\fP \- filter packages by name, uses \fB<value>\fP and \fB<cmp_operator>\fP
694 .IP \(bu 2
695 \fBarch\fP \- filter packages by arch, uses \fB<value>\fP and \fB<cmp_operator>\fP
696 .IP \(bu 2
697 \fBversion\fP \- filter packages by version, uses \fB<value>\fP and \fB<cmp_operator>\fP
698 .IP \(bu 2
699 \fBrelease\fP \- filter packages by release, uses \fB<value>\fP and \fB<cmp_operator>\fP
700 .IP \(bu 2
701 \fBepoch\fP \- filter packages by epoch, uses \fB<value>\fP and \fB<cmp_operator>\fP
702 .IP \(bu 2
703 \fBnevra\fP \- filter packages by nevra (0 epoch is hidden), uses \fB<value>\fP and \fB<cmp_operator>\fP
704 .IP \(bu 2
705 \fBrepo_id\fP \- filter packages by repository id, uses \fB<value>\fP and \fB<cmp_operator>\fP
706 .IP \(bu 2
707 \fBavailable\fP \- filter available packages
708 .IP \(bu 2
709 \fBinstalled\fP \- filter installed packages
710 .IP \(bu 2
711 \fBuserinstalled\fP \- filter user installed packages
712 .IP \(bu 2
713 \fBinstallonly\fP \- filter installonly packages
714 .IP \(bu 2
715 \fBdescription\fP \- filter packages by description, uses \fB<value>\fP and \fB<cmp_operator>\fP
716 .IP \(bu 2
717 \fBfile\fP \- filter packages by files they contain, uses \fB<value>\fP and \fB<cmp_operator>\fP
718 .IP \(bu 2
719 \fBupgradable\fP \- filter installed packages for which there are available upgrades
720 .IP \(bu 2
721 \fBupgrades\fP \- filter available packages that are upgrades to installed packages
722 .IP \(bu 2
723 \fBdowngradable\fP \- filter installed packages for which there are available downgrades
724 .IP \(bu 2
725 \fBdowngrades\fP \- filter available packages that are downgrades to installed packages
726 .UNINDENT
727 .sp
728 Attributes usable only with the \fBtrans_packages\fP domain
729 .INDENT 2.0
730 .IP \(bu 2
731 \fBdirection\fP \- filters packages by their direction in a transaction, uses \fB<value>\fP; supported values:
732 .UNINDENT
733 .INDENT 2.0
734 .INDENT 3.5
735 .INDENT 0.0
736 .IP \(bu 2
737 \fBIN\fP \- packages coming to the system (downgrade, install, reinstall, upgrade)
738 .IP \(bu 2
739 \fBOUT\fP \- packages going out of the system (upgraded, downgraded, reinstalled, removed, replaced/obsoleted)
740 .UNINDENT
741 .UNINDENT
742 .UNINDENT
743 .IP \(bu 2
744 \fB<value>\fP \- a value used by some filters; the type of comparison depends on the \fB<cmp_operator>\fP
745 .IP \(bu 2
746 \fB<cmp_operator>\fP \- the operator used by the filter to evaluate a match with \fB<value>\fP; if not specified, \fBEQ\fP is assumed
747 .IP \(bu 2
748 \fB<attr_value>\fP \- the value of the package attribute
749 .IP \(bu 2
750 \fB<error message>\fP \- error message
751 .UNINDENT
752 .sp
753 The number of \fBpackages\fP and \fBtrans_packages\fP items in the response depends on the number of matching packages.
754 .sp
755 \fIExample:\fP
756 .INDENT 0.0
757 .INDENT 3.5
758 .sp
759 .EX
760 {\(dqop\(dq:\(dqget\(dq, \(dqdomain\(dq:\(dqpackages\(dq,
761 \(dqargs\(dq:{
762 \(dqparams\(dq:[{\(dqkey\(dq:\(dqIGNORE_EXCLUDES\(dq}],
763 \(dqfilters\(dq:[{\(dqkey\(dq:\(dqname\(dq, \(dqvalue\(dq:\(dqlame*\(dq, \(dqoperator\(dq:\(dqGLOB\(dq}],
764 \(dqoutput\(dq:[\(dqnevra\(dq]}}
765 {\(dqop\(dq:\(dqreply\(dq, \(dqrequested_op\(dq:\(dqget\(dq, \(dqdomain\(dq:\(dqpackages\(dq, \(dqstatus\(dq:\(dqOK\(dq, \(dqreturn\(dq:{\(dqpackages\(dq:[
766 { \(dqnevra\(dq:\(dqlame\-3.100\-5.fc29.src\(dq }, { \(dqnevra\(dq:\(dqlame\-3.100\-5.fc29.x86_64\(dq },
767 { \(dqnevra\(dq:\(dqlame\-libs\-3.100\-5.fc29.x86_64\(dq }, { \(dqnevra\(dq:\(dqlame\-3.100\-4.fc29.src\(dq },
768 { \(dqnevra\(dq:\(dqlame\-3.100\-4.fc29.x86_64\(dq }, { \(dqnevra\(dq:\(dqlame\-libs\-3.100\-4.fc29.x86_64\(dq}]}}
769
770 {\(dqop\(dq:\(dqget\(dq, \(dqdomain\(dq:\(dqpackages\(dq,
771 \(dqargs\(dq:{
772 \(dqparams\(dq:[{\(dqkey\(dq:\(dqUNKNOWN\(dq}],
773 \(dqfilters\(dq:[{\(dqkey\(dq:\(dqname\(dq, \(dqvalue\(dq:\(dqlame*\(dq, \(dqoperator\(dq:\(dqGLOB\(dq}],
774 \(dqoutput\(dq:[\(dqnevra\(dq]}}
775 {\(dqop\(dq:\(dqreply\(dq, \(dqrequested_op\(dq:\(dqget\(dq, \(dqdomain\(dq:\(dqpackages\(dq, \(dqstatus\(dq:\(dqERROR\(dq,
776 \(dqmessage\(dq:\(dqBad key \e\(dqUNKNOWN\e\(dq for params\(dq}
777
778 {\(dqop\(dq:\(dqget\(dq, \(dqdomain\(dq:\(dqtrans_packages\(dq,
779 \(dqargs\(dq:{
780 \(dqfilters\(dq:[{\(dqkey\(dq:\(dqdirection\(dq, \(dqvalue\(dq:\(dqIN\(dq}, {\(dqkey\(dq:\(dqarch\(dq, \(dqvalue\(dq:\(dqx86_64\(dq}],
781 \(dqoutput\(dq:[\(dqaction\(dq, \(dqname\(dq, \(dqversion\(dq, \(dqrepo_id\(dq]}}
782 {\(dqop\(dq:\(dqreply\(dq, \(dqrequested_op\(dq:\(dqget\(dq, \(dqdomain\(dq:\(dqtrans_packages\(dq, \(dqstatus\(dq:\(dqOK\(dq,
783 \(dqreturn\(dq:{
784 \(dqtrans_packages\(dq:[
785 {\(dqaction\(dq:\(dqI\(dq, \(dqname\(dq:\(dqglibc\(dq, \(dqversion\(dq:\(dq2.28\(dq, \(dqrepo_id\(dq:\(dqdnf\-ci\-fedora\-updates\(dq},
786 {\(dqaction\(dq:\(dqI\(dq, \(dqname\(dq:\(dqglibc\-all\-langpacks\(dq, \(dqversion\(dq:\(dq2.28\(dq, \(dqrepo_id\(dq:\(dqdnf\-ci\-fedora\-updates\(dq},
787 {\(dqaction\(dq:\(dqI\(dq, \(dqname\(dq:\(dqglibc\-common\(dq, \(dqversion\(dq:\(dq2.28\(dq, \(dqrepo_id\(dq:\(dqdnf\-ci\-fedora\-updates\(dq},
788 {\(dqaction\(dq:\(dqI\(dq, \(dqname\(dq:\(dqfilesystem\(dq, \(dqversion\(dq:\(dq3.9\(dq, \(dqrepo_id\(dq:\(dqdnf\-ci\-fedora\(dq}]}}
789 .EE
790 .UNINDENT
791 .UNINDENT
792 .SS Getting paths of command\-line specified packages
793 .sp
794 \fIRequest format:\fP
795 .INDENT 0.0
796 .INDENT 3.5
797 .sp
798 .EX
799 {\(dqop\(dq:\(dqget\(dq, \(dqdomain\(dq:\(dqcmdline_packages_paths\(dq, \(dqargs\(dq:{}}
800
801 {\(dqop\(dq:\(dqget\(dq, \(dqdomain\(dq:\(dqcmdline_packages_paths\(dq, \(dqargs\(dq:{
802 \(dqfilters\(dq:[{\(dqkey\(dq:\(dqpath\(dq, \(dqvalue\(dq:\(dq<value>\(dq}]}}
803
804 {\(dqop\(dq:\(dqget\(dq, \(dqdomain\(dq:\(dqcmdline_packages_paths\(dq, \(dqargs\(dq:{
805 \(dqfilters\(dq:[{\(dqkey\(dq:\(dqpath\(dq, \(dqvalue\(dq:\(dq<value>\(dq, \(dqoperator\(dq:\(dq<cmp_operator>\(dq}]}}
806 .EE
807 .UNINDENT
808 .UNINDENT
809 .sp
810 \fIResponse format:\fP
811 .INDENT 0.0
812 .INDENT 3.5
813 .sp
814 .EX
815 {\(dqop\(dq:\(dqreply\(dq, \(dqrequested_op\(dq:\(dqget\(dq, \(dqdomain\(dq:\(dqcmdline_packages_paths\(dq, \(dqstatus\(dq:\(dqOK\(dq,
816 \(dqreturn\(dq:{\(dqcmdline_packages_paths\(dq:[\(dq<pkg_path>\(dq]}}
817 .EE
818 .UNINDENT
819 .UNINDENT
820 .sp
821 \fIDescription:\fP
822 .INDENT 0.0
823 .IP \(bu 2
824 \fB<value>\fP \- if specified, it will only return paths matching the given pattern; the comparison type depends on \fB<cmp_operator>\fP
825 .IP \(bu 2
826 \fB<cmp_operator>\fP \- the operator to evaluate whether the path matches the pattern in \fB<value>\fP; if not specified, \fBEQ\fP is assumed
827 .IP \(bu 2
828 \fB<pkg_path>\fP \- the path to the package specified on the command line
829 .UNINDENT
830 .sp
831 The number of \fBcmdline_packages_paths\fP items in the response depends on the number of matching package paths on the command line.
832 .sp
833 \fIExample:\fP
834 .INDENT 0.0
835 .INDENT 3.5
836 .sp
837 .EX
838 {\(dqop\(dq:\(dqget\(dq, \(dqdomain\(dq:\(dqcmdline_packages_paths\(dq,
839 \(dqargs\(dq:{\(dqfilters\(dq:[{\(dqkey\(dq:\(dqpath\(dq, \(dqvalue\(dq:\(dq/local/*\(dq, \(dqoperator\(dq:\(dqGLOB\(dq}]}}
840 {\(dqop\(dq:\(dqreply\(dq, \(dqrequested_op\(dq:\(dqget\(dq, \(dqdomain\(dq:\(dqcmdline_packages_paths\(dq, \(dqstatus\(dq:\(dqOK\(dq,
841 \(dqreturn\(dq:{\(dqcmdline_packages_paths\(dq:[\(dq/local/packageB.rpm\(dq, \(dq/local/packageC.rpm\(dq]}}
842 .EE
843 .UNINDENT
844 .UNINDENT
845 .SS Supported compare operators
846 .sp
847 Some \fBget\fP operations support \fB<cmp_operator>\fP\&. The actions plugin supports the following compare operators:
848 .INDENT 0.0
849 .IP \(bu 2
850 \fBEQ\fP \- exact equality of arguments
851 .IP \(bu 2
852 \fBIEQ\fP \- string equality, case\-insensitive comparison
853 .IP \(bu 2
854 \fBGT\fP \- greater than
855 .IP \(bu 2
856 \fBGTE\fP \- greater than or equal to
857 .IP \(bu 2
858 \fBLT\fP \- less than
859 .IP \(bu 2
860 \fBLTE\fP \- less than or equal to
861 .IP \(bu 2
862 \fBCONTAINS\fP \- contains a substring
863 .IP \(bu 2
864 \fBICONTAINS\fP \- contains a substring, case\-insensitive search
865 .IP \(bu 2
866 \fBSTARTSWITH\fP \- starts with a substring
867 .IP \(bu 2
868 \fBISTARTSWITH\fP \- starts with a substring, case\-insensitive comparison
869 .IP \(bu 2
870 \fBENDSWITH\fP \- ends with a substring
871 .IP \(bu 2
872 \fBIENDSWITH\fP \- ends with a substring, case\-insensitive comparison
873 .IP \(bu 2
874 \fBREGEX\fP \- matches a regular expression
875 .IP \(bu 2
876 \fBIREGEX\fP \- matches a regular expression, case\-insensitive evaluation
877 .IP \(bu 2
878 \fBGLOB\fP \- matches a glob pattern
879 .IP \(bu 2
880 \fBIGLOB\fP \- matches a glob pattern, case\-insensitive evaluation
881 .UNINDENT
882 .sp
883 The meaning of any operator can be inverted by using the \fBNOT_\fP prefix. Examples: \fBNOT_EQ\fP, \fBNOT_GT\fP\&.
884 .SS Description of the \fBset\fP operation
885 .sp
886 The \fBset\fP operation is defined for several \fB<domain>\fP\&.
887 .INDENT 0.0
888 .IP \(bu 2
889 \fBconf\fP \- request to set a configuration value (global or repository configuration)
890 .IP \(bu 2
891 \fBvars\fP \- request to set a variable value
892 .IP \(bu 2
893 \fBactions_vars\fP \- request to set an action plugin variable \- these variables exist only in the actions plugin context
894 .UNINDENT
895 .SS Setting a configuration value
896 .sp
897 \fIRequest format:\fP
898 .INDENT 0.0
899 .INDENT 3.5
900 .sp
901 .EX
902 {\(dqop\(dq:\(dqset\(dq, \(dqdomain\(dq:\(dqconf\(dq, \(dqargs\(dq:{\(dqkey\(dq:\(dq<name>\(dq, \(dqvalue\(dq:\(dq<value>\(dq}}
903
904 {\(dqop\(dq:\(dqset\(dq, \(dqdomain\(dq:\(dqconf\(dq, \(dqargs\(dq:{\(dqkey\(dq:\(dq<repo_id>.<name>\(dq, \(dqvalue\(dq:\(dq<value>\(dq}}
905 .EE
906 .UNINDENT
907 .UNINDENT
908 .sp
909 \fIResponse format:\fP
910 .INDENT 0.0
911 .INDENT 3.5
912 .sp
913 .EX
914 {\(dqop\(dq:\(dqreply\(dq, \(dqrequested_op\(dq:\(dqset\(dq, \(dqdomain\(dq:\(dqconf\(dq, \(dqstatus\(dq:\(dqOK\(dq,
915 \(dqreturn\(dq:{\(dqkeys_val\(dq:[{\(dqkey\(dq:\(dq<name>\(dq, \(dqvalue\(dq:\(dq<value>\(dq}]}}
916
917 {\(dqop\(dq:\(dqreply\(dq, \(dqrequested_op\(dq:\(dqset\(dq, \(dqdomain\(dq:\(dqconf\(dq, \(dqstatus\(dq:\(dqOK\(dq,
918 \(dqreturn\(dq:{\(dqkeys_val\(dq:[{\(dqkey\(dq:\(dq<repo_id>.<name>\(dq, \(dqvalue\(dq:\(dq<value>\(dq}]}}
919
920 {\(dqop\(dq:\(dqreply\(dq, \(dqrequested_op\(dq:\(dqset\(dq, \(dqdomain\(dq:\(dqconf\(dq, \(dqstatus\(dq:\(dqERROR\(dq,
921 \(dqmessage\(dq:\(dq<error message>\(dq}
922 .EE
923 .UNINDENT
924 .UNINDENT
925 .sp
926 \fIDescription:\fP
927 .INDENT 0.0
928 .IP \(bu 2
929 \fB<name>\fP \- the name of a global configuration option or a repository configuration option if \fB<repo_id>\fP is specified
930 .IP \(bu 2
931 \fB<repo_id>\fP \- the repository ID; in a request, it can contain globs, in which case the value of the configuration option is set for all matching repositories
932 .IP \(bu 2
933 \fB<value>\fP \- in the request, the value to be set; in the response, the actual value after being set
934 .IP \(bu 2
935 \fB<error message>\fP \- error message
936 .UNINDENT
937 .sp
938 When using \fB<repo_id>\fP, the number of \fBkeys_val\fP items in the response depends on the number of matching repositories.
939 .sp
940 \fIExample:\fP
941 .INDENT 0.0
942 .INDENT 3.5
943 .sp
944 .EX
945 {\(dqop\(dq:\(dqset\(dq, \(dqdomain\(dq:\(dqconf\(dq, \(dqargs\(dq:{\(dqkey\(dq:\(dqcountme\(dq, \(dqvalue\(dq:\(dq1\(dq}}
946 {\(dqop\(dq:\(dqreply\(dq, \(dqrequested_op\(dq:\(dqset\(dq, \(dqdomain\(dq:\(dqconf\(dq, \(dqstatus\(dq:\(dqOK\(dq,
947 \(dqreturn\(dq:{\(dqkeys_val\(dq:[{\(dqkey\(dq:\(dqcountme\(dq, \(dqvalue\(dq:\(dq1\(dq}]}}
948
949 {\(dqop\(dq:\(dqset\(dq, \(dqdomain\(dq:\(dqconf\(dq, \(dqargs\(dq:{\(dqkey\(dq:\(dqdnf\-ci\-fedora*.enabled\(dq, \(dqvalue\(dq:\(dq1\(dq}}
950 {\(dqop\(dq:\(dqreply\(dq, \(dqrequested_op\(dq:\(dqset\(dq, \(dqdomain\(dq:\(dqconf\(dq, \(dqstatus\(dq:\(dqOK\(dq,
951 \(dqreturn\(dq:{
952 \(dqkeys_val\(dq:[{\(dqkey\(dq:\(dqdnf\-ci\-fedora.enabled\(dq, \(dqvalue\(dq:\(dq1\(dq},
953 {\(dqkey\(dq:\(dqdnf\-ci\-fedora\-updates.enabled\(dq, \(dqvalue\(dq:\(dq1\(dq}]}}
954 .EE
955 .UNINDENT
956 .UNINDENT
957 .SS Setting a variable value
958 .sp
959 \fIRequest format:\fP
960 .INDENT 0.0
961 .INDENT 3.5
962 .sp
963 .EX
964 {\(dqop\(dq:\(dqset\(dq, \(dqdomain\(dq:\(dqvars\(dq, \(dqargs\(dq:{\(dqname\(dq:\(dq<name>\(dq, \(dqvalue\(dq:\(dq<value>\(dq}}
965
966 {\(dqop\(dq:\(dqset\(dq, \(dqdomain\(dq:\(dqvars\(dq, \(dqargs\(dq:{\(dqname\(dq:\(dq<name>\(dq}}
967 .EE
968 .UNINDENT
969 .UNINDENT
970 .sp
971 \fIResponse format:\fP
972 .INDENT 0.0
973 .INDENT 3.5
974 .sp
975 .EX
976 {\(dqop\(dq:\(dqreply\(dq, \(dqrequested_op\(dq:\(dqset\(dq, \(dqdomain\(dq:\(dqvars\(dq, \(dqstatus\(dq:\(dqOK\(dq,
977 \(dqreturn\(dq:{\(dqvars\(dq:[{\(dqname\(dq:\(dq<name>\(dq, \(dqvalue\(dq:\(dq<value>\(dq}]}}
978
979 {\(dqop\(dq:\(dqreply\(dq, \(dqrequested_op\(dq:\(dqset\(dq, \(dqdomain\(dq:\(dqvars\(dq, \(dqstatus\(dq:\(dqOK\(dq,
980 \(dqreturn\(dq:{\(dqvars\(dq:[{\(dqname\(dq:\(dq<name>\(dq}]}}
981
982 {\(dqop\(dq:\(dqreply\(dq, \(dqrequested_op\(dq:\(dqset\(dq, \(dqdomain\(dq:\(dqvars\(dq, \(dqstatus\(dq:\(dqERROR\(dq,
983 \(dqmessage\(dq:\(dq<error message>\(dq}
984 .EE
985 .UNINDENT
986 .UNINDENT
987 .sp
988 \fIDescription:\fP
989 .INDENT 0.0
990 .IP \(bu 2
991 \fB<name>\fP \- the name of the variable
992 .IP \(bu 2
993 \fB<value>\fP \- in the request, the value to be set; if not specified, it means the variable should be removed. In the response, the actual value after being set; if not specified, the variable did not exist or was removed
994 .IP \(bu 2
995 \fB<error message>\fP \- error message
996 .UNINDENT
997 .sp
998 \fIExample:\fP
999 .INDENT 0.0
1000 .INDENT 3.5
1001 .sp
1002 .EX
1003 {\(dqop\(dq:\(dqset\(dq, \(dqdomain\(dq:\(dqvars\(dq, \(dqargs\(dq:{\(dqname\(dq:\(dqtest_var1\(dq, \(dqvalue\(dq:\(dqvalue1\(dq}}
1004 {\(dqop\(dq:\(dqreply\(dq, \(dqrequested_op\(dq:\(dqset\(dq, \(dqdomain\(dq:\(dqvars\(dq, \(dqstatus\(dq:\(dqOK\(dq,
1005 \(dqreturn\(dq:{\(dqvars\(dq:[{\(dqname\(dq:\(dqtest_var1\(dq, \(dqvalue\(dq:\(dqvalue1\(dq}]}}
1006 .EE
1007 .UNINDENT
1008 .UNINDENT
1009 .SS Setting an action variable value
1010 .sp
1011 \fIRequest format:\fP
1012 .INDENT 0.0
1013 .INDENT 3.5
1014 .sp
1015 .EX
1016 {\(dqop\(dq:\(dqset\(dq, \(dqdomain\(dq:\(dqactions_vars\(dq, \(dqargs\(dq:{\(dqname\(dq:\(dq<name>\(dq, \(dqvalue\(dq:\(dq<value>\(dq}}
1017
1018 {\(dqop\(dq:\(dqset\(dq, \(dqdomain\(dq:\(dqactions_vars\(dq, \(dqargs\(dq:{\(dqname\(dq:\(dq<name>\(dq}}
1019 .EE
1020 .UNINDENT
1021 .UNINDENT
1022 .sp
1023 \fIResponse format:\fP
1024 .INDENT 0.0
1025 .INDENT 3.5
1026 .sp
1027 .EX
1028 {\(dqop\(dq:\(dqreply\(dq, \(dqrequested_op\(dq:\(dqset\(dq, \(dqdomain\(dq:\(dqactions_vars\(dq, \(dqstatus\(dq:\(dqOK\(dq,
1029 \(dqreturn\(dq:{\(dqvars\(dq:[{\(dqname\(dq:\(dq<name>\(dq, \(dqvalue\(dq:\(dq<value>\(dq}]}}
1030
1031 {\(dqop\(dq:\(dqreply\(dq, \(dqrequested_op\(dq:\(dqset\(dq, \(dqdomain\(dq:\(dqactions_vars\(dq, \(dqstatus\(dq:\(dqOK\(dq,
1032 \(dqreturn\(dq:{\(dqvars\(dq:[{\(dqname\(dq:\(dq<name>\(dq}]}}
1033
1034 {\(dqop\(dq:\(dqreply\(dq, \(dqrequested_op\(dq:\(dqset\(dq, \(dqdomain\(dq:\(dqactions_vars\(dq, \(dqstatus\(dq:\(dqERROR\(dq,
1035 \(dqmessage\(dq:\(dq<error message>\(dq}
1036 .EE
1037 .UNINDENT
1038 .UNINDENT
1039 .sp
1040 \fIDescription:\fP
1041 .INDENT 0.0
1042 .IP \(bu 2
1043 \fB<name>\fP \- the name of the action variable
1044 .IP \(bu 2
1045 \fB<value>\fP \- in the request, the value to be set; if not specified, it means the variable should be removed. In the response, the actual value after being set; if not specified, the variable did not exist or was removed
1046 .IP \(bu 2
1047 \fB<error message>\fP \- error message
1048 .UNINDENT
1049 .sp
1050 \fIExample:\fP
1051 .INDENT 0.0
1052 .INDENT 3.5
1053 .sp
1054 .EX
1055 {\(dqop\(dq:\(dqset\(dq, \(dqdomain\(dq:\(dqactions_vars\(dq, \(dqargs\(dq:{\(dqname\(dq:\(dqtest_actions_var1\(dq, \(dqvalue\(dq:\(dqvalue1\(dq}}
1056 {\(dqop\(dq:\(dqreply\(dq, \(dqrequested_op\(dq:\(dqset\(dq, \(dqdomain\(dq:\(dqactions_vars\(dq, \(dqstatus\(dq:\(dqOK\(dq,
1057 \(dqreturn\(dq:{\(dqactions_vars\(dq:[{\(dqname\(dq:\(dqtest_actions_var1\(dq, \(dqvalue\(dq:\(dqvalue1\(dq}]}}
1058 .EE
1059 .UNINDENT
1060 .UNINDENT
1061 .SS Description of the \fBnew\fP operation
1062 .sp
1063 The \fBnew\fP operation creates a new repository configuration. It can be used only in the \fBrepos_configured\fP callback.
1064 .sp
1065 \fIRequest format:\fP
1066 .INDENT 0.0
1067 .INDENT 3.5
1068 .sp
1069 .EX
1070 {\(dqop\(dq:\(dqnew\(dq, \(dqdomain\(dq:\(dqrepoconf\(dq,
1071 \(dqargs\(dq:{\(dqkeys_val\(dq:[{\(dqkey\(dq:\(dqrepo_id\(dq, \(dqvalue\(dq:\(dq<repo_id>\(dq},
1072 {\(dqkey\(dq:\(dq<repo_opt>\(dq, \(dqvalue\(dq:\(dq<opt_value>\(dq}]}
1073 .EE
1074 .UNINDENT
1075 .UNINDENT
1076 .sp
1077 \fIResponse format:\fP
1078 .INDENT 0.0
1079 .INDENT 3.5
1080 .sp
1081 .EX
1082 {\(dqop\(dq:\(dqreply\(dq, \(dqrequested_op\(dq:\(dqnew\(dq, \(dqdomain\(dq:\(dqrepoconf\(dq, \(dqstatus\(dq:\(dqOK\(dq,
1083 \(dqreturn\(dq:{\(dqkeys_val\(dq:[{\(dqkey\(dq:\(dqrepo_id\(dq, \(dqvalue\(dq:\(dq<repo_id>\(dq},
1084 {\(dqkey\(dq:\(dq<repo_opt>\(dq, \(dqvalue\(dq:\(dq<opt_value>\(dq}]}}
1085
1086 {\(dqop\(dq:\(dqreply\(dq, \(dqrequested_op\(dq:\(dqnew\(dq, \(dqdomain\(dq:\(dqrepoconf\(dq, \(dqstatus\(dq:\(dqERROR\(dq,
1087 \(dqmessage\(dq:\(dq<error_message>\(dq}
1088 .EE
1089 .UNINDENT
1090 .UNINDENT
1091 .sp
1092 \fIDescription:\fP
1093 .INDENT 0.0
1094 .IP \(bu 2
1095 \fB<repo_id>\fP \- repository ID
1096 .IP \(bu 2
1097 \fB<repo_opt>\fP \- any existing repository configuration option
1098 .IP \(bu 2
1099 \fB<opt_value>\fP \- the value to be set for the configuration option
1100 .UNINDENT
1101 .sp
1102 The \fBkeys_val\fP field must contain at least one element \- specifying the \fBrepo_id\fP is mandatory. Setting other repository configuration options is optional. If the \fBenabled\fP option is not present, the repository is disabled by default. The response contains the same keys as the request and their actual values.
1103 .sp
1104 \fIExample:\fP
1105 .INDENT 0.0
1106 .INDENT 3.5
1107 .sp
1108 .EX
1109 {\(dqop\(dq:\(dqnew\(dq, \(dqdomain\(dq:\(dqrepoconf\(dq,
1110 \(dqargs\(dq:{
1111 \(dqkeys_val\(dq:[{\(dqkey\(dq:\(dqrepo_id\(dq, \(dqvalue\(dq:\(dqtest\-repo\(dq},
1112 {\(dqkey\(dq:\(dqname\(dq, \(dqvalue\(dq:\(dqTest repository\(dq},
1113 {\(dqkey\(dq:\(dqenabled\(dq, \(dqvalue\(dq:\(dqfalse\(dq},
1114 {\(dqkey\(dq:\(dqbaseurl\(dq, \(dqvalue\(dq:\(dqhttps://xyz.com/rpm\(dq}]}}
1115 {\(dqop\(dq:\(dqreply\(dq, \(dqrequested_op\(dq:\(dqnew\(dq, \(dqdomain\(dq:\(dqrepoconf\(dq, \(dqstatus\(dq:\(dqOK\(dq,
1116 \(dqreturn\(dq:{
1117 \(dqkeys_val\(dq:[{\(dqkey\(dq:\(dqrepo_id\(dq, \(dqvalue\(dq:\(dqtest\-repo\(dq},
1118 {\(dqkey\(dq:\(dqname\(dq, \(dqvalue\(dq:\(dqTest repository\(dq},
1119 {\(dqkey\(dq:\(dqenabled\(dq, \(dqvalue\(dq:\(dq0\(dq},
1120 {\(dqkey\(dq:\(dqbaseurl\(dq, \(dqvalue\(dq:\(dqhttps://xyz.com/rpm\(dq}]}}
1121 .EE
1122 .UNINDENT
1123 .UNINDENT
1124 .SS Description of the \fBlog\fP operation
1125 .sp
1126 The \fBlog\fP operation writes a message to the logger.
1127 .sp
1128 \fIRequest format:\fP
1129 .INDENT 0.0
1130 .INDENT 3.5
1131 .sp
1132 .EX
1133 {\(dqop\(dq:\(dqlog\(dq, \(dqargs\(dq:{\(dqlevel\(dq:\(dq<level>\(dq, \(dqmessage\(dq:\(dq<message>\(dq}}
1134 .EE
1135 .UNINDENT
1136 .UNINDENT
1137 .sp
1138 \fIResponse format:\fP
1139 .INDENT 0.0
1140 .INDENT 3.5
1141 .sp
1142 .EX
1143 {\(dqop\(dq:\(dqreply\(dq, \(dqrequested_op\(dq:\(dqlog\(dq, \(dqdomain\(dq:\(dqlog\(dq, \(dqstatus\(dq:\(dqOK\(dq}
1144
1145 {\(dqop\(dq:\(dqreply\(dq, \(dqrequested_op\(dq:\(dqlog\(dq, \(dqdomain\(dq:\(dqlog\(dq, \(dqstatus\(dq:\(dqERROR\(dq,
1146 \(dqmessage\(dq:\(dqUnknown log level \(aq<level_from_request>\(aq\(dq}
1147 .EE
1148 .UNINDENT
1149 .UNINDENT
1150 .sp
1151 \fIDescription:\fP
1152 .INDENT 0.0
1153 .IP \(bu 2
1154 \fB<level>\fP \- \fBCRITICAL\fP, \fBERROR\fP, \fBWARNING\fP, \fBNOTICE\fP, \fBINFO\fP, \fBDEBUG\fP, \fBTRACE\fP
1155 .IP \(bu 2
1156 \fB<message>\fP \- text to be written to the log
1157 .IP \(bu 2
1158 \fB<level_from_request>\fP \- the level from the request, if it contains an unsupported value
1159 .UNINDENT
1160 .sp
1161 \fIExample:\fP
1162 .INDENT 0.0
1163 .INDENT 3.5
1164 .sp
1165 .EX
1166 {\(dqop\(dq:\(dqlog\(dq, \(dqargs\(dq:{\(dqlevel\(dq:\(dqWARNING\(dq, \(dqmessage\(dq:\(dqMy warning message\(dq}}
1167 {\(dqop\(dq:\(dqreply\(dq, \(dqrequested_op\(dq:\(dqlog\(dq, \(dqdomain\(dq:\(dqlog\(dq, \(dqstatus\(dq:\(dqOK\(dq}
1168 .EE
1169 .UNINDENT
1170 .UNINDENT
1171 .SS Description of the \fBstop\fP operation
1172 .sp
1173 The \fBstop\fP operation throws a stop exception with a message.
1174 .sp
1175 \fIRequest format:\fP
1176 .INDENT 0.0
1177 .INDENT 3.5
1178 .sp
1179 .EX
1180 {\(dqop\(dq:\(dqstop\(dq, \(dqargs\(dq:{\(dqmessage\(dq:\(dq<message>\(dq}}
1181 .EE
1182 .UNINDENT
1183 .UNINDENT
1184 .sp
1185 \fIDescription:\fP
1186 .INDENT 0.0
1187 .IP \(bu 2
1188 \fB<message>\fP \- text to be included in the stop exception
1189 .UNINDENT
1190 .sp
1191 After this request, the application is expected to terminate. The actions plugin does not send a response but closes the communication channel \- pipes connected to the standard output and input of the process.
1192 .sp
1193 \fIExample:\fP
1194 .INDENT 0.0
1195 .INDENT 3.5
1196 .sp
1197 .EX
1198 {\(dqop\(dq:\(dqstop\(dq, \(dqargs\(dq:{\(dqmessage\(dq:\(dqI want to stop the task\(dq}}
1199 .EE
1200 .UNINDENT
1201 .UNINDENT
1202 .SS Description of the \fBerror\fP operation
1203 .sp
1204 The \fBerror\fP operation logs the error message or throws an error exception with a message if \fBraise_error=1\fP\&.
1205 .sp
1206 \fIRequest format:\fP
1207 .INDENT 0.0
1208 .INDENT 3.5
1209 .sp
1210 .EX
1211 {\(dqop\(dq:\(dqerror\(dq, \(dqargs\(dq:{\(dqmessage\(dq:\(dq<message>\(dq}}
1212 .EE
1213 .UNINDENT
1214 .UNINDENT
1215 .sp
1216 \fIResponse format:\fP
1217 .INDENT 0.0
1218 .INDENT 3.5
1219 .sp
1220 .EX
1221 {\(dqop\(dq:\(dqreply\(dq, \(dqrequested_op\(dq:\(dqerror\(dq, \(dqdomain\(dq:\(dqerror\(dq, \(dqstatus\(dq:\(dqOK\(dq}
1222 .EE
1223 .UNINDENT
1224 .UNINDENT
1225 .sp
1226 \fIDescription:\fP
1227 .INDENT 0.0
1228 .IP \(bu 2
1229 \fB<message>\fP \- text written to the log or included in the error exception if \fBraise_error=1\fP
1230 .UNINDENT
1231 .sp
1232 If \fBraise_error=1\fP, the application is expected to terminate. The actions plugin does not send a response but closes the communication channel \- pipes connected to the standard output and input of the process.
1233 .sp
1234 \fIExample:\fP
1235 .INDENT 0.0
1236 .INDENT 3.5
1237 .sp
1238 .EX
1239 {\(dqop\(dq:\(dqerror\(dq, \(dqargs\(dq:{\(dqmessage\(dq:\(dqError in action process 1\(dq}}
1240 {\(dqop\(dq:\(dqreply\(dq, \(dqrequested_op\(dq:\(dqerror\(dq, \(dqdomain\(dq:\(dqerror\(dq, \(dqstatus\(dq:\(dqOK\(dq}
1241 .EE
1242 .UNINDENT
1243 .UNINDENT
1244 .SH AN EXAMPLE ACTIONS FILE:
1245 .INDENT 0.0
1246 .INDENT 3.5
1247 .sp
1248 .EX
1249 # Prints header with process id
1250 pre_base_setup::::/usr/bin/sh \-c echo\e \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\e >>/tmp/actions\-trans.log
1251 pre_base_setup::::/usr/bin/sh \-c date\e >>/tmp/actions\-trans.log
1252 pre_base_setup::::/usr/bin/sh \-c echo\e libdnf5\e pre_base_setup\e was\e called.\e Process\e ID\e =\e \(aq${pid}\(aq.\e >>/tmp/actions\-trans.log
1253 pre_base_setup:::enabled=installroot\-only:/usr/bin/sh \-c echo\e run\e in\e alternative\e \(dqinstallroot\(dq:\e installroot\e =\e \(aq${conf.installroot}\(aq\e >>/tmp/actions\-trans.log
1254
1255 # Prints the value of the configuration option \(dqdefaultyes\(dq.
1256 pre_base_setup::::/usr/bin/sh \-c echo\e pre_base_setup:\e conf.defaultyes=${conf.defaultyes}\e >>/tmp/actions.log
1257
1258 # Prints a message that the \(dqpost_base_setup\(dq callback was called.
1259 post_base_setup::::/usr/bin/sh \-c echo\e libdnf5\e post_base_setup\e was\e called.\e >>/tmp/actions\-trans.log
1260
1261 # Executes the \(dqadd_new_repo\(dq application with json communication.
1262 # This application, for instance, can add new repository configurations.
1263 repos_configured:::mode=json:/usr/local/bin/add_new_repo
1264
1265 # Prints a list of configured repositories with their enable state.
1266 repos_configured::::/usr/bin/sh \-c echo\e Repositories:\e ${conf.*.enabled}\e >>/tmp/repos.log
1267
1268 # Prints a list of repositories that use the http protocol in baseurl.
1269 repos_configured::::/usr/bin/sh \-c echo\e \(dq${conf.*.baseurl=*http://*}\(dq\e >>/tmp/baseurl_http.log
1270
1271 # Disables all repositories whose id starts with \(dqrpmfusion\(dq.
1272 repos_configured::::/usr/bin/sh \-c echo\e conf.rpmfusion*.enabled=0
1273
1274 # Executes the \(dqcheck_transaction\(dq application with json communication, terminating if the application encounters an error.
1275 # This application, for instance, can check for forbidden packages within a transaction and send a stop message.
1276 pre_transaction:::mode=json raise_error=1:/usr/local/bin/check_transaction
1277
1278 # Prints the information about the start of the transaction.
1279 # Since package_filter is empty, it executes the commands once.
1280 pre_transaction::::/usr/bin/sh \-c echo\e Transaction\e start.\e Packages\e in\e transaction:\e >>/tmp/actions\-trans.log
1281
1282 # Logs all packages (package action, full_nevra, repo id) in transaction into a file.
1283 # Uses the shell command \(dqecho\(dq and redirection to a file.
1284 pre_transaction:*:::/usr/bin/sh \-c echo\e \(aq${pkg.action}\(aq\e \(aq${pkg.full_nevra}\(aq\e \(aq${pkg.repo_id}\(aq\e >>/tmp/actions\-trans.log
1285
1286 # Prints the date and time and information about the end of the transaction.
1287 # Since package_filter is empty, it executes the commands once.
1288 post_transaction::::/usr/bin/sh \-c date\e >>/tmp/actions\-trans.log
1289 post_transaction::::/usr/bin/sh \-c echo\e Transaction\e end.\e Repositories\e used\e in\e the\e transaction:\e >>/tmp/actions\-trans.log
1290
1291 # Logs all the repositories from which packages were used in the transaction to install on the system.
1292 # Each repository will be listed only once, even if multiple packages from the same repository were used.
1293 # The same command (after variables substitution) is executed only once per transaction.
1294 post_transaction:*:in::/usr/bin/sh \-c echo\e \(aq${pkg.repo_id}\(aq\e >>/tmp/actions\-trans.log
1295
1296 # ==============================================================================================
1297 # The next two actions emulate the DNF4 snapper plugin. It uses the \(dqsnapper\(dq command\-line program.
1298
1299 # Creates a snapshot description and saves it to the \(dqtmp.snapper_descr\(dq variable.
1300 pre_transaction::::/usr/bin/sh \-c echo\e \(dqtmp.snapper_descr=$(ps\e \-o\e command\e \-\-no\-headers\e \-p\e \(aq${pid}\(aq)\(dq
1301
1302 # Creates pre snapshot before the transaction and stores the snapshot number in the \(dqtmp.snapper_pre_number\(dq variable.
1303 pre_transaction::::/usr/bin/sh \-c echo\e \(dqtmp.snapper_pre_number=$(snapper\e create\e \-t\e pre\e \-p\e \-d\e \(aq${tmp.snapper_descr}\(aq)\(dq
1304
1305 # If the variable \(dqtmp.snapper_pre_number\(dq exists, it creates post snapshot after the transaction and removes the used variables.
1306 post_transaction::::/usr/bin/sh \-c [\e \-n\e \(dq${tmp.snapper_pre_number}\(dq\e ]\e &&\e snapper\e create\e \-t\e post\e \-\-pre\-number\e \(dq${tmp.snapper_pre_number}\(dq\e \-d\e \(dq${tmp.snapper_descr}\(dq\e ;\e echo\e tmp.snapper_pre_number\e ;\e echo\e tmp.snapper_descr
1307 .EE
1308 .UNINDENT
1309 .UNINDENT
1310 .SH Author
1311 See AUTHORS.md in dnf5 source distribution.
1312 .SH Copyright
1313 Contributors to the dnf5 project.
1314 .\" End of generated man page.