lsrel

Name

lsrel - Lists an already-defined managed relationship and its attributes.

Synopsis

lsrel [-h] [-s "selection_string"] [-A p | d | b] [-l | -t | -d | -D Delimiter] [-T] [-V] [Attr...]

lsrel [-h] [-M relation_name] [-A p | d | b] [-l | -t | -d | -D Delimiter] [-T] [-V] [Attr...]

lsrel [-h] [-S Source_Class[:Resource_name[:Node]] [-s "Source_string"] [-G Target_Class[:Resource_name[:Node][,Target class[:Resource_name[:Node][,…]]]] [-g "Target_string"] [-P Current_relationship] [-O Current_condition] [-A p | d | b] [-l | -t | -d | -D Delimiter] [-T] [-V] [Attr...]

Description

The lsrel command lists the managed relationships. If the relationship name is omitted, all managed relationships are listed. If the resource relationship is specified, the persistent attributes of the specified relationship is listed. If the Attr parameter is specified, the attributes that are specified for the relationship is listed.

If the attribute option is specified, the persistent or dynamic attributes of the relationships are listed. If specified, the Attr parameter overrides the -A option. The Attr parameter must be a valid relationship attribute when listing relationship information. If the Attr parameters are specified, the exact value of these attributes are listed. Otherwise, some of these attribute values are translated to English words.

Options

-A p | d | b
Specifies an attribute type. By default, only persistent attributes are displayed. This option can be used only when no attribute names are specified on the command line. To view all the persistent attributes of the member resources, the option must be used with -p attribute type.
p
Displays only persistent attributes.
d
Displays only dynamic attributes.
b
Displays both persistent and dynamic attributes.
For best performance, specify the -A p option.
-d
Specifies delimiter-formatted output. The default delimiter is a colon (:). Use the -D option if you want to change the default delimiter.
-D Delimiter
Specifies delimiter-formatted output that uses the specified delimiter. Use this option to specify something other than the default colon (:); for example, when the data to be displayed contains colons. Use this option to specify a delimiter of one or more characters.
-g Target_string
The Target_string is applied to all resources of the resource class that is specified by the -G option, to determine the targets of the relationship.

If the -g option is used to specify a source selection string, Resource_name and Node must not be specified for the -G option.

-G Target_class[:Resource_name[:Node]]

Specifies the target resources to display with the relationship. The target resource or resources are used with the source and any other specified query to find a match from all of the defined relationships. A target resource is identified by the resource's class (Target_class), the resource name (Resource_name), and, optionally, the node (Node) at which the resource is located. Target_class, Resource_name, and Node must be separated by colons. Multiple target resources can be specified and are separated by commas. The colons are required, but omitting Target_class causes the previously specified class to be used when multiple target resources are specified.

If the -g option is used to specify a target selection string, Resource_name and Node must not be specified for the -G option.

-h
Writes the command's usage statement to standard output.
-l
Specifies long formatted output. Each attribute is displayed on a separate line, which is the default display format.
-M relation_name
Specifies the name of the managed relationship to be listed.
-P Current_relationship
Specifies the managed relationship value that is used to query all the defined relationships to find a match. The value can be a numeric value or the word (not case-sensitive):
0x0001 or Collocated
Specifies that the source and the target resources are on the same node.
0x0002 or AntiCollocated
Specifies that the source and the target resources are on different nodes.
0x0003 or Affinity
Specifies that the source resource and its specified affinity resource are on the same node, if possible.
0x0004 or AntiAffinity
Specifies that the source resource and its specified affinity resource are on different nodes, if possible.
0x0005 or IsStartable
Specifies that the source and its target resources are startable.
0x0006 or StartAfter
Specifies that the source is to be started after the target resources.
0x0007 or DependsOn
Specifies that the target resources must be online before the source resource is started and includes an implicit collocation between the source and target resources.
0x0008 or DependsOnAny
Specifies that the target must be online before the source resource is started. It is identical to the DependsOn relationship except that it does not provide the collocated constraint for the start sequence. Therefore, the source and target resources cannot be started on the same node.
0x0009 or StopAfter
Specifies that the source resource cannot be stopped until after the target resource is offline.
0x000A or ForcedDownBy
Specifies that the source resource must be forced offline if either the target resource goes offline unexpectedly or the target resource itself is forced offline.
-O Current_condition
If condition query. Specifies the condition value to query all the defined relationships to find a match. The value can be the numeric value or the word (not case-sensitive):
0x0000 or NoCondition
Specifies unconditional location relationship.
0x0001 or IfOnline
Specifies that the target resource is online.
0x0002 or IfOffline
Specifies that the target resource is offline, failed offline, or unknown.
0x0003 or IfNotOnline
Specifies that the target resource is not online.
0x0004 or IfNotOffline
Specifies that the target resource is not offline or failed offline.
0x0005 or IfPossible
Used with the StartAfter relationship. Specifies that the target resource group can be bypassed if it cannot be bound, in which case it ends up in Sacrificed state and the StartAfter relationship is ignored.
-s "selection_string"
Specifies a selection string. This option without the -S option is applied to all the defined relationships and its attribute fields. All selection strings must be enclosed within either double or single quotation marks. If the selection string contains double quotation marks, enclose the entire selection string in single quotation marks. For example:
-s 'Name == "testing"'
-s 'Name ?= "test"'

Only persistent attributes can be listed in a selection string.

-s Source_string

Specifies the source selection string of the relationship to list. The Source_string is applied to all resources of the resource class that is specified by the -S option to determine the source of the relationship. The result of the selection may contain one or more resources.

If the -s option is used to specify a source selection string, Resource_name and Node must not be specified for the -S option.

-S Source_class[:Resource_name[:Node]]

Specifies the source resource of the relationship to list. A source resource is identified by the resource class (Resource_class) of the resource, the resource name (Resource_name), and, optionally, the node (Node) at which the resource is located. The result of the selection can contain one or more resources.

If the -s option is used to specify a source selection string, Resource_name and Node must not be specified for the -S option.

-t
Specifies tabular formatted output. Each attribute is displayed in a separate column, one resource per line.
-T
Writes the command's trace messages to standard error. For your software-service organization's use only.
-V
Writes the command's verbose messages to standard output.

Parameters

Attr
Specifies the names of one or more attributes whose values are to be displayed. These attributes must be separated by spaces. When the -m option is specified, these attributes must match the member resource attribute fields; when the -m option is not specified, the attributes must match the resource group attribute fields.
Node
Specifies the node name. The node name must be included when an attempt is made to list a fixed member resource. The node and its resource must be separated by the colon (:).
Resource_class
Specifies the name of the resource class to which the member resource belongs. The resource and the resource class must be separated by spaces.
Resource_name
Specifies the resource name. One or more resources can be specified along with the resource class to which it belongs. Each resource or set of resources must be preceded by its resource class. The resource and the resource class must be separated by spaces.

Exit Status

0
The command ran successfully.
1
Error occurred with RMC.
2
Error occurred with CLI script.
3
Incorrect flag on command line.
4
Incorrect parameter on command line.
5
Error occurred with RMC that was based on faulty command line input.
6
Resource specified was not found.

Security

This command requires root authority, or a user ID with appropriate permissions. For more information, see Setting up non-root user Ids for the command line interface.

Examples

  1. To list all the currently defined managed relationships, enter:
    lsrel

    Output:

    Displaying Managed Relations :
    Name       Resource:Node[Source]       ResourceGroup[Source]
    resA       IBM.Application:ja                   ResA
    jaffinity  IBM.Application:ja                   ResA
               IBM.ResourceGroup:john               Ja
  2. To list the persistent attributes of the managed relationship resA, enter:
    lsrel -A p -M resA

    Output:

    Displaying Managed Relationship Information:
    Persistent Attributes
    for Managed Relationship "resA".
    
    Managed Relationship 1:
        Class:Resource:Node[Source] = IBM.Application:ja:nodename
        Class:Resource:Node[Target] = {IBM.Application:Nate:Nodename}
        Relationship                = Collocated
        Conditional                 = NoCondition
        Name                        = resA
  3. To list the managed relationship that matches the source resA from class IBM.Application, having a Collocated relationship value with target resource narten from class IBM.ResourceGroup, enter:
    lsrel -S IBM.Application:ResA -P Collocated 
          -G IBM.ResourceGroup:narten

    Output:

    Displaying Managed Relationship Information:
    Managed Relationship 1:
    Name                        = ResA
    Class:Resource:Node[Source] = IBM.Application:ResA
    Class:Resource:Node[Target] = {IBM.ResourceGroup:Narten 
    ,IBM.Application:ja}
    Relationship                = Collocated
    Conditional                 = NoCondition
    ResourceGroup[Source]       = charm
  4. To list the dynamic attributes of the managed relationship name resA, enter:
    lsrel -A d -M resA
  5. To list the persistent attributes of the managed relationship name resA by using a selection string, enter:
    lsrel -A p -s 'Name == "resA"'

Files

/usr/sbin/rsct/bin/lsrel
Location of the lsrel command.

See Also

The addrgmbr, samctrl, chrg, chrgmbr, mkrg, rmrg, rmrgmbr commands.

The rmccli general information file.