onyo unset
Remove KEYs from assets.
Keys that are used in asset names (see the onyo.assets.name-format
configuration option) cannot be unset.
The contents of all modified assets are checked for validity before committing. If problems are found, Onyo will error and leave the assets unmodified.
usage: onyo unset [-h] -k KEY [KEY ...] -a ASSET [ASSET ...] [-m MESSAGE]
[--no-auto-message]
Named Arguments
- -k, --keys
Keys to unset in assets. Multiple keys can be given (e.g. key1 key2 key3). Dictionary subkeys can be addressed using a period (e.g.
model.name,model.year, etc.). Note, that unsetting the last child of a dictionary does not remove the parent dictionary itself.- -a, --asset
Assets to unset **KEY**s in.
- -m, --message
Append MESSAGE to the commit message. If multiple
--messageoptions are given, their values are concatenated as separate paragraphs.- --no-auto-message
Do not auto-generate the commit message subject. If no MESSAGE is given, the subject line will be
[Empty subject]. This does not disable the inventory operations record at the end of a commit message. The default is configured via ‘onyo.commit.auto-message’.Default:
False
Examples
Remove a key from an asset:
$ onyo unset --keys USB_A --asset accounting/Bingo\ Bob/laptop_apple_macbook.oiw629
Remove a key from all laptops:
- $ onyo get –machine-readable –match type=laptop –keys path
xargs -d “n” onyo –yes unset –keys USB_A –asset