SAFplus Runtime Director API  3.0.5
aspAmf.Session Class Reference

Interface into ASP Availability Management Framework (AMF) functionality. More...

Public Member Functions

def __init__
 Constructor. More...
 
def Finalize
 Clean up allocated resources (AMF session handles) More...
 
def InstallApp
 Install a created application into the AMF. More...
 
def GetRunningAmfNodes
 Return a list of existing nodes as AmfNode objects. More...
 
def GetNodes
 Return a list of existing nodes where each node is a dictionary The clusterinfo module provides a much more extensive API. More...
 
def GetConfiguredNodeNames
 Return a list of existing nodes as (type, name) pairs The clusterinfo module provides a much more extensive API. More...
 
def GetConfiguredEntities
 Return a list of entities by name. More...
 
def GetConfiguredServiceGroupNames
 Return a list of existing nodes where each node is a dictionary The clusterinfo module provides a much more extensive API. More...
 
def GetMasterNode
 Returns the master node address. More...
 
def GetWorkOnServiceGroup
 Return a dictionary describing the Service Instances and contained Component Service Instances in a particular service group. More...
 
def GetCluster
 Deprecated: Return a large nested dictionary describing the cluster's current work assignment state. More...
 
def GetAllWorkAssignments
 Return a large nested dictionary describing the cluster's current work assignment state The clusterinfo module provides a much more extensive API. More...
 
def RedundancyMigrate
 Change redundancy modes using the underlying C clAmsMgmtMigrateSG "one-stop-shopping" function Note that you can also modify redundancy modes by hand (add Service Units) using the Python layers directly. More...
 
def DeleteEntities
 Delete AMF entities. More...
 
def Shutdown
 Stop an entity, regardless of its current state. More...
 
def Quiesce
 Move an entity into the idle state gently. More...
 
def Idle
 Puts an entity in the idle state (running but no assigned work), regardless of its current state. More...
 
def Startup
 Starts an entity running and assigns work, regardless of its current state. More...
 
def UpdateCsiAttributes
 Add or change CSI attributes. More...
 
def GetAssociatedData
 Sets user data to be associated with this entity. More...
 
def SetAssociatedData
 Sets user data to be associated with this entity. More...
 
def SetLoad
 Sets the load of an entity for use with the AMF triggering mechanism. More...
 
def GetLoad
 Gets the load of an entity for use with the AMF triggering mechanism. More...
 
def Log
 Private. More...
 
def InstallEntities
 Creates all entities in the passed list in the AMF, but does NOT configure them. More...
 
def InstallSgConfig
 Sets the configuration of service groups in the passed list in the AMF. More...
 
def InstallNodeConfig
 Sets the configuration of nodes in the passed list in the AMF. More...
 
def InstallSiConfig
 Sets the configuration of service instances in the passed list in the AMF. More...
 
def InstallSuConfig
 Sets the configuration of service units in the passed list in the AMF. More...
 
def InstallCompConfig
 Sets the configuration of components in the passed list in the AMF. More...
 
def InstallCsiConfig
 Sets the supported csi types to the component. More...
 

Public Attributes

 cbs
 
 hdl
 
 entity
 
 targetentity
 
 metric
 
 cname
 
 defaultAssociatedDataKey
 
 configHdl
 

Detailed Description

Interface into ASP Availability Management Framework (AMF) functionality.

All communications to the AMF occur through a Session object, which provides all-or-none semantics. Multiple sessions can be used simultaneously.

Constructor & Destructor Documentation

def aspAmf.Session.__init__ (   self)

Constructor.

The constructor makes the initial connection to the underlying AMF and grabs the needed handles.

Member Function Documentation

def aspAmf.Session.DeleteEntities (   self,
  entityList 
)

Delete AMF entities.

Parameters
entityListList of entities to delete (or a single entity). The entities can either by specified by name or as an aspAmfEntity object
def aspAmf.Session.Finalize (   self)

Clean up allocated resources (AMF session handles)

This function must be called when you are done with this session or handles will be leaked.

def aspAmf.Session.GetAllWorkAssignments (   self)

Return a large nested dictionary describing the cluster's current work assignment state The clusterinfo module provides a much more extensive API.

def aspAmf.Session.GetAssociatedData (   self,
  entity,
  key = None 
)

Sets user data to be associated with this entity.

Parameters
entityAn object derived from AmfEntity or a (type,name) pair
keyThe key to use to retrieve this data. If None or unspecified, the default key for this session will be used.
def aspAmf.Session.GetCluster (   self)

Deprecated: Return a large nested dictionary describing the cluster's current work assignment state.

def aspAmf.Session.GetConfiguredEntities (   self,
  entityTypes 
)

Return a list of entities by name.

Parameters
entityTypesinteger types of the entities you want. For example, aspAmfEntity.NodeType (preferred) or asp.CL_AMS_ENTITY_TYPE_NODE
def aspAmf.Session.GetConfiguredNodeNames (   self)

Return a list of existing nodes as (type, name) pairs The clusterinfo module provides a much more extensive API.

def aspAmf.Session.GetConfiguredServiceGroupNames (   self)

Return a list of existing nodes where each node is a dictionary The clusterinfo module provides a much more extensive API.

def aspAmf.Session.GetLoad (   self,
  entity,
  loadType = CpuLoadMetric 
)

Gets the load of an entity for use with the AMF triggering mechanism.

def aspAmf.Session.GetMasterNode (   self)

Returns the master node address.

def aspAmf.Session.GetNodes (   self)

Return a list of existing nodes where each node is a dictionary The clusterinfo module provides a much more extensive API.

def aspAmf.Session.GetRunningAmfNodes (   self)

Return a list of existing nodes as AmfNode objects.

The clusterinfo.ClusterInfo module provides a much more extensive API

def aspAmf.Session.GetWorkOnServiceGroup (   self,
  serviceGroupInstance 
)

Return a dictionary describing the Service Instances and contained Component Service Instances in a particular service group.

Parameters
serviceGroupInstanceA string containing the name of the service group instance
def aspAmf.Session.Idle (   self,
  entity 
)

Puts an entity in the idle state (running but no assigned work), regardless of its current state.

Parameters
entity.A pair (entity type, entity name) or an instance of a class derived from AspEntity (i.e. AmfServiceGroup, AmfServiceUnit, AmfNode, etc), or a list of those
Exceptions
AmfErroris raised if the entity cannot be moved to the appropriate state.
Returns
Nothing
def aspAmf.Session.InstallApp (   self,
  newEntityList,
  modifiedEntityList = [] 
)

Install a created application into the AMF.

This function takes a list of amfEntity objects, creates them down in the AMF C layer, and then sets their configuration correctly. It is expected that this list of objects will completely describe an application. Passing partial sets of objects may confuse the AMF since it may cause an invalid configuration. Hint: use the functions in aspAmfCreate to make the entity list.

Parameters
newEntityList,:The list of created entity objects, for example created by the CreateApp function
modifiedEntityList,:The list of modified entity objects
def aspAmf.Session.InstallCompConfig (   self,
  comp 
)

Sets the configuration of components in the passed list in the AMF.

Call InstallApp if you want to create the entity if it does not exist.

Parameters
compA list or singleton of type aspAmfEntity.Component
Exceptions
AssertionErroris raised if an unhandleable ASP error occurs.
Returns
None
def aspAmf.Session.InstallCsiConfig (   self,
  entityList 
)

Sets the supported csi types to the component.

Parameters
sgA list or singleton of type aspAmfEntity.ComponentServiceInstance
Exceptions
AssertionErroris raised if an unhandleable ASP error occurs.
Returns
None
def aspAmf.Session.InstallEntities (   self,
  amfentitylist 
)

Creates all entities in the passed list in the AMF, but does NOT configure them.

Therefore calling InstallApp is recommended.

Parameters
amfentitylistA list of aspAmfEntity objects to be created in the AMF
def aspAmf.Session.InstallNodeConfig (   self,
  node 
)

Sets the configuration of nodes in the passed list in the AMF.

Call InstallApp if you want to create the entity if it does not exist.

Parameters
nodeA list or singleton of type aspAmfEntity.Node
Exceptions
AssertionErroris raised if an unhandleable ASP error occurs.
Returns
None
def aspAmf.Session.InstallSgConfig (   self,
  sg 
)

Sets the configuration of service groups in the passed list in the AMF.

Call InstallApp if you want to create the entity if it does not exist.

Parameters
sgA list or singleton of type aspAmfEntity.ServiceGroup
Exceptions
AssertionErroris raised if an unhandleable ASP error occurs.
Returns
None
def aspAmf.Session.InstallSiConfig (   self,
  si 
)

Sets the configuration of service instances in the passed list in the AMF.

Call InstallApp if you want to create the entity if it does not exist.

Parameters
siA list or singleton of type aspAmfEntity.ServiceInstance
Exceptions
AssertionErroris raised if an unhandleable ASP error occurs.
Returns
None
def aspAmf.Session.InstallSuConfig (   self,
  su 
)

Sets the configuration of service units in the passed list in the AMF.

Call InstallApp if you want to create the entity if it does not exist.

Parameters
suA list or singleton of type aspAmfEntity.ServiceUnit
Exceptions
AssertionErroris raised if an unhandleable ASP error occurs.
Returns
None
def aspAmf.Session.Log (   self,
  s,
  lvl = None,
  unwind = 1 
)

Private.

Writes an ASP log. This is not actually an ASP AMF API, but is included here for convenience. Use misc.Log

Parameters
sThe log you want written
lvlThe log level (ex. misc.LogLevelError)
unwind(optional) Stack location of the original log producer. Useful if you wrap this Log function. (1 is you, 2 is your parent, etc)
def aspAmf.Session.Quiesce (   self,
  entity 
)

Move an entity into the idle state gently.

Puts an entity in the idle state (running but no assigned work), regardless of its current state. Allows the entity to finish its work before quitting.

Parameters
entity.A pair (entity type, entity name) or an instance of a class derived from AspEntity (i.e. AmfServiceGroup, AmfServiceUnit, AmfNode, etc), or a list of those
Exceptions
AmfErroris raised if the entity cannot be moved to the appropriate state.
Returns
Nothing
def aspAmf.Session.RedundancyMigrate (   self,
  sgName,
  prefix,
  active,
  standby 
)

Change redundancy modes using the underlying C clAmsMgmtMigrateSG "one-stop-shopping" function Note that you can also modify redundancy modes by hand (add Service Units) using the Python layers directly.

This may be necessary if this function does not provide that exact functionality you need. See aspAmfEntity and aspAmfModify APIs

Parameters
sgNameA string containing the name of the Service Group to be modified
prefixA string containing the basename for any newly created entities
activeThe desired number of active SUs in this SG (SUs will be added or removed to match this value)
standbyThe desired number of standby SUs in this SG (SUs will be added or removed to match this value)
def aspAmf.Session.SetAssociatedData (   self,
  entity,
  value,
  key = None 
)

Sets user data to be associated with this entity.

Parameters
entityAn object derived from AmfEntity or a (type,name) pair
valueString to set the associated data to
keyThe key to use to retrieve this data. If None or unspecified, the default key for this session will be used.
def aspAmf.Session.SetLoad (   self,
  entity,
  value,
  loadType = CpuLoadMetric 
)

Sets the load of an entity for use with the AMF triggering mechanism.

def aspAmf.Session.Shutdown (   self,
  entity 
)

Stop an entity, regardless of its current state.

This function moves the entity into SAF LOCKED_I state, or into SAF LOCKED_A state if the entity does not have a LOCKED_I state. The entity will be transitioned through the LOCKED_A state if this is necessary. In this case, the SIs are not quiesced, but aborted. To quiesce, uses the Quiesce member function.

Parameters
entity.A pair (entity type, entity name) or an instance of a class derived from AspEntity (i.e. AmfServiceGroup, AmfServiceUnit, AmfNode, etc), or a list of those
Exceptions
AmfErroris raised if the entity cannot be moved to the appropriate state.
Returns
Nothing
def aspAmf.Session.Startup (   self,
  entity 
)

Starts an entity running and assigns work, regardless of its current state.

Parameters
entity.A pair (entity type, entity name), an instance of a class derived from AspEntity (i.e. AmfServiceGroup, AmfServiceUnit, AmfNode, etc), or a list of those.
Exceptions
AmfErroris raised if the entity cannot be moved to the appropriate state.
Returns
Nothing
def aspAmf.Session.UpdateCsiAttributes (   self,
  csi,
  kvdict 
)

Add or change CSI attributes.

Parameters
csiAn object of type AmfComponentServiceInstance
kvdicta dictionary of key/value pairs to add or change.

Member Data Documentation

aspAmf.Session.cbs
aspAmf.Session.cname
aspAmf.Session.configHdl
aspAmf.Session.defaultAssociatedDataKey
aspAmf.Session.entity
aspAmf.Session.hdl
aspAmf.Session.metric
aspAmf.Session.targetentity