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 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]
  tag = property(_get_tag, doc= "Get the TPG Tag as an int.")
  parent_target = property(_get_parent_target, doc= "Get the par...
  enable = property(_get_enable, _set_enable, doc= "Get or set a...
  network_portals = property(_list_network_portals, doc= "Get th...
  node_acls = property(_list_node_acls, doc= "Get the list of No...
  node_acl_groups = property(_list_node_acl_groups, doc= "Get th...
  luns = property(_list_luns, doc= "Get the list of LUN objects ...
  nexus = property(_get_nexus, _set_nexus, doc= "Get or set (onc...
  chap_userid = property(partial(_get_auth_attr, attribute= 'aut...
  chap_password = property(partial(_get_auth_attr, attribute= 'a...
  chap_mutual_userid = property(partial(_get_auth_attr, attribut...
  chap_mutual_password = property(partial(_get_auth_attr, attrib...
  authenticate_target = property(_get_authenticate_target, doc= ...

Inherited from node.CFSNode: configfs_dir, exists, path

Properties [hide private]

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

Class Variable Details [hide private]

parent_target

Value:
property(_get_parent_target, doc= "Get the parent Target object to whi\
ch the "+ "TPG is attached.")

enable

Value:
property(_get_enable, _set_enable, doc= "Get or set a boolean value re\
presenting the "+ "enable status of the TPG. "+ "True means the TPG is\
 enabled, False means it is "+ "disabled.")

network_portals

Value:
property(_list_network_portals, doc= "Get the list of NetworkPortal ob\
jects currently attached "+ "to the TPG.")

node_acls

Value:
property(_list_node_acls, doc= "Get the list of NodeACL objects curren\
tly "+ "attached to the TPG.")

node_acl_groups

Value:
property(_list_node_acl_groups, doc= "Get the list of NodeACL groups c\
urrently "+ "attached to the TPG.")

luns

Value:
property(_list_luns, doc= "Get the list of LUN objects currently attac\
hed "+ "to the TPG.")

nexus

Value:
property(_get_nexus, _set_nexus, doc= "Get or set (once) the TPG's Nex\
us is used.")

chap_userid

Value:
property(partial(_get_auth_attr, attribute= 'auth/userid', ignore= Tru\
e), partial(_set_auth_attr, attribute= 'auth/userid', ignore= True), d\
oc= "Set or get the initiator CHAP auth userid.")

chap_password

Value:
property(partial(_get_auth_attr, attribute= 'auth/password', ignore= T\
rue), partial(_set_auth_attr, attribute= 'auth/password', ignore= True\
), doc= "Set or get the initiator CHAP auth password.")

chap_mutual_userid

Value:
property(partial(_get_auth_attr, attribute= 'auth/userid_mutual', igno\
re= True), partial(_set_auth_attr, attribute= 'auth/userid_mutual', ig\
nore= True), doc= "Set or get the initiator CHAP auth userid.")

chap_mutual_password

Value:
property(partial(_get_auth_attr, attribute= 'auth/password_mutual', ig\
nore= True), partial(_set_auth_attr, attribute= 'auth/password_mutual'\
, ignore= True), doc= "Set or get the initiator CHAP auth password.")

authenticate_target

Value:
property(_get_authenticate_target, doc= "Get the boolean authenticate \
target flag.")