Follow

About this task

InfiniShell provides options that help the user to control the way query result are displayed.

Filtering a query

InfiniBox queries can be filtered, so that only specific entities will be returned. The filtering options of each query are available through running help on the query command: typing the command and pressing TAB.

For example:

You can filter the volume query by:

  • Name - the name of the volume
  • Pool - the pool that the volume belongs to
  • CG - the consistency group that the volume is a member of
  • Mapped, thin, write protected - volumes attributes
vol.query                                                                                                                                                                           
[name]            [pool]            [mapped]          [thin]            
[--columns]       [--format]        [-d|--xdebug]                                                                            
[cg]              [unit]            [write_protected] [--detailed]
[--sort]          [--grep]          [-y|--yes]   

Filtering the query result by any string of characters

Filtering by a string of characters

Example: vol.query --grep=replica

Filtering for query results that do not include a specific string

Examples:

  • vol.query --grep=replica
  • vol.query --inverted-grep=replica

Sorting the query

The query results can be sorted by the value of any of its fields.

Sorting by numerical value

Sorting the query results by used, from small to big.

vol.query --sort=used                                                                                                                                                               
NAME              THIN        USED               POOL                          
vol_1             yes    980.02 MB               replication-from-ibox1092    
vol_2             yes    880.02 MB               replica_from_ibox3008        
vol_3             yes    763.69 MB               replica_from_ibox3008       
vol_4             yes    678.97 MB               replica_from_ibox3008      
...

Sorting the query results by used, from big to small.

vol.query --sort=-used                                                                                                                                                               
NAME              THIN        USED               POOL                         
vol_4             yes    678.97 MB               replica_from_ibox3008        
vol_3             yes    763.69 MB               replica_from_ibox3008         
vol_2             yes    880.02 MB               replica_from_ibox3008      
vol_1             yes    980.02 MB               replication-from-ibox1092      
...

Sorting by alphanumerical value

Sorting the query results by volume name.

vol.query --sort=name                                                                                                                                                               
NAME              THIN        USED               POOL                         
vol_1             yes    980.02 MB               replication-from-ibox1092       
vol_2             yes    880.02 MB               replica_from_ibox3008         
vol_3             yes    763.69 MB               replica_from_ibox3008        
vol_4             yes    678.97 MB               replica_from_ibox3008        
...

Setting the displayed capacity unit

You can select the unit in which capacity is displayed.

vol.query unit=      
B, G, GB, GiB, T, TB, TiB or block
B      G      GB     GiB    T      TB     TiB    block   

Selecting the displayed columns

Select the columns that will be displayed on the query result.

vol.query --columns=name,used,pool                                                                                                                                                  
NAME                         USED  POOL                                                                                                        
aixio001_1                      0  aix                                                                                                         
aixio001_2                      0  aix                                                                                                         
aixio001_3                      0  aix                                                                                                         
aixio001_4                      0  aix                                                                                                         
aixio001_5                      0  aix                                                                                                         
aixio003_boot_1                 0  aix                                                                                                         
aixio003_boot_2                 0  aix                                                                                                         
aixio003_boot_3                 0  aix                                                                                                         
aixio003_boot_4                 0  aix                                                                                                         
aixio004-01             222.00 GB  aix                                                                                                         
aixio004-02             444.00 GB  aix                                                                                                         
aixio004-03             665.99 GB  aix                                                                                                         
aixio004-04             887.96 GB  aix   
...

Setting the results format

You can select between tabular, CSV and JSON formats.

(For tabular format, run the query without the format option.)

CSV format

vol.query --format=csv                                                                                                                                                              
NAME,THIN,SIZE,USED,ALLOCATED,TREE ALLOCATED,POOL,WP,MAPPED                                                                                                                                          
aixio001_1,no,500.00 GB,0,500.00 GB,0,aix,no,yes                                                                                                                                                     
aixio001_2,no,500.00 GB,0,500.00 GB,0,aix,no,yes                                                                                                                                                     
aixio001_3,no,500.00 GB,0,500.00 GB,0,aix,no,yes                                                                                                                                                     
aixio001_4,no,500.00 GB,0,500.00 GB,0,aix,no,yes                                                                                                                                                     
aixio001_5,no,500.00 GB,0,500.00 GB,0,aix,no,yes 

JSON format

vol.query name=vol_fea63de9-6a2f-4f9d-8fa2-62aa34e6d855_replica --format=json                                                                                                       
{                                                                                                                                                                                                    
"command": "vol.query name=vol_fea63de9-6a2f-4f9d-8fa2-62aa34e6d855_replica --format=json",                                                                                                          
"result": [                                                                                                                                                                                          
{                                                                                                                                                                                                    
    "allocated": "1.00 GB",                                                                                                                                                                          
    "mapped": "no",                                                                                                                                                                                  
    "name": "vol_fea63de9-6a2f-4f9d-8fa2-62aa34e6d855_replica",                                                                                                                                      
    "pool": "replica_from_ibox3008",                                                                                                                                                                 
    "size": "1.00 GB",                                                                                                                                                                               
    "thin": "yes",                                                                                                                                                                                   
    "tree_allocated": "0",                                                                                                                                                                           
    "used": "1.00 GB",                                                                                                                                                                               
    "write_protected": "no"                                                                                                                                                                          
}                                                                                                                                                                                                    
]                                                                                                                                                                                                    
}                    

Displaying a detailed output

The detailed output displays more fields than the default tabular output.

vol.query name=vol_fea63de9-6a2f-4f9d-8fa2-62aa34e6d855_replica --detailed                                                                                                          
Name               vol_fea63de9-6a2f-4f9d-8fa2-62aa34e6d855_replica                                                                                                                                  
Serial             742b0f000000bbb0000000000000414                                                                                                                                                   
Thin               yes                                                                                                                                                                               
Size               1.00 GB                                                                                                                                                                           
Used               1.00 GB                                                                                                                                                                           
Allocated          1.00 GB                                                                                                                                                                           
Tree Allocated     0                                                                                                                                                                                 
Pool               replica_from_ibox3008                                                                                                                                                             
Write Protected    no                                                                                                                                                                                
Mapped             no                                                                                                                                                                                
Ssd Cache          yes                                                                                                                                                                               
Replication Role   -                                                                                                                                                                                 
Created At         2015-09-27 09:59:28                                                                                                                                                               
Updated At         2015-10-19 12:33:45    
Was this article helpful?
0 out of 0 found this helpful

0 out of 0 found this helpful

Comments