dnac_pnp.dnac_info_butler module

Information butler functions

get_device_id(authentication_token=None, dnac_api_headers=None, serial_number=None, dnac_tab=None, show_all=False)

This function retrieves the device id by serial number

Parameters
  • authentication_token – (str) Authentication token

  • dnac_api_headers – (dict) API headers

  • serial_number – (str) Device serial number

  • dnac_tab – (str) Where to look for the device info (PnP or Inventory)

  • show_all – (boolean) To show whole list or not

Returns

(str) device ID from DNA center

get_full_site_list(dnac_auth_token=None, api_headers=None)

This function retrieves the list of available sites and type form DNA center

Parameters
  • dnac_auth_token – (str) DNA center authentication string

  • api_headers – (dict) DNA center API headers

Returns

(dict) a dictionary of sites and types

get_image_id(authentication_token=None, dnac_api_headers=None, image_name=None)

This function retrieves site id based on site name

Parameters
  • authentication_token – (str) Authentication token

  • dnac_api_headers – (dict) DNAC api headers

  • image_name – (str) Full image name with extension

Returns

(str) Image ID from DNAC

get_pnp_device_count(dnac_auth_token=None, api_headers=None)

This function gets pnp device count and returns the number

Parameters
  • dnac_auth_token – (str) DNA center authentication string

  • api_headers – (dict) DNA center API headers

Returns

(int) Total number of pnp devices available in DNA center

get_site_id(authentication_token=None, dnac_api_headers=None, site_name=None)

This function retrieves site id based on site name

Parameters
  • authentication_token – (str) Authentication token

  • dnac_api_headers – (dict) DNAC api headers

  • site_name – (str) Site name with full hierarchy

Returns

(str) site ID from DNAC

get_template_id(dnac_auth_token=None, api_headers=None, config_data=None, show_all=False, template=None)

This function retrieves configuration ID by template name

Parameters
  • dnac_auth_token – (str) DNA center authentication token

  • api_headers – (dict) DNA Center API headers

  • config_data – (dict) data <- CSV or CLI input

  • show_all – (boolean) To show whole list or not

  • template – (str) Template name

Returns

(string) Config ID (Config ID==Template ID) from DNA Center

get_template_parameters(dnac_auth_token=None, api_headers=None, config_id=None)

This function retrieves parameters from the specified templates

Parameters
  • dnac_auth_token – (str) DNA center authentication token

  • api_headers – (dict) DNA center API headers

  • config_id – (str) Template id/config ID (templateId==configId)

Returns

(str, list) Template content, Template parameters