SAFplus Runtime Director API  3.0.5
aspAmf Namespace Reference

The aspAmf module centralizes all communications with the ASP AMF C layer. More...

Classes

class  AmfError
 Basic error exception class for AMF problems. More...
 
class  Session
 Interface into ASP Availability Management Framework (AMF) functionality. More...
 

Functions

def EntityRef
 Build an entity reference tuple out of the entity type and its instance name This is really just a wrapper for creating a python tuple. More...
 
def auditLog
 
def getEntityName
 
def SetCEntity
 Sets the C level "Entity" object to an entity. More...
 
def ErrCode
 Strip the component off of an ASP return code. More...
 
def exc2ret
 
def AspExcHandler
 
def ChkAspErr
 Internal function to check for C level errors. More...
 
def Test
 Internal module unit test. More...
 
def TestCreate
 Internal module unit test. More...
 
def TestGetConfig
 Internal module unit test. More...
 

Variables

string AUDIT_LOG_PREPEND_STR = "Audit Log : "
 
 CpuLoadMetric = asp.CL_METRIC_CPU
 Identify CPU Load types. More...
 

Detailed Description

The aspAmf module centralizes all communications with the ASP AMF C layer.

The functions are divided into several major categories:

  • 1. Entity installation/deletion/configuration modification. These functions add and remove entities from the AMF, or change the entity configuration. When creating a bunch of entities, it is recommended to use the DWIM function Session.InstallApp, which calls other functions in this class. But it is possible to do it yourself by using the InstallEntity and Install<entity type>Config APIs. The important thing to remember is that it is an error to configure an entity to refer to another non-existent entity. Since the entities are mutually referential, you must FIRST "Install" ALL mutually referential entities and THEN configure them.

    To reconfigure existing entities, use the Install<entity type>Config, for example Session.InstallSgConfig. To delete entities, use the Session.DeleteEntities API.

  • 2. Entity state changes.

    Use the Session.Startup, Session.Shutdown, Session.Quiesce, and Session.Idle functions to move entities though startup states.

  • 3. Entity state access. The clusterinfo.ci object provides much more comprehensive access to entity state. However there are some functions in this file that may be useful as they may return the exact subset of data that you need in a more convenient format than clusterinfo, which returns the entire ASP AMF information model.

Function Documentation

def aspAmf.AspExcHandler (   fn,
  args,
  obj = None,
  okset = [],
  errDict = {} 
)
def aspAmf.auditLog (   logStr,
  context = None 
)
def aspAmf.ChkAspErr (   ret,
  obj = None,
  okset = [],
  errDict = {} 
)

Internal function to check for C level errors.

def aspAmf.EntityRef (   type,
  name 
)

Build an entity reference tuple out of the entity type and its instance name This is really just a wrapper for creating a python tuple.

Parameters:

Parameters
typeentity type (see aspAmfEntity.py)
namestring identifying the entity
Returns
EntityRef = (type,name)
def aspAmf.ErrCode (   retval)

Strip the component off of an ASP return code.

def aspAmf.exc2ret (   fn,
  args 
)
def aspAmf.getEntityName (   entity)
def aspAmf.SetCEntity (   entity,
  obj 
)

Sets the C level "Entity" object to an entity.

Parameters
entityThe C level entity object. Pass "None" to create one.
objThe entity as either a tuple (type, name), or an AmfEntity object
def aspAmf.Test ( )

Internal module unit test.

def aspAmf.TestCreate (   name)

Internal module unit test.

def aspAmf.TestGetConfig ( )

Internal module unit test.

Variable Documentation

string aspAmf.AUDIT_LOG_PREPEND_STR = "Audit Log : "
aspAmf.CpuLoadMetric = asp.CL_METRIC_CPU

Identify CPU Load types.