api.policy_lists
¶
Cisco vManage Policy Lists API Methods.
Module Contents¶
-
class
api.policy_lists.
PolicyLists
(session, host, port=443)[source]¶ Bases:
object
vManage Policy Lists API
Responsible for DELETE, GET, POST, PUT methods against vManage Policy Lists used in Centralized, Localized, and Security Policy.
-
delete_data_prefix_list
(self, listid)[source]¶ Delete a Data Prefix List from vManage.
- Parameters
listid (str) – vManaged assigned list identifier
- Returns
Results from deletion attempt.
- Return type
response (dict)
-
get_data_prefix_list
(self)[source]¶ Get all Data Prefix Lists from vManage.
- Returns
- A list of all data prefix lists currently
in vManage.
- Return type
response (dict)
-
get_policy_list_all
(self)[source]¶ Get all Policy Lists from vManage.
- Returns
- A list of all policy lists currently
in vManage.
- Return type
response (dict)
-
post_data_prefix_list
(self, name, entries)[source]¶ Add a new Data Prefix List to vManage.
- Parameters
name (str) – name of the data prefix list
entries (list) – a list of prefixes to add to the list
- Returns
- Results from attempting to add a new
data prefix list.
- Return type
response (dict)
-
put_data_prefix_list
(self, name, listid, entries)[source]¶ Update an existing Data Prefix List on vManage.
- Parameters
name (str) – name of the data prefix list
listid (str) – vManaged assigned list identifier
entries (list) – a list of prefixes to add to the list
- Returns
- Results from attempting to update an
existing data prefix list.
- Return type
response (dict)
-
delete_policy_list
(self, listType, listId)[source]¶ Deletes the specified policy list type
- Parameters
listType (str) – Policy list type
listId (str) – ID of the policy list
- Returns
All data associated with a response.
- Return type
result (dict)
-
get_policy_list_list
(self, policy_list_type='all', cache=True)[source]¶ Get a list of policy lists
- Parameters
policy_list_type (str) – Policy list type (default: all)
cache (bool) – Use cached data
- Returns
All data associated with a response.
- Return type
result (dict)
-
get_policy_list_dict
(self, policy_list_type='all', key_name='name', remove_key=False, cache=True)[source]¶ Get a dictionary of policy lists
- Parameters
policy_list_type (str) – Policy list type
key_name (string) – The name of the attribute to use as the dictionary key
remove_key (boolean) – Remove the search key from the element
cache (boolean) – Use cached data
- Returns
All data associated with a response.
- Return type
result (dict)
-
get_policy_list_by_name
(self, policy_list_name, policy_list_type='all')[source]¶ Get a policy list by name
- Parameters
policy_list_name (str) – Policy list name
policy_list_type (str) – Policy list type (default: all)
- Returns
All data associated with a response.
- Return type
result (dict)
-
get_policy_list_by_id
(self, policy_list_id, policy_list_type='all')[source]¶ Get a policy list by ID
- Parameters
policy_list_name (str) – Policy list ID
policy_list_type (str) – Policy list type (default: all)
- Returns
All data associated with a response.
- Return type
result (dict)
-