cisco.aci

cisco.aci.cleanup_url(query_url_or_dn):

not documented yet

cisco.aci.connect_apic(subscription_enabled=False, *, _requires=<function _get_missing_apic_connection_vars at 0x7f9dcc848b80>):

not documented yet

cisco.aci.credentials_set():

Check if jinjamator has all information set necessary to connect to APIC.

Returns:

True if all required APIC connection parameters are set, False if not.

Return type:

boolean

cisco.aci.delete(query_url_or_dn, timeout=60, force=False, _requires=<function _get_missing_apic_connection_vars at 0x7f9dcc848b80>):

not documented yet

cisco.aci.dn_exists(dn, *, _requires=<function _get_missing_apic_connection_vars at 0x7f9dcc848b80>):

Checks if the dn exists. Logs API Error to error log.

Parameters:

dn (str) – APIC dn-string

Returns:

True if dn exists (or contains an error), false if not existing

Return type:

bool

cisco.aci.dn_has_attribute(dn, key, value, *, _requires=<function _get_missing_apic_connection_vars at 0x7f9dcc848b80>):

not documented yet

cisco.aci.get_access_aep_name_by_vlan_id(vlan_id, dn_filter='Access', *, _requires=<function _get_missing_apic_connection_vars at 0x7f9dcc848b80>):

not documented yet

cisco.aci.get_all_configured_spine_uplinks(*, _requires=<function _get_missing_apic_connection_vars at 0x7f9dcc848b80>):

not documented yet

cisco.aci.get_all_downlinks(model, role='leaf'):

Return all downlink ports from plugin internal switch database.

Parameters:

model (string) – Cisco Switch Model String

Returns:

A list of all default downlink port numbers.

Return type:

list

cisco.aci.get_all_fabric_ports(*, _requires=<function _get_missing_apic_connection_vars at 0x7f9dcc848b80>):

not documented yet

cisco.aci.get_all_lldp_neighbours(*, _requires=<function _get_missing_apic_connection_vars at 0x7f9dcc848b80>):

not documented yet

cisco.aci.get_all_nodes(index_by='id', *, _requires=<function _get_missing_apic_connection_vars at 0x7f9dcc848b80>):

not documented yet

cisco.aci.get_all_uplinks(model, role='leaf'):

not documented yet

cisco.aci.get_all_vlans_from_pool(pool_name, *, _requires=<function _get_missing_apic_connection_vars at 0x7f9dcc848b80>):

not documented yet

cisco.aci.get_convertible_uplinks(model, count, min_uplinks=2, role='leaf'):

not documented yet

cisco.aci.get_dict_from_epg_dn(dn):

not documented yet

cisco.aci.get_dict_from_external_epg_dn(dn):

not documented yet

cisco.aci.get_dict_from_node_dn(dn):

not documented yet

cisco.aci.get_dict_from_vrf_dn(dn):

not documented yet

cisco.aci.get_endpoint_table(*, _requires=<function _get_missing_apic_connection_vars at 0x7f9dcc848b80>):

not documented yet

cisco.aci.get_fex_types():

not documented yet

cisco.aci.get_interface_info(node_id, nxos_interface_name, pod_id=None, _requires=<function _get_missing_apic_connection_vars at 0x7f9dcc848b80>):

not documented yet

cisco.aci.get_leaf_types():

not documented yet

cisco.aci.get_next_free_vpc_domain_id(*, _requires=<function _get_missing_apic_connection_vars at 0x7f9dcc848b80>):

not documented yet

cisco.aci.get_parent_dn_from_child_dn(dn):

not documented yet

cisco.aci.get_podid_by_switch_id(switch_id, *, _requires=<function _get_missing_apic_connection_vars at 0x7f9dcc848b80>):

Retrive the pod_id for a switch_id from APIC, if not possible ask user to enter pod_id

Parameters:

switch_id (int) – integer from 100 to 3999

Returns:

pod_id

Return type:

int

Raises:

ValueError – If the node with the specified apic_node_id is invalid.

cisco.aci.get_role_by_model(model):

not documented yet

cisco.aci.get_spine_types():

not documented yet

cisco.aci.get_tenants():

not documented yet

cisco.aci.get_vlan_pools(*, _requires=<function _get_missing_apic_connection_vars at 0x7f9dcc848b80>):

not documented yet

cisco.aci.is_api_error(response):

Check the API-Response for errors

Parameters:

response (dict) – Dict of the request response ([imdata][0][….])

Returns:

True if response contains an error, false if not

Return type:

bool

cisco.aci.is_dn_in_use(dn, ignore_children=False, *, _requires=<function _get_missing_apic_connection_vars at 0x7f9dcc848b80>):

not documented yet

cisco.aci.is_min_version(major, minor, patch_level=None, node_id=1):

Checks if the APIC run a minimum version specified

Parameters:
  • major (int) – minimum APIC major version, eg.: 4 for ACI 4.x.x

  • minor (int) – minimum APIC major version, eg.: 2 for ACI x.2.x

  • patch_level (str or None) – minimum APIC patchlevel . eg.: 4i for ACI x.x.(4i) or None if it should be ignored

  • node_id (int, optional) – APIC node id to query, defaults to 1

Returns:

True if the APIC run specified version or greater, False if not.

Return type:

bool

Examples:

jinja2 tasklet:

{% if aci_is_min_version(4, 2, None) %} {#check if APIC runs at least 4.2 version of code#}
bla bla
{% endif %}

python tasklet:

if aci_is_min_version(4, 2, None): //check if APIC runs at least 4.2 version of code
    do_something_fancy()
else:
    do_other_things()
cisco.aci.model_is_leaf(model):

not documented yet

cisco.aci.model_is_spine(model):

not documented yet

cisco.aci.parse_api_error(response):

Parse the error-message from the API Response. Assumes, that a check if there is an error present was done beforehand.

Parameters:

response (dict) – Dict of the request response ([imdata][0][….])

Returns:

Parsed Error-Text

Return type:

str

cisco.aci.post(data, timeout=60, force=False, _requires=<function _get_missing_apic_connection_vars at 0x7f9dcc848b80>):

not documented yet

cisco.aci.pprint(object, stream=None, indent=1, width=80, depth=None, *, compact=False, sort_dicts=True, underscore_numbers=False):

not documented yet

cisco.aci.query(query_url, timeout=60, fail_on_error=True, *, _requires=<function _get_missing_apic_connection_vars at 0x7f9dcc848b80>):

[summary]

Parameters:
  • query_url (str) – URL for the query, eg. “/api/node/class/topology/pod-1/node-101/faultSummary.json”. If the URL contains “subscription=yes as parameter”, a websocket session will be opened automatically.

  • timeout (int, optional) – Timeout waiting for an http response from the apic, defaults to 60

Returns:

dictionary containing the response from the APIC

Return type:

dict

cisco.aci.version(apic_node_id=1, *, _requires=<function _get_missing_apic_connection_vars at 0x7f9dcc848b80>):

Returns the firmware version of an APIC

Parameters:

apic_node_id (integer, optional) – Node id of the apic to query for the version from 1 to 10, defaults to 1

Returns:

Version information as returned from APIC e.g.: 4.2(1p)

Return type:

string

Raises:

ValueError – If the node with the specified apic_node_id cannot be found.

cisco.aci.vlan_pool_contains_vlan(pool_name, vlan_id):

not documented yet