SAFplus Runtime Director API
3.0.5
|
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 | |
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.
def aspAmf.Session.__init__ | ( | self | ) |
Constructor.
The constructor makes the initial connection to the underlying AMF and grabs the needed handles.
def aspAmf.Session.DeleteEntities | ( | self, | |
entityList | |||
) |
Delete AMF entities.
entityList | List 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.
entity | An object derived from AmfEntity or a (type,name) pair |
key | The 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.
entityTypes | integer 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.
serviceGroupInstance | A 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.
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 |
AmfError | is raised if the entity cannot be moved to the appropriate state. |
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.
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.
comp | A list or singleton of type aspAmfEntity.Component |
AssertionError | is raised if an unhandleable ASP error occurs. |
def aspAmf.Session.InstallCsiConfig | ( | self, | |
entityList | |||
) |
Sets the supported csi types to the component.
sg | A list or singleton of type aspAmfEntity.ComponentServiceInstance |
AssertionError | is raised if an unhandleable ASP error occurs. |
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.
amfentitylist | A 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.
node | A list or singleton of type aspAmfEntity.Node |
AssertionError | is raised if an unhandleable ASP error occurs. |
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.
sg | A list or singleton of type aspAmfEntity.ServiceGroup |
AssertionError | is raised if an unhandleable ASP error occurs. |
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.
si | A list or singleton of type aspAmfEntity.ServiceInstance |
AssertionError | is raised if an unhandleable ASP error occurs. |
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.
su | A list or singleton of type aspAmfEntity.ServiceUnit |
AssertionError | is raised if an unhandleable ASP error occurs. |
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
s | The log you want written |
lvl | The 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.
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 |
AmfError | is raised if the entity cannot be moved to the appropriate state. |
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
sgName | A string containing the name of the Service Group to be modified |
prefix | A string containing the basename for any newly created entities |
active | The desired number of active SUs in this SG (SUs will be added or removed to match this value) |
standby | The 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.
entity | An object derived from AmfEntity or a (type,name) pair |
value | String to set the associated data to |
key | The 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.
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 |
AmfError | is raised if the entity cannot be moved to the appropriate state. |
def aspAmf.Session.Startup | ( | self, | |
entity | |||
) |
Starts an entity running and assigns work, regardless of its current state.
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. |
AmfError | is raised if the entity cannot be moved to the appropriate state. |
def aspAmf.Session.UpdateCsiAttributes | ( | self, | |
csi, | |||
kvdict | |||
) |
Add or change CSI attributes.
csi | An object of type AmfComponentServiceInstance |
kvdict | a dictionary of key/value pairs to add or change. |
aspAmf.Session.cbs |
aspAmf.Session.cname |
aspAmf.Session.configHdl |
aspAmf.Session.defaultAssociatedDataKey |
aspAmf.Session.entity |
aspAmf.Session.hdl |
aspAmf.Session.metric |
aspAmf.Session.targetentity |