api.security_policy

Cisco vManage Security Policy API Methods.

Module Contents

class api.security_policy.SecurityPolicy(session, host, port=443)[source]

Bases: object

vManage Security Policy API

Responsible for DELETE, GET, POST, PUT methods against vManage Security Policy.

add_security_policy(self, policy)[source]

Add a Security Policy from vManage.

Parameters

policy – The Security Policy

Returns

All data associated with a response.

Return type

result (dict)

update_security_policy(self, policy, policy_id)[source]

Update a Security from vManage.

Parameters
  • policy – The Security Policy

  • policy_id – The ID of the Security Policy to update

Returns

All data associated with a response.

Return type

result (dict)

delete_security_policy(self, policyId)[source]

Deletes the specified security policy

Parameters

policyId (str) – ID of the active security policy

Returns

All data associated with a response.

Return type

result (dict)

delete_security_definition(self, definition, definitionId)[source]

Deletes the specified policy definition which include: ‘zonebasedfw’,’urlfiltering’, ‘dnssecurity’,’intrusionprevention’, ‘advancedMalwareProtection’ for 18.4.0 or greater and ‘zonebasedfw’ for

Parameters
  • definition (str) – One of the above policy types

  • definitionId (str) – ID of the policy definitions

Returns

All data associated with a response.

Return type

result (dict)

get_security_policy(self)[source]

Obtain a list of all configured security policies

Returns

All data associated with a response.

Return type

result (dict)

get_security_definition(self, definition)[source]

Obtain a list of various security definitions which include: ‘zonebasedfw’,’urlfiltering’,’intrusionprevention’, ‘advancedMalwareProtection’, ‘dnssecurity’

Parameters

definition (str) – One of the above policy types

Returns

All data associated with a response.

Return type

result (dict)

get_security_policy_list(self)[source]

Get all Security Policies from vManage.

Returns

A list of all policy lists currently

in vManage.

Return type

response (list)

get_security_policy_dict(self, key_name='policyName', remove_key=False)[source]

Get all Security Policies from vManage.

Parameters
  • key_name (str) – The name of the attribute to use as the key

  • remove_key (bool) – Remove the key from the dict (default: False)

Returns

A dict of all Security Policies currently

in vManage.

Return type

response (dict)