Package rtslib :: Module loop :: Class Nexus

[hide private]
[frames] | no frames]

# Class Nexus

      object --+
               |
    node.CFSNode --+
                   |
                  Nexus

This is a an interface to Target Portal Groups in configFS. A Nexus is identified by its parent Target object and its nexus Tag. To a Nexus object is attached a list of NetworkPortals.

Instance Methods | [hide private]

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

__str__(self) str(x) |

_get_initiator(self) |

_get_tag(self) |

_get_parent_target(self) |

_create_in_cfs_ine(self, mode) Creates the configFS node if it does not already exists depending on the mode. |

_list_luns(self) |

_control(self, command) |

_get_alua_metadata_path(self) |

delete(self) Recursively deletes a Nexus object. |

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

Inherited from `node.CFSNode`: `__nonzero__`, `get_attribute`, `get_auth_attr`, `get_parameter`, `list_attributes`, `list_auth_attrs`, `list_parameters`, `set_attribute`, `set_auth_attr`, `set_parameter`

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

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

Class Variables | [hide private]

Inherited from `node.CFSNode`: `alua_metadata_dir`, `configfs_dir`, `spec_dir`

Properties | [hide private]

| alua_metadata_path Get the ALUA metadata directory path for the Nexus.
| tag Get the Nexus Tag as an int.
| initiator Get the Nexus initiator address as a string.
| parent_target Get the parent Target object to which the Nexus is attached.
| luns Get the list of LUN objects currently attached to the Nexus.
Inherited from `node.CFSNode`: `exists`, `is_fresh`, `path` Inherited from `object`: `__class__`

Method Details | [hide private]

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

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

Parameters:
  - `parent_target` (Target) - The parent Target object of the Nexus.
  - `tag` (int > 0) - The Nexus 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 Nexus object.
Overrides: object.__init__

### __str__(self)
(Informal representation operator)

str(x)

Overrides: object.__str__
  (inherited documentation)

### _create_in_cfs_ine(self, mode)

Creates the configFS node if it does not already exists depending on the mode. any -> makes sure it exists, also works if the node already does exists lookup -> make sure it does NOT exists create -> create the node which must not exists beforehand Upon success (no exception raised), self._fresh is True if a node was created, else self._fresh is False.

Overrides: node.CFSNode._create_in_cfs_ine
  (inherited documentation)

### delete(self)

Recursively deletes a Nexus object. This will delete all attached LUN, and then the Nexus itself.

Overrides: node.CFSNode.delete

Property Details | [hide private]

### alua_metadata_path

Get the ALUA metadata directory path for the Nexus.

Get Method:
  _get_alua_metadata_path(self)

### tag

Get the Nexus Tag as an int.

Get Method:
  _get_tag(self)

### initiator

Get the Nexus initiator address as a string.

Get Method:
  _get_initiator(self)

### parent_target

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

Get Method:
  _get_parent_target(self)

### luns

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

Get Method:
  _list_luns(self)