-
Notifications
You must be signed in to change notification settings - Fork 6
Filters and Settings
Ivan Krutov edited this page Apr 28, 2016
·
3 revisions
Perspective Shell supports two similar concepts called filters and settings.
A setting is a key-value pair that modifies shell properties, e.g. API URL or table width. Available settings are shown in the table below:
Name | Description | Default value | Possible values |
---|---|---|---|
always_say_yes | Whether to automatically answer "yes" to all wizard questions | false | true or false |
api_url | URL to access Perspective REST API | http://localhost:8080/ | an URL |
date_format | Format expression to be used when showing dates | YYYYMMdd_HHmmss | dd.MM.yyyy HH:mm:ss |
instance_suffixes | A list of suffixes to be ignored when searching for instances. E.g. if instance hostname is one.example.com then specifying .example.com in this setting will match both one and one.example.com when searching for instance one . |
- | .example.com,.test.com |
page_size | Number of rows to show per page. | 20 | positive integer |
paging_mode | Whether to use external pager (less, more or most) for showing results | 20 | external or nothing for internal pager |
show_bottom_table_header | Whether to also show table header as the last of row of the table. | false | true or false |
table_width | Number of symbols per row to show for the table. | 180 | positive integer |
A filter is also a key-value pair that defines which data should be shown. For example you may want to show instances from one project only or to fetch a list of images with names matching some pattern. Available filters are shown in the table below:
Name | Description | Possible values |
---|---|---|
clouds | Strings to match cloud name against | my-cloud |
flavor_names | Strings to match flavor name against | m1.medium |
image_names | Strings to match image name against | ^ubuntu_.* |
image_states | Strings to match image state against | saved,error |
instance_names | Strings to match instance name against | my-instance.*,test-vm |
instance_states | Strings to match instance state against | launched,rebooting |
network_names | Strings to match network name against | TESTNETWORK |
projects | Strings to match project name against | project-1,project-2 |
When one or more filters are enabled command line prompt changes to perspective*> (a star is added). |
Both filters and settings are modified with the same commands.
- To view a list of set filters type:
perspective> show filters
- To view a list of all filters type:
perspective> show filters --all
- Similarly for settings:
perspective> show settings
perspective> show settings --all
- To set a filter or a setting type:
perspective> set api_url = http://example.com/api
perspective> set instance_names = one.*,two.*
- To unset a filter or a setting use the following command:
perspective> unset api_url