Package onep :: Package policyservice :: Module policymap :: Class PolicyMap
[frames] | no frames]

Class PolicyMap


PolicyMap class.

This PolicyMap class contains a hierarchy of objects that define class map, match and action objects for applying policies to targets. Capability specifications are contained in the PolicyCapability class and the policy can be associated with multiple targets. Adding and removing Action(s), Match(es), and Entries will only be applied to the local copy of this Class. The BulkService class must be used to submit those changes on the Network Element.

Class variables

capabilities - PolicyCapabilities class

storage_type - StorageType enum (default TRANSIENT)

name - polcy name (default auto-generated by element)

op_id - Integer set by application for async operations (default None)

Instance Methods
 
__init__(self, capabilities, name=None, storage_type=StorageType.TRANSIENT)
Constructs an instance of PolicyMap with specified capability.
 
remove_entry(self, *entries)
Removes entries from the policy map.
 
get_result_detail(self)
Gets the results from policy submit/update/delete operations
 
__str__(self)
str(x)

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

Class Variables
Enum Order = enum('ONEP_POLICY_ORDER_END', 'ONEP_POLICY_ORDER_BEFOR...
Enumeration of Target Location Type.
  PolicyOperation = enum(ONEP_POLICY_OP_CREATE= 0, ONEP_POLICY_O...
Properties

Inherited from object: __class__

Method Details

__init__(self, capabilities, name=None, storage_type=StorageType.TRANSIENT)
(Constructor)

 

Constructs an instance of PolicyMap with specified capability.

Parameters:
Raises:
Overrides: object.__init__

remove_entry(self, *entries)

 

Removes entries from the policy map.

Removes only the entries that are added to policy map.

Parameters:
  • entries (Variable length argument list of Entry) - The entries.

__str__(self)
(Informal representation operator)

 

str(x)

Overrides: object.__str__
(inherited documentation)

Class Variable Details

Order

Enumeration of Target Location Type.

ONEP_POLICY_ORDER_END: end

ONEP_POLICY_ORDER_BEFORE: before

ONEP_POLICY_ORDER_DEFAULT: default

ONEP_POLICY_ORDER_SEQUENCE: sequence

Type:
Enum
Value:
enum('ONEP_POLICY_ORDER_END', 'ONEP_POLICY_ORDER_BEFORE', 'ONEP_POLICY\
_ORDER_DEFAULT', 'ONEP_POLICY_ORDER_SEQUENCE')

PolicyOperation

Value:
enum(ONEP_POLICY_OP_CREATE= 0, ONEP_POLICY_OP_MODIFY= 1, ONEP_POLICY_O\
P_DELETE= 2, ONEP_POLICY_OP_ACTIVATE= 3, ONEP_POLICY_OP_DEACTIVATE= 4,\
 ONEP_POLICY_OP_GET= 5, ONEP_POLICY_OP_GET_STATS= 6, ONEP_POLICY_OP_RE\
MOVE_STATS= 7, ONEP_POLICY_OP_REPLACE_ALL_ACTIONS= 8, ONEP_POLICY_OP_R\
EPLACE_ALL_MATCHES= 9, ONEP_POLICY_OP_REPLACE_ALL_ACTIONS_MATCHES= 10)