Welcome to the Python Viptela SDK documentation!¶
python-viptela provides a Python SDK for interacting with Cisco SDWAN (formerly Viptela).
API Reference¶
This page contains auto-generated API reference documentation 1.
utils
¶
Module Contents¶
-
utils.
list_to_dict
(lst, key_name, remove_key=True)[source]¶ Convert a list of dictionaries into a dictionary of dictionaries.
- Parameters
key_name – The name of the key from the child dictionary to use to use in the parent.
remove_key – Remove the key used for the parent dictionary from the child.
- Returns
The resulting dictionary.
- Return type
result (dict)
data
¶
Submodules¶
data.parse_methods
¶
Parse Methods for Data Returned by Cisco vManage.
Module Contents¶
-
class
data.parse_methods.
ParseMethods
[source]¶ Reset all configuratios on a vManage instance.
Executes the necessary REST calls in specific order to remove configurations applied to a vManage instance.
-
static
parse_data
(response)[source]¶ Parse data and provide error handling for missing data.
- Parameters
response (obj) – Requests response object
- Returns
All data associated with a response.
- Return type
result (dict)
- Raises
Exception – Provides error message and details of issue.
-
static
parse_status
(response)[source]¶ Retrieve status code for transactions that do not receive a response.
- Parameters
response (obj) – Requests response object
- Returns
All data associated with a response.
- Return type
result (dict)
-
static
data.policy_data
¶
Cisco vManage Policy Methods.
Module Contents¶
-
class
data.policy_data.
PolicyData
(session, host, port=443)[source]¶ Bases:
object
Methods that deal with importing, exporting, and manipulating data from policies.
-
import_policy_list_list
(self, policy_list_list, push=False, update=False, check_mode=False, force=False)[source]¶ Import a list of policyies lists into vManage. Object Names are translated to IDs.
- Parameters
policy_list_list – A list of polcies
push (bool) – Whether to push a change out
update (bool) – Whether to update when the list exists
check_mode (bool) – Report what updates would happen, but don’t update
- Returns
All data associated with a response.
- Return type
result (dict)
-
convert_list_name_to_id
(self, name_list)[source]¶ Convert policy list from names to IDs in object.
- Parameters
name_list (list) – Object
-
convert_list_id_to_name
(self, id_list)[source]¶ Convert policy list from IDs to names in object.
- Parameters
id_list (list) – Object
-
convert_sequences_to_id
(self, sequence_list)[source]¶ Convert sequence entries from IDs to names in object.
- Parameters
sequence_list (list) – Sequence list
-
convert_definition_id_to_name
(self, policy_definition)[source]¶ Convert policy_definition from IDs to names in object.
- Parameters
policy_definition (list) – Sequence list
-
convert_definition_name_to_id
(self, policy_definition)[source]¶ Convert policy_definition from names to IDs in object.
- Parameters
policy_definition (list) – Sequence list
-
convert_policy_definition_to_name
(self, policy_definition)[source]¶ Convert policy_definition objects from IDs to names
- Parameters
policy_definition (list) – Sequence list
- Returns
The converted policy definition
- Return type
result (dict)
-
convert_policy_definition_to_id
(self, policy_definition)[source]¶ Convert policy_definition objects from names to IDs
- Parameters
policy_definition (list) – Sequence list
- Returns
The converted policy definition
- Return type
result (dict)
-
export_policy_definition_list
(self, definition_type='all')[source]¶ Export Policy Definition Lists from vManage, translating IDs to Names.
- Parameters
definition_type (string) – The type of Definition List to retreive
- Returns
- A list of all definition lists currently
in vManage.
- Return type
response (list)
-
import_policy_definition_list
(self, policy_definition_list, update=False, push=False, check_mode=False, force=False)[source]¶ Import Policy Definitions into vManage. Object names are converted to IDs.
- Returns
- A list of all policy lists currently
in vManage.
- Return type
response (dict)
-
convert_policy_to_name
(self, policy_item)[source]¶ Convert policy items from IDs to names
- Parameters
definition_type (string) – Policy item
- Returns
The converted policy item
- Return type
response (dict)
-
convert_policy_to_id
(self, policy_item)[source]¶ Convert policy items from names IDs
- Parameters
definition_type (string) – Policy item
- Returns
The converted policy item
- Return type
response (dict)
-
export_local_policy_list
(self)[source]¶ Export Local Policies from vManage. Object IDs are converted to names.
- Returns
- A list of all policy lists currently
in vManage.
- Return type
response (dict)
-
import_local_policy_list
(self, local_policy_list, update=False, push=False, check_mode=False, force=False)[source]¶ Import Local Policies into vManage. Object names are converted to IDs.
- Returns
- A list of all policy lists currently
in vManage.
- Return type
response (dict)
-
export_central_policy_list
(self)[source]¶ Export Central Policies from vManage, converting IDs to names.
- Returns
- A list of all policy lists currently
in vManage.
- Return type
response (dict)
-
import_central_policy_list
(self, central_policy_list, update=False, push=False, check_mode=False, force=False)[source]¶ Import Central Policies into vManage. Object names are converted to IDs.
- Returns
- A list of all policy lists currently
in vManage.
- Return type
response (dict)
-
data.template_data
¶
Cisco vManage Templates Methods.
Module Contents¶
-
class
data.template_data.
TemplateData
(session, host, port=443)[source]¶ Bases:
object
Methods that deal with importing, exporting, and converting data from templates.
-
convert_device_template_to_name
(self, device_template)[source]¶ Convert a device template objects from IDs to Names.
- Parameters
device_template (dict) – Device Template
- Returns
Converted Device Template.
- Return type
result (dict)
-
convert_device_template_to_id
(self, device_template)[source]¶ Convert a device template objects from Names to IDs.
- Parameters
device_template (dict) – Device Template
- Returns
Converted Device Template.
- Return type
result (dict)
-
generalTemplates_to_id
(self, generalTemplates)[source]¶ Convert a generalTemplates object from Names to IDs.
- Parameters
generalTemplates (dict) – generalTemplates object
- Returns
Converted generalTemplates object.
- Return type
result (dict)
-
import_feature_template_list
(self, feature_template_list, push=False, check_mode=False, update=False)[source]¶ Import a list of feature templates from list to vManage. Object Names are converted to IDs.
- Parameters
feature_template_list (list) – List of feature templates
check_mode (bool) – Only check to see if changes would be made
update (bool) – Update the template if it exists
- Returns
Returns the diffs of the updates.
- Return type
result (list)
-
export_device_template_list
(self, factory_default=False, name_list=None)[source]¶ Export device templates from vManage into a list. Object IDs are converted to Names.
- Parameters
factory_default (bool) – Include factory default
name_list (list of strings) – A list of template names to retreive.
- Returns
All data associated with a response.
- Return type
result (dict)
-
import_device_template_list
(self, device_template_list, check_mode=False, update=False, push=False)[source]¶ Import a list of device templates from list to vManage. Object Names are converted to IDs.
- Parameters
device_template_list (list) – List of device templates
check_mode (bool) – Only check to see if changes would be made
update (bool) – Update the template if it exists
- Returns
Returns the diffs of the updates.
- Return type
result (list)
-
import_attachment_list
(self, attachment_list, check_mode=False, update=False)[source]¶ Import a list of device attachments to vManage.
- Parameters
attachment_list (list) – List of attachments
check_mode (bool) – Only check to see if changes would be made
update (bool) – Update the template if it exists
- Returns
Returns the diffs of the updates.
- Return type
result (list)
-
Package Contents¶
apps
¶
Submodules¶
apps.clean
¶
Clean vManage Resources.
Module Contents¶
apps.files
¶
Cisco vManage Files API Methods.
Module Contents¶
-
class
apps.files.
Files
(session, host, port=443)[source]¶ Bases:
object
Read and write data to file.
-
export_templates_to_file
(self, export_file, name_list=None, template_type=None)[source]¶ Export templates to a file. All object IDs will be translated to names. Use a ‘.yml’ extention to export as YAML and a ‘.json’ extension to export as JSON.
- Parameters
export_file (str) – The name of the export file
name_list (list) – List of device templates to export
template_type (str) – Template type: device or template
-
import_templates_from_file
(self, import_file, update=False, check_mode=False, name_list=None, template_type=None)[source]¶ Import templates from a file. All object Names will be translated to IDs.
- Parameters
import_file (str) – The name of the import file
name_list (list) – List of device templates to export
template_type (str) – Template type: device or template
check_mode (bool) – Try the import, but don’t make changes (default: False)
update (bool) – Update existing templates (default: False)
-
export_policy_to_file
(self, export_file)[source]¶ Export policy to a file. All object IDs will be translated to names. Use a ‘.yml’ extention to export as YAML and a ‘.json’ extension to export as JSON.
- Parameters
export_file (str) – The name of the export file
-
import_policy_from_file
(self, file, update=False, check_mode=False, push=False)[source]¶ Import policy from a file. All object Names will be translated to IDs.
- Parameters
import_file (str) – The name of the import file
check_mode (bool) – Try the import, but don’t make changes (default: False)
update (bool) – Update existing templates (default: False)
push (bool) – Push tempaltes to devices if changed (default: False)
-
export_attachments_to_file
(self, export_file, name_list=None, device_type=None)[source]¶ Export attachments to a file. All object IDs will be translated to names. Use a ‘.yml’ extention to export as YAML and a ‘.json’ extension to export as JSON.
- Parameters
export_file (str) – The name of the export file
-
import_attachments_from_file
(self, import_file, update=False, check_mode=False, name_list=None)[source]¶ Import attachments from a file. All object Names will be translated to IDs.
- Parameters
import_file (str) – The name of the import file
check_mode (bool) – Try the import, but don’t make changes (default: False)
update (bool) – Update existing templates (default: False)
-
Package Contents¶
api
¶
Submodules¶
api.authentication
¶
Cisco vManage Authentication API Methods.
Module Contents¶
-
class
api.authentication.
Authentication
(host=None, user=None, password=None, port=443, validate_certs=False, timeout=10)[source]¶ Bases:
object
vManage Authentication API
Responsible for retrieving the JSESSIONID after a username/password has been authenticated. If the vManage version is >= 19.2.0 then the X-XSRF-TOKEN will be retrieved and added to the header. An HTTP(S) Request session object will be returned.
-
login
(self)[source]¶ Executes login tasks against vManage to retrieve token(s).
- Parameters
None. –
- Returns
a Requests session with JSESSIONID and an X-XSRF-TOKEN for vManage version >= 19.2.0.
- Return type
self.session
- Raises
LoginFailure – If the username/password are incorrect.
RequestException – If the host is not accessible.
-
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)
-
api.certificate
¶
Cisco vManage Certificate API Methods.
Module Contents¶
-
class
api.certificate.
Certificate
(session, host, port=443)[source]¶ Bases:
object
vManage Certificate API
Responsible for DELETE, GET, POST, PUT methods against vManage Certificates.
-
generate_csr
(self, device_ip)[source]¶ Generate CSR for device
- Parameters
device_ip (str) – IP address of device.
- Returns
The CSR for the device.
- Return type
deviceCSR (str)
-
install_device_cert
(self, cert)[source]¶ Install signed cert on vManage
- Parameters
cert (str) – The certificate to install.
- Returns
The action ID of the install command.
- Return type
id (str)
-
api.cluster
¶
Cisco vManage Cluster API Methods.
Module Contents¶
-
class
api.cluster.
Cluster
(session, host, port=443)[source]¶ Bases:
object
vManage Cluster API
Responsible for DELETE, GET, POST, PUT methods against vManage Cluster.
-
get_cluster_connected_devices_list
(self, vmanage_cluster_ip)[source]¶ Obtain vManage cluster connected devices
- Parameters
vmanage_cluster_ip (str) – vManage cluster interface IP address
- Returns
All data associated with a response.
- Return type
result (list)
-
get_cluster_health_details_list
(self)[source]¶ Obtain vManage cluster health details
- Parameters
None (None) –
- Returns
All data associated with a response.
- Return type
result (list)
-
get_cluster_health_status_list
(self)[source]¶ Obtain vManage cluster health status
- Parameters
None (None) –
- Returns
All data associated with a response.
- Return type
result (list)
-
get_cluster_list
(self)[source]¶ Obtain vManage cluster list
- Parameters
None (None) –
- Returns
All data associated with a response.
- Return type
result (list)
-
get_cluster_ip_addresses_dict
(self)[source]¶ Obtain vManage cluster IP addresses
- Parameters
None (None) –
- Returns
All data associated with a response.
- Return type
result (dict)
-
get_cluster_ready_state
(self)[source]¶ Obtain vManage cluster ready state
- Parameters
None (None) –
- Returns
All data associated with a response.
- Return type
result (bool)
-
get_cluster_node_properties
(self)[source]¶ Obtain connected vManage cluster node properties
- Parameters
None (None) –
- Returns
All data associated with a response.
- Return type
result (dict)
-
api.device
¶
Cisco vManage Device Inventory API Methods.
Module Contents¶
-
class
api.device.
Device
(session, host, port=443)[source]¶ Bases:
object
vManage Device Inventory API
Responsible for DELETE, GET, POST, PUT methods against vManage Device Inventory.
-
get_device_list
(self, category)[source]¶ Obtain a list of specified device type
- Parameters
category (str) – vedges or controllers
- Returns
All data associated with a response.
- Return type
result (dict)
-
post_device_cli_mode
(self, deviceId, deviceType)[source]¶ Update a device to CLI mode
- Parameters
deviceId (str) – uuid for device object
deviceType (str) – vedge or controller
-
get_device_status_list
(self)[source]¶ Obtain a list of specified device type
Args: None
- Returns
Device status
- Return type
result (list)
-
get_device_status_dict
(self, key_name='host-name', remove_key=False)[source]¶ Obtain a dict of specified device type
- Parameters
category (str) – vedges or controllers
- Returns
Device status
- Return type
result (dict)
-
get_device_status
(self, value, key='system-ip')[source]¶ Get the status of a specific device
- Parameters
string (value) – The value of the key to match
key (string) – The key on which to match (e.g. system-ip)
- Returns
Device status
- Return type
result (dict)
-
get_device_config
(self, device_type, value, key='system-ip')[source]¶ Get the config of a specific device
- Parameters
string (value) – The value of the key to match
key (string) – The key on which to match (e.g. system-ip)
- Returns
Device config
- Return type
result (dict)
-
get_device_config_list
(self, device_type)[source]¶ - Get the config status of a list of devices. When ‘all’ is specified, it concatenats
the vedges and controller together to provide a single method to retrieve status in the same way as get_device_status_list.
- Parameters
device_type (str) – ‘vedges’, ‘controllers’, or ‘all’
- Returns
All data associated with a response.
- Return type
result (list)
-
get_device_config_dict
(self, device_type, key_name='host-name', remove_key=False)[source]¶ Get the config status of a list of devices as a dictionary
- Parameters
device_type (str) – vedge or controller
key_name (string) – The name of the attribute to use as the dictionary key
remove_key (boolean) – remove the search key from the element
- Returns
All data associated with a response.
- Return type
result (dict)
-
get_device_data
(self, path, device_ip)[source]¶ Get the data from a device
- Parameters
path (str) – The path of the data
device_ip (str) – The IP address of the device
- Returns
All data associated with a response.
- Return type
result (dict)
-
put_device_decommission
(self, device_id)[source]¶ Decommission a device
- Parameters
device_id (str) – uuid for device object
- Returns
Device status
- Return type
result (list)
-
post_device
(self, device_ip, personality, username, password)[source]¶ Add control plane device
- Parameters
device_ip (str) – device interface IP
personality (str) – controller type (vmanage, vsmart, vbond)
username (str) – device username
password (str) – device password
- Returns
Device status
- Return type
result (list)
-
post_reset_interface
(self, device_ip, vpn_id, ifname)[source]¶ Reset an Interface :param device_ip: device IP for device object :type device_ip: str :param vpn_id: VPN Id for Interface :type vpn_id: int :param ifname: Interface name to reset :type ifname: str
- Returns
HTTP response status
- Return type
result (int)
-
api.device_templates
¶
Cisco vManage Device Templates API Methods.
Module Contents¶
-
class
api.device_templates.
DeviceTemplates
(session, host, port=443)[source]¶ Bases:
object
vManage Device Templates API
Responsible for DELETE, GET, POST, PUT methods against vManage Device Templates.
-
delete_device_template
(self, templateId)[source]¶ Obtain a list of all configured device templates.
- Parameters
templateId (str) – Object ID for device template
- Returns
All data associated with a response.
- Return type
result (dict)
-
get_device_templates
(self)[source]¶ Obtain a list of all configured device templates.
- Returns
All data associated with a response.
- Return type
result (dict)
-
get_device_template_object
(self, template_id)[source]¶ Obtain a device template object.
- Parameters
template_id (str) – Object ID for device template
- Returns
All data associated with a response.
- Return type
result (dict)
-
get_device_template_list
(self, factory_default=False, name_list=None)[source]¶ Get the list of device templates.
- Parameters
factory_default (bool) – Include factory default
name_list (list of strings) – A list of template names to retreive.
- Returns
All data associated with a response.
- Return type
result (dict)
-
get_device_template_dict
(self, factory_default=False, key_name='templateName', remove_key=True, name_list=None)[source]¶ Obtain a dictionary of all configured device templates.
- Parameters
factory_default (bool) – Wheter to return factory default templates
key_name (string) – The name of the attribute to use as the dictionary key
remove_key (boolean) – remove the search key from the element
name_list (list of strings) – A list of template names to retreive.
- Returns
All data associated with a response.
- Return type
result (dict)
-
get_template_attachments
(self, template_id, key='host-name')[source]¶ Get the devices that a template is attached to.
- Parameters
template_id (string) – Template ID
key (string) – The key of the device to put in the list (default: host-name)
- Returns
List of keys.
- Return type
result (list)
-
get_template_input
(self, template_id, device_id_list=None)[source]¶ Get the input associated with a device attachment.
- Parameters
template_id (string) – Template ID
device_id_list (list) – list of device UUID’s to get input for
- Returns
All data associated with a response.
- Return type
result (dict)
-
add_device_template
(self, device_template)[source]¶ Add a single device template to Vmanage.
- Parameters
device_template (dict) – Device Template
- Returns
Response from Vmanage
- Return type
result (list)
-
update_device_template
(self, device_template)[source]¶ Update a single device template to Vmanage.
- Parameters
device_template (dict) – Device Template
- Returns
Response from Vmanage
- Return type
result (list)
-
reattach_device_template
(self, template_id, config_type, is_edited=True, is_master_edited=True)[source]¶ Re-Attach a template to the devices it it attached to.
- Parameters
template_id (str) – The template ID to attach to
config_type (str) – Type of template i.e. device or CLI template
is_edited (bool) – True if the template has been edited
is_master_edited (bool) – For CLI device template needs to match is_edited. For device templates using feature templates needs to be set to False.
- Returns
Returns the action id of the attachment
- Return type
action_id (str)
-
attach_to_template
(self, template_id, config_type, uuid)[source]¶ Attach and device to a template
- Parameters
template_id (str) – The template ID to attach to
config_type (str) – Type of template i.e. device or CLI template
uuid (dict) – The UUIDs of the device to attach and mapping for corresponding variables, system-ip, host-name
- Returns
Returns the action id of the attachment
- Return type
action_id (str)
-
detach_from_template
(self, uuid, device_ip, device_type)[source]¶ Detach a device from a template (i.e. Put in CLI mode)
- Parameters
uuid (str) – The UUID of the device to detach
device_ip (str) – The System IP of the system to detach
device_type (str) – The device type of the device to detach
- Returns
Returns the action id of the attachment
- Return type
action_id (str)
-
get_attachments
(self, template_id, key='host-name')[source]¶ Get a list of attachments to a particular template.
- Parameters
template_id (str) – Template ID of the template
key (str) – The key of the elements to return
- Returns
Returns the specified key of the attached devices.
- Return type
result (list)
-
get_device_running_config
(self, uuid)[source]¶ Get the running configuration of a specific device.
- Parameters
uuid (str) – UUID of device
- Returns
The running configuration of the specified device.
- Return type
result (str)
-
reattach_multi_device_templates
(self, template_ids)[source]¶ Re-Attach a template to the devices it it attached to.
- Parameters
template_id (str) – The template ID to attach to
config_type (str) – Type of template i.e. device or CLI template
is_edited (bool) – True if the template has been edited
is_master_edited (bool) – For CLI device template needs to match is_edited. For device templates using feature templates needs to be set to False.
- Returns
Returns the action id of the attachment
- Return type
action_id (str)
-
api.feature_templates
¶
Cisco vManage Feature Templates API Methods.
Module Contents¶
-
class
api.feature_templates.
FeatureTemplates
(session, host, port=443)[source]¶ Bases:
object
vManage Feature Templates API
Responsible for DELETE, GET, POST, PUT methods against vManage Feature Templates.
-
delete_feature_template
(self, templateId)[source]¶ Obtain a list of all configured feature templates.
- Parameters
templateId (str) – Object ID for feature template
- Returns
All data associated with a response.
- Return type
result (dict)
-
get_feature_templates
(self)[source]¶ Obtain a list of all configured feature templates.
- Returns
All data associated with a response.
- Return type
result (dict)
-
add_feature_template
(self, feature_template)[source]¶ Add a feature template to Vmanage.
- Parameters
feature_template (dict) – Feature Template
- Returns
Response from Vmanage
- Return type
result (list)
-
update_feature_template
(self, feature_template)[source]¶ Update a feature template on Vmanage.
- Parameters
feature_template (dict) – Feature Template
- Returns
Response from Vmanage
- Return type
result (list)
-
get_feature_template_list
(self, factory_default=False, name_list=None)[source]¶ Obtain a list of all configured feature templates.
- Parameters
factory_default (bool) – Whether to return factory default templates
name_list (list of strings) – A list of the template names to return
- Returns
All data associated with a response.
- Return type
result (dict)
-
get_feature_template_dict
(self, factory_default=False, key_name='templateName', remove_key=True, name_list=None)[source]¶ Obtain a dictionary of all configured feature templates.
- Parameters
factory_default (bool) – Whether to return factory default templates
key_name (string) – The name of the attribute to use as the dictionary key
remove_key (boolean) – Remove the search key from the element
name_list (list of strings) – A list of the template names to return
- Returns
All data associated with a response.
- Return type
result (dict)
-
api.http_methods
¶
Module Contents¶
-
class
api.http_methods.
HttpMethods
(session, url)[source]¶ Bases:
object
HTTP Methods for vManage API Interaction
Provides a consistent interaction with the vManage REST API. Contains error handling for common HTTP interaction issues.
-
request
(self, method, headers=None, payload=None, files=None, timeout=STANDARD_TIMEOUT)[source]¶ Performs HTTP REST API Call.
- Parameters
method (str) – DELETE, GET, POST, PUT
headers (dict) – Use standard vManage header provided in module or custom header for specific API interaction
payload (str) – A formatted string to be delivered to vManage via POST or PUT REST call
file (obj) – A file to be sent to vManage
- Returns
- A parsable dictionary containing the full
response from vManage for an interaction
- Return type
result (dict)
- Raises
JSONDecodeError – Payload format error.
ConnectionError – Connection error.
HTTPError – An HTTP error occurred.
URLRequired – A valid URL is required to make a request.
TooManyRedirects – Too many redirects.
Timeout – The request timed out.
RequestException – There was an ambiguous exception.
-
api.local_policy
¶
Cisco vManage Localized Policy API Methods.
Module Contents¶
-
class
api.local_policy.
LocalPolicy
(session, host, port=443)[source]¶ Bases:
object
vManage Local Policy API
Responsible for DELETE, GET, POST, PUT methods against vManage Local Policy.
-
add_local_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_local_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_local_policy
(self, policy_id)[source]¶ Deletes the specified local policy
- Parameters
policyId (str) – ID of the active local policy
- Returns
All data associated with a response.
- Return type
result (dict)
-
get_local_policy
(self)[source]¶ Obtain a list of all configured local policies
- Returns
All data associated with a response.
- Return type
result (dict)
-
get_local_policy_list
(self)[source]¶ Get all Central Policies from vManage.
- Returns
- A list of all policy lists currently
in vManage.
- Return type
response (dict)
-
get_local_policy_dict
(self, key_name='policyName', remove_key=False)[source]¶ Get all Local 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 Local Polices currently
in vManage.
- Return type
response (dict)
-
api.monitor_network
¶
Cisco vManage Monitor Networks API Methods.
Module Contents¶
-
class
api.monitor_network.
MonitorNetwork
(session, host, port=443)[source]¶ Bases:
object
vManage Monitor Networks API
Responsible for GET methods against vManage Real Time Monitoring for network devices.
-
get_aaa_users
(self, system_ip)[source]¶ Provides AAA users for device.
- Parameters
system_ip (str) – Device System IP
- Returns
Device ARP table data.
- Return type
result (dict)
-
get_arp_table
(self, system_ip)[source]¶ Provides ARP entries for device.
- Parameters
system_ip (str) – Device System IP
- Returns
Device ARP table data.
- Return type
result (dict)
-
get_bfd_history
(self, system_ip, **kwargs)[source]¶ Provides BFD history for device.
- Parameters
system_ip (str) – Device System IP
remote_system_ip (str) – (Optional) Remote System IP
remote_color (str) – (Optional) Remote Color
- Returns
Device BFD history data.
- Return type
result (dict)
-
get_bfd_links
(self, system_ip, **kwargs)[source]¶ Provides BFD links for device.
- Parameters
system_ip (str) – Device System IP
state (str) – (Optional) State
- Returns
Device BFD links data.
- Return type
result (dict)
-
get_bfd_sessions
(self, system_ip, **kwargs)[source]¶ Provides BFD sessions for device.
- Parameters
system_ip (str) – Device System IP
remote_system_ip (str) – (Optional) Remote System IP
remote_color (str) – (Optional) Remote Color
local_color (str) – (Optional) Local Color
- Returns
Device BFD sessions data.
- Return type
result (dict)
-
get_bfd_device_state
(self, system_ip)[source]¶ Provides BFD state for device.
- Parameters
system_ip (str) – Device System IP
- Returns
Device BFD state data.
- Return type
result (dict)
-
get_bfd_device_state_tloc
(self, system_ip)[source]¶ Provides BFD state summary with TLOC for device.
- Parameters
system_ip (str) – Device System IP
- Returns
Device BFD state summary with TLOC data.
- Return type
result (dict)
-
get_bfd_summary
(self, system_ip)[source]¶ Provides BFD summary data for device.
- Parameters
system_ip (str) – Device System IP
- Returns
Device BFD summary data.
- Return type
result (dict)
-
get_bfd_tloc
(self, system_ip)[source]¶ Provides BFD TLOC for device.
- Parameters
system_ip (str) – Device System IP
- Returns
Device BFD TLOC data.
- Return type
result (dict)
-
get_bgp_neighbors
(self, system_ip, **kwargs)[source]¶ Provides BGP neighbors for device.
- Parameters
system_ip (str) – Device System IP
vpn-id (str) – VPN ID
peer-addr (str) – Peer address
as (str) – ASN
- Returns
All data associated with a response.
- Return type
result (dict)
-
get_bgp_routes
(self, system_ip, **kwargs)[source]¶ Provides BGP routes for device.
- Parameters
system_ip (str) – Device System IP
vpn-id (str) – VPN ID
prefix (str) – IP prefix
nexthop (str) – Nexthop
- Returns
All data associated with a response.
- Return type
result (dict)
-
get_bgp_summary
(self, system_ip)[source]¶ Provides BGP summary for device.
- Parameters
system_ip (str) – Device System IP
- Returns
All data associated with a response.
- Return type
result (dict)
-
get_cellular_connections
(self, system_ip)[source]¶ Provides celluar connection information for device.
- Parameters
system_ip (str) – Device System IP
- Returns
All data associated with a response.
- Return type
result (dict)
-
get_cellular_hardware
(self, system_ip)[source]¶ Provides celluar hardware information for device.
- Parameters
system_ip (str) – Device System IP
- Returns
All data associated with a response.
- Return type
result (dict)
-
get_cellular_modems
(self, policy_id)[source]¶ Provides celluar modem information for device.
- Parameters
policy_id (str) – Device System IP
- Returns
All data associated with a response.
- Return type
result (dict)
-
get_cellular_networks
(self, system_ip)[source]¶ Provides celluar network information for device.
- Parameters
system_ip (str) – Device System IP
- Returns
All data associated with a response.
- Return type
result (dict)
-
get_cellular_profiles
(self, system_ip)[source]¶ Provides celluar profile information for device.
- Parameters
system_ip (str) – Device System IP
- Returns
All data associated with a response.
- Return type
result (dict)
-
get_cellular_radios
(self, system_ip)[source]¶ Provides celluar radio information for device.
- Parameters
system_ip (str) – Device System IP
- Returns
All data associated with a response.
- Return type
result (dict)
-
get_cellular_sessions
(self, system_ip, **kwargs)[source]¶ Provides celluar session information for device.
- Parameters
system_ip (str) – Device System IP
interface_name (str) – Interface name values: ge0/0 - ge0/7, system, , eth0
primary_dns_ipv4 (str) – Primary DNS IP
- Returns
All data associated with a response.
- Return type
result (dict)
-
get_cellular_status
(self, system_ip)[source]¶ Provides celluar status information for device.
- Parameters
system_ip (str) – Device System IP
- Returns
All data associated with a response.
- Return type
result (dict)
-
get_control_affinity_config
(self, system_ip)[source]¶ Provides current control affinity config for device.
- Parameters
system_ip (str) – Device System IP
- Returns
All data associated with a response.
- Return type
result (dict)
-
get_control_affinity_status
(self, system_ip)[source]¶ Provides current control affinity status for device.
- Parameters
system_ip (str) – Device System IP
- Returns
All data associated with a response.
- Return type
result (dict)
-
get_control_connections
(self, system_ip, **kwargs)[source]¶ Provides current control connections for device.
- Parameters
system_ip (str) – Device System IP
peer_type (str) – Peer type (vedge, vsmart, vmanage, vbond)
peer_system_ip (str) – Peer System IP
- Returns
All data associated with a response.
- Return type
result (dict)
-
get_control_connections_history
(self, system_ip, **kwargs)[source]¶ Provides control connections history for device.
- Parameters
system_ip (str) – Device System IP
peer_type (str) – Peer type (vedge, vsmart, vmanage, vbond)
peer_system_ip (str) – Peer System IP
local_color (str) – Local Color
- Returns
All data associated with a response.
- Return type
result (dict)
-
get_control_count
(self)[source]¶ Provides current control count for device.
- Parameters
None (None) –
- Returns
All data associated with a response.
- Return type
result (dict)
-
get_control_links
(self, system_ip, **kwargs)[source]¶ Provides control links for device.
- Parameters
system_ip (str) – Device System IP
state (str) – State
- Returns
All data associated with a response.
- Return type
result (dict)
-
get_control_local_properties
(self, system_ip)[source]¶ Provides control local properties history for device.
- Parameters
system_ip (str) – Device System IP
- Returns
All data associated with a response.
- Return type
result (dict)
-
get_control_summary
(self, system_ip)[source]¶ Provides current control summary for device.
- Parameters
system_ip (str) – Device System IP
- Returns
All data associated with a response.
- Return type
result (dict)
-
get_control_valid_devices
(self, system_ip)[source]¶ Provides control valid devices for device.
- Parameters
system_ip (str) – Device System IP
- Returns
All data associated with a response.
- Return type
result (dict)
-
get_control_valid_vsmarts
(self, system_ip)[source]¶ Provides control valid vsmarts for device.
- Parameters
system_ip (str) – Device System IP
- Returns
All data associated with a response.
- Return type
result (dict)
-
get_control_wan_interface
(self, system_ip)[source]¶ Provides current control wan interface for device.
- Parameters
system_ip (str) – Device System IP
- Returns
All data associated with a response.
- Return type
result (dict)
-
get_control_wan_interface_color
(self, system_ip)[source]¶ Provides current control wan interface for device.
- Parameters
system_ip (str) – Device System IP
- Returns
All data associated with a response.
- Return type
result (dict)
-
get_device_status
(self, system_ip)[source]¶ Provides status for device.
- Parameters
system_ip (str) – Device System IP
- Returns
All data associated with a response.
- Return type
result (dict)
-
get_device_system_info
(self, system_ip)[source]¶ Provides system info for device.
- Parameters
system_ip (str) – Device System IP
- Returns
All data associated with a response.
- Return type
result (dict)
-
get_dhcp_clients
(self, system_ip)[source]¶ Provides dhcp clients for device.
- Parameters
system_ip (str) – Device System IP
- Returns
All data associated with a response.
- Return type
result (dict)
-
get_dhcp_interfaces
(self, system_ip)[source]¶ Provides dhcp interfaces for device.
- Parameters
system_ip (str) – Device System IP
- Returns
All data associated with a response.
- Return type
result (dict)
-
get_dhcp_servers
(self, system_ip)[source]¶ Provides dhcp servers for device.
- Parameters
system_ip (str) – Device System IP
- Returns
All data associated with a response.
- Return type
result (dict)
-
get_dot1x_clients
(self, system_ip)[source]¶ Provides DOT1X clients for device.
- Parameters
system_ip (str) – Device System IP
- Returns
All data associated with a response.
- Return type
result (dict)
-
get_dot1x_interfaces
(self, system_ip)[source]¶ Provides DOT1X interfaces for device.
- Parameters
system_ip (str) – Device System IP
- Returns
All data associated with a response.
- Return type
result (dict)
-
get_dot1x_radius
(self, system_ip)[source]¶ Provides DOT1X RADIUS information for device.
- Parameters
system_ip (str) – Device System IP
- Returns
All data associated with a response.
- Return type
result (dict)
-
get_dpi_applications
(self, system_ip, **kwargs)[source]¶ Provides DPI application information for device.
- Parameters
system_ip (str) – Device System IP
vpn_id (str) – VPN/VRF ID
application (str) – Application
family (str) – Family
- Returns
All data associated with a response.
- Return type
result (dict)
-
get_dpi_common_applications
(self)[source]¶ Provides common DPI application information.
- Parameters
None (None) – None
- Returns
All data associated with a response.
- Return type
result (dict)
-
get_dpi_device_fields
(self)[source]¶ Provides DPI fields for device.
- Parameters
None (None) – None
- Returns
All data associated with a response.
- Return type
result (dict)
-
get_dpi_device_fields_details
(self)[source]¶ Provides DPI detailed fields for device.
- Parameters
None (None) – None
- Returns
All data associated with a response.
- Return type
result (dict)
-
get_dpi_flows
(self, system_ip, **kwargs)[source]¶ Provides DPI application information for device.
- Parameters
system_ip (str) – Device System IP
vpn_id (str) – VPN/VRF ID
source_ip (str) – Source IP
application (str) – Application
family (str) – Family
- Returns
All data associated with a response.
- Return type
result (dict)
-
get_dpi_summary
(self, system_ip)[source]¶ Provides DPI summary information for device.
- Parameters
system_ip (str) – Device System IP
- Returns
All data associated with a response.
- Return type
result (dict)
-
get_dpi_supported_applications
(self, system_ip, **kwargs)[source]¶ Provides DPI supported application information for device.
- Parameters
system_ip (str) – Device System IP
application (str) – Application
family (str) – Family
- Returns
All data associated with a response.
- Return type
result (dict)
-
get_eigrp_interfaces
(self, system_ip)[source]¶ Provides EIGRP interface for device.
- Parameters
system_ip (str) – Device System IP
- Returns
All data associated with a response.
- Return type
result (dict)
-
get_eigrp_routes
(self, system_ip)[source]¶ Provides EIGRP route for device.
- Parameters
system_ip (str) – Device System IP
- Returns
All data associated with a response.
- Return type
result (dict)
-
get_eigrp_topology
(self, system_ip)[source]¶ Provides EIGRP topology for device.
- Parameters
system_ip (str) – Device System IP
- Returns
All data associated with a response.
- Return type
result (dict)
-
get_hardware_alarms
(self, system_ip)[source]¶ Provides hardware alarms for device.
- Parameters
system_ip (str) – Device System IP
- Returns
All data associated with a response.
- Return type
result (dict)
-
get_hardware_environment
(self, system_ip)[source]¶ Provides hardware environment information for device.
- Parameters
system_ip (str) – Device System IP
- Returns
All data associated with a response.
- Return type
result (dict)
-
get_hardware_inventory
(self, system_ip)[source]¶ Provides hardware inventory information for device.
- Parameters
system_ip (str) – Device System IP
- Returns
All data associated with a response.
- Return type
result (dict)
-
get_hardware_status_summary
(self, system_ip)[source]¶ Provides hardware status summary information for device.
- Parameters
system_ip (str) – Device System IP
- Returns
All data associated with a response.
- Return type
result (dict)
-
get_hardware_system
(self, system_ip)[source]¶ Provides hardware system information for device.
- Parameters
system_ip (str) – Device System IP
- Returns
All data associated with a response.
- Return type
result (dict)
-
get_igmp_groups
(self, system_ip)[source]¶ Provides IGMP groups information for device.
- Parameters
system_ip (str) – Device System IP
- Returns
All data associated with a response.
- Return type
result (dict)
-
get_igmp_interfaces
(self, system_ip)[source]¶ Provides IGMP interfaces information for device.
- Parameters
system_ip (str) – Device System IP
- Returns
All data associated with a response.
- Return type
result (dict)
-
get_igmp_statistics
(self, system_ip)[source]¶ Provides IGMP statistics information for device.
- Parameters
system_ip (str) – Device System IP
- Returns
All data associated with a response.
- Return type
result (dict)
-
get_igmp_summary
(self, system_ip)[source]¶ Provides IGMP summary information for device.
- Parameters
system_ip (str) – Device System IP
- Returns
All data associated with a response.
- Return type
result (dict)
-
get_interface_vpn
(self, system_ip)[source]¶ Provides interface vpn/vrf information for device.
- Parameters
system_ip (str) – Device System IP
- Returns
All data associated with a response.
- Return type
result (dict)
-
get_ip_fib
(self, system_ip, **kwargs)[source]¶ Provides IP FIB for device.
- Parameters
system_ip (str) – Device System IP
vpn_id (str) – VPN ID
address_family (str) – Address Family
destination_prefix (str) – Destination Prefix
tloc (str) – TLOC
color (str) – TLOC color
- Returns
All data associated with a response.
- Return type
result (dict)
-
get_ip_route_table
(self, system_ip, **kwargs)[source]¶ Provides IP route table for device.
- Parameters
system_ip (str) – Device System IP
vpn_id (str) – VPN ID
address_family (str) – Address Family
destination_prefix (str) – Destination Prefix
source_protocol (str) – Source Protocol
next_hop_address (str) – Next-Hop Address (cEdge Only)
next_hop_oif (str) – Next-Hop Outgoing Interface (cEdge Only)
- Returns
All data associated with a response.
- Return type
result (dict)
-
get_ip_nat_translations
(self, system_ip)[source]¶ Provides IP NAT translations for device.
- Parameters
system_ip (str) – Device System IP
- Returns
All data associated with a response.
- Return type
result (dict)
-
get_ip_nat64_translations
(self, system_ip)[source]¶ Provides IP NAT64 translations for device.
- Parameters
system_ip (str) – Device System IP
- Returns
All data associated with a response.
- Return type
result (dict)
-
get_ipsec_inbound_connections
(self, system_ip, **kwargs)[source]¶ Provides IPSec inbound connections for device.
- Parameters
system_ip (str) – Device System IP
remote_tloc_address (str) – Remote TLOC address
remote_tloc_color (str) – Remote TLOC color
local_tloc_color (str) – Local TLOC color
- Returns
All data associated with a response.
- Return type
result (dict)
-
get_ipsec_localsa
(self, system_ip)[source]¶ Provides IPSec localsa for device.
- Parameters
system_ip (str) – Device System IP
- Returns
All data associated with a response.
- Return type
result (dict)
-
get_ipsec_outbound_connections
(self, system_ip, **kwargs)[source]¶ Provides IPSec outbound connections for device.
- Parameters
system_ip (str) – Device System IP
remote_tloc_address (str) – Remote TLOC address
remote_tloc_color (str) – Remote TLOC color
- Returns
All data associated with a response.
- Return type
result (dict)
-
get_ipsec_pwk_inbound_connections
(self, system_ip, **kwargs)[source]¶ Provides IPSec pairwise key inbound connections for device.
- Parameters
system_ip (str) – Device System IP
remote_tloc_address (str) – Remote TLOC address
remote_tloc_color (str) – Remote TLOC color
local_tloc_color (str) – Local TLOC color
- Returns
All data associated with a response.
- Return type
result (dict)
-
get_ipsec_pwk_localsa
(self, system_ip, **kwargs)[source]¶ Provides IPSec pairwise key localsa for device.
- Parameters
system_ip (str) – Device System IP
remote_tloc_address (str) – Remote TLOC address
remote_tloc_color (str) – Remote TLOC color
local_tloc_color (str) – Local TLOC color
- Returns
All data associated with a response.
- Return type
result (dict)
-
get_ipsec_pwk_outbound_connections
(self, system_ip, **kwargs)[source]¶ Provides IPSec pairwise key outbound connections for device.
- Parameters
system_ip (str) – Device System IP
remote_tloc_address (str) – Remote TLOC address
remote_tloc_color (str) – Remote TLOC color
local_tloc_color (str) – Local TLOC color
- Returns
All data associated with a response.
- Return type
result (dict)
-
get_multicast_replicator
(self, system_ip)[source]¶ Provides multicast replicator for device.
- Parameters
system_ip (str) – Device System IP
- Returns
All data associated with a response.
- Return type
result (dict)
-
get_multicast_rpf
(self, system_ip)[source]¶ Provides multicast rpf for device.
- Parameters
system_ip (str) – Device System IP
- Returns
All data associated with a response.
- Return type
result (dict)
-
get_multicast_topology
(self, system_ip)[source]¶ Provides multicast topology for device.
- Parameters
system_ip (str) – Device System IP
- Returns
All data associated with a response.
- Return type
result (dict)
-
get_multicast_tunnel
(self, system_ip)[source]¶ Provides multicast tunnel for device.
- Parameters
system_ip (str) – Device System IP
- Returns
All data associated with a response.
- Return type
result (dict)
-
get_omp_peers
(self, system_ip)[source]¶ Provides OMP peers for device.
- Parameters
system_ip (str) – Device System IP
- Returns
All data associated with a response.
- Return type
result (dict)
-
get_omp_routes_received
(self, system_ip, **kwargs)[source]¶ Provides OMP received routes for device.
- Parameters
system_ip (str) – Device System IP
vpn_id (str) – VPN ID
prefix (str) – Prefix
- Returns
All data associated with a response.
- Return type
result (dict)
-
get_omp_routes_advertised
(self, system_ip, **kwargs)[source]¶ Provides OMP advertised routes for device.
- Parameters
system_ip (str) – Device System IP
vpn_id (str) – VPN ID
prefix (str) – Prefix
- Returns
All data associated with a response.
- Return type
result (dict)
-
get_omp_summary
(self, system_ip)[source]¶ Provides OMP summary for device.
- Parameters
system_ip (str) – Device System IP
- Returns
All data associated with a response.
- Return type
result (dict)
-
get_orchestrator_summary
(self, system_ip)[source]¶ Provides orchestrator (vbond) summary for device.
- Parameters
system_ip (str) – Device System IP
- Returns
All data associated with a response.
- Return type
result (dict)
-
get_orchestrator_connections
(self, system_ip)[source]¶ Provides orchestrator (vbond) connections for device.
- Parameters
system_ip (str) – Device System IP
- Returns
All data associated with a response.
- Return type
result (dict)
-
get_orchestrator_connections_history
(self, system_ip)[source]¶ Provides orchestrator (vbond) connections history for device.
- Parameters
system_ip (str) – Device System IP
- Returns
All data associated with a response.
- Return type
result (dict)
-
get_orchestrator_local_properties
(self, system_ip)[source]¶ Provides orchestrator (vbond) local properties history for device.
- Parameters
system_ip (str) – Device System IP
- Returns
All data associated with a response.
- Return type
result (dict)
-
get_ospf_interfaces
(self, system_ip)[source]¶ Provides OSPF interfaces for device.
- Parameters
system_ip (str) – Device System IP
- Returns
All data associated with a response.
- Return type
result (dict)
-
get_ospf_neighbors
(self, system_ip)[source]¶ Provides OSPF neighbors for device.
- Parameters
system_ip (str) – Device System IP
- Returns
All data associated with a response.
- Return type
result (dict)
-
get_ospf_routes
(self, system_ip)[source]¶ Provides OSPF routes for device.
- Parameters
system_ip (str) – Device System IP
- Returns
All data associated with a response.
- Return type
result (dict)
-
get_ospf_database
(self, system_ip)[source]¶ Provides OSPF database for device.
- Parameters
system_ip (str) – Device System IP
- Returns
All data associated with a response.
- Return type
result (dict)
-
get_ospf_database_summary
(self, system_ip)[source]¶ Provides OSPF database summary for device.
- Parameters
system_ip (str) – Device System IP
- Returns
All data associated with a response.
- Return type
result (dict)
-
get_ospf_process
(self, system_ip)[source]¶ Provides OSPF process for device.
- Parameters
system_ip (str) – Device System IP
- Returns
All data associated with a response.
- Return type
result (dict)
-
get_ospf_database_external
(self, system_ip)[source]¶ Provides OSPF database external for device.
- Parameters
system_ip (str) – Device System IP
- Returns
All data associated with a response.
- Return type
result (dict)
-
get_pim_interfaces
(self, system_ip)[source]¶ Provides PIM interfaces for device.
- Parameters
system_ip (str) – Device System IP
- Returns
All data associated with a response.
- Return type
result (dict)
-
get_pim_neighbors
(self, system_ip)[source]¶ Provides PIM neighbors for device.
- Parameters
system_ip (str) – Device System IP
- Returns
All data associated with a response.
- Return type
result (dict)
-
get_pim_rp_mapping
(self, system_ip)[source]¶ Provides PIM RP mapping for device.
- Parameters
system_ip (str) – Device System IP
- Returns
All data associated with a response.
- Return type
result (dict)
-
get_pim_statistics
(self, system_ip)[source]¶ Provides PIM statistics for device.
- Parameters
system_ip (str) – Device System IP
- Returns
All data associated with a response.
- Return type
result (dict)
-
get_security_information
(self, system_ip)[source]¶ Provides security information for device.
- Parameters
system_ip (str) – Device System IP
- Returns
All data associated with a response.
- Return type
result (dict)
-
get_software
(self, system_ip)[source]¶ Provides software for device.
- Parameters
system_ip (str) – Device System IP
- Returns
All data associated with a response.
- Return type
result (dict)
-
get_umbrella_sig_tunnels
(self, system_ip)[source]¶ Provides Cisco Umbrella SIG tunnels for device.
- Parameters
system_ip (str) – Device System IP
- Returns
All data associated with a response.
- Return type
result (dict)
-
get_users
(self, system_ip)[source]¶ Provides users for device.
- Parameters
system_ip (str) – Device System IP
- Returns
Device ARP table data.
- Return type
result (dict)
-
get_users_list
(self, system_ip)[source]¶ Provides users list for device.
- Parameters
system_ip (str) – Device System IP
- Returns
Device ARP table data.
- Return type
result (dict)
-
get_vrrp
(self, system_ip)[source]¶ Provides VRRP entries for device.
- Parameters
system_ip (str) – Device System IP
- Returns
All data associated with a response.
- Return type
result (dict)
-
get_wlan_clients
(self, system_ip)[source]¶ Provides WLAN clients for device.
- Parameters
system_ip (str) – Device System IP
- Returns
All data associated with a response.
- Return type
result (dict)
-
get_wlan_interfaces
(self, system_ip)[source]¶ Provides WLAN interfaces for device.
- Parameters
system_ip (str) – Device System IP
- Returns
All data associated with a response.
- Return type
result (dict)
-
get_wlan_radios
(self, system_ip)[source]¶ Provides WLAN radios for device.
- Parameters
system_ip (str) – Device System IP
- Returns
All data associated with a response.
- Return type
result (dict)
-
api.policy_definitions
¶
Cisco vManage Policy Definitions API Methods.
Module Contents¶
-
api.policy_definitions.
definition_types_19_2_0
= ['data', 'approute', 'control', 'cflowd', 'mesh', 'hubandspoke', 'vpnmembershipgroup', 'qosmap', 'rewriterule', 'acl', 'aclv6', 'vedgeroute', 'zonebasedfw', 'intrusionprevention', 'urlfiltering', 'advancedMalwareProtection', 'dnssecurity'][source]¶
-
api.policy_definitions.
definition_types_19_3_0
= ['data', 'approute', 'control', 'cflowd', 'mesh', 'hubandspoke', 'vpnmembershipgroup', 'qosmap', 'rewriterule', 'acl', 'aclv6', 'deviceaccesspolicy', 'deviceaccesspolicyv6', 'vedgeroute', 'zonebasedfw', 'intrusionprevention', 'urlfiltering', 'advancedMalwareProtection', 'dnssecurity', 'ssldecryption', 'fxoport', 'fxsport', 'fxsdidport', 'dialpeer', 'srstphoneprofile'][source]¶
-
class
api.policy_definitions.
PolicyDefinitions
(session, host, port=443)[source]¶ Bases:
object
vManage Policy Definitions API
Responsible for DELETE, GET, POST, PUT methods against vManage Policy Definitions used in Centralized, Localized, and Security Policy.
-
get_definition_types
(self)[source]¶ Return the definition types for this version of vManage
Args:
- Returns
List of definition types
- Return type
result (list)
-
delete_policy_definition
(self, definition_type, definition_id)[source]¶ Delete a Policy Definition from vManage.
- Parameters
definition_type (str) – The defintion type of the requested policy definition
definition_id (str) – The defintion ID of the requested policy definition
- Returns
All data associated with a response.
- Return type
result (dict)
-
add_policy_definition
(self, policy_definition)[source]¶ Delete a Policy Definition from vManage.
- Parameters
definition_type (str) – The defintion type of the requested policy definition
definition_id (str) – The defintion ID of the requested policy definition
- Returns
All data associated with a response.
- Return type
result (dict)
-
update_policy_definition
(self, policy_definition, policy_definition_id)[source]¶ Update a Policy Definition from vManage.
- Parameters
definition_type (str) – The defintion type of the requested policy definition
definition_id (str) – The defintion ID of the requested policy definition
- Returns
All data associated with a response.
- Return type
result (dict)
-
get_policy_definition
(self, definition_type, definition_id)[source]¶ Get a Policy Definition from vManage.
- Parameters
definition_type (str) – The defintion type of the requested policy definition
definition_id (str) – The defintion ID of the requested policy definition
- Returns
All data associated with a response.
- Return type
result (dict)
-
get_policy_definition_list
(self, definition_type='all')[source]¶ Get all Policy Definition Lists from vManage.
- Parameters
definition_type (string) – The type of Definition List to retreive
- Returns
- A list of all definition lists currently
in vManage.
- Return type
response (dict)
-
get_policy_definition_dict
(self, definition_type, key_name='name', remove_key=False)[source]¶ Get all Policy Definition Lists from vManage.
- Parameters
definition_type (str) – Policy definition 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
- Returns
All data associated with a response.
- Return type
result (dict)
-
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)
-
api.policy_updates
¶
Cisco vManage Policy Lists API Methods.
Module Contents¶
-
class
api.policy_updates.
PolicyUpdates
(session, host, port=443)[source]¶ Bases:
object
vManage Policy Updates API
Responsible for POST and PUT methods against vManage Policy APIs used in Centralized, Localized, and Security Policy.
-
get_device_ids
(self, template_id)[source]¶ GET vSmart device ids from vManage.
- Parameters
templateid (str) – vManaged assigned template identifier.
- Returns
device ids list.
- Return type
response (list)
-
get_device_inputs
(self, template_id, device_ids)[source]¶ GET vSmart device inputs from vManage.
- Parameters
templateid (str) – vManage assigned template identifier.
device_ids (list) – vManage assigned device ids for vSmarts.
- Returns
device inputs.
- Return type
response (dict)
-
get_policy_id
(self, policy_type, policy_name)[source]¶ GET vSmart device ids from vManage.
- Parameters
policy_type (str) – vManage policy type i.e. approute, data, hubandspoke etc.
policy_name (str) – policy name for user needs policy id.
- Returns
vManage assigned policy id.
- Return type
response (str)
-
get_policy_definition
(self, policy_type, policy_id)[source]¶ GET vSmart device ids from vManage.
- Parameters
policy_type (str) – vManage policy type i.e. approute, data, hubandspoke etc.
policy_id (str) – vManage assigned policy id.
- Returns
policy definition.
- Return type
response (dict)
-
update_policy_definition
(self, policy_type, name, policy_id, policy_def, new_color, seq_name=None)[source]¶ update policy definition
- Parameters
policy_type (str) – vManage policy type i.e. approute, data, hubandspoke etc.
policy_id (str) – vManage assigned policy id.
policy_def (dict) – dict of data for policy updates to be done
- Returns
policy definition.
- Return type
response (dict)
-
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)
-
api.settings
¶
Cisco vManage Settings API Methods.
Module Contents¶
-
class
api.settings.
Settings
(session, host, port=443)[source]¶ Bases:
object
vManage Settings API
Responsible for DELETE, GET, POST, PUT methods against vManage Settings.
-
get_vmanage_org
(self)[source]¶ Get vManage organization
Args:
- Returns
The vManage organization.
- Return type
org (str)
-
set_vmanage_org
(self, org)[source]¶ Set vManage organization
- Parameters
org (str) – The organization name to set.
- Returns
The result of the POST operation
- Return type
result (dict)
-
get_vmanage_vbond
(self)[source]¶ Get vBond
Args:
- Returns
The result of the GET operation.
- Return type
result (dict)
-
set_vmanage_vbond
(self, vbond, vbond_port='12346')[source]¶ Set vBond
- Parameters
vbond (str) – The vBond IP address.
vbond_port (str) – The vBond port.
- Returns
The result of the POST operation.
- Return type
result (dict)
-
get_vmanage_ca_type
(self)[source]¶ Get vManage CA type
Args:
- Returns
The CA type.
- Return type
certificateSigning (str)
-
set_vmanage_ca_type
(self, ca_type)[source]¶ Set vManage CA type
- Parameters
ca_type (str) – The CA type.
- Returns
The result of the POST operation.
- Return type
result (dict)
-
set_vmanage_root_cert
(self, cert, timeout=20)[source]¶ Set vManage root certiticate
- Parameters
cert (str) – The root certiticate.
timeout (int) – Timeout in seconds.
Returns:
Get vManage Banner
Args:
- Returns
The banner for vmanage.
- Return type
bannerDetail (str)
-
api.utilities
¶
Cisco vManage Utilities API Methods.
Module Contents¶
-
class
api.utilities.
Utilities
(session, host, port=443)[source]¶ Bases:
object
Access to Various vManage Utilitiesinstance.
vManage has several utilities that are needed for correct execution of applications against the API. For example, this includes waiting for an action to complete before moving onto the next task.
Package Contents¶
- 1
Created with sphinx-autoapi