Package onep :: Package policyservice :: Module match :: Class Match
[frames] | no frames]

Class Match


The Match class is an abstract class that represents a match specified in the class map.

There may be one or more Match objects in a ClassMap object or directly in an Entry object of a PolicyMap object (referred to as an inline class). There are different types of Match objects that specify details of each match criteria to be matched. The different types of Match are specified by different classes extended from Match.

***DEPRECATED*** MatchType in Match class is deprecated Please use match.MatchType ****************

Instance Methods
 
__init__(self, match_type)
Constructs Match.
bool
check_match_support(self, capable_matches)
Check to see if class match is supported on network element
{MatchType<match.MatchType>}
get_match_type(self)
Return MatchType of match class
 
match_type(self)
 
set_negate(self, sense_value)
Sets whether this is a "match not" statement.

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

Class Variables
  __metaclass__ = ABCMeta
Enum MatchOpCode = enum('CREATE', 'MOD', 'DEL', 'ADD', 'REM')
Enumeration of Match OpCode Type.
  MatchType = enum(MATCH_NONE= 0, MATCH_ACL= 1, MATCH_IP_DSCP= 2...
Properties

Inherited from object: __class__

Method Details

__init__(self, match_type)
(Constructor)

 

Constructs Match.

Overrides: object.__init__

check_match_support(self, capable_matches)

 

Check to see if class match is supported on network element

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

get_match_type(self)

 

Return MatchType of match class

Returns: {MatchType<match.MatchType>}
Return MatchType of match

match_type(self)

 
Decorators:
  • @property

set_negate(self, sense_value)

 

Sets whether this is a "match not" statement.

Parameters:
  • sense_value (bool) - Pass in true if it is match not. Otherwise pass in false.

Class Variable Details

MatchOpCode

Enumeration of Match OpCode Type.

CREATE: Create MOD: Modify DEL: Delete ADD: Add REM: Remove

Type:
Enum
Value:
enum('CREATE', 'MOD', 'DEL', 'ADD', 'REM')

MatchType

Value:
enum(MATCH_NONE= 0, MATCH_ACL= 1, MATCH_IP_DSCP= 2, MATCH_FR_DE= 3, MA\
TCH_FR_DLCI= 4, MATCH_INTERFACE= 5, MATCH_L2_COS= 6, MATCH_DST_MAC_ADD\
RESS= 7, MATCH_SRC_MAC_ADDRESS= 8, MATCH_MPLS_EXP= 9, MATCH_PKT_LEN= 1\
0, MATCH_QOS_GROUP= 11, MATCH_PROTOCOL= 12, MATCH_RTP_PORT= 13, MATCH_\
VLAN= 14, MATCH_VRF= 15, MATCH_DST_IP_ADDRESS= 16, MATCH_SRC_IP_ADDRES\
S= 17, MATCH_DST_TCP_PORT= 18, MATCH_SRC_TCP_PORT= 19, MATCH_IP_PROTOC\
OL= 20, MATCH_ETYPE= 21, MATCH_IP_TOS= 22, MATCH_MPLS_LABEL= 23, MATCH\
_IN_PHYSICAL_PORT= 24, MATCH_METADATA= 25, MATCH_ICMPV4_TYPE= 26, MATC\
...