lspolicy

Lists the active and inactive policies.

Read syntax diagramSkip visual syntax diagram
>>-lspolicy--+--------+--+-----------------------------+-------->
             +- -?----+  |        .-default----------. |
             +- -h----+  '- -fmt--+-delim--character-+-'
             '- -help-'           '-xml--------------'

>--+--------------+--+----------------+--+-------------+-------->
   |      .-off-. |  |        .-on--. |  '- -r--number-'
   '- -p--+-on--+-'  '- -hdr--+-off-+-'

>--+--------------+--+-----+--+-----------------------+--------->
   |      .-off-. |  +- -l-+  '- -state--+-active---+-'
   '- -v--+-on--+-'  '- -s-'             '-inactive-'

>--+-----------------+-----------------------------------------><
   | .-------------. |
   | V             | |
   +---policy_name-+-+
   '- - -------------'

Parameters

–? | –h | –help
Displays a detailed description of this command, including syntax, parameter descriptions, and examples. If you specify a help option, all other command options are ignored.
–fmt
Specifies the format of the output. You can specify one of the following values:
default
Specifies to display output in a tabular format using spaces as the delimiter between the columns. This is the default value. For example:
Name         State   Last Active                Modified             
========================================================================
policy1      Active  Jul 19, 2003 14:00:34 PM   Jul 19, 2003 13:59:34 PM

Description
=================
Active policy
delim character
Specifies to display output in a tabular format using the specified character to separate the columns. If you use a shell metacharacter (for example, * or \t) as the delimiting character, enclose the character in single quotation marks (') or double quotation marks ("). A blank space is not a valid character. For example:
policy1,Active,Jul 19, 2003 14:00:34 PM,Jul 19, 2003 13:59:34 PM,Active
policy
xml
Specifies to display output using XML format, for example:
<IRETURNVALUE>
<INSTANCE CLASSNAME="STC_PolicySet">
<PROPERTY NAME="Name" TYPE="string"><VALUE TYPE="string">policy1</VALUE>
</PROPERTY>
<PROPERTY NAME="State" TYPE="uint16"><VALUE TYPE="uint16">1</VALUE>
</PROPERTY>
<PROPERTY NAME="Description" TYPE="string"><VALUE TYPE="string">
Active&#32;policy</VALUE></PROPERTY>
<PROPERTY NAME="LastModificationDate" TYPE="datetime"><VALUE 
TYPE="datetime">20030719135934&#45;000000&#45;420</VALUE></PROPERTY>
<PROPERTY NAME="LastActiveDate" TYPE="datetime"><VALUE TYPE="datetime">
20030719140034&#45;000000&#45;420</VALUE></PROPERTY>
</INSTANCE>
</IRETURNVALUE>
–p
Specifies whether to display one page of text at a time or all text at once.
off
Displays all text at one time. This is the default value when the sfscli command is run in single-shot mode.
on
Displays one page of text at time. Pressing any key displays the next page. This is the default value when the sfscli command is run in interactive mode.
–hdr
Specifies whether to display the table header.
on
Displays the table header. This is the default value.
off
Does not display the table header.
–r number
Specifies the number of rows per page to display when the –p parameter is on. The default is 24 rows. You can specify a value from 1 to 100.
–v
Specifies whether to enable verbose mode.
off
Disables verbose mode. This is the default value.
on
Enables verbose mode.
–l
Displays the default information about each policy.
–s
Displays only the name of each policy.
–state active | inactive
Specifies the state of the policies to display. You can specify one of the following values:
active
Displays only the active policy.
inactive
Displays only the inactive policies.
policy_name
Specifies the names of one or more policies to list.
Specifies that you want to read the names of one or more policies to list from stdin (for example, – << /work/policies_list.txt).

Prerequisites

You must be logged in to the engine hosting the master metadata server to run this command.

Description

When you specify multiple parameters in this command, these behaviors apply:
  • Flags work as AND coordinators.
  • Objects work as OR coordinators.
  • When flags and objects are combined, the they are listed in this manner: WHERE flag_1 AND flag_2 AND ... AND flag_n AND (object_1 OR object_2 OR ... OR object_m).
  • When flags or objects are not required and not specified, this command searches all possible values unless a default overrides this rule.
For example, if you specify –state and two policy names, the search would be performed in the following manner: WHERE state AND (policy_name_1 OR policy_name_2).
If you do not specify a listing parameter or if you specify the –l listing parameter, this command displays the following information for each policy:
  • Name of the policy.
  • State of the policy.
  • Timestamp when the policy was last active, if applicable, based on coordinated universal time (UTC).
  • Timestamp when the policy was last modified, based on coordinated universal time (UTC).
  • Policy description.

Example

Display policies The following example displays all the available information about all the policies:
sfscli> lspolicy -l

Name         State      Last Active                Modified             
===========================================================================
policy1      Active     Jul 19, 2003 14:00:34 PM   Jul 19, 2003 13:59:34 PM
testpolicy   Inactive   Mar 18, 2003 10:30:17 PM   Mar 18, 2003 10:06:25 PM
DEFAULT      Inactive   Jan 11, 2003 16:36:24 PM   Jan 11, 2003 15:36:14 PM

Description
===================
Active policy
Test policy
Default Policy
Display the rules of the active policy The following example displays the rules of the active policy:
$sfscli lspolicy -s -state active -hdr off | sfscli catpolicy -
VERSION 1
rule 'stgRule1' set stgpool 'pool1' for fileset ('cnt_A')
rule 'stgRule2' set stgpool 'pool2' where NAME like '%.doc'
rule 'stgRule3' set stgpool 'pool3' where DAYOFWEEK(CREATION_DATE) == 1
rule 'stgRule4' set stgpool 'pool4' where USER_ID <= 100

Parent topic: Administrative commands

Related reference
catpolicy
mkpolicy
rmpolicy
statpolicy
usepolicy

Terms of use | Feedback
(C) Copyright IBM Corporation 2003, 2004. All Rights Reserved.