-
Notifications
You must be signed in to change notification settings - Fork 6
Bulk Operations
While working in a cloud a frequent task is to do bulk operations. For example you may wish to reboot several instances or delete some images. To do this in Perspective Shell you should use expressions with the simple syntax described below. We'll use reboot command as an example to describe available options.
This is the default behavior and anything you type is considered as a Perl-compatible regular expression.
perspective> reboot test-.*
The command above will reboot all instances starting with test-
(like test-vm
or some-test-1
) because .*
means any number of symbols. One command can match against multiple patterns - just separate them with commas:
perspective> reboot test-.*,example-.*
To process only entities exactly matching some string you should enclose this string in ^$
, e.g. ^string$
.
perspective> reboot ^test-vm$,^one-more-vm$
This command will only reboot test-vm
and one-more-vm
instances.
Although this can be achieved using regular expressions Perspective shell supports %-syntax
like the following:
perspective> reboot %vm%
This command will process every instance containing vm
somewhere inside its name.