Skip to content

Instantly share code, notes, and snippets.

@otherwiseguy
Created April 1, 2020 17:02
Show Gist options
  • Save otherwiseguy/72f31f8c6673482ff26a450b2f438642 to your computer and use it in GitHub Desktop.
Save otherwiseguy/72f31f8c6673482ff26a450b2f438642 to your computer and use it in GitHub Desktop.
# User specific aliases and functions
function ovs_destroy_find() {
local cmd=$1
local table=$2
local condition=$3
eval $cmd "-- destroy $table "{$(ovs-vsctl --no-headings --columns=_uuid -f csv find $table $condition|paste -sd",")}
}
alias nbdf="ovs_destroy_find ovn-nbctl"
alias sbdf="ovs_destroy_find ovn-sbctl"
alias ovsdf="ovs_destroy_find ovs-vsctl"
@otherwiseguy
Copy link
Author

otherwiseguy commented Apr 1, 2020

Example:
Delete all QoS table entries with a type=test:

ovsdf QoS type=test

Delete all QoS table entries:

ovsdf QoS

(though for deleting everything in a table you could do $cmd --all destroy $table as well)
etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment