api.central_policy

Cisco vManage Centralized Policy API Methods.

Module Contents

class api.central_policy.CentralPolicy(session, host, port=443)[source]

Bases: object

vManage Central Policy API

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

activate_central_policy(self, policy_name, policy_id)[source]

Activates the current active centralized policy

Parameters

policyId (str) – ID of the active centralized policy

Returns

The Action ID from the activation.

Return type

action_id (str)

reactivate_central_policy(self, policy_id)[source]

reActivates the current active centralized policy

Parameters

policyId (str) – ID of the active centralized policy

Returns

The Action ID from the activation.

Return type

action_id (str)

deactivate_central_policy(self, policy_id)[source]

Deactivates the current active centralized policy

Parameters

policyId (str) – ID of the deactive centralized policy

Returns

The Action ID from the activation.

Return type

result (str)

add_central_policy(self, policy)[source]

Delete a Central Policy from vManage.

Parameters

policy – The Central Policy

Returns

All data associated with a response.

Return type

result (dict)

update_central_policy(self, policy, policy_id)[source]

Update a Central from vManage.

Parameters
  • policy – The Central Policy

  • policy_id – The ID of the Central Policy to update

Returns

All data associated with a response.

Return type

result (dict)

delete_central_policy(self, policyId)[source]

Deletes the specified centralized policy

Parameters

policyId (str) – ID of the active centralized policy

Returns

All data associated with a response.

Return type

result (dict)

get_central_policy(self)[source]

Obtain a list of all configured central policies

Returns

All data associated with a response.

Return type

result (dict)

get_central_policy_list(self)[source]

Get all Central Policies from vManage.

Returns

A list of all policy lists currently

in vManage.

Return type

response (list)

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

Get all Central 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 Central Policies currently

in vManage.

Return type

response (dict)