Package onep :: Package policyservice :: Module action :: Class Action
[frames] | no frames]

Class Action


The Action class is an abstract class that represents an action to be applied to a policy entry (PolicyMap.Entry). The Action object specifies the actions to be performed when a packet matches the match criteria. There may be one or more actions within an entry. There are different types of action objects that specify details of each action to be performed. It is also possible that an action object can contain a dependent action object. You will see this object assigned to the dependent_action instance variable.

***DEPRECATED*** The following enums were copied to root of action.py module because they are used by multiple classes in the module. Eventually they will be removed from this class.

RateUnits BurstUnits BandwidthUnits ThresholdUnits ActionType Direction ***********

Instance Methods
bool
check_action_support(self, capable_actions)
Check to see if policy action is supported on network element
ActionType
get_action_type(self)
Return ActionType of action class (action_type variable is internal only)

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __init__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables
  __metaclass__ = abc.ABCMeta
  RateUnits = enum(RATE_UNITS_BPS= 1, RATE_UNITS_PERCENT= 2)
***DEPRECATED***
  BandwidthUnits = enum(RATE_UNITS_BPS= 1, RATE_UNITS_PERCENT= 2)
***DEPRECATED***
  BurstUnits = enum(BURST_UNITS_BITS= 1, BURST_UNITS_MSEC= 2)
***DEPRECATED***
  ThresholdUnits = enum(UNITS_PKTS= 1, UNITS_BYTES= 2, UNITS_CEL...
***DEPRECATED***
  ActionType = enum(NONE= 0, DROP= 1, COPY= 2, DIVERT= 3, XMIT= ...
***DEPRECATED***
  Direction = enum(SOURCE= 0, DESTINATION= 1)
***DEPRECATED***
  ActionOpCode = enum('CREATE', 'MOD', 'DEL', 'REP')
Internal use only
  action_type = property(_get_actiontype, _set_actiontype, None,...
  op_code = property(_get_opcode, _set_opcode, None, None)
  handle = property(_get_handle, _set_handle, None, None)
Properties

Inherited from object: __class__

Method Details

check_action_support(self, capable_actions)

 

Check to see if policy action is supported on network element

Parameters:
  • capable_actions (ActionType) - list of ActionType from network element
Returns: bool
Returns True if supported False if not

get_action_type(self)

 

Return ActionType of action class (action_type variable is internal only)

Returns: ActionType
Return ActionType of action

Class Variable Details

ThresholdUnits

***DEPRECATED***

Value:
enum(UNITS_PKTS= 1, UNITS_BYTES= 2, UNITS_CELLS= 3, UNITS_PERCENT= 4, \
UNITS_MSEC= 5)

ActionType

***DEPRECATED***

Value:
enum(NONE= 0, DROP= 1, COPY= 2, DIVERT= 3, XMIT= 4, SET_QOS_GROUP= 5, \
SET_MPLS_EXP= 6, SET_DSCP= 7, MARK= 8, SET_MPLS_EXP_TOPMOST= 9, SET_TU\
NNEL_DSCP= 10, HDR_COMPRESS= 11, OUTPUT_INTERFACE= 12, POLICE= 13, SHA\
PE= 14, WRED= 15, PRIORITY_QUEUE= 16, CLASS_BASED_QUEUE= 17, FAIR_QUEU\
E= 18, QUEUE_LIMIT= 19, NEXT_HOP= 20, SET_TOS= 21, SET_DST_MAC= 22, SE\
T_SRC_MAC= 23, SET_DST_IP= 24, SET_SRC_IP= 25, SET_DST_UDP_PORT= 26, S\
ET_DST_TCP_PORT= 27, SET_DST_SCTP_PORT= 28, SET_SRC_UDP_PORT= 29, SET_\
SRC_TCP_PORT= 30, SET_SRC_SCTP_PORT= 31, SET_IP_PROTOCOL= 32, SET_VLAN\
...

action_type

Value:
property(_get_actiontype, _set_actiontype, None, None)