Package rtslib :: Module target :: Class TPG

[hide private]
[frames] | no frames]

# Class TPG

      object --+
               |
    node.CFSNode --+
                   |
                  TPG

This is a an interface to Target Portal Groups in configFS. A TPG is identified by its parent Target object and its TPG Tag. To a TPG object is attached a list of NetworkPortals. Targets without the 'tpgts' feature cannot have more than a single TPG, so attempts to create more will raise an exception.

Instance Methods | [hide private]

__repr__(self) repr(x) |

__init__(self, parent_target, tag=None, mode=`'``any``'`) Returns: A TPG object. |

_get_tag(self) |

_get_parent_target(self) |

_list_network_portals(self) |

_get_enable(self) |

_set_enable(self, boolean) Enables or disables the TPG. |

_get_nexus(self) Gets the nexus initiator WWN, or None if the TPG does not have one. |

_set_nexus(self, nexus_wwn=None) Sets the nexus initiator WWN. |

_list_node_acls(self) |

_list_node_acl_groups(self) |

_list_luns(self) |

_control(self, command) |

has_feature(self, feature) Whether or not this TPG has a certain feature. |

delete(self) Recursively deletes a TPG object. |

node_acl(self, node_wwn, mode=`'``any``'`) Same as NodeACL() but without specifying the parent_tpg. |

network_portal(self, ip_address, port, mode=`'``any``'`) Same as NetworkPortal() but without specifying the parent_tpg. |

lun(self, lun, storage_object=None, alias=None) Same as LUN() but without specifying the parent_tpg. |

_get_authenticate_target(self) |

dump(self) |

Inherited from `node.CFSNode`: `__eq__`, `__ne__`, `get_attribute`, `get_parameter`, `list_attributes`, `list_parameters`, `set_attribute`, `set_parameter`

Inherited from `node.CFSNode` (private): `_check_self`, `_create_in_cfs_ine`, `_exists`, `_get_path`, `_list_files`

Inherited from `object`: `__delattr__`, `__format__`, `__getattribute__`, `__hash__`, `__new__`, `__reduce__`, `__reduce_ex__`, `__setattr__`, `__sizeof__`, `__str__`, `__subclasshook__`

Class Methods | [hide private]

setup(cls, t_obj, tpg, err_func) |

Class Variables | [hide private]

Inherited from `node.CFSNode`: `configfs_dir`

Properties | [hide private]

| tag Get the TPG Tag as an int.
| parent_target Get the parent Target object to which the TPG is attached.
| enable Get or set a boolean value representing the enable status of the TPG.
| network_portals Get the list of NetworkPortal objects currently attached to the TPG.
| node_acls Get the list of NodeACL objects currently attached to the TPG.
| node_acl_groups Get the list of NodeACL groups currently attached to the TPG.
| luns Get the list of LUN objects currently attached to the TPG.
| nexus Get or set (once) the TPG's Nexus is used.
| chap_userid Set or get the initiator CHAP auth userid.
| chap_password Set or get the initiator CHAP auth password.
| chap_mutual_userid Set or get the initiator CHAP auth userid.
| chap_mutual_password Set or get the initiator CHAP auth password.
| authenticate_target Get the boolean authenticate target flag.
Inherited from `node.CFSNode`: `exists`, `path` Inherited from `object`: `__class__`

Method Details | [hide private]

### __repr__(self)
(Representation operator)

repr(x)

Overrides: object.__repr__
  (inherited documentation)

### __init__(self, parent_target, tag=None, mode=`'``any``'`)
(Constructor)

x.__init__(...) initializes x; see help(type(x)) for signature

Parameters:
  - `parent_target` (Target) - The parent Target object of the TPG.
  - `tag` (int > 0) - The TPG Tag (TPGT).
  - `mode` (string) - An optionnal string containing the object creation mode:
    - 'any' means the configFS object will be either looked up or created.
    - 'lookup' means the object MUST already exist configFS.
    - 'create' means the object must NOT already exist in configFS.
Returns:
  A TPG object.
Overrides: object.__init__

### _set_enable(self, boolean)

Enables or disables the TPG. If the TPG doesn't support the enable attribute, do nothing.

### _set_nexus(self, nexus_wwn=None)

Sets the nexus initiator WWN. Raises an exception if the nexus is already set or if the TPG does not use a nexus.

### delete(self)

Recursively deletes a TPG object. This will delete all attached LUN, NetworkPortal and Node ACL objects and then the TPG itself. Before starting the actual deletion process, all sessions will be disconnected.

Overrides: node.CFSNode.delete

### dump(self)

Overrides: node.CFSNode.dump

Property Details | [hide private]

### tag

Get the TPG Tag as an int.

Get Method:
  _get_tag(self)

### parent_target

Get the parent Target object to which the TPG is attached.

Get Method:
  _get_parent_target(self)

### enable

Get or set a boolean value representing the enable status of the TPG. True means the TPG is enabled, False means it is disabled.

Get Method:
  _get_enable(self)
Set Method:
  _set_enable(self, boolean) - Enables or disables the TPG.

### network_portals

Get the list of NetworkPortal objects currently attached to the TPG.

Get Method:
  _list_network_portals(self)

### node_acls

Get the list of NodeACL objects currently attached to the TPG.

Get Method:
  _list_node_acls(self)

### node_acl_groups

Get the list of NodeACL groups currently attached to the TPG.

Get Method:
  _list_node_acl_groups(self)

### luns

Get the list of LUN objects currently attached to the TPG.

Get Method:
  _list_luns(self)

### nexus

Get or set (once) the TPG's Nexus is used.

Get Method:
  _get_nexus(self) - Gets the nexus initiator WWN, or None if the TPG does not have one.
Set Method:
  _set_nexus(self, nexus_wwn=None) - Sets the nexus initiator WWN.

### chap_userid

Set or get the initiator CHAP auth userid.

Get Method:

      <functools.partial object>

Set Method:

      <functools.partial object>

### chap_password

Set or get the initiator CHAP auth password.

Get Method:

      <functools.partial object>

Set Method:

      <functools.partial object>

### chap_mutual_userid

Set or get the initiator CHAP auth userid.

Get Method:

      <functools.partial object>

Set Method:

      <functools.partial object>

### chap_mutual_password

Set or get the initiator CHAP auth password.

Get Method:

      <functools.partial object>

Set Method:

      <functools.partial object>

### authenticate_target

Get the boolean authenticate target flag.

Get Method:
  _get_authenticate_target(self)