Package rtslib :: Module target :: Class NetworkPortal

[hide private]
[frames] | no frames]

# Class NetworkPortal

      object --+
               |
    node.CFSNode --+
                   |
                  NetworkPortal

This is an interface to NetworkPortals in configFS. A NetworkPortal is identified by its IP and port, but here we also require the parent TPG, so instance objects represent both the NetworkPortal and its association to a TPG. This is necessary to get path information in order to create the portal in the proper configFS hierarchy.

Instance Methods | [hide private]

__init__(self, parent_tpg, ip_address, port=3260, mode=`'``any``'`) Returns: A NetworkPortal object. |

_get_ip_address(self) |

_get_port(self) |

_get_parent_tpg(self) |

_set_iser_attr(self, iser_attr) |

_get_iser_attr(self) |

delete(self) Delete the NetworkPortal. |

Inherited from `node.CFSNode`: `__nonzero__`, `__str__`, `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`, `_create_in_cfs_ine`, `_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`

Properties | [hide private]

| parent_tpg Get the parent TPG object.
| port Get the NetworkPortal's TCP port as an int.
| ip_address Get the NetworkPortal's IP address as a string.
Inherited from `node.CFSNode`: `exists`, `is_fresh`, `path` Inherited from `object`: `__class__`

Method Details | [hide private]

### __init__(self, parent_tpg, ip_address, port=3260, mode=`'``any``'`)
(Constructor)

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

Parameters:
  - `parent_tpg` (TPG) - The parent TPG object.
  - `ip_address` (string) - The ipv4 IP address of the NetworkPortal.
  - `port` (int) - The optional (defaults to 3260) NetworkPortal TCP/IP port.
  - `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 NetworkPortal object.
Overrides: object.__init__

### delete(self)

Delete the NetworkPortal.

Overrides: node.CFSNode.delete

Property Details | [hide private]

### parent_tpg

Get the parent TPG object.

Get Method:
  _get_parent_tpg(self)

### port

Get the NetworkPortal's TCP port as an int.

Get Method:
  _get_port(self)

### ip_address

Get the NetworkPortal's IP address as a string.

Get Method:
  _get_ip_address(self)