B `@sddlmZddlZddlZddlTddlmZddlmZddlm Z ddl m Z dd l m Z dd lmZdd lmZdd lmZdd lmZddlmZddlmZddlmZmZmZmZmZm Z m!Z!m"Z"m#Z#m$Z$m%Z%m&Z&m'Z'm(Z(m)Z)m*Z*m+Z+m,Z,m-Z-dZ.Gddde/Z0dS))datetimeN)*) Organizations)Networks)Devices) Appliance)Camera)CellularGateway)Insight)Sm)Switch)Wireless)Batch)API_KEY_ENVIRONMENT_VARIABLEDEFAULT_BASE_URLSINGLE_REQUEST_TIMEOUTCERTIFICATE_PATHREQUESTS_PROXYWAIT_ON_RATE_LIMITNGINX_429_RETRY_WAIT_TIMEACTION_BATCH_RETRY_WAIT_TIMERETRY_4XX_ERRORRETRY_4XX_ERROR_WAIT_TIMEMAXIMUM_RETRIES OUTPUT_LOGLOG_PATHLOG_FILE_PREFIXPRINT_TO_CONSOLESUPPRESS_LOGGINGSIMULATE_API_CALLS BE_GEO_IDMERAKI_PYTHON_SDK_CALLERz1.10.0c@sBeZdZdZdeeeeee e e e e eeeeeeeedfddZdS) DashboardAPIaX **Creates a persistent Meraki dashboard API session** - api_key (string): API key generated in dashboard; can also be set as an environment variable MERAKI_DASHBOARD_API_KEY - base_url (string): preceding all endpoint resources - single_request_timeout (integer): maximum number of seconds for each API call - certificate_path (string): path for TLS/SSL certificate verification if behind local proxy - requests_proxy (string): proxy server and port, if needed, for HTTPS - wait_on_rate_limit (boolean): retry if 429 rate limit error encountered? - nginx_429_retry_wait_time (integer): Nginx 429 retry wait time - action_batch_retry_wait_time (integer): action batch concurrency error retry wait time - retry_4xx_error (boolean): retry if encountering other 4XX error (besides 429)? - retry_4xx_error_wait_time (integer): other 4XX error retry wait time - maximum_retries (integer): retry up to this many times when encountering 429s or other server-side errors - output_log (boolean): create an output log file? - log_path (string): path to output log; by default, working directory of script if not specified - log_file_prefix (string): log file name appended with date and timestamp - print_console (boolean): print logging output to console? - suppress_logging (boolean): disable all logging? you're on your own then! - simulate (boolean): simulate POST/PUT/DELETE calls to prevent changes? - be_geo_id (string): optional partner identifier for API usage tracking; can also be set as an environment variable BE_GEO_ID - caller (string): optional identifier for API usage tracking; can also be set as an environment variable MERAKI_PYTHON_SDK_CALLER - use_iterator_for_get_pages (boolean): list* methods will return an iterator with each object instead of a complete list with all items NFcCs|ptjt}|st|p(tjd}|p8tjd}|s(tt|_|j tj tj ddd}t }| || r| r| ddkr| d7} | |dtd d |_tj|jd }| || r|js|j||r&| tj|j|n|r.|js.|j|nd|_t|j||||||||| | | ||||d |_t|j|_t|j|_t|j|_t|j|_t|j|_ t!|j|_"t#|j|_$t%|j|_&t'|j|_(t)|j|_*t+|_,dS) Nr!r"z4%(asctime)s %(name)12s: %(levelname)8s > %(message)sz%Y-%m-%d %H:%M:%S)fmtdatefmt/Z_log__z%Y-%m-%d_%H-%M-%Sz.log)filename)loggerapi_keybase_urlsingle_request_timeoutcertificate_pathrequests_proxywait_on_rate_limitnginx_429_retry_wait_timeaction_batch_retry_wait_timeretry_4xx_errorretry_4xx_error_wait_timemaximum_retriessimulate be_geo_idcalleruse_iterator_for_get_pages)-osenvirongetrZ APIKeyErrorlogging getLogger__name__Z_loggersetLevelDEBUG Formatter StreamHandler setFormatterrnowZ _log_file FileHandler hasHandlers addHandlerINFOZ RestSession_sessionrZ organizationsrZnetworksrZdevicesrZ appliancer Zcamerar ZcellularGatewayr Zinsightr smr switchrZwirelessrbatch)selfr*r+r,r-r.r/r0r1r2r3r4Z output_logZlog_pathZlog_file_prefixZ print_consolesuppress_loggingr5r6r7r8 formatterZhandler_consoleZ handler_logrPj/private/var/folders/7j/8686xlfs15q3tgljmghtvg0r0000gn/T/pip-target-isidps9b/lib/python/meraki/__init__.py__init__9sp                  zDashboardAPI.__init__)r> __module__ __qualname____doc__rrrrrrrrrrrrrrrr r!r"rRrPrPrPrQr#sr#)1rr<r9Z rest_sessionZapi.organizationsrZ api.networksrZ api.devicesrZ api.appliancerZ api.camerar Zapi.cellularGatewayr Z api.insightr Zapi.smr Z api.switchr Z api.wirelessrZ api.batchrconfigrrrrrrrrrrrrrrrrr r!r" __version__objectr#rPrPrPrQs"            T