diff --git a/py-json/LANforge/lf_json_autogen.py b/py-json/LANforge/lf_json_autogen.py index 7d3cb307..73af189a 100644 --- a/py-json/LANforge/lf_json_autogen.py +++ b/py-json/LANforge/lf_json_autogen.py @@ -1,67 +1,823 @@ #!/usr/bin/env python3 """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Generated by LANforge JsonApiPythonGenerator, Mon Sep 13 15:28:41 PDT 2021 - - - WORK IN PROGRESS - - - The API this library provides is actively being changed. - This file expects to live in py-json/LANforge directory. + + LANforge-GUI Source Code + Copyright (C) 1999-2021 Candela Technologies Inc + http:www.candelatech.com + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License + as published by the Free Software Foundation; either version 2 + of the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + Contact: Candela Technologies if you have any + questions. + + LANforge JSON API + + A distinct difference from previous LF scripts is the notion of a session. + Please create a session instance before connecting to your LANforge client. + The session is informative for a GUI user how many scripts are actively + using the GUI. It also provides logging to diagnose how many scripts are + potentially accessing the GUI at the same time. + + EXAMPLE PYTHON USAGE: + ----- ----- ----- 8< ----- ----- ----- 8< ----- ----- ----- + session = LFSession(lfclient_url="http://localhost:8080", + connect_timeout_sec=20, + proxy_map={ + 'http':'http://192.168.1.250:3128' + }, + debug=True, + die_on_error=False); + lf_command = session.get_command() + full_response = [] + first_response = lf_command.json_post( url="/nc_show_ports", + post_data={ + "shelf": 1, + "resource": 1, + "ports": "all" + }, + full_response) + pprint(first_response) + + lf_query = session.get_query() + response = lf_query.get_as_json(url="/port/1/1/list", + debug=True) + pprint(response) + ----- ----- ----- 8< ----- ----- ----- 8< ----- ----- ----- + + The API that this library provides is ACTIVELY BEING CHANGED. + + MAINTENANCE: + To maintain this library, please refer to these files: + * client/candela/lanforge/json_api.py + - the basis for many of the auto-generated python classes + that follow after these class definitions. + * client/candela/lanforge/JsonApiPythonGenerator.java + - the builder class that produces lf_json_autogen + The file json_api.py is intended to be bundled in lfclient.jar and + not to be extracted. It is sourced during build by the JsonApiPythonGenerator + class which appends subclasses to it. + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" +import http.client import sys -import os -import importlib -from enum import Enum -from enum import IntFlag if sys.version_info[0] != 3: print("This script requires Python 3") exit() - -sys.path.append(os.path.join(os.path.abspath(__file__ + "../../../../"))) +import urllib +from urllib import request +from urllib import error +from urllib import parse +from http.client import HTTPResponse -lfcli_base = importlib.import_module("py-json.LANforge.lfcli_base") -LFCliBase = lfcli_base.LFCliBase +import json +import logging +from logging import Logger +import time +import traceback +# from typing import Type +from datetime import datetime +from enum import IntFlag +from pprint import pprint +from pprint import pformat +from enum import Enum -class LFJsonGet(LFCliBase): - def __init__(self, lfclient_host='localhost', - lfclient_port=8080, - debug_=False, - _exit_on_error=False, - _exit_on_fail=False, - _proxy_str=None, - _capture_signal_list=()): - super().__init__(_lfjson_host=lfclient_host, - _lfjson_port=lfclient_port, - _debug=debug_, - _exit_on_error=_exit_on_error, - _exit_on_fail=_exit_on_fail, - _proxy_str=_proxy_str, - _capture_signal_list=_capture_signal_list) +SESSION_HEADER = 'X-LFJson-Session' +LOGGER = Logger('json_api') - @staticmethod - def extract_values(response: dict = None, +def _now_ms() -> int: + return round(time.time() * 1000) + + +def _now_sec() -> int: + return round(time.time() * 1000 * 1000) + + +def _is(text: str) -> bool: + if text is None: + return False + if (len(text) == 0) or (text.strip() == ""): + return False + return True + + +def _not(text: str) -> bool: + return not _is(text=text) + + +def default_proxies() -> dict: + return { + # 'http': 'http://example.com', + # 'https': 'https://example.com' + } + + +def print_diagnostics(url_: str = None, + request_: urllib.request.Request = None, + responses_: list = None, + error_=None, + error_list_: list = None, + debug_: bool = False, + die_on_error_: bool = False): + if debug_: + print("::print_diagnostics: error_.__class__: %s" % error_.__class__) + pprint(error_) + + if url_ is None: + print("WARNING:print_diagnostics: url_ is None") + if request_ is None: + print("WARNING:print_diagnostics: request_ is None") + if error_ is None: + print("WARNING:print_diagnostics: error_ is None") + + method = 'NA' + if hasattr(request_, 'method'): + method = request_.method + err_code = 0 + err_reason = 'NA' + err_headers = [] + err_full_url = url_ + if hasattr(error_, 'code'): + err_code = error_.code + if hasattr(error_, 'reason'): + err_reason = error_.reason + if hasattr(error_, 'headers'): + err_headers = error_.headers + if hasattr(error_, 'get_full_url'): + err_full_url = error_.get_full_url() + xerrors = [] + if err_code == 404: + xerrors.append("[%s HTTP %s] <%s> : %s" % (method, err_code, err_full_url, err_reason)) + else: + if len(err_headers) > 0: + for headername in sorted(err_headers.keys()): + if headername.startswith("X-Error-"): + xerrors.append("%s: %s" % (headername, err_headers.get(headername))) + if len(xerrors) > 0: + print(" = = LANforge Error Messages = =") + print(" = = URL: %s" % err_full_url) + for xerr in xerrors: + print(xerr) + if (error_list_ is not None) and isinstance(error_list_, list): + error_list_.append(xerr) + print(" = = = = = = = = = = = = = = = =") + + if error_.__class__ is urllib.error.HTTPError: + if debug_: + print("----- HTTPError: ------------------------------------ print_diagnostics:") + print("%s <%s> HTTP %s: %s" % (method, err_full_url, err_code, err_reason)) + + if err_code == 404: + if (error_list_ is not None) and isinstance(error_list_, list): + error_list_.append("[%s HTTP %s] <%s> : %s" % (method, err_code, err_full_url, err_reason)) + else: + if debug_: + print(" Content-type:[%s] Accept[%s]" % ( + request_.get_header('Content-type'), request_.get_header('Accept'))) + + if hasattr(request_, "data") and (request_.data is not None): + print(" Data:") + pprint(request_.data) + elif debug_: + print(" ") + + if debug_ and (len(err_headers) > 0): + # the HTTPError is of type HTTPMessage a subclass of email.message + print(" Response Headers: ") + for headername in sorted(err_headers.keys()): + print(" %s: %s" % (headername, err_headers.get(headername))) + + if len(responses_) > 0: + print("----- Response: --------------------------------------------------------") + pprint(responses_[0].reason) + if debug_: + print("------------------------------------------------------------------------") + if die_on_error_: + exit(1) + return + + if error_.__class__ is urllib.error.URLError: + print("----- URLError: ---------------------------------------------") + print("%s <%s> HTTP %s: %s" % (method, err_full_url, err_code, err_reason)) + print("------------------------------------------------------------------------") + if die_on_error_: + exit(1) + +class Logg: + DEFAULT_LEVEL = logging.WARNING + + def __init__(self, + log_level: int = DEFAULT_LEVEL, + name: str = None, + debug: bool = False): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Base class that can be used to send logging messages elsewhere. extend this + in order to send log messages from this framework elsewhere. + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + self.level = log_level + self.logger : Logger + + self.start_time = datetime.now() + self.start_time_str = time.strftime("%Y%m%d-%I:%M%:%S") + if name: + self.name = name + if "@" in name: + self.name = name.replace('@', self.start_time_str) + else: + self.name = "started-" + self.start_time_str + self.logger = Logger(name, level=log_level) + + if debug: + self.logg(level=logging.WARNING, message="Logger begun: " + self.name) + + def logg(self, + level: int = logging.WARNING, + message: str = None): + """ + + :param level: python logging priority + :param message: text to send to logging channel + :return: None + """ + if _not(message): + return + if level == logging.CRITICAL: + self.logger.critical(message) + + if level == logging.ERROR: + self.logger.error(message) + + if level == logging.WARNING: + self.logger.warning(message) + + if level == logging.INFO: + self.logger.info(message) + + if level == logging.DEBUG: + self.logger.debug(message) + + + def error(self, message: str = None): + if not message: + return + self.logg(level=logging.ERROR, message=message) + + def warning(self, message: str = None): + if not message: + return + self.logg(level=logging.WARNING, message=message) + + def info(self, message: str = None): + if not message: + return + self.logg(level=logging.INFO, message=message) + + def debug(self, message: str = None): + if not message: + return + self.logg(level=logging.DEBUG, message=message) + + +class BaseLFJsonRequest: + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Perform HTTP get/post/put/delete with extensions specific to LANforge JSON + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + No_Data: dict = {'No Data': 0} + OK_STATUSES = (100, 200, 201, 204, 205, 206, 301, 302, 303, 304, 307, 308, 404) + subclasses = [] + + def __init_subclass__(cls, **kwargs): + super().__init_subclass__(**kwargs) + cls.subclasses.append(cls) + + def __init__(self, + session_obj: 'BaseSession' = None, + debug: bool = False, + stream_errors: bool = True, + stream_warnings: bool = False, + exit_on_error: bool = False): + self.default_headers: dict = {'Accept': 'application/json'} + self.debug_on: bool = False + self.error_list: list = [] + # post_data: dict = No_Data + self.proxies_installed: bool = False + self.session_instance: 'BaseSession' + self.session_instance = None + self.stream_errors: bool = True + self.stream_warnings: bool = False + + if not session_obj: + LOGGER.warning("BaseLFJsonRequest: no session instance") + else: + self.session_instance = session_obj + self.session_id = session_obj.get_session_id() + self.proxies_installed = session_obj.proxies_installed + + self.die_on_error: bool + self.die_on_error = exit_on_error + if session_obj: + self.die_on_error |= session_obj.is_exit_on_error() + + self.lfclient_url = session_obj.get_lfclient_url() + + self.stream_errors = stream_errors + self.warnings = [] + self.stream_warnings = stream_warnings + self.logger = Logg(name="LFJsonRequest-@", debug=debug) + self.debug_on = debug + + def get_corrected_url(self, + url: str = None, + debug: bool = False): + """ + + :param url: If you have a session you can provide the abbreviated URL optionally starting with a slash + :param debug: turn on debugging + :return: full url prepended with + """ + if _not(url): + raise Exception("%s: Bad url[%s]" % (__name__, url)) + + corrected_url: str = url + + if not url.startswith(self.session_instance.get_lfclient_url()): + if url.startswith('/'): + corrected_url = self.session_instance.get_lfclient_url() + url + else: + corrected_url = self.session_instance.get_lfclient_url() + '/' + url + + if _not(corrected_url): + raise Exception("%s: Bad url[%s]" % (__name__, url)) + + if corrected_url.find('//'): + protopos = corrected_url.find("://") + corrected_url = corrected_url[:protopos + 2] + corrected_url[protopos + 2:].replace("//", "/") + + # finding '#' prolly indicates a macvlan (eth1#0) + # finding ' ' prolly indicates a field name that should imply %20 + if corrected_url.find('#') >= 1: + corrected_url = corrected_url.replace('#', '%23') + if corrected_url.find(' ') >= 1: + corrected_url = corrected_url.replace(' ', '%20') + if debug: + self.logger.debug("%s: url [%s] now [%s]" % (str(__class__), url, corrected_url)) + return corrected_url + + def add_error(self, message: str = None): + if not message: + return + if self.stream_errors: + self.logger.error(message=message) + self.error_list.append(message) + + def add_warning(self, message: str = None): + self.logger.warning(message) + if self.stream_errors: + self.logger.warning(message=message) + self.warnings.append(message) + + def get_errors(self) -> list: + return self.error_list + + def get_warnings(self) -> list: + return self.warnings + + def clear_warnings_errors(self, flush_to_session=False): + """ erase errors and warnings """ + if flush_to_session: + if not self.session_instance: + self.logger.error(message="cannot flush messages to session when there is no session instance") + else: + self.session_instance.session_error_list.extend(self.error_list) + self.session_instance.session_warnings_list.extend(self.warnings) + self.error_list = [] + self.warnings = [] + self.logger.info(message='BaseLFJsonRequest.clear()') + + def extract_values(self, + response: dict = None, singular_key: str = None, plural_key: str = None) -> list: """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Extract fields from this response using the expected keys: ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - if (singular_key is None) or (plural_key is None) or (not singular_key) or (not plural_key): - raise ValueError("extract_values wants non-empty response, singular_key and plural_key") - if (singular_key in response) and (not response[singular_key]): - return [] - elif (singular_key in response) and (type(response[singular_key]) is dict): - return [response[singular_key]] - elif (plural_key in response) and (not response[plural_key]): - return [] - else: - return response[plural_key] + if not singular_key: + raise ValueError("extract_values wants non-empty singular_key") + if not plural_key: + raise ValueError("extract_values wants non-empty plural_key") + + if singular_key not in response: + if plural_key not in response: + self.add_warning("response did not contain <{}> or <{}>".format(singular_key, plural_key)) + return [] + if not response[plural_key]: + self.add_warning("response[{}] is empty".format(plural_key)) + return response[plural_key] + if not response[singular_key]: + self.add_warning("response[{}] is empty".format(singular_key)) + return response[singular_key] + + def form_post(self, + url: str = None, + post_data: dict = None, + debug: bool = False, + die_on_error_: bool = False): + die_on_error_ |= self.die_on_error + debug |= self.debug_on + responses = [] + # https://stackoverflow.com/a/59635684/11014343 + if (self.session_instance.proxy_map is not None) and (len(self.session_instance.proxy_map) > 0): + # https://stackoverflow.com/a/59635684/11014343 + opener = request.build_opener(request.ProxyHandler(self.session_instance.proxy_map)) + request.install_opener(opener) + + if debug: + self.logger.debug("formPost: url: " + url) + if (post_data is not None) and (post_data is not self.No_Data): + urlenc_data = urllib.parse.urlencode(post_data).encode("utf-8") + if debug: + self.logger.debug("formPost: data looks like:" + str(urlenc_data)) + print("formPost: url: " + url) + myrequest = request.Request(url=url, + data=urlenc_data, + headers=self.default_headers) + else: + myrequest = request.Request(url=url, headers=self.default_headers) + self.logger.info("json_post: No data sent to [%s]" % url) + + myrequest.headers['Content-type'] = 'application/x-www-form-urlencoded' + + try: + resp = urllib.request.urlopen(myrequest) + responses.append(resp) + return responses[0] + + except urllib.error.HTTPError as herror: + print_diagnostics(url_=url, + request_=myrequest, + responses_=responses, + error_=herror, + error_list_=self.error_list, + debug_=debug, + die_on_error_=die_on_error_) + if die_on_error_ and (herror.code != 404): + exit(1) + except urllib.error.URLError as uerror: + print_diagnostics(url_=url, + request_=myrequest, + responses_=responses, + error_=uerror, + error_list_=self.error_list, + debug_=debug, + die_on_error_=die_on_error_) + if die_on_error_: + exit(1) + if die_on_error_: + exit(1) + return None + + def json_post(self, + url: str = "", + post_data: dict = None, + debug: bool = False, + die_on_error: bool = False, + response_json_list: list = None, + method_: str = 'POST', + session_id_: str = ""): + """ + + :param url: URL to post to + :param post_data: data to send in post + :param debug: turn on diagnostics + :param die_on_error: exit() if the return status is not 200 + :param response_json_list: list of result data + :param method_: override HTTP method, please do not override + :param session_id_: insert a session to the header; this is useful in the case where we are + operating outside a session context, like during the __del__ constructor + :return: returns first set of http.client.HTTPResponse data + """ + debug |= self.debug_on + die_on_error |= self.die_on_error + + if self.session_id != self.session_instance.get_session_id(): + self.logger.error("BaseLFJsonRequest.session_id[%s] != session.get_session_id: [%s]" + % (self.session_id, self.session_instance.get_session_id())) + if die_on_error: + exit(1) + responses = [] + url = self.get_corrected_url(url) + if (post_data is not None) and (post_data is not self.No_Data): + myrequest = request.Request(url=url, + method=method_, + data=json.dumps(post_data).encode("utf-8"), + headers=self.default_headers) + else: + myrequest = request.Request(url=url, + headers=self.default_headers, + method=method_, + data=post_data) + self.logger.info("json_post: empty post sent to [%s]" % url) + + myrequest.headers['Content-type'] = 'application/json' + sess_id = self.session_instance.get_session_id() + if _is(sess_id): + myrequest.headers[SESSION_HEADER] = str(sess_id) + elif _is(session_id_): + myrequest.headers[SESSION_HEADER] = str(session_id_) + else: + self.logger.warning("Request sent without X-LFJson-ID header: "+url) + if debug: + self.logger.warning("json_post headers to "+url) + self.logger.warning(pformat(myrequest.headers)) + + # https://stackoverflow.com/a/59635684/11014343 + + resp: http.client.HTTPResponse + try: + resp = urllib.request.urlopen(myrequest) + resp_data = resp.read().decode('utf-8') + if debug and die_on_error: + self.logger.debug(__name__+" ----- json_post: debug: --------------------------------------------") + self.logger.debug("URL: %s :%d " % (url, resp.status)) + self.logger.debug(__name__+" ----- headers -------------------------------------------------") + if resp.status != 200: + self.logger.error(pformat(resp.getheaders())) + self.logger.error(__name__+" ----- response -------------------------------------------------") + self.logger.error(pformat(resp_data)) + self.logger.error(" ----- -------------------------------------------------") + responses.append(resp) + headers = resp.getheaders() + if debug: + self.logger.warning("response headers:") + self.logger.warning(pformat(headers)) + if SESSION_HEADER in headers: + if self.session_id != headers[SESSION_HEADER]: + self.logger.warning("established session header [%s] different from response session header[%s]" + % (self.session_id, headers[SESSION_HEADER])) + if response_json_list is not None: + if type(response_json_list) is not list: + raise ValueError("reponse_json_list needs to be type list") + jzon_str = json.loads(resp_data) + if debug: + self.logger.debug(__name__+":----- json_post debug: --------------------------------------------") + self.logger.debug("URL: %s :%d " % (url, resp.status)) + self.logger.debug(__name__+" ----- headers -------------------------------------------------") + self.logger.debug(pformat(resp.getheaders())) + self.logger.debug(__name__+" ----- response -------------------------------------------------") + self.logger.debug(pformat(jzon_str)) + self.logger.debug("-------------------------------------------------") + response_json_list.append(jzon_str) + if resp.status not in self.OK_STATUSES: + self.logger.debug("----------------- BAD STATUS --------------------------------") + if die_on_error: + exit(1) + return responses[0] + + except urllib.error.HTTPError as herror: + print_diagnostics(url_=url, + request_=myrequest, + responses_=responses, + error_=herror, + debug_=debug, + die_on_error_=die_on_error) + if die_on_error: + exit(1) + + except urllib.error.URLError as uerror: + print_diagnostics(url_=url, + request_=myrequest, + responses_=responses, + error_=uerror, + debug_=debug, + die_on_error_=die_on_error) + if die_on_error: + exit(1) + + if die_on_error: + exit(1) + return None + + def json_put(self, + url: str = None, + debug: bool = False, + die_on_error: bool = False, + response_json_list: list = None): + if not url: + raise ValueError("json_put requires url") + return self.json_post(url=url, + debug=debug | self.debug_on, + die_on_error=die_on_error | self.die_on_error, + response_json_list=response_json_list, + method_='PUT') + + def json_delete(self, + url: str = None, + debug: bool = False, + die_on_error: bool = False): + return self.get_as_json(url=url, + debug=debug | self.debug_on, + die_on_error=die_on_error, + method_='DELETE') + + def get(self, + url: str = None, + debug: bool = False, + die_on_error: bool = False, + method_: str = 'GET', + connection_timeout_sec: int = None): + """ + Makes a HTTP GET request with specified timeout. + :param url: Fully qualified URL to request + :param debug: if true, print out diagnostic information + :param die_on_error: call exit() if query fails to connect, is a 400 or 500 response status. + Responses with 404 status are expected to be normal and will not cause an exit. + :param method_: Override the HTTP METHOD. Please do not override. + :param connection_timeout_sec: number of seconds to have an outstanding request + :return: returns an urllib.response or None + """ + debug |= self.debug_on + die_on_error |= self.die_on_error + + if debug: + self.logger.debug(message="%s url:[%s]" % (__name__, url)) + + if not connection_timeout_sec: + if self.session_instance.get_timeout_sec(): + connection_timeout_sec = self.session_instance.get_timeout_sec() + else: + connection_timeout_sec = 120 + + requested_url = self.get_corrected_url(url, + debug=debug | self.debug_on) + myrequest = request.Request(url=requested_url, + headers=self.default_headers, + method=method_) + if connection_timeout_sec: + myrequest.timeout = connection_timeout_sec + + myresponses = [] + try: + myresponses.append(request.urlopen(myrequest)) + return myresponses[0] + + except urllib.error.HTTPError as herror: + print_diagnostics(url_=requested_url, + request_=myrequest, + responses_=myresponses, + error_=herror, + error_list_=self.error_list, + debug_=debug, + die_on_error_=die_on_error) + if die_on_error: + exit(1) + except urllib.error.URLError as uerror: + print_diagnostics(url_=requested_url, + request_=myrequest, + responses_=myresponses, + error_=uerror, + error_list_=self.error_list, + debug_=debug, + die_on_error_=die_on_error) + if die_on_error: + exit(1) + if die_on_error: + exit(1) + return None + + def get_as_json(self, + url: str = None, + die_on_error: bool = False, + debug: bool = False, + timeout_sec: float = None, + method_='GET'): + """ + :param url: url to do GET request on + :param die_on_error: exit immediate if result status is BAD RESPONSE + :param debug: print diagnostic information about query + :param timeout_sec: number of seconds to wait for a response + :param method_: Overrides the HTTP method used. Please do not override. + :return: get request as Json data + """ + responses = [] + j = self.get(url=url, + debug=debug, + die_on_error=die_on_error, + connection_timeout_sec=timeout_sec, + method_=method_) + responses.append(j) + if len(responses) < 1: + if debug and self.has_errors(): + self.print_errors() + return None + + if responses[0] is None: + if debug: + self.logger.debug(message="No response from " + url) + return None + json_data = json.loads(responses[0].read().decode('utf-8')) + return json_data + + def json_get(self, + url: str = None, + debug: bool = False, + wait_sec: float = None, + request_timeout_sec: float = None, + max_timeout_sec: float = None, + errors_warnings: list = None): + """ + Returns json record from GET request. This will retry until timeout_sec + :param url: URL to make GET request to + :param debug: print diagnostic information if true + :param wait_sec: time to wait before making request, or waiting until you get a non-404 response + :param request_timeout_sec: maximum time each request can take + :param max_timeout_sec: maximum time to spend making requests + :param errors_warnings: if present, fill this with error and warning messages from the response JSON + :return: dictionary of json response from server + """ + debug |= self.debug_on + json_response = None + if not max_timeout_sec: + max_timeout_sec = self.session_instance.max_timeout_sec + + if _not(url): + raise ValueError("json_get called withou url") + + url = self.get_corrected_url(url=url) + + deadline_sec: float = (_now_ms() * 1000) + max_timeout_sec + self.error_list.clear() + attempt_counter = 1 + while _now_sec() < deadline_sec: + time.sleep(wait_sec) + try: + json_response = self.get_as_json(url=url, + debug=debug, + die_on_error=False, + timeout_sec=request_timeout_sec) + if debug: + self.logger.debug("[%s] json_get: URL[%s]" % (attempt_counter, url)) + self.logger.debug(pformat(json_response)) + if json_response is None: + if errors_warnings: + errors_warnings.append("No json_response") + errors_warnings.extend(self.error_list) + if debug: + if hasattr(self, 'print_errors'): + self.print_errors() + else: + self.logger.error("json_get: [%s] no response, check other errors" % url) + time.sleep(wait_sec) + return None + else: + return json_response + except ValueError as ve: + if debug or self.die_on_error: + self.logger.error("json_get: [%s] " % url) + self.logger.error("Exception %s:" % ve) + self.logger.error(traceback.format_exception(ValueError, ve, ve.__traceback__, chain=True)) + # traceback.print_exception(ValueError, ve, ve.__traceback__, chain=True) + if self.die_on_error: + sys.exit(1) + return json_response + + # def set_post_data(self, data): + # """ + # :param data: dictionary of parameters for post + # :return: nothing + # """ + # self.post_data = data + + def has_errors(self): + return (True, False)[len(self.error_list) > 0] + + def print_errors(self): + if not self.has_errors: + self.logger.debug("---------- no errors ----------") + return + for err in self.error_list: + Logg.error("error: %s" % err) - # TODO: rename me to make_port_eid_url @staticmethod - def make_eid_url(eid_list=()): - """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Convert a list of EIDs into a URL: - ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + def create_port_eid_url(eid_list: list = None) -> str: + """ ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Convert a list of EIDs into a URL: + :param eid_list + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- """ if not len(eid_list): return "/list" url = "/" @@ -69,2424 +825,41 @@ class LFJsonGet(LFCliBase): return url + eid_list.replace('.', '/') # The first in a series has to define the resource number, - # but the remainder of a series has to match that resource number + # but the remainder of a series has to match that resource number for i in range(0, len(eid_list)): eid = eid_list[i] if i == 0: url += eid.replace('.', '/') elif eid.find('.') > 0: - url += ',' + eid.split('.')[-1] + url += str(',' + eid.split('.')[-1]) else: - url += ','+eid - + url += str(',' + eid) return url - """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Notes for type requests - If you need to call the URL directly, - request one of these URLs: - /attenuator/ - /attenuator/$shelf_id - /attenuator/$shelf_id/$resource_id - /attenuator/$shelf_id/$resource_id/$port_id - /attenuators/ - /attenuators/$shelf_id - /attenuators/$shelf_id/$resource_id - /attenuators/$shelf_id/$resource_id/$port_id - When requesting specific column names, they need to be URL encoded: - entity+id, module+1, module+2, module+3, module+4, module+5, module+6, module+7, - module+8, name, script, state, temperature - Example URL: /attenuator?fields=entity+id,module+1 - - Example py-json call (it knows the URL): - record = LFJsonGet.get_attenuator(eid_list=['1.234', '1.344'], - requested_col_names=['entity id'], - debug_=True) - - The record returned will have these members: - { - 'entity id': # Entity ID - 'module 1': # Reported attenuator dB settings. - 'module 2': # Reported attenuator dB settings. - 'module 3': # Reported attenuator dB settings. - 'module 4': # Reported attenuator dB settings. - 'module 5': # Reported attenuator dB settings. - 'module 6': # Reported attenuator dB settings. - 'module 7': # Reported attenuator dB settings. - 'module 8': # Reported attenuator dB settings. - 'name': # Attenuator module identifier (shelf . resource . serial-num). - 'script': # Attenuator script state. - 'state': # Attenuator state. - 'temperature': # Temperature in degres Farenheight reported in Attenuator unit. - } - ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - - def get_attenuator(self, - eid_list=None, - requested_col_names=(), - debug_=False): - debug_ |= self.debug - url = "/attenuator" - if (eid_list is None) or (len(eid_list) < 1): - raise ValueError("no entity id in request") - trimmed_fields = [] - if isinstance(requested_col_names, str): - if not requested_col_names.strip(): - raise ValueError("column name cannot be blank") - trimmed_fields.append(requested_col_names.strip()) - if isinstance(requested_col_names, list): - for field in requested_col_names: - if not field.strip(): - raise ValueError("column names cannot be blank") - field = field.strip() - if field.find(" ") > -1: - raise ValueError("field should be URL encoded: [%s]" % field) - trimmed_fields.append(field) - url += self.make_eid_url(eid_list=eid_list) - - if len(trimmed_fields) > 0: - url += "?fields=%s" % (",".join(trimmed_fields)) - - response = self.json_get(url, debug_=debug_) - if response is None: - return None - return self.extract_values(response=response, - singular_key="attenuator", - plural_key="attenuators") - # - """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Notes for type requests - - If you need to call the URL directly, - request one of these URLs: - /chamber/ - /chamber/$chamber_name - - When requesting specific column names, they need to be URL encoded: - chamber, chamber+connections, chamber+resources, chamber+type, duts, entity+id, - flags, hide, isolation, marked, open, reported+rotation+%28deg%29, reported+rpm, - reported+tilt+%28deg%29, resource, rotation+%28deg%29, rpm, smas, tilt+%28deg%29, turntable, - turntable+type, virtual - Example URL: /chamber?fields=chamber,chamber+connections - - Example py-json call (it knows the URL): - record = LFJsonGet.get_chamber(eid_list=['1.234', '1.344'], - requested_col_names=['entity id'], - debug_=True) - - The record returned will have these members: - { - 'chamber': # - - 'chamber connections': # - - 'chamber resources': # - - 'chamber type': # - - 'duts': # - - 'entity id': # - - 'flags': # - - 'hide': # - - 'isolation': # - - 'marked': # - - 'open': # - - 'reported rotation (deg)': # - - 'reported rpm ': # - - 'reported tilt (deg)': # - - 'resource': # - - 'rotation (deg)': # - - 'rpm': # - - 'smas': # - - 'tilt (deg)': # - - 'turntable': # - - 'turntable type': # - - 'virtual': # - - } - ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - - def get_chamber(self, - eid_list=None, - requested_col_names=(), - debug_=False): - debug_ |= self.debug - url = "/chamber" - if (eid_list is None) or (len(eid_list) < 1): - raise ValueError("no entity id in request") - trimmed_fields = [] - if isinstance(requested_col_names, str): - if not requested_col_names.strip(): - raise ValueError("column name cannot be blank") - trimmed_fields.append(requested_col_names.strip()) - if isinstance(requested_col_names, list): - for field in requested_col_names: - if not field.strip(): - raise ValueError("column names cannot be blank") - field = field.strip() - if field.find(" ") > -1: - raise ValueError("field should be URL encoded: [%s]" % field) - trimmed_fields.append(field) - url += self.make_eid_url(eid_list=eid_list) - - if len(trimmed_fields) > 0: - url += "?fields=%s" % (",".join(trimmed_fields)) - - response = self.json_get(url, debug_=debug_) - if response is None: - return None - return self.extract_values(response=response, - singular_key="chamber", - plural_key="chambers") - # - """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Notes for type requests - - If you need to call the URL directly, - request one of these URLs: - /control/$command - - - Example py-json call (it knows the URL): - record = LFJsonGet.get_control(eid_list=['1.234', '1.344'], - debug_=True) - ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - - def get_control(self, - eid_list=None, - requested_col_names=(), - debug_=False): - debug_ |= self.debug - url = "/control" - if (eid_list is None) or (len(eid_list) < 1): - raise ValueError("no entity id in request") - trimmed_fields = [] - if isinstance(requested_col_names, str): - if not requested_col_names.strip(): - raise ValueError("column name cannot be blank") - trimmed_fields.append(requested_col_names.strip()) - if isinstance(requested_col_names, list): - for field in requested_col_names: - if not field.strip(): - raise ValueError("column names cannot be blank") - field = field.strip() - if field.find(" ") > -1: - raise ValueError("field should be URL encoded: [%s]" % field) - trimmed_fields.append(field) - url += self.make_eid_url(eid_list=eid_list) - - if len(trimmed_fields) > 0: - url += "?fields=%s" % (",".join(trimmed_fields)) - - response = self.json_get(url, debug_=debug_) - if response is None: - return None - return self.extract_values(response=response, - singular_key="", - plural_key="") - # - """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Notes for type requests - - If you need to call the URL directly, - request one of these URLs: - /cx/ - /cx/$cx_id - - When requesting specific column names, they need to be URL encoded: - avg+rtt, bps+rx+a, bps+rx+b, drop+pkts+a, drop+pkts+b, eid, endpoints+%28a%C2%A0%E2%86%94%C2%A0b%29, - entity+id, name, pkt+rx+a, pkt+rx+b, rpt+timer, rx+drop+%25+a, rx+drop+%25+b, - state, type - Example URL: /cx?fields=avg+rtt,bps+rx+a - - Example py-json call (it knows the URL): - record = LFJsonGet.get_cx(eid_list=['1.234', '1.344'], - requested_col_names=['entity id'], - debug_=True) - - The record returned will have these members: - { - 'avg rtt': # Average Round-Trip-Time (latency) for this connection (ms). - 'bps rx a': # Endpoint A's real receive rate (bps). - 'bps rx b': # Endpoint B's real receive rate (bps). - 'drop pkts a': # The number of packets Endpoint B sent minus the number Endpoint A - # received.This number is not 100% correct as long as packets are in - # flight.After a Quiesce of the test, the number should be perfectly - # accurate. - 'drop pkts b': # The number of packets Endpoint A sent minus the number Endpoint B - # received.This number is not 100% correct as long as packets are in - # flight.After a Quiesce of the test, the number should be perfectly - # accurate. - 'eid': # Cross Connect's Name. - 'endpoints (a ↔ b)': # Endpoints that make up this Cross Connect. - 'entity id': # Cross Connect's Name. - 'name': # Cross Connect's Name. - 'pkt rx a': # Endpoint A's Packets Recieved. - 'pkt rx b': # Endpoint B's Packets Recieved. - 'rpt timer': # Cross Connect's Report Timer (milliseconds).This is how often the GUI - # will ask for updates from the LANforge processes.If the GUI is sluggish, - # increasing the report timers may help. - 'rx drop % a': # Endpoint A percentage packet loss.Calculated using the number of PDUs - # Endpoint B sent minus the number Endpoint A received.This number is not - # 100% correct as long as packets are in flight.After a Quiesce of the - # test, the number should be perfectly accurate. - 'rx drop % b': # Endpoint B percentage packet loss.Calculated using the number of PDUs - # Endpoint A sent minus the number Endpoint B received.This number is not - # 100% correct as long as packets are in flight.After a Quiesce of the - # test, the number should be perfectly accurate. - 'state': # Current State of the connection.UninitializedHas not yet been - # started/stopped.InitializingBeing set up.StartingStarting the - # test.RunningTest is actively running.StoppedTest has been - # stopped.QuiesceTest will gracefully stop soon.HW-BYPASSTest is in - # hardware-bypass mode (WanLinks only)FTM_WAITTest wants to run, but is - # phantom, probably due to non-existent interface or resource.WAITINGWill - # restart as soon as resources are available.PHANTOMTest is stopped, and - # is phantom, probably due to non-existent interface or resource. - 'type': # Cross-Connect type. - } - ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - - def get_cx(self, - eid_list=None, - requested_col_names=(), - debug_=False): - debug_ |= self.debug - url = "/cx" - if (eid_list is None) or (len(eid_list) < 1): - raise ValueError("no entity id in request") - trimmed_fields = [] - if isinstance(requested_col_names, str): - if not requested_col_names.strip(): - raise ValueError("column name cannot be blank") - trimmed_fields.append(requested_col_names.strip()) - if isinstance(requested_col_names, list): - for field in requested_col_names: - if not field.strip(): - raise ValueError("column names cannot be blank") - field = field.strip() - if field.find(" ") > -1: - raise ValueError("field should be URL encoded: [%s]" % field) - trimmed_fields.append(field) - url += self.make_eid_url(eid_list=eid_list) - - if len(trimmed_fields) > 0: - url += "?fields=%s" % (",".join(trimmed_fields)) - - response = self.json_get(url, debug_=debug_) - if response is None: - return None - return self.extract_values(response=response, - singular_key="", - plural_key="") - # - """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Notes for type requests - - If you need to call the URL directly, - request one of these URLs: - /dut/ - /dut/$name - - When requesting specific column names, they need to be URL encoded: - api+version, bssid-1, bssid-2, bssid-3, bssid-4, bssid-5, bssid-6, bssid-7, - bssid-8, dut, eap-id, entity+id, hw+info, image+file, lan, mgt+ip, model+number, - notes, num+ant+radio+1, num+ant+radio+2, num+ant+radio+3, password-1, password-2, - password-3, password-4, password-5, password-6, password-7, password-8, serial+number, - serial+port, ssid-1, ssid-2, ssid-3, ssid-4, ssid-5, ssid-6, ssid-7, ssid-8, - sw+info, wan - Example URL: /dut?fields=api+version,bssid-1 - - Example py-json call (it knows the URL): - record = LFJsonGet.get_dut(eid_list=['1.234', '1.344'], - requested_col_names=['entity id'], - debug_=True) - - The record returned will have these members: - { - 'api version': # API Version - 'bssid-1': # WiFi BSSID for DUT. - 'bssid-2': # WiFi BSSID for DUT. - 'bssid-3': # WiFi BSSID for DUT. - 'bssid-4': # WiFi BSSID for DUT. - 'bssid-5': # WiFi BSSID for DUT. - 'bssid-6': # WiFi BSSID for DUT. - 'bssid-7': # WiFi BSSID for DUT. - 'bssid-8': # WiFi BSSID for DUT. - 'dut': # Devices Under Test - 'eap-id': # EAP Identifier, only used when one of the EAP options are selected. - 'entity id': # Entity ID - 'hw info': # DUT Hardware Info - 'image file': # Image file name. Relative paths assume directory /home/lanforge. Fully - # qualified pathnames begin with a slash (eg - # /usr/lib/share/icons/icon.png).File format should be PNG, JPG or BMP. - 'lan': # IP/Mask for LAN port (192.168.2.1/24). - 'mgt ip': # DUT Management IP address. - 'model number': # DUT model number or product name - 'notes': # Notes - 'num ant radio 1': # Antenna count for DUT radio(s). - 'num ant radio 2': # Antenna count for DUT radio(s). - 'num ant radio 3': # Antenna count for DUT radio(s). - 'password-1': # WiFi Password needed to connect to DUT. - 'password-2': # WiFi Password needed to connect to DUT. - 'password-3': # WiFi Password needed to connect to DUT. - 'password-4': # WiFi Password needed to connect to DUT. - 'password-5': # WiFi Password needed to connect to DUT. - 'password-6': # WiFi Password needed to connect to DUT. - 'password-7': # WiFi Password needed to connect to DUT. - 'password-8': # WiFi Password needed to connect to DUT. - 'serial number': # DUT Identifier (serial-number, or similar) - 'serial port': # Resource and name of LANforge serial port that connects to this DUT. - # (1.1.ttyS0). Does not need to belong to lan_port or wan_port resource. - 'ssid-1': # WiFi SSID advertised by DUT. - 'ssid-2': # WiFi SSID advertised by DUT. - 'ssid-3': # WiFi SSID advertised by DUT. - 'ssid-4': # WiFi SSID advertised by DUT. - 'ssid-5': # WiFi SSID advertised by DUT. - 'ssid-6': # WiFi SSID advertised by DUT. - 'ssid-7': # WiFi SSID advertised by DUT. - 'ssid-8': # WiFi SSID advertised by DUT. - 'sw info': # DUT Software Info - 'wan': # IP/Mask for WAN port (192.168.3.2/24). - } - ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - - def get_dut(self, - eid_list=None, - requested_col_names=(), - debug_=False): - debug_ |= self.debug - url = "/dut" - if (eid_list is None) or (len(eid_list) < 1): - raise ValueError("no entity id in request") - trimmed_fields = [] - if isinstance(requested_col_names, str): - if not requested_col_names.strip(): - raise ValueError("column name cannot be blank") - trimmed_fields.append(requested_col_names.strip()) - if isinstance(requested_col_names, list): - for field in requested_col_names: - if not field.strip(): - raise ValueError("column names cannot be blank") - field = field.strip() - if field.find(" ") > -1: - raise ValueError("field should be URL encoded: [%s]" % field) - trimmed_fields.append(field) - url += self.make_eid_url(eid_list=eid_list) - - if len(trimmed_fields) > 0: - url += "?fields=%s" % (",".join(trimmed_fields)) - - response = self.json_get(url, debug_=debug_) - if response is None: - return None - return self.extract_values(response=response, - singular_key="dut", - plural_key="duts") - # - """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Notes for type requests - - If you need to call the URL directly, - request one of these URLs: - /endp/ - /endp/$endp_id - - When requesting specific column names, they need to be URL encoded: - 1st+rx, a%2Fb, bursty, crc+fail, cwnd, cx+active, cx+estab, cx+estab%2Fs, cx+to, - delay, destination+addr, dropped, dup+pkts, eid, elapsed, entity+id, jitter, - max+pdu, max+rate, min+pdu, min+rate, mng, name, ooo+pkts, pattern, pdu%2Fs+rx, - pdu%2Fs+tx, pps+rx+ll, pps+tx+ll, rcv+buf, replays, run, rx+ber, rx+bytes, - rx+drop+%25, rx+dup+%25, rx+ooo+%25, rx+pdus, rx+pkts+ll, rx+rate, rx+rate+%281%C2%A0min%29, - rx+rate+%28last%29, rx+rate+ll, rx+wrong+dev, script, send+buf, source+addr, - tcp+mss, tcp+rtx, tx+bytes, tx+pdus, tx+pkts+ll, tx+rate, tx+rate+%281%C2%A0min%29, - tx+rate+%28last%29, tx+rate+ll # hidden columns: - drop-count-5m, latency-5m, rt-latency-5m, rx-silence-5m - Example URL: /endp?fields=1st+rx,a%2Fb - - Example py-json call (it knows the URL): - record = LFJsonGet.get_endp(eid_list=['1.234', '1.344'], - requested_col_names=['entity id'], - debug_=True) - - The record returned will have these members: - { - '1st rx': # Miliseconds between starting the endpoint and receiving the first - # packet.Note that LANforge UDP connections (not including multicast) will - # wait 20msbefore sending first frame to make sure receiver has adequate - # time to start. - 'a/b': # Display side (A or B) for the endpoint. - 'bursty': # Is the transmit rate bursty or not? - 'crc fail': # Total packets received with a bad payload CRC. - 'cwnd': # Sender's TCP Current Window Size. In units of Maximum Segment Size. - 'cx active': # Total number of active connections for this endpoint. - 'cx estab': # Total times the connection between the endpoints has been established. - 'cx estab/s': # Connections established per second, averaged over the last 30 seconds. - 'cx to': # Number of TCP connection attemtps timed out by LANforge. - 'delay': # Average latency in milliseconds for packets received by this endpoint. - 'destination addr': # Destination Address (MAC, ip/port, VoIP destination). - 'dropped': # Total dropped packets, as identified by gaps in packet sequence numbers. - 'dup pkts': # Total duplicate packets received. Only an estimate, but never less than - # this value. - 'eid': # Entity ID - 'elapsed': # Amount of time (seconds) this endpoint has been running (or ran.) - 'entity id': # Entity ID - 'jitter': # Exponential decaying average jitter calculated per RFC3393(old_jitter * - # 15/16 + new_jitter * 1/16) - 'max pdu': # The maximum write size.For Ethernet protocols, this is the entire - # Ethernet frame. For UDP, it is the UDP payload size, and for TCP, it - # just means the maximum amount of data that is written per socket - # write.In all cases, the packets on the wire will not exceed theport's - # MTU + Ethernet-Header-Size (typically 1514 for Ethernet) - 'max rate': # Maximum desired transmit rate, in bits per second (bps). - 'min pdu': # The minimum write size.For Ethernet protocols, this is the entire - # Ethernet frame. For UDP, it is the UDP payload size, and for TCP, it - # just means the maximum amount of data that is written per socket - # write.In all cases, the packets on the wire will not exceed theport's - # MTU + Ethernet-Header-Size (typically 1514 for Ethernet) - 'min rate': # Minimum desired transmit rate, in bits per second (bps). - 'mng': # Is the Endpoint managed or not? - 'name': # Endpoint's Name. - 'ooo pkts': # Total out of order packets received. Only an estimate, but never less - # than this value. - 'pattern': # Pattern of bytes this endpoint transmits. - 'pdu/s rx': # Received PDU per second.This counts the protocol reads, such as UDP - # PDUs. - 'pdu/s tx': # Transmitted PDU per second.This counts the protocol writes, such as UDP - # PDUs. - 'pps rx ll': # Estimated total received packets per second (on the wire).For TCP, this - # is an estimate.UDP and Ethernet protocols should be quite accurate on - # normal networks. - 'pps tx ll': # Estimated total transmitted packets per second (on the wire).For TCP, - # this is an estimate.UDP and Ethernet protocols should be quite accurate - # on normal networks. - 'rcv buf': # Configured/Actual values for receiving buffer size (bytes). - 'replays': # Total number of files replayed. - 'run': # Is the Endpoint is Running or not. - 'rx ber': # Received bit-errors. These are only calculated in the LANforge payload - # portion starting 28 bytes into the UDP or TCP payload. In addition, the - # bit-errors are only checked when LANforge CRCis enabled and detected to - # be invalid. If the 28-byte header is corrupted, LANforge will not - # detectit, and may also give false positives for other packet errors. - # Bit-Errors are only calculated forcertain payload patterns: Increasing, - # Decreasing, Zeros, Ones, and the PRBS patterns. - 'rx bytes': # Total received bytes count. - 'rx drop %': # Percentage of packets that should have been received by Endpoint, but - # were not, as calculated by the Cross-Connect. - 'rx dup %': # Percentage of duplicate packets, as detected by sequence numbers. - 'rx ooo %': # Percentage of packets received out of order, as detected by sequence - # numbers. - 'rx pdus': # Total received PDU count.This counts the protocol reads, such as UDP - # PDUs (aka goodput). - 'rx pkts ll': # Estimated total received packet count (on the wire).For TCP, this is an - # estimate.UDP and Ethernet protocols should be quite accurate on normal - # networks. - 'rx rate': # Real receive rate (bps) for this run.This includes only the protocol - # payload (goodput). - 'rx rate (1 min)': # Real receive rate (bps) over the last minute.This includes only the - # protocol payload (goodput). - 'rx rate (last)': # Real receive rate (bps) over the last report interval.This includes only - # the protocol payload (goodput). - 'rx rate ll': # Estimated low-level receive rate (bps) over the last minute.This - # includes any Ethernet, IP, TCP, UDP or similar headers. - 'rx wrong dev': # Total packets received on the wrong device (port). - 'script': # Endpoint script state. - 'send buf': # Configured/Actual values for sending buffer size (bytes). - 'source addr': # - 'tcp mss': # Sender's TCP-MSS (max segment size) setting.This cooresponds to the - # TCP_MAXSEGS socket option,and TCP-MSS plus 54 is the maximum packet size - # on the wirefor Ethernet frames.This is a good option to efficiently - # limit TCP packet size. - 'tcp rtx': # Total packets retransmitted by the TCP stack for this connection.These - # were likely dropped or corrupted in transit. - 'tx bytes': # Total transmitted bytes count. - 'tx pdus': # Total transmitted PDU count.This counts the protocol writes, such as UDP - # PDUs (aka goodput). - 'tx pkts ll': # Estimated total transmitted packet count (on the wire).For TCP, this is - # an estimate.UDP and Ethernet protocols should be quite accurate on - # normal networks. - 'tx rate': # Real transmit rate (bps) for this run.This includes only the protocol - # payload (goodput). - 'tx rate (1 min)': # Real transmit rate (bps) over the last minute.This includes only the - # protocol payload (goodput). - 'tx rate (last)': # Real transmit rate (bps) over the last report interval.This includes - # only the protocol payload (goodput). - 'tx rate ll': # Estimated low-level transmit rate (bps) over the last minute.This - # includes any Ethernet, IP, TCP, UDP or similar headers. - } - ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - - def get_endp(self, - eid_list=None, - requested_col_names=(), - debug_=False): - debug_ |= self.debug - url = "/endp" - if (eid_list is None) or (len(eid_list) < 1): - raise ValueError("no entity id in request") - trimmed_fields = [] - if isinstance(requested_col_names, str): - if not requested_col_names.strip(): - raise ValueError("column name cannot be blank") - trimmed_fields.append(requested_col_names.strip()) - if isinstance(requested_col_names, list): - for field in requested_col_names: - if not field.strip(): - raise ValueError("column names cannot be blank") - field = field.strip() - if field.find(" ") > -1: - raise ValueError("field should be URL encoded: [%s]" % field) - trimmed_fields.append(field) - url += self.make_eid_url(eid_list=eid_list) - - if len(trimmed_fields) > 0: - url += "?fields=%s" % (",".join(trimmed_fields)) - - response = self.json_get(url, debug_=debug_) - if response is None: - return None - return self.extract_values(response=response, - singular_key="endpoint", - plural_key="endpoint") - # - """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Notes for type requests - - If you need to call the URL directly, - request one of these URLs: - /events/ - /events/$event_id - /events/before/$event_id - /events/between/$start_event_id/$end_event_id - /events/last/$event_count - /events/since/$event_id - - When requesting specific column names, they need to be URL encoded: - eid, entity+id, event, event+description, id, name, priority, time-stamp, - type - Example URL: /events?fields=eid,entity+id - - Example py-json call (it knows the URL): - record = LFJsonGet.get_events(eid_list=['1.234', '1.344'], - requested_col_names=['entity id'], - debug_=True) - - The record returned will have these members: - { - 'eid': # Time at which this event was created.This uses the clock on the source - # machine. - 'entity id': # Entity IdentifierExact format depends on the - # type.(shelf.resource.port.endpoint.extra) - 'event': # Event Type - 'event description': # Text description for this event. - 'id': # Unique ID for this event. - 'name': # Name of the entity associated with this event. - 'priority': # Event priority. - 'time-stamp': # Time at which this event was created.This uses the clock on the source - # machine. - 'type': # Entity type. - } - ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - - def get_events(self, - eid_list=None, - requested_col_names=(), - debug_=False): - debug_ |= self.debug - url = "/events" - if (eid_list is None) or (len(eid_list) < 1): - raise ValueError("no entity id in request") - trimmed_fields = [] - if isinstance(requested_col_names, str): - if not requested_col_names.strip(): - raise ValueError("column name cannot be blank") - trimmed_fields.append(requested_col_names.strip()) - if isinstance(requested_col_names, list): - for field in requested_col_names: - if not field.strip(): - raise ValueError("column names cannot be blank") - field = field.strip() - if field.find(" ") > -1: - raise ValueError("field should be URL encoded: [%s]" % field) - trimmed_fields.append(field) - url += self.make_eid_url(eid_list=eid_list) - - if len(trimmed_fields) > 0: - url += "?fields=%s" % (",".join(trimmed_fields)) - - response = self.json_get(url, debug_=debug_) - if response is None: - return None - return self.extract_values(response=response, - singular_key="alert", - plural_key="alerts") - # - """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Notes for type requests - - If you need to call the URL directly, - request one of these URLs: - /fileio/ - /fileio/$endp_id - - When requesting specific column names, they need to be URL encoded: - buf-rd, buf-wr, bytes-rd, bytes-wr, crc+fail, eid, entity+id, files+%23, files-read, - files-wr, io+fail, max-file-sz, max-rd-bps, max-rw-sz, max-wr-bps, min-file-sz, - min-rd-bps, min-rw-sz, min-wr-bps, name, read-bps, rpt+timer, rx-bps-20s, - status, tx-bps-20s, type, write-bps - Example URL: /fileio?fields=buf-rd,buf-wr - - Example py-json call (it knows the URL): - record = LFJsonGet.get_fileio(eid_list=['1.234', '1.344'], - requested_col_names=['entity id'], - debug_=True) - - The record returned will have these members: - { - 'buf-rd': # Buffer reads. When doing CRC, it takes two reads per 'packet', because - # we first read the header, then the payload. Non-CRC reads ignore the - # header. - 'buf-wr': # Buffer writes. - 'bytes-rd': # Bytes read. - 'bytes-wr': # Bytes written. - 'crc fail': # 32-bit CRC Errors detected upon READ. - 'eid': # Entity ID - 'entity id': # Entity ID - 'files #': # Number of files to write. - 'files-read': # Files read. - 'files-wr': # Files written. - 'io fail': # Amount of time in miliseconds this test has been experiencing IO - # failures. - 'max-file-sz': # Maximum configured file size (bytes). - 'max-rd-bps': # Maximum configured read rate (bps). - 'max-rw-sz': # Maximum configured size for each call to read(2) or write(2) (bytes). - 'max-wr-bps': # Maximum configured write rate (bps). - 'min-file-sz': # Minimum configured file size (bytes). - 'min-rd-bps': # Minimum configured read rate (bps). - 'min-rw-sz': # Minimum configured size for each call to read(2) or write(2) (bytes). - 'min-wr-bps': # Minimum configured write rate (bps). - 'name': # File Endpoint's Name. - 'read-bps': # File read rate for this endpoint over the duration of the test. - 'rpt timer': # Report Timer (milliseconds).This is how often the GUI will ask for - # updates from the LANforge processes.If the GUI is sluggish, increasing - # the report timers may help. - 'rx-bps-20s': # File read rate for this endpoint over the last 20 seconds. - 'status': # Current State of the connection.UninitializedHas not yet been - # started/stopped.InitializingBeing set up.StartingStarting the - # test.RunningTest is actively running.StoppedTest has been - # stopped.QuiesceTest will gracefully stop soon.HW-BYPASSTest is in - # hardware-bypass mode (WanLinks only)FTM_WAITTest wants to run, but is - # phantom, probably due to non-existent interface or resource.WAITINGWill - # restart as soon as resources are available.PHANTOMTest is stopped, and - # is phantom, probably due to non-existent interface or resource. - 'tx-bps-20s': # File write rate for this endpoint over the last 20 seconds. - 'type': # The specific type of this File Endpoint. - 'write-bps': # File write rate for this endpoint over the duration of the test. - } - ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - - def get_fileio(self, - eid_list=None, - requested_col_names=(), - debug_=False): - debug_ |= self.debug - url = "/fileio" - if (eid_list is None) or (len(eid_list) < 1): - raise ValueError("no entity id in request") - trimmed_fields = [] - if isinstance(requested_col_names, str): - if not requested_col_names.strip(): - raise ValueError("column name cannot be blank") - trimmed_fields.append(requested_col_names.strip()) - if isinstance(requested_col_names, list): - for field in requested_col_names: - if not field.strip(): - raise ValueError("column names cannot be blank") - field = field.strip() - if field.find(" ") > -1: - raise ValueError("field should be URL encoded: [%s]" % field) - trimmed_fields.append(field) - url += self.make_eid_url(eid_list=eid_list) - - if len(trimmed_fields) > 0: - url += "?fields=%s" % (",".join(trimmed_fields)) - - response = self.json_get(url, debug_=debug_) - if response is None: - return None - return self.extract_values(response=response, - singular_key="endpoint", - plural_key="endpoint") - # - """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Notes for type requests - - If you need to call the URL directly, - request one of these URLs: - /generic/ - /generic/$endp_id - - When requesting specific column names, they need to be URL encoded: - bps+rx, bps+tx, command, dropped, eid, elapsed, entity+id, last+results, - name, pdu%2Fs+rx, pdu%2Fs+tx, rpt+timer, rpt%23, rx+bytes, rx+pkts, status, tx+bytes, - tx+pkts, type - Example URL: /generic?fields=bps+rx,bps+tx - - Example py-json call (it knows the URL): - record = LFJsonGet.get_generic(eid_list=['1.234', '1.344'], - requested_col_names=['entity id'], - debug_=True) - - The record returned will have these members: - { - 'bps rx': # Receive rate reported by this endpoint. - 'bps tx': # Transmit rate reported by this endpoint. - 'command': # The command that this endpoint executes. - 'dropped': # Dropped PDUs reported by this endpoint. - 'eid': # Entity ID - 'elapsed': # Amount of time (seconds) this endpoint has been running (or ran.) - 'entity id': # Entity ID - 'last results': # Latest output from the Generic Endpoint. - 'name': # Endpoint's Name. - 'pdu/s rx': # Received packets-per-second reported by this endpoint. - 'pdu/s tx': # Transmitted packets-per-second reported by this endpoint. - 'rpt timer': # Report Timer (milliseconds).This is how often the GUI will ask for - # updates from the LANforge processes.If the GUI is sluggish, increasing - # the report timers may help. - 'rpt#': # The N_th report that we have received. (Some cmds will produce only one - # report, others will produce continuous reports.) - 'rx bytes': # Received bytes reported by this endpoint. - 'rx pkts': # Received PDUs reported by this endpoint. - 'status': # Current State of the connection.UninitializedHas not yet been - # started/stopped.InitializingBeing set up.StartingStarting the - # test.RunningTest is actively running.StoppedTest has been - # stopped.QuiesceTest will gracefully stop soon.HW-BYPASSTest is in - # hardware-bypass mode (WanLinks only)FTM_WAITTest wants to run, but is - # phantom, probably due to non-existent interface or resource.WAITINGWill - # restart as soon as resources are available.PHANTOMTest is stopped, and - # is phantom, probably due to non-existent interface or resource. - 'tx bytes': # Transmitted bytes reported by this endpoint. - 'tx pkts': # Transmitted PDUs reported by this endpoint. - 'type': # The specific type of this Generic Endpoint. - } - ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - - def get_generic(self, - eid_list=None, - requested_col_names=(), - debug_=False): - debug_ |= self.debug - url = "/generic" - if (eid_list is None) or (len(eid_list) < 1): - raise ValueError("no entity id in request") - trimmed_fields = [] - if isinstance(requested_col_names, str): - if not requested_col_names.strip(): - raise ValueError("column name cannot be blank") - trimmed_fields.append(requested_col_names.strip()) - if isinstance(requested_col_names, list): - for field in requested_col_names: - if not field.strip(): - raise ValueError("column names cannot be blank") - field = field.strip() - if field.find(" ") > -1: - raise ValueError("field should be URL encoded: [%s]" % field) - trimmed_fields.append(field) - url += self.make_eid_url(eid_list=eid_list) - - if len(trimmed_fields) > 0: - url += "?fields=%s" % (",".join(trimmed_fields)) - - response = self.json_get(url, debug_=debug_) - if response is None: - return None - return self.extract_values(response=response, - singular_key="endpoint", - plural_key="endpoints") - # - """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Notes for type requests - - If you need to call the URL directly, - request one of these URLs: - /gui-cli/ - - - Example py-json call (it knows the URL): - record = LFJsonGet.get_gui_cli(eid_list=['1.234', '1.344'], - debug_=True) - ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - - def get_gui_cli(self, - eid_list=None, - requested_col_names=(), - debug_=False): - debug_ |= self.debug - url = "/gui-cli" - if (eid_list is None) or (len(eid_list) < 1): - raise ValueError("no entity id in request") - trimmed_fields = [] - if isinstance(requested_col_names, str): - if not requested_col_names.strip(): - raise ValueError("column name cannot be blank") - trimmed_fields.append(requested_col_names.strip()) - if isinstance(requested_col_names, list): - for field in requested_col_names: - if not field.strip(): - raise ValueError("column names cannot be blank") - field = field.strip() - if field.find(" ") > -1: - raise ValueError("field should be URL encoded: [%s]" % field) - trimmed_fields.append(field) - url += self.make_eid_url(eid_list=eid_list) - - if len(trimmed_fields) > 0: - url += "?fields=%s" % (",".join(trimmed_fields)) - - response = self.json_get(url, debug_=debug_) - if response is None: - return None - return self.extract_values(response=response, - singular_key="", - plural_key="") - # - """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Notes for type requests - - If you need to call the URL directly, - request one of these URLs: - /layer4/ - /layer4/$endp_id - - When requesting specific column names, they need to be URL encoded: - %21conn, acc.+denied, bad-proto, bad-url, bytes-rd, bytes-wr, dns-avg, dns-max, - dns-min, eid, elapsed, entity+id, fb-avg, fb-max, fb-min, ftp-host, ftp-port, - ftp-stor, http-p, http-r, http-t, login-denied, name, nf+%284xx%29, other-err, - read, redir, rpt+timer, rslv-h, rslv-p, rx+rate, rx+rate+%281%C2%A0min%29, status, - timeout, total-err, total-urls, tx+rate, tx+rate+%281%C2%A0min%29, type, uc-avg, - uc-max, uc-min, urls%2Fs, write # hidden columns: - rpt-time - Example URL: /layer4?fields=%21conn,acc.+denied - - Example py-json call (it knows the URL): - record = LFJsonGet.get_layer4(eid_list=['1.234', '1.344'], - requested_col_names=['entity id'], - debug_=True) - - The record returned will have these members: - { - '!conn': # Could not establish connection. - 'acc. denied': # Access Access Denied Error.This could be password, user-name, - # file-permissions or other error. - 'bad-proto': # Bad protocol. - 'bad-url': # Bad URL format. - 'bytes-rd': # Bytes read. - 'bytes-wr': # Bytes written. - 'dns-avg': # Average time in milliseconds to complete resolving the DNS lookupfor the - # last 100 requests. - 'dns-max': # Maximum time in milliseconds to complete resolving the DNS lookupfor - # requests made in the last 30 seconds. - 'dns-min': # Minimum time in milliseconds to complete resolving the DNS lookupfor - # requests made in the last 30 seconds. - 'eid': # EID - 'elapsed': # Amount of time (seconds) this endpoint has been running (or ran.) - 'entity id': # Entity ID - 'fb-avg': # Average time in milliseconds for receiving the first byte of the URLfor - # the last 100 requests. - 'fb-max': # Maximum time in milliseconds for receiving the first byte of the URLfor - # requests made in the last 30 seconds. - 'fb-min': # Minimum time in milliseconds for receiving the first byte of the URLfor - # requests made in the last 30 seconds. - 'ftp-host': # FTP HOST Error - 'ftp-port': # FTP PORT Error. - 'ftp-stor': # FTP STOR Error. - 'http-p': # HTTP Post error. - 'http-r': # HTTP RANGE error. - 'http-t': # HTTP PORT Error. - 'login-denied': # Login attempt was denied.Probable cause is user-name or password errors. - 'name': # Endpoint's Name. - 'nf (4xx)': # File not found.For HTTP, an HTTP 4XX error was returned. This is only - # counted when the endpoint has 'Enable 4XX' selected.Includes 403 - # permission denied and 404 not found errors.For other protocols, it - # should be returned any time a file is not found. - 'other-err': # Error not otherwise specified. The actual error code may be found - # inl4helper logs. Contact support if you see these errors:we would like - # to account for all possible errors. - 'read': # Error attempting to read file or URL. - 'redir': # Noticed redirect loop! - 'rpt timer': # Cross Connect's Report Timer (milliseconds).This is how often the GUI - # will ask for updates from the LANforge processes.If the GUI is sluggish, - # increasing the report timers may help. - 'rslv-h': # Couldn't resolve host. - 'rslv-p': # Couldn't resolve Proxy. - 'rx rate': # Payload receive rate (bps). - 'rx rate (1 min)': # Payload receive rate over the last minute (bps). - 'status': # Current State of the connection.UninitializedHas not yet been - # started/stopped.InitializingBeing set up.StartingStarting the - # test.RunningTest is actively running.StoppedTest has been - # stopped.QuiesceTest will gracefully stop soon.HW-BYPASSTest is in - # hardware-bypass mode (WanLinks only)FTM_WAITTest wants to run, but is - # phantom, probably due to non-existent interface or resource.WAITINGWill - # restart as soon as resources are available.PHANTOMTest is stopped, and - # is phantom, probably due to non-existent interface or resource. - 'timeout': # Operation timed out. - 'total-err': # Total Errors. - 'total-urls': # URLs processed. - 'tx rate': # Payload transmit rate (bps). - 'tx rate (1 min)': # Payload transmit rate over the last minute (bps). - 'type': # The specific type of this Layer 4-7 Endpoint. - 'uc-avg': # Average time in milliseconds to complete processing of the URLfor the - # last 100 requests. - 'uc-max': # Maximum time in milliseconds to complete processing of the URLfor - # requests made in the last 30 seconds. - 'uc-min': # Minimum time in milliseconds to complete processing of the URLfor - # requests made in the last 30 seconds. - 'urls/s': # URLs processed per second over the last minute. - 'write': # Error attempting to write file or URL. - } - ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - - def get_layer4(self, - eid_list=None, - requested_col_names=(), - debug_=False): - debug_ |= self.debug - url = "/layer4" - if (eid_list is None) or (len(eid_list) < 1): - raise ValueError("no entity id in request") - trimmed_fields = [] - if isinstance(requested_col_names, str): - if not requested_col_names.strip(): - raise ValueError("column name cannot be blank") - trimmed_fields.append(requested_col_names.strip()) - if isinstance(requested_col_names, list): - for field in requested_col_names: - if not field.strip(): - raise ValueError("column names cannot be blank") - field = field.strip() - if field.find(" ") > -1: - raise ValueError("field should be URL encoded: [%s]" % field) - trimmed_fields.append(field) - url += self.make_eid_url(eid_list=eid_list) - - if len(trimmed_fields) > 0: - url += "?fields=%s" % (",".join(trimmed_fields)) - - response = self.json_get(url, debug_=debug_) - if response is None: - return None - return self.extract_values(response=response, - singular_key="endpoint", - plural_key="endpoint") - # - """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Notes for type requests - - If you need to call the URL directly, - request one of these URLs: - /port/ - /port/$shelf_id - /port/$shelf_id/$resource_id - /port/$shelf_id/$resource_id/$port_id - /portprobe/ - /portprobe/$shelf_id/$resource_id/$port_id - /ports/ - /ports/$shelf_id - /ports/$shelf_id/$resource_id - /ports/$shelf_id/$resource_id/$port_id - - When requesting specific column names, they need to be URL encoded: - 4way+time+%28us%29, activity, alias, anqp+time+%28us%29, ap, beacon, bps+rx, bps+rx+ll, - bps+tx, bps+tx+ll, bytes+rx+ll, bytes+tx+ll, channel, collisions, connections, - crypt, cx+ago, cx+time+%28us%29, device, dhcp+%28ms%29, down, entity+id, gateway+ip, - ip, ipv6+address, ipv6+gateway, key%2Fphrase, login-fail, login-ok, logout-fail, - logout-ok, mac, mask, misc, mode, mtu, no+cx+%28us%29, noise, parent+dev, phantom, - port, port+type, pps+rx, pps+tx, qlen, reset, retry+failed, rx+bytes, rx+crc, - rx+drop, rx+errors, rx+fifo, rx+frame, rx+length, rx+miss, rx+over, rx+pkts, - rx-rate, sec, signal, ssid, status, time-stamp, tx+abort, tx+bytes, tx+crr, - tx+errors, tx+fifo, tx+hb, tx+pkts, tx+wind, tx-failed+%25, tx-rate, wifi+retries, - # hidden columns: - beacon_rx_signal, port_cur_flags_h, port_cur_flags_l, port_supported_flags_h, - port_supported_flags_l, resource, rx_multicast, tx_dropped - Example URL: /port?fields=4way+time+%28us%29,activity - - Example py-json call (it knows the URL): - record = LFJsonGet.get_port(eid_list=['1.234', '1.344'], - requested_col_names=['entity id'], - debug_=True) - - The record returned will have these members: - { - '4way time (us)': # TIme (in micro-seconds) it took to complete the last WiFi 4-way - # authentication. - 'activity': # Percent of the channel that is utilized over the last minute.This - # includes locally generated traffic as well as anyother systems active on - # this channel.This is a per-radio value. - 'alias': # User-specified alias for this Port. - 'anqp time (us)': # Time (in micro-seconds) it took to complete the last WiFi ANQP - # request/response session. - 'ap': # BSSID of AP for connected stations. - 'beacon': # Number of Wireless beacons from Cell or AP that have been missed. - 'bps rx': # Average bits per second received for the last 30 seconds. - 'bps rx ll': # Bits per second received, including low-level framing (Ethernet Only). - 'bps tx': # Average bits per second transmitted for the last 30 seconds. - 'bps tx ll': # Bits per second transmitted, including low-level framing (Ethernet - # Only). - 'bytes rx ll': # Bytes received, including low-level framing (Ethernet Only). - 'bytes tx ll': # Bytes transmitted, including low-level framing (Ethernet Only). - 'channel': # Channel at the device is currently on, if known. - 'collisions': # Total number of collisions reported by this Interface.For WiFi devices, - # this is number of re-transmit attempts. - 'connections': # Number of wireless connections completed. - 'crypt': # Number of Wireless packets dropped due to inability to decrypt. - 'cx ago': # How long ago was the last WiFi connection attempt started?This relates - # only to the network interface, not any higher level protocol traffic - # upon it. - 'cx time (us)': # Time (in micro-seconds) it took to complete the last WiFi connection to - # the AP. - 'device': # Ethernet device name, as seen by the kernel. - 'dhcp (ms)': # Time (in miliseconds) it took to acquire DHCP lease,or to time out while - # trying to acquire lease. - 'down': # The interface is configured DOWN. It must be configured UP to be in - # active use. - 'entity id': # Entity ID - 'gateway ip': # Default Router/Gateway IP for the Interface. - 'ip': # IP Address of the Interface. - 'ipv6 address': # IPv6 Address for this interface. If global-scope address exists, it - # will be displayed,otherwise link-local will be displayed. - 'ipv6 gateway': # IPv6 default gateway. - 'key/phrase': # WEP Key or WPA Phrase (if enabled). - 'login-fail': # The 'ifup-post' script reported failure. This is usually used for WiFi - # portallogins, but may be customized by the user for other needs. - 'login-ok': # The 'ifup-post' script reported OK. This is usually used for WiFi - # portallogins, but may be customized by the user for other needs. - 'logout-fail': # The 'ifup-post --logout' script reported failure. This is usually used - # for WiFi portallogouts, but may be customized by the user for other - # needs. - 'logout-ok': # The 'ifup-post --logout' script reported OK. This is usually used for - # WiFi portallogouts, but may be customized by the user for other needs. - 'mac': # Ethernet MAC address of the Interface. - 'mask': # IP Mask of the Interface. - 'misc': # Number of Wireless packets dropped on receive due to unspecified - # reasons. - 'mode': # Wireless radio mode (802.11a/b/g). - 'mtu': # MTU (Maximum Transmit Unit) size, in bytes. - 'no cx (us)': # How long was the WiFi disconnect duration for the last disconnection? - 'noise': # Wireless noise level. - 'parent dev': # Parent device or port of this port. Blank if this device is not a child - # of another device or port. - 'phantom': # Is the port PHANTOM (no hardware found) or not. - 'port': # Entity ID - 'port type': # Ports can be Ethernet, Radio, vAP, vSTA, Redirect, or Bridges - 'pps rx': # Average packets per second received for the last 30 seconds. - 'pps tx': # Average packets per second transmitted for the last 30 seconds. - 'qlen': # "Transmit Queue Length for this Interface. - 'reset': # Current Reset-State. - 'retry failed': # Number of Wireless packets that the interface failed to send due to - # excessive retries. - 'rx bytes': # Total number of bytes received by this Interface. - 'rx crc': # Total number of packets dropped because of a bad CRC/FCS. - 'rx drop': # Total number of dropped packets on recieve. Usually means driver/kernel - # is being over-worked. - 'rx errors': # Total number of all types of Receive Errors. - 'rx fifo': # Total number of packets dropped because driver/kernel queues are full. - 'rx frame': # Total number of packets dropped because of framing errors at the - # physical layer. - 'rx length': # Total number of packets dropped because their length was invalid. - 'rx miss': # Total number of packets dropped because of a missed interrupt. - 'rx over': # Total number of packets dropped because of framing errors at the - # physical layer. - 'rx pkts': # Total number of packets received by this Interface. - 'rx-rate': # Reported network device RX link speed. - 'sec': # Number of secondary IP addresses configured or detected. - 'signal': # Wireless signal strength (RSSI). - 'ssid': # WiFi SSID identifier.Use [BLANK] for empty SSID, which means use any - # available SSID when associating. - 'status': # Wireless link status. - 'time-stamp': # Time-Stamp - 'tx abort': # Total packets dropped on transmit because of driver abort. - 'tx bytes': # Total number of bytes sent by this Interface. - 'tx crr': # Total packets dropped on transmit because of carrier error. - 'tx errors': # Total number of all types of Transmit Errors. - 'tx fifo': # Total packets dropped on transmit because outgoing queue was full. - 'tx hb': # Total packets dropped on transmit because of transceiver heartbeat - # errors. - 'tx pkts': # Total number of packets sent by this Interface. - 'tx wind': # Total number dropped on transmit because of Out-of-Window collision. - 'tx-failed %': # Percentage of transmitted Wireless packets that were not ACKed.They - # might have succeeded on retry. - 'tx-rate': # Reported network device TX link speed. - 'wifi retries': # Number of Wireless packets that the wifi radio retried.One packet may be - # tried multiple times and each try would be counted in this stat.Not all - # radios can properly report this statistic. - } - ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - - def get_port(self, - eid_list=None, - requested_col_names=(), - debug_=False): - debug_ |= self.debug - url = "/port" - if (eid_list is None) or (len(eid_list) < 1): - raise ValueError("no entity id in request") - trimmed_fields = [] - if isinstance(requested_col_names, str): - if not requested_col_names.strip(): - raise ValueError("column name cannot be blank") - trimmed_fields.append(requested_col_names.strip()) - if isinstance(requested_col_names, list): - for field in requested_col_names: - if not field.strip(): - raise ValueError("column names cannot be blank") - field = field.strip() - if field.find(" ") > -1: - raise ValueError("field should be URL encoded: [%s]" % field) - trimmed_fields.append(field) - url += self.make_eid_url(eid_list=eid_list) - - if len(trimmed_fields) > 0: - url += "?fields=%s" % (",".join(trimmed_fields)) - - response = self.json_get(url, debug_=debug_) - if response is None: - return None - return self.extract_values(response=response, - singular_key="interface", - plural_key="interfaces") - # - """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Notes for type requests - - If you need to call the URL directly, - request one of these URLs: - /probe/ - /probe/$shelf_id/$resource_id/$port_id - - When requesting specific column names, they need to be URL encoded: - entity+id, probe+results - Example URL: /probe?fields=entity+id,probe+results - - Example py-json call (it knows the URL): - record = LFJsonGet.get_probe(eid_list=['1.234', '1.344'], - requested_col_names=['probe results'], - debug_=True) - - The record returned will have these members: - { - 'entity id': # Entity ID - 'probe results': # Probe the low level information about the port. - } - ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - - def get_probe(self, - eid_list=None, - requested_col_names=(), - debug_=False): - debug_ |= self.debug - url = "/probe" - if (eid_list is None) or (len(eid_list) < 1): - raise ValueError("no entity id in request") - trimmed_fields = [] - if isinstance(requested_col_names, str): - if not requested_col_names.strip(): - raise ValueError("column name cannot be blank") - trimmed_fields.append(requested_col_names.strip()) - if isinstance(requested_col_names, list): - for field in requested_col_names: - if not field.strip(): - raise ValueError("column names cannot be blank") - field = field.strip() - if field.find(" ") > -1: - raise ValueError("field should be URL encoded: [%s]" % field) - trimmed_fields.append(field) - url += self.make_eid_url(eid_list=eid_list) - - if len(trimmed_fields) > 0: - url += "?fields=%s" % (",".join(trimmed_fields)) - - response = self.json_get(url, debug_=debug_) - if response is None: - return None - return self.extract_values(response=response, - singular_key="probe-results", - plural_key="probe-results") - # - """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Notes for type requests - - If you need to call the URL directly, - request one of these URLs: - /quit - - - Example py-json call (it knows the URL): - record = LFJsonGet.get_quit(eid_list=['1.234', '1.344'], - debug_=True) - ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - - def get_quit(self, - eid_list=None, - requested_col_names=(), - debug_=False): - debug_ |= self.debug - url = "/quit" - if (eid_list is None) or (len(eid_list) < 1): - raise ValueError("no entity id in request") - trimmed_fields = [] - if isinstance(requested_col_names, str): - if not requested_col_names.strip(): - raise ValueError("column name cannot be blank") - trimmed_fields.append(requested_col_names.strip()) - if isinstance(requested_col_names, list): - for field in requested_col_names: - if not field.strip(): - raise ValueError("column names cannot be blank") - field = field.strip() - if field.find(" ") > -1: - raise ValueError("field should be URL encoded: [%s]" % field) - trimmed_fields.append(field) - url += self.make_eid_url(eid_list=eid_list) - - if len(trimmed_fields) > 0: - url += "?fields=%s" % (",".join(trimmed_fields)) - - response = self.json_get(url, debug_=debug_) - if response is None: - return None - return self.extract_values(response=response, - singular_key="", - plural_key="") - # - """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Notes for type requests - - If you need to call the URL directly, - request one of these URLs: - /radiostatus/ - /radiostatus/$eid - /radiostatus/$shelf_id/$resource_id/$port_id - - When requesting specific column names, they need to be URL encoded: - _links, antenna, ap, capabilities, channel, country, driver, entity+id, firmware+version, - frag, frequency, max_sta, max_vap, max_vifs, monitors_down, monitors_up, - phantom, port, resource, rts, stations_down, stations_up, tx-power, vaps_down, - vaps_up, verbose+debug - Example URL: /radiostatus?fields=_links,antenna - - Example py-json call (it knows the URL): - record = LFJsonGet.get_radiostatus(eid_list=['1.234', '1.344'], - requested_col_names=['firmware version'], - debug_=True) - - The record returned will have these members: - { - '_links': # - - 'antenna': # - - 'ap': # - - 'capabilities': # - - 'channel': # - - 'country': # - - 'driver': # - - 'entity id': # - - 'firmware version': # - - 'frag': # - - 'frequency': # - - 'max_sta': # - - 'max_vap': # - - 'max_vifs': # - - 'monitors_down': # - - 'monitors_up': # - - 'phantom': # - - 'port': # - - 'resource': # - - 'rts': # - - 'stations_down': # - - 'stations_up': # - - 'tx-power': # - - 'vaps_down': # - - 'vaps_up': # - - 'verbose debug': # - - } - ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - - def get_radiostatus(self, - eid_list=None, - requested_col_names=(), - debug_=False): - debug_ |= self.debug - url = "/radiostatus" - if (eid_list is None) or (len(eid_list) < 1): - raise ValueError("no entity id in request") - trimmed_fields = [] - if isinstance(requested_col_names, str): - if not requested_col_names.strip(): - raise ValueError("column name cannot be blank") - trimmed_fields.append(requested_col_names.strip()) - if isinstance(requested_col_names, list): - for field in requested_col_names: - if not field.strip(): - raise ValueError("column names cannot be blank") - field = field.strip() - if field.find(" ") > -1: - raise ValueError("field should be URL encoded: [%s]" % field) - trimmed_fields.append(field) - url += self.make_eid_url(eid_list=eid_list) - - if len(trimmed_fields) > 0: - url += "?fields=%s" % (",".join(trimmed_fields)) - - response = self.json_get(url, debug_=debug_) - if response is None: - return None - return self.extract_values(response=response, - singular_key="radio", - plural_key="radios") - # - """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Notes for type requests - - If you need to call the URL directly, - request one of these URLs: - /resource/ - /resource/$shelf_id - /resource/$shelf_id/$resource_id - - When requesting specific column names, they need to be URL encoded: - bps-rx-3s, bps-tx-3s, cli-port, cpu, ctrl-ip, ctrl-port, eid, entity+id, - free+mem, free+swap, gps, hostname, hw+version, load, max+if-up, max+staged, - mem, phantom, ports, rx+bytes, shelf, sta+up, sw+version, swap, tx+bytes, - # hidden columns: - timestamp - Example URL: /resource?fields=bps-rx-3s,bps-tx-3s - - Example py-json call (it knows the URL): - record = LFJsonGet.get_resource(eid_list=['1.234', '1.344'], - requested_col_names=['entity id'], - debug_=True) - - The record returned will have these members: - { - 'bps-rx-3s': # Rate in bits-per-second that the manager issending management data to - # the resource, averaged over the last 3 seconds.This is TCP payload data, - # and does not count the IP and Ethernet overhead. - 'bps-tx-3s': # Rate in bits-per-second that the manager isreceiving management data - # from the resource, averaged over the last 3 seconds.This is TCP payload - # data, and does not count the IP and Ethernet overhead. - 'cli-port': # Text (telnet) interface IP Port. - 'cpu': # CPU information for the machine. - 'ctrl-ip': # IP Address of the Control Interface. - 'ctrl-port': # Binary interface IP Port. - 'eid': # Resource EID (Shelf.Resource). - 'entity id': # Entity ID - 'free mem': # Free Memory (Kbytes) in the machine. If this is too low, performance - # will be degraded. - 'free swap': # Free Swap (Kbytes) in the machine. If this is too low, performance will - # be degraded. - 'gps': # GPS Info for this machine, if GPS is attached. - 'hostname': # The name for this resource, as reported by the resource. - 'hw version': # Hardware version on the machine. - 'load': # Unix process load.. - 'max if-up': # Max number of interface-config scripts try to run at once. - 'max staged': # Max number of interfaces the system will try to bringup at once. - 'mem': # Total memory (Kbytes) on the machine. - 'phantom': # Is the resource PHANTOM (undiscovered) or not. - 'ports': # All real and phantom ports on this machine. - 'rx bytes': # Total management TCP payload bytes received from the manager process by - # this resource. - 'shelf': # Number of shelf that this resource belongs to. - 'sta up': # Max number of stations to bring up per radio per 0.25s tick. - 'sw version': # LANforge Software version running on the machine. - 'swap': # Total swap space (Kbytes) on the machine. - 'tx bytes': # Total management TCP payload bytes sent from this resource to the - # manager process. - } - ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - - def get_resource(self, - eid_list=None, - requested_col_names=(), - debug_=False): - debug_ |= self.debug - url = "/resource" - if (eid_list is None) or (len(eid_list) < 1): - raise ValueError("no entity id in request") - trimmed_fields = [] - if isinstance(requested_col_names, str): - if not requested_col_names.strip(): - raise ValueError("column name cannot be blank") - trimmed_fields.append(requested_col_names.strip()) - if isinstance(requested_col_names, list): - for field in requested_col_names: - if not field.strip(): - raise ValueError("column names cannot be blank") - field = field.strip() - if field.find(" ") > -1: - raise ValueError("field should be URL encoded: [%s]" % field) - trimmed_fields.append(field) - url += self.make_eid_url(eid_list=eid_list) - - if len(trimmed_fields) > 0: - url += "?fields=%s" % (",".join(trimmed_fields)) - - response = self.json_get(url, debug_=debug_) - if response is None: - return None - return self.extract_values(response=response, - singular_key="resource", - plural_key="resources") - # - """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Notes for type requests - - If you need to call the URL directly, - request one of these URLs: - /scan-results/ - /scan-results/$shelf_id/$resource_id/$port_id - /scan-results/$shelf_id/$resource_id/$port_id/$bssid - /scan/ - /scan/$shelf_id/$resource_id/$port_id - /scan/$shelf_id/$resource_id/$port_id/$bssid - /scanresults/ - /scanresults/$shelf_id/$resource_id/$port_id - /scanresults/$shelf_id/$resource_id/$port_id/$bssid - - - Example py-json call (it knows the URL): - record = LFJsonGet.get_scan(eid_list=['1.234', '1.344'], - debug_=True) - ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - - def get_scan(self, - eid_list=None, - requested_col_names=(), - debug_=False): - debug_ |= self.debug - url = "/scan" - if (eid_list is None) or (len(eid_list) < 1): - raise ValueError("no entity id in request") - trimmed_fields = [] - if isinstance(requested_col_names, str): - if not requested_col_names.strip(): - raise ValueError("column name cannot be blank") - trimmed_fields.append(requested_col_names.strip()) - if isinstance(requested_col_names, list): - for field in requested_col_names: - if not field.strip(): - raise ValueError("column names cannot be blank") - field = field.strip() - if field.find(" ") > -1: - raise ValueError("field should be URL encoded: [%s]" % field) - trimmed_fields.append(field) - url += self.make_eid_url(eid_list=eid_list) - - if len(trimmed_fields) > 0: - url += "?fields=%s" % (",".join(trimmed_fields)) - - response = self.json_get(url, debug_=debug_) - if response is None: - return None - return self.extract_values(response=response, - singular_key="scan-results", - plural_key="scan-results") - # - """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Notes for type requests - - If you need to call the URL directly, - request one of these URLs: - /stations/ - /stations/$mac - - When requesting specific column names, they need to be URL encoded: - ap, auth-for, capabilities, entity+id, idle, roam-duration, rx+bytes, rx+pkts, - rx+rate, signal, station+bssid, tx+bytes, tx+pkts, tx+rate, tx+retries, tx-failed, - - Example URL: /stations?fields=ap,auth-for - - Example py-json call (it knows the URL): - record = LFJsonGet.get_stations(eid_list=['1.234', '1.344'], - requested_col_names=['entity id'], - debug_=True) - - The record returned will have these members: - { - 'ap': # The Port that owns this station. - 'auth-for': # Duration in seconds this station has been authenticated. - 'capabilities': # Station's negotiated capabilities. - 'entity id': # Entity ID - 'idle': # Miliseconds since this station last received a frame from the peer. - 'roam-duration': # The difference between the authenticate-time on the new APand the last - # frame received on old AP, in milliseconds.It is not always possible to - # compute this accurately,especially if traffic is not flowing during the - # roam. - 'rx bytes': # RX Byte counter for this station. - 'rx pkts': # RX Packets counter for this station. - 'rx rate': # Station last received encoding rate. - 'signal': # Station signal quality. - 'station bssid': # Station's MAC address (BSSID). - 'tx bytes': # TX Byte counter for this station. - 'tx pkts': # TX Packets counter for this station. - 'tx rate': # Station transmit encoding rate. - 'tx retries': # TX Retries counter for this station.This counts retries at the driver - # level.Retries made by the WiFi hardware and/or firmware is not counted. - 'tx-failed': # TX Failed counter for this station.This counts TX failures at the driver - # level.The hardware and/or firmware may have made several failed attempts - # that are not included in this counter. - } - ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - - def get_stations(self, - eid_list=None, - requested_col_names=(), - debug_=False): - debug_ |= self.debug - url = "/stations" - if (eid_list is None) or (len(eid_list) < 1): - raise ValueError("no entity id in request") - trimmed_fields = [] - if isinstance(requested_col_names, str): - if not requested_col_names.strip(): - raise ValueError("column name cannot be blank") - trimmed_fields.append(requested_col_names.strip()) - if isinstance(requested_col_names, list): - for field in requested_col_names: - if not field.strip(): - raise ValueError("column names cannot be blank") - field = field.strip() - if field.find(" ") > -1: - raise ValueError("field should be URL encoded: [%s]" % field) - trimmed_fields.append(field) - url += self.make_eid_url(eid_list=eid_list) - - if len(trimmed_fields) > 0: - url += "?fields=%s" % (",".join(trimmed_fields)) - - response = self.json_get(url, debug_=debug_) - if response is None: - return None - return self.extract_values(response=response, - singular_key="station", - plural_key="stations") - # - """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Notes for type requests - - If you need to call the URL directly, - request one of these URLs: - /status-msg/ - /status-msg/$session - /status-msg/$session/$id - /status-msg/$session/$id/ws-msg,... - /status-msg/$session/all - /status-msg/$session/this - /status-msg/sessions - - - Example py-json call (it knows the URL): - record = LFJsonGet.get_status_msg(eid_list=['1.234', '1.344'], - debug_=True) - ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - - def get_status_msg(self, - eid_list=None, - requested_col_names=(), - debug_=False): - debug_ |= self.debug - url = "/status-msg" - if (eid_list is None) or (len(eid_list) < 1): - raise ValueError("no entity id in request") - trimmed_fields = [] - if isinstance(requested_col_names, str): - if not requested_col_names.strip(): - raise ValueError("column name cannot be blank") - trimmed_fields.append(requested_col_names.strip()) - if isinstance(requested_col_names, list): - for field in requested_col_names: - if not field.strip(): - raise ValueError("column names cannot be blank") - field = field.strip() - if field.find(" ") > -1: - raise ValueError("field should be URL encoded: [%s]" % field) - trimmed_fields.append(field) - url += self.make_eid_url(eid_list=eid_list) - - if len(trimmed_fields) > 0: - url += "?fields=%s" % (",".join(trimmed_fields)) - - response = self.json_get(url, debug_=debug_) - if response is None: - return None - return self.extract_values(response=response, - singular_key="sessions/messages", - plural_key="sessions/messages") - # - """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Notes for type requests - - If you need to call the URL directly, - request one of these URLs: - /test-group/ - /test-group/$id - /test-groups/ - /test-groups/$id - - When requesting specific column names, they need to be URL encoded: - cross+connects, entity+id, name, run, script - Example URL: /test-group?fields=cross+connects,entity+id - - Example py-json call (it knows the URL): - record = LFJsonGet.get_test_group(eid_list=['1.234', '1.344'], - requested_col_names=['entity id'], - debug_=True) - - The record returned will have these members: - { - 'cross connects': # List of Test Manager's Cross-Connects. - 'entity id': # Entity ID - 'name': # Test Group's Name. - 'run': # Is Test Group running or not. - 'script': # Endpoint script state. - } - ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - - def get_test_group(self, - eid_list=None, - requested_col_names=(), - debug_=False): - debug_ |= self.debug - url = "/test-group" - if (eid_list is None) or (len(eid_list) < 1): - raise ValueError("no entity id in request") - trimmed_fields = [] - if isinstance(requested_col_names, str): - if not requested_col_names.strip(): - raise ValueError("column name cannot be blank") - trimmed_fields.append(requested_col_names.strip()) - if isinstance(requested_col_names, list): - for field in requested_col_names: - if not field.strip(): - raise ValueError("column names cannot be blank") - field = field.strip() - if field.find(" ") > -1: - raise ValueError("field should be URL encoded: [%s]" % field) - trimmed_fields.append(field) - url += self.make_eid_url(eid_list=eid_list) - - if len(trimmed_fields) > 0: - url += "?fields=%s" % (",".join(trimmed_fields)) - - response = self.json_get(url, debug_=debug_) - if response is None: - return None - return self.extract_values(response=response, - singular_key="groups", - plural_key="groups") - # - """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Notes for type requests - - If you need to call the URL directly, - request one of these URLs: - /text/ - /text/$group - /text/$group/$class - /text/$group/$class/$key - - When requesting specific column names, they need to be URL encoded: - eid, name, text, type - Example URL: /text?fields=eid,name - - Example py-json call (it knows the URL): - record = LFJsonGet.get_text(eid_list=['1.234', '1.344'], - requested_col_names=['text'], - debug_=True) - - The record returned will have these members: - { - 'eid': # - - 'name': # - - 'text': # - - 'type': # - - } - ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - - def get_text(self, - eid_list=None, - requested_col_names=(), - debug_=False): - debug_ |= self.debug - url = "/text" - if (eid_list is None) or (len(eid_list) < 1): - raise ValueError("no entity id in request") - trimmed_fields = [] - if isinstance(requested_col_names, str): - if not requested_col_names.strip(): - raise ValueError("column name cannot be blank") - trimmed_fields.append(requested_col_names.strip()) - if isinstance(requested_col_names, list): - for field in requested_col_names: - if not field.strip(): - raise ValueError("column names cannot be blank") - field = field.strip() - if field.find(" ") > -1: - raise ValueError("field should be URL encoded: [%s]" % field) - trimmed_fields.append(field) - url += self.make_eid_url(eid_list=eid_list) - - if len(trimmed_fields) > 0: - url += "?fields=%s" % (",".join(trimmed_fields)) - - response = self.json_get(url, debug_=debug_) - if response is None: - return None - return self.extract_values(response=response, - singular_key="record", - plural_key="records") - # - """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Notes for type requests - - If you need to call the URL directly, - request one of these URLs: - /voip-endp/ - /voip-endp/$endp_id - /voip-ep/ - /voip-ep/$endp_id - /voip/ - /voip/$cx_id - /voip_endp/ - /voip_endp/$endp_id - /voip_ep/ - /voip_ep/$endp_id - - When requesting specific column names, they need to be URL encoded: - bps+rx+a, bps+rx+b, delay+a+%E2%86%90+b, delay+a+%E2%86%92+b, eid, endpoints+%28a%C2%A0%E2%86%94%C2%A0b%29, - entity+id, jitter+a+%E2%86%90+b, jitter+a+%E2%86%92+b, name, pkt+tx+a%C2%A0%E2%86%90%C2%A0b, - pkt+tx+a%C2%A0%E2%86%92%C2%A0b, rpt+timer, rx+drop+%25+a, rx+drop+%25+b, state, - type - Example URL: /voip?fields=bps+rx+a,bps+rx+b - - Example py-json call (it knows the URL): - record = LFJsonGet.get_voip(eid_list=['1.234', '1.344'], - requested_col_names=['entity id'], - debug_=True) - - The record returned will have these members: - { - 'bps rx a': # Endpoint B's real transmit rate (bps).Measured at the CX Type layer. - 'bps rx b': # Endpoint A's real transmit rate (bps).Measured at the CX Type layer. - 'delay a ← b': # Average Latency in milliseconds for traffic from Endpoint B to Endpoint - # A - 'delay a → b': # Average Latency in milliseconds for traffic from Endpoint A to Endpoint - # B - 'eid': # Entity ID - 'endpoints (a ↔ b)': # Endpoints that make up this Cross Connect. - 'entity id': # Entity ID - 'jitter a ← b': # Average Jitter in milliseconds for traffic from Endpoint B to Endpoint A - 'jitter a → b': # Average Jitter in milliseconds for traffic from Endpoint A to Endpoint B - 'name': # Cross Connect's Name. - 'pkt tx a ← b': # Endpoint B's Packets Transmitted. - 'pkt tx a → b': # Endpoint A's Packets Transmitted. - 'rpt timer': # Cross Connect's Report Timer (milliseconds).This is how often the GUI - # will ask for updates from the LANforge processes.If the GUI is sluggish, - # increasing the report timers may help. - 'rx drop % a': # Endpoint A percentage packet loss.Calculated using the number of PDUs - # Endpoint B sent minus the number Endpoint A received.This number is not - # 100% correct as long as packets are in flight.After a Quiesce of the - # test, the number should be perfectly accurate. - 'rx drop % b': # Endpoint B percentage packet loss.Calculated using the number of PDUs - # Endpoint A sent minus the number Endpoint B received.This number is not - # 100% correct as long as packets are in flight.After a Quiesce of the - # test, the number should be perfectly accurate. - 'state': # Current State of the connection.UninitializedHas not yet been - # started/stopped.InitializingBeing set up.StartingStarting the - # test.RunningTest is actively running.StoppedTest has been - # stopped.QuiesceTest will gracefully stop soon.HW-BYPASSTest is in - # hardware-bypass mode (WanLinks only)FTM_WAITTest wants to run, but is - # phantom, probably due to non-existent interface or resource.WAITINGWill - # restart as soon as resources are available.PHANTOMTest is stopped, and - # is phantom, probably due to non-existent interface or resource. - 'type': # Cross-Connect type. - } - ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - - def get_voip(self, - eid_list=None, - requested_col_names=(), - debug_=False): - debug_ |= self.debug - url = "/voip" - if (eid_list is None) or (len(eid_list) < 1): - raise ValueError("no entity id in request") - trimmed_fields = [] - if isinstance(requested_col_names, str): - if not requested_col_names.strip(): - raise ValueError("column name cannot be blank") - trimmed_fields.append(requested_col_names.strip()) - if isinstance(requested_col_names, list): - for field in requested_col_names: - if not field.strip(): - raise ValueError("column names cannot be blank") - field = field.strip() - if field.find(" ") > -1: - raise ValueError("field should be URL encoded: [%s]" % field) - trimmed_fields.append(field) - url += self.make_eid_url(eid_list=eid_list) - - if len(trimmed_fields) > 0: - url += "?fields=%s" % (",".join(trimmed_fields)) - - response = self.json_get(url, debug_=debug_) - if response is None: - return None - return self.extract_values(response=response, - singular_key="connection", - plural_key="connections") - # - """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Notes for type requests - - If you need to call the URL directly, - request one of these URLs: - /voip-endp/ - /voip-endp/$endp_id - - When requesting specific column names, they need to be URL encoded: - calls+answered, calls+attempted, calls+completed, calls+failed, cf+404, cf+408, - cf+busy, cf+canceled, delay, destination+addr, dropped, dup+pkts, eid, elapsed, - entity+id, jb+cur, jb+over, jb+silence, jb+under, jitter, mng, name, ooo+pkts, - pesq, pesq+bklg, pesq%23, reg+state, rst, rtp+rtt, run, rx+bytes, rx+pkts, - source+addr, state, tx+bytes, tx+pkts, vad+pkts - Example URL: /voip-endp?fields=calls+answered,calls+attempted - - Example py-json call (it knows the URL): - record = LFJsonGet.get_voip_endp(eid_list=['1.234', '1.344'], - requested_col_names=['entity id'], - debug_=True) - - The record returned will have these members: - { - 'calls answered': # Number of calls that where the remote answered - 'calls attempted': # Number of calls that have been attempted - 'calls completed': # Number of calls that have been successfully completed - 'calls failed': # Number of calls that did not succeed for any reason. - 'cf 404': # Number of calls failed for '404': callee not found. - 'cf 408': # Number of calls failed for '408': callee did not answer. - 'cf busy': # Number of calls failed because callee is busy. - 'cf canceled': # Number of calls failed because they were canceled. - 'delay': # Average latency in milliseconds for packets received by this endpoint. - 'destination addr': # Destination Address (MAC, ip/port, VoIP destination). - 'dropped': # Total dropped packets, as identified by gaps in RTP sequence numbers - # (pre jitter buffer). - 'dup pkts': # Total duplicate packets, as identified by RTP sequence numbers (pre - # jitter buffer). - 'eid': # Entity ID - 'elapsed': # Amount of time (seconds) this endpoint has been running (or ran.) - 'entity id': # Entity ID - 'jb cur': # Current number of packets in the jitter buffer waiting to be played / - # Jitter Buffer Size. - 'jb over': # Total times the jitter buffer was given more packets than it could hold. - 'jb silence': # Silence is played when there is no valid voice packet, due to drop, or - # reorder/jitter/latency out of range of the jitter buffer. - 'jb under': # Total times the reader asked for a packet to play but the jitter buffer - # was empty. - 'jitter': # Average interpacket variation, calculated per RFC 1889 A.8. - 'mng': # Is the Endpoint managed or not? - 'name': # Endpoint's Name. - 'ooo pkts': # Total out-of-order packets, as identified by RTP sequence numbers (pre - # jitter buffer). - 'pesq': # PESQ Report score for the PESQ report number (PESQ#). - 'pesq bklg': # PESQ server call processing backlog. - 'pesq#': # The pesq-report-number to which the PESQ value cooresponds. - 'reg state': # Current State of the Endpoint. - 'rst': # How many times has the endpoint been restarted due to abnormal - # termination. - 'rtp rtt': # Round trip latency as reported by RTCP - 'run': # Is the Endpoint is Running or not. - 'rx bytes': # Total received bytes count. - 'rx pkts': # Total received packet count. - 'source addr': # Source Address (MAC, ip/port, VoIP source). - 'state': # Phone registration state - 'tx bytes': # Total transmitted bytes count. - 'tx pkts': # Total transmitted packet count. - 'vad pkts': # Total VAD (Silence Suppression) packets suppressed before transmit. - } - ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - - def get_voip_endp(self, - eid_list=None, - requested_col_names=(), - debug_=False): - debug_ |= self.debug - url = "/voip-endp" - if (eid_list is None) or (len(eid_list) < 1): - raise ValueError("no entity id in request") - trimmed_fields = [] - if isinstance(requested_col_names, str): - if not requested_col_names.strip(): - raise ValueError("column name cannot be blank") - trimmed_fields.append(requested_col_names.strip()) - if isinstance(requested_col_names, list): - for field in requested_col_names: - if not field.strip(): - raise ValueError("column names cannot be blank") - field = field.strip() - if field.find(" ") > -1: - raise ValueError("field should be URL encoded: [%s]" % field) - trimmed_fields.append(field) - url += self.make_eid_url(eid_list=eid_list) - - if len(trimmed_fields) > 0: - url += "?fields=%s" % (",".join(trimmed_fields)) - - response = self.json_get(url, debug_=debug_) - if response is None: - return None - return self.extract_values(response=response, - singular_key="endpoint", - plural_key="endpoints") - # - """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Notes for type requests - - If you need to call the URL directly, - request one of these URLs: - /vr-cx/ - /vr-cx/$shelf_id/$resource_id/$port_id - /vr/ - /vr/$shelf_id/$resource_id - /vrcx/ - /vrcx/$shelf_id/$resource_id/$port_id - - When requesting specific column names, they need to be URL encoded: - active+ipv6+router, bgp+4byte+as, bgp+damping, bgp+peers, cluster+id, collision+domain+id, - confederation+id, damping+half+life, damping+max+suppress, damping+reuse, - damping+suppress, entity+id, height, ipv6+radv, is+bgp+reflector, local+as, - multicast+routing, name, netsmith-state, notes, pad, ripv2, router+connections, - router+id, router+id, use+confederation, use+existing+cfg, use+ospf, use+rip+dft+route, - using+bgp, using+olsr, width, x, xorp+sha, y - Example URL: /vr?fields=active+ipv6+router,bgp+4byte+as - - Example py-json call (it knows the URL): - record = LFJsonGet.get_vr(eid_list=['1.234', '1.344'], - requested_col_names=['netsmith-state'], - debug_=True) - - The record returned will have these members: - { - 'active ipv6 router': # - - 'bgp 4byte as': # - - 'bgp damping': # lc_key > lc_col_name- - 'bgp peers': # - - 'cluster id': # - - 'collision domain id': # - - 'confederation id': # - - 'damping half life': # - - 'damping max suppress': # - - 'damping reuse': # - - 'damping suppress': # - - 'entity id': # Entity ID - 'height': # - - 'ipv6 radv': # - - 'is bgp reflector': # - - 'local as': # - - 'multicast routing': # - - 'name': # Name - 'netsmith-state': # - - 'notes': # - - 'pad': # - - 'ripv2': # - - 'router connections': # - - 'router id': # - - 'router id': # - - 'use confederation ': # - - 'use existing cfg': # - - 'use ospf': # - - 'use rip dft route': # - - 'using bgp': # - - 'using olsr': # - - 'width': # - - 'x': # - - 'xorp sha': # - - 'y': # - - } - ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - - def get_vr(self, - eid_list=None, - requested_col_names=(), - debug_=False): - debug_ |= self.debug - url = "/vr" - if (eid_list is None) or (len(eid_list) < 1): - raise ValueError("no entity id in request") - trimmed_fields = [] - if isinstance(requested_col_names, str): - if not requested_col_names.strip(): - raise ValueError("column name cannot be blank") - trimmed_fields.append(requested_col_names.strip()) - if isinstance(requested_col_names, list): - for field in requested_col_names: - if not field.strip(): - raise ValueError("column names cannot be blank") - field = field.strip() - if field.find(" ") > -1: - raise ValueError("field should be URL encoded: [%s]" % field) - trimmed_fields.append(field) - url += self.make_eid_url(eid_list=eid_list) - - if len(trimmed_fields) > 0: - url += "?fields=%s" % (",".join(trimmed_fields)) - - response = self.json_get(url, debug_=debug_) - if response is None: - return None - return self.extract_values(response=response, - singular_key="virtual-routers", - plural_key="virtual-routers") - # - """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Notes for type requests - - If you need to call the URL directly, - request one of these URLs: - /vrcx/ - /vrcx/$shelf_id/$resource_id/$port_id - - When requesting specific column names, they need to be URL encoded: - entity+id, height, interface+cost, local-a, local-b, netsmith-state, remote-a, - remote-b, resource, rip+metric, vrrp+id, vrrp+interval, vrrp+ip, vrrp+ip-prefix, - vrrp+priority, wan+link, width, x, y - Example URL: /vrcx?fields=entity+id,height - - Example py-json call (it knows the URL): - record = LFJsonGet.get_vrcx(eid_list=['1.234', '1.344'], - requested_col_names=['netsmith-state'], - debug_=True) - - The record returned will have these members: - { - 'entity id': # - - 'height': # - - 'interface cost': # - - 'local-a': # - - 'local-b': # - - 'netsmith-state': # - - 'remote-a': # - - 'remote-b': # - - 'resource': # - - 'rip metric': # - - 'vrrp id': # - - 'vrrp interval': # - - 'vrrp ip': # - - 'vrrp ip-prefix': # - - 'vrrp priority': # - - 'wan link': # - - 'width': # - - 'x': # - - 'y': # - - } - ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - - def get_vrcx(self, - eid_list=None, - requested_col_names=(), - debug_=False): - debug_ |= self.debug - url = "/vrcx" - if (eid_list is None) or (len(eid_list) < 1): - raise ValueError("no entity id in request") - trimmed_fields = [] - if isinstance(requested_col_names, str): - if not requested_col_names.strip(): - raise ValueError("column name cannot be blank") - trimmed_fields.append(requested_col_names.strip()) - if isinstance(requested_col_names, list): - for field in requested_col_names: - if not field.strip(): - raise ValueError("column names cannot be blank") - field = field.strip() - if field.find(" ") > -1: - raise ValueError("field should be URL encoded: [%s]" % field) - trimmed_fields.append(field) - url += self.make_eid_url(eid_list=eid_list) - - if len(trimmed_fields) > 0: - url += "?fields=%s" % (",".join(trimmed_fields)) - - response = self.json_get(url, debug_=debug_) - if response is None: - return None - return self.extract_values(response=response, - singular_key="router-connections", - plural_key="router-connections") - # - """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Notes for type requests - - If you need to call the URL directly, - request one of these URLs: - /wl-endp/ - /wl-endp/$wl_ep_id - /wl-ep/ - /wl-ep/$wl_ep_id - /wl/ - /wl/$wl_id - /wl_endp/ - /wl_endp/$wl_ep_id - /wl_ep/ - /wl_ep/$wl_ep_id - /wlendp/$wl_ep_id - - When requesting specific column names, they need to be URL encoded: - bps+rx+a, bps+rx+b, eid, endpoints+%28a%C2%A0%E2%86%94%C2%A0b%29, entity+id, k-m, - name, pkt+tx+a%C2%A0%E2%86%90%C2%A0b, pkt+tx+a%C2%A0%E2%86%92%C2%A0b, rpt+timer, - state - Example URL: /wl?fields=bps+rx+a,bps+rx+b - - Example py-json call (it knows the URL): - record = LFJsonGet.get_wl(eid_list=['1.234', '1.344'], - requested_col_names=['entity id'], - debug_=True) - - The record returned will have these members: - { - 'bps rx a': # Endpoint B's Max transmit rate (bps). - 'bps rx b': # Endpoint A's Max transmit rate (bps). - 'eid': # Entity ID - 'endpoints (a ↔ b)': # Endpoints that make up this WanLink. - 'entity id': # Entity ID - 'k-m': # Whether the WanLink is Kernel-Mode or not. - 'name': # WanLink's Name. - 'pkt tx a ← b': # Packets received on endpoint B and transmitted out endpoint A. - 'pkt tx a → b': # Packets received on endpoint A and transmitted out endpoint B. - 'rpt timer': # Cross Connect's Report Timer (milliseconds).This is how often the GUI - # will ask for updates from the LANforge processes.If the GUI is sluggish, - # increasing the report timers may help. - 'state': # Current State of the connection.UninitializedHas not yet been - # started/stopped.InitializingBeing set up.StartingStarting the - # test.RunningTest is actively running.StoppedTest has been - # stopped.QuiesceTest will gracefully stop soon.HW-BYPASSTest is in - # hardware-bypass mode (WanLinks only)FTM_WAITTest wants to run, but is - # phantom, probably due to non-existent interface or resource.WAITINGWill - # restart as soon as resources are available.PHANTOMTest is stopped, and - # is phantom, probably due to non-existent interface or resource. - } - ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - - def get_wl(self, - eid_list=None, - requested_col_names=(), - debug_=False): - debug_ |= self.debug - url = "/wl" - if (eid_list is None) or (len(eid_list) < 1): - raise ValueError("no entity id in request") - trimmed_fields = [] - if isinstance(requested_col_names, str): - if not requested_col_names.strip(): - raise ValueError("column name cannot be blank") - trimmed_fields.append(requested_col_names.strip()) - if isinstance(requested_col_names, list): - for field in requested_col_names: - if not field.strip(): - raise ValueError("column names cannot be blank") - field = field.strip() - if field.find(" ") > -1: - raise ValueError("field should be URL encoded: [%s]" % field) - trimmed_fields.append(field) - url += self.make_eid_url(eid_list=eid_list) - - if len(trimmed_fields) > 0: - url += "?fields=%s" % (",".join(trimmed_fields)) - - response = self.json_get(url, debug_=debug_) - if response is None: - return None - return self.extract_values(response=response, - singular_key="", - plural_key="") - # - """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Notes for type requests - - If you need to call the URL directly, - request one of these URLs: - /wl-endp/ - /wl-endp/$wl_ep_id - - When requesting specific column names, they need to be URL encoded: - buffer, corrupt+1, corrupt+2, corrupt+3, corrupt+4, corrupt+5, corrupt+6, - delay, dropfreq+%25, dropped, dup+pkts, dupfreq+%25, eid, elapsed, extrabuf, - failed-late, jitfreq+%25, max+rate, maxjitter, maxlate, name, ooo+pkts, qdisc, - reordfrq+%25, run, rx+bytes, rx+pkts, script, serdelay, tx+bytes, tx+drop+%25, - tx+pkts, tx+rate, tx-failed, wps - Example URL: /wl-endp?fields=buffer,corrupt+1 - - Example py-json call (it knows the URL): - record = LFJsonGet.get_wl_endp(eid_list=['1.234', '1.344'], - requested_col_names=['eid'], - debug_=True) - - The record returned will have these members: - { - 'buffer': # Maximum size of receive buffer, in bytes.This is the sum of the amount - # needed for the transit buffers (delay * bandwidth)plus the WanLink - # "Backlog Buffer:" queue size which handles bursts. - 'corrupt 1': # Counters for how many times this corruption has been applied. - 'corrupt 2': # Counters for how many times this corruption has been applied. - 'corrupt 3': # Counters for how many times this corruption has been applied. - 'corrupt 4': # Counters for how many times this corruption has been applied. - 'corrupt 5': # Counters for how many times this corruption has been applied. - 'corrupt 6': # Counters for how many times this corruption has been applied. - 'delay': # Base induced latency on received packets, in microseconds. - 'dropfreq %': # Frequency out of 1,000,000 to drop a received packet.Select a preset - # value or enter your own. - 'dropped': # Total dropped packets on receive.This does not include the tx-failed - # counters. - 'dup pkts': # Total duplicate packets generated. - 'dupfreq %': # Frequency out of 1,000,000 to duplicate a received packet.Select a - # preset value or enter your own. - 'eid': # Entity ID - 'elapsed': # Amount of time (seconds) this endpoint has been running (or ran.) - 'extrabuf': # Size of "Backlog Buffer:" setting in WanLink configuration in bytes. - 'failed-late': # Total amount of received packets that could not be transmitted out the - # peer becausethe emulator was overloaded and could not transmit within - # the specified 'lateness' - 'jitfreq %': # Frequency out of 1,000,000 that packets should have jitter applied to - # them.Select a preset value or enter your own. - 'max rate': # Max transmit rate (bps) for this Endpoint. - 'maxjitter': # Maximum additional delay, in microseconds. See Jitter-Frequency as - # well. - 'maxlate': # The maximum lateness in milliseconds allowed before packets will be - # dropped on transmit.If lateness is configured to be automatic, this - # variable will change based onconfigured bandwidth and backlog buffer, - # but will not go below 10ms. - 'name': # Endpoint's Name. - 'ooo pkts': # Total out of order packets generated. - 'qdisc': # Queueing discipline (FIFO, WRR, etc). - 'reordfrq %': # Frequency out of 1,000,000 to re-order a received packet.Select a preset - # value or enter your own. - 'run': # Is the Endpoint is Running or not. - 'rx bytes': # Total received bytes count. - 'rx pkts': # Total received packet count. - 'script': # Endpoint script state. - 'serdelay': # Additional serialization delay for a 1514 byte packet at the configured - # speed (microseconds). - 'tx bytes': # Total transmitted bytes count. - 'tx drop %': # Packet drop percentage over the last 1 minute. - 'tx pkts': # Packets received on the peer interface and transmitted out this - # endpoint's interface. - 'tx rate': # The average speed over the last 30 seconds at which we are - # transmittingout the peer interface.This can be thought of as the actual - # transfer rate for packets entering the interfaceassociated with this - # Endpoint. - 'tx-failed': # Total amount of received packets that could not be transmitted out the - # peer.This includes any tx-failed-late packets. - 'wps': # Enable/Disable showing of WanPaths for individual endpoints. - } - ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - - def get_wl_endp(self, - eid_list=None, - requested_col_names=(), - debug_=False): - debug_ |= self.debug - url = "/wl-endp" - if (eid_list is None) or (len(eid_list) < 1): - raise ValueError("no entity id in request") - trimmed_fields = [] - if isinstance(requested_col_names, str): - if not requested_col_names.strip(): - raise ValueError("column name cannot be blank") - trimmed_fields.append(requested_col_names.strip()) - if isinstance(requested_col_names, list): - for field in requested_col_names: - if not field.strip(): - raise ValueError("column names cannot be blank") - field = field.strip() - if field.find(" ") > -1: - raise ValueError("field should be URL encoded: [%s]" % field) - trimmed_fields.append(field) - url += self.make_eid_url(eid_list=eid_list) - - if len(trimmed_fields) > 0: - url += "?fields=%s" % (",".join(trimmed_fields)) - - response = self.json_get(url, debug_=debug_) - if response is None: - return None - return self.extract_values(response=response, - singular_key="endpoint", - plural_key="endpoint") - # - """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - Notes for type requests - - If you need to call the URL directly, - request one of these URLs: - /ws-msg/ - /ws-msg/$sessionid - - - Example py-json call (it knows the URL): - record = LFJsonGet.get_ws_msg(eid_list=['1.234', '1.344'], - debug_=True) - ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - - def get_ws_msg(self, - eid_list=None, - requested_col_names=(), - debug_=False): - debug_ |= self.debug - url = "/ws-msg" - if (eid_list is None) or (len(eid_list) < 1): - raise ValueError("no entity id in request") - trimmed_fields = [] - if isinstance(requested_col_names, str): - if not requested_col_names.strip(): - raise ValueError("column name cannot be blank") - trimmed_fields.append(requested_col_names.strip()) - if isinstance(requested_col_names, list): - for field in requested_col_names: - if not field.strip(): - raise ValueError("column names cannot be blank") - field = field.strip() - if field.find(" ") > -1: - raise ValueError("field should be URL encoded: [%s]" % field) - trimmed_fields.append(field) - url += self.make_eid_url(eid_list=eid_list) - - if len(trimmed_fields) > 0: - url += "?fields=%s" % (",".join(trimmed_fields)) - - response = self.json_get(url, debug_=debug_) - if response is None: - return None - return self.extract_values(response=response, - singular_key="", - plural_key="") - # - - -"""----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- - - These are POST requests - ------ ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - - -class LFJsonPost(LFCliBase): - def __init__(self, lfclient_host='localhost', - lfclient_port=8080, - debug_=False, - _exit_on_error=False, - _exit_on_fail=False, - _proxy_str=None, - _capture_signal_list=()): - super().__init__(_lfjson_host=lfclient_host, - _lfjson_port=lfclient_port, - _debug=debug_, - _exit_on_error=_exit_on_error, - _exit_on_fail=_exit_on_fail, - _proxy_str=_proxy_str, - _capture_signal_list=_capture_signal_list) +class JsonQuery(BaseLFJsonRequest): + """ ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + request LANforge JSON data with knowledge of the LANforge JSON headers + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- """ + + def __init__(self, + session_obj: 'BaseSession' = None, + debug=False, + exit_on_error=False): + super().__init__(session_obj=session_obj, + debug=debug | session_obj.is_debug(), + exit_on_error=exit_on_error) + + +class JsonCommand(BaseLFJsonRequest): + def __init__(self, + session_obj: object = None, + debug: bool = False, + exit_on_error: bool = False): + super().__init__(session_obj=session_obj, + debug=debug, + exit_on_error=exit_on_error) + self.logger.debug("%s new instance " % str(__class__)) @staticmethod def set_flags(flag_class: IntFlag, starting_value: int, flag_names=None): @@ -2495,7 +868,7 @@ class LFJsonPost(LFCliBase): :param starting_value: integer flag value to OR values into :param flag_names: list of flag names to convert to integers to OR onto starting_value - Example Usage: + Example Usage: value = LFJsonPost.add_flags(SetPortMumble, 0, flag_names=['bridge', 'dhcp']) print('value now: '+value) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" @@ -2511,13 +884,13 @@ class LFJsonPost(LFCliBase): raise ValueError("%s lacks member:[%s]" % (flag_class.__class__.__name__, flag)) selected_flags.extend([flag_class[member].value - for member in flag_class.__members__ if member == flag]) + for member in flag_class.__members__ if member == flag]) if isinstance(flag, IntFlag): if flag not in flag_class: raise ValueError("%s lacks member:[%s]" % (flag_class.__class__.__name__, flag)) selected_flags.extend([member.value - for member in flag_class.__members___ if member == flag]) + for member in flag_class.__members___ if member == flag]) selected_flags.append(starting_value) result_flags = 0 for i in selected_flags: @@ -2541,7 +914,7 @@ class LFJsonPost(LFCliBase): :param starting_value: integer flag value to OR values into :param flag_names: list of flag names to convert to integers to OR onto starting_value - Example Usage: + Example Usage: value = LFJsonPost.clear_flags(SetPortMumble, 0, flag_names=['bridge', 'dhcp']) print('value now: '+value) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" @@ -2575,29 +948,259 @@ class LFJsonPost(LFCliBase): unselected_val = starting_value unselected_val &= ~flag_names.value return unselected_val + + def start_session(self, + debug: bool = False, + die_without_session_id_: bool = False) -> bool: + responses = [] + debug |= self.debug_on + if not self.session_instance: + raise ValueError("JsonCommand::start_session lacks self.session_instance") + + first_response: HTTPResponse + first_response = self.json_post(url="/newsession", + debug=True, + response_json_list=responses) + if not first_response: + self.logger.warning("No session established.") + self.logger.debug(pformat(first_response)) + self.logger.debug(pformat(responses)) + if die_without_session_id_: + exit(1) + return False + if _not(first_response.msg): + self.logger.error("no session_response.msg: %s" % pformat(first_response)) + if die_without_session_id_: + exit(1) + return False + + if debug: + self.logger.debug("%s: newsession: %s" % (__name__, pformat(first_response))) + # self.session_instance.session_id = first_response["session_id"] + self.logger.debug(pformat( ("start_session headers:", + first_response.getheaders()))) + if SESSION_HEADER not in first_response.headers: + self.logger.error("start_session: no %s in response headers:" % SESSION_HEADER) + self.logger.error(pformat(first_response.headers)) + if die_without_session_id_: + exit(1) + return False + + self.session_id = first_response.getheader(SESSION_HEADER) + self.session_instance.session_id = first_response.getheader(SESSION_HEADER) + return True + + +class BaseSession: + """ + Use this class to make your initial connection to a LANforge GUI. This class can + will create a session id and hold errors and warnings as needed. + """ + + Default_Base_URL: str = "http://localhost:8080" + Default_Retry_Sec: float = 1.0 + Default_Request_Timeout_Sec: float = 120.0 + Default_Max_Timeout_Sec: float = 240.0 + subclasses = [] + + def __init_subclass__(cls, **kwargs): + super().__init_subclass__(**kwargs) + cls.subclasses.append(cls) + + def __init__(self, lfclient_url: str = 'http://localhost:8080', + debug: bool = False, + proxy_map: dict = None, + connection_timeout_sec: float = Default_Request_Timeout_Sec, + max_timeout_sec: float = Default_Max_Timeout_Sec, + retry_sec: float = Default_Retry_Sec, + stream_errors: bool = True, + stream_warnings: bool = False, + exit_on_error: bool = False): + self.debug_on = debug + self.logger = Logg(name='json_api_session') + if debug: + self.logger.level = logging.DEBUG + self.exit_on_error = exit_on_error + self.command_instance: JsonCommand + self.connection_timeout_sec: int = 10 + self.debug_on: bool + self.debug_on = False + self.exit_on_error: bool + self.exit_on_error = False + self.lfclient_url: str + self.max_timeout_sec: float + self.max_timeout_sec = max_timeout_sec + self.proxies_installed: bool + self.proxies_installed = False + self.proxy_map: dict + self.query_instance: JsonQuery + self.query_instance = None + self.retry_sec: float + self.retry_sec = retry_sec + self.session_error_list: list = [] + self.session_id: str + self.session_id = None + self.session_warnings_list: list = [] + self.stream_errors: bool + self.stream_errors = True + self.stream_warnings: bool + self.stream_warnings = False + self.session_connection_check: bool + self.session_connection_check = False + self.session_started_at: int = 0 + + # please see this discussion on ProxyHandlers: + # https://docs.python.org/3/library/urllib.request.html#urllib.request.ProxyHandler + # but this makes much more sense: + # https://gist.github.com/aleiphoenix/4159510 + + if debug: + if proxy_map is None: + self.logger.debug("%s: no proxy_str" % __class__) + else: + self.logger.debug("BaseSession.__init__: proxies_: %s" % pformat(proxy_map)) + + if (proxy_map is not None) and (len(proxy_map) > 0): + if ("http" not in proxy_map) and ("https" not in proxy_map): + raise ValueError("Neither http or https set in proxy definitions. Expects proxy={'http':, 'https':, }") + self.proxy_map = proxy_map + if (proxy_map is not None) and (len(proxy_map) > 0): + opener = urllib.request.build_opener(request.ProxyHandler(proxy_map)) + urllib.request.install_opener(opener) + self.proxies_installed = True + + if connection_timeout_sec: + self.connection_timeout_sec = connection_timeout_sec + self.logger.debug("%s connection timeout sec now [%f]" % (__name__, connection_timeout_sec)) + + self.stream_errors = stream_errors + self.stream_warnings = stream_warnings + + # if debug: + # if self.proxies is None: + # print("BaseSession _init_: no proxies") + # else: + # print("BaseSession _init_: proxies: ") + # pprint.pprint(self.proxies) + + if not lfclient_url.startswith("http://") and not lfclient_url.startswith("https://"): + self.logger.warning("No http:// or https:// found, prepending http:// to " + lfclient_url) + lfclient_url = "http://" + lfclient_url + + # we do not want the lfclient_url to end with a slash + if lfclient_url.endswith('/'): + self.lfclient_url = lfclient_url[0: len(lfclient_url) - 1] + else: + self.lfclient_url = lfclient_url + + # test connection with GUI to get a session id, then set our session ids in those instances + # self.session_connection_check = self.command_instance.start_session(debug=debug) + self.command_instance = None + self.query_instance = None + + # indicate session destroyed if possible + def __del__(self): + if not self.session_connection_check: + self.logger.warning("%s no connection established, exiting" % self.session_connection_check) + return + self.logger.debug("%s: asking for session %s to end" % (__name__, self.session_id)) + BaseSession.end_session(command_obj=self.command_instance, + session_id_=self.session_id) + + def get_command(self) -> 'JsonCommand': + """ + Remember to override this method with your session subclass, it should return LFJsonCommand + :return: registered instance of JsonCommand + """ + if self.command_instance: + return self.command_instance + self.command_instance = JsonCommand(session_obj=self) + return self.command_instance + + def get_query(self) -> 'JsonQuery': + """ + Remember to override this method with your session subclass, it should return LFJsonQuery + :return: registered instance of JsonQuery + """ + if self.query_instance: + return self.query_instance + self.query_instance = JsonQuery(session_obj=self, debug=self.debug_on) + return self.query_instance + + def is_exit_on_error(self) -> bool: + return self.exit_on_error + + def get_lfclient_url(self) -> str: + return self.lfclient_url + + def get_lf_client_error(self) -> str: + return self.lfclient_url + + def is_debug(self) -> bool: + return self.debug_on + + def get_session_id(self) -> str: + return self.session_id + + def get_proxies(self): + return self.proxy_map + + def get_timeout_sec(self) -> float: + return self.connection_timeout_sec + + @classmethod + def end_session(cls, + command_obj: JsonCommand = None, + session_id_: str = ""): + responses = [] + first_response = command_obj.json_post(url="endsession", + debug=True, + response_json_list=responses, + session_id_=session_id_) + pprint(first_response) + pprint(responses) + +# End of json_api.py; subclasses defined below + + +class LFJsonCommand(JsonCommand): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + LFJsonCommand inherits from JsonCommand + Commands are used for POST requests. + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + def __init__(self, + session_obj: object = None, + debug: bool = False, + exit_on_error: bool = False): + super().__init__(session_obj=session_obj, + debug=debug, + exit_on_error=exit_on_error) + + # Auto generated methods follow: + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Notes for type requests https://www.candelatech.com/lfcli_ug.php#add_arm_endp ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_add_arm_endp(self, - alias=None, # Name of endpoint. - cpu_id=None, # Preferred CPU ID on which this endpoint should run. - mx_pkt_sz=None, # Maximum packet size, including all Ethernet headers. - pkt_sz=None, # Minimum packet size, including all Ethernet headers. - port=None, # Port number. - pps=None, # Packets per second to generate. - resource=None, # Resource number. - shelf=None, # Shelf name/id. - tos=None, # The Type of Service, can be HEX. See set_endp_tos for details. - p_type=None, # Endpoint Type : arm_udp - debug_=False): + alias: str = None, # Name of endpoint. [R] + cpu_id: str = None, # Preferred CPU ID on which this endpoint should run. + mx_pkt_sz: str = None, # Maximum packet size, including all Ethernet headers. + pkt_sz: str = None, # Minimum packet size, including all Ethernet headers. + port: str = None, # Port number. [W] + pps: str = None, # Packets per second to generate. + resource: str = None, # Resource number. [W] + shelf: str = None, # Shelf name/id. Required. [R][D:1] + tos: str = None, # The Type of Service, can be HEX. See set_endp_tos for details. + p_type: str = None, # Endpoint Type : arm_udp. [W] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_add_arm_endp(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if alias is not None: data["alias"] = alias @@ -2621,9 +1224,10 @@ class LFJsonPost(LFCliBase): data["type"] = p_type if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/add_arm_endp", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/add_arm_endp", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -2656,25 +1260,25 @@ class LFJsonPost(LFCliBase): return (cls[member].value for member in cls.__members__ if member == name) def post_add_bgp_peer(self, - p_as=None, # BGP Peer Autonomous System number, 0-65535 - delay_open_time=None, # BGP Peer delay open time. - flags=None, # Virtual router BGP Peer flags, see above for definitions. - holdtime=None, # BGP Peer hold-time. - local_dev=None, # BGP Peer Local interface. - nexthop=None, # BGP Peer Nexthop, IPv4 Address. - nexthop6=None, # BGP Peer IPv6 Nexthop address. - peer_id=None, # BGP Peer Identifier: IPv4 Address - peer_index=None, # Peer index in this virtual router (0-7). - resource=None, # Resource number. - shelf=None, # Shelf name/id. - vr_id=None, # Name of virtual router. - debug_=False): + p_as: str = None, # BGP Peer Autonomous System number, 0-65535 + delay_open_time: str = None, # BGP Peer delay open time. + flags: str = None, # Virtual router BGP Peer flags, see above for definitions. + holdtime: str = None, # BGP Peer hold-time. + local_dev: str = None, # BGP Peer Local interface. + nexthop: str = None, # BGP Peer Nexthop, IPv4 Address. + nexthop6: str = None, # BGP Peer IPv6 Nexthop address. + peer_id: str = None, # BGP Peer Identifier: IPv4 Address + peer_index: str = None, # Peer index in this virtual router (0-7). + resource: str = None, # Resource number. [W] + shelf: str = None, # Shelf name/id. [R][D:1] + vr_id: str = None, # Name of virtual router. [R] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_add_bgp_peer(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if p_as is not None: data["as"] = p_as @@ -2702,9 +1306,10 @@ class LFJsonPost(LFCliBase): data["vr_id"] = vr_id if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/add_bgp_peer", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/add_bgp_peer", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -2714,17 +1319,17 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#add_bond ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_add_bond(self, - network_devs=None, # Comma-separated list of network devices: eth1,eth2,eth3... - port=None, # Name of the bond device. - resource=None, # Resource number. - shelf=None, # Shelf number. - debug_=False): + network_devs: str = None, # Comma-separated list of network devices: eth1,eth2,eth3... [W] + port: str = None, # Name of the bond device. [W] + resource: str = None, # Resource number. [W] + shelf: str = None, # Shelf number. [R][D:1] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_add_bond(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if network_devs is not None: data["network_devs"] = network_devs @@ -2736,9 +1341,10 @@ class LFJsonPost(LFCliBase): data["shelf"] = shelf if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/add_bond", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/add_bond", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -2756,23 +1362,23 @@ class LFJsonPost(LFCliBase): stp_enabled = 1 # Enable Spanning Tree Protocol (STP) def post_add_br(self, - br_aging_time=None, # MAC aging time, in seconds, 32-bit number. - br_flags=None, # Bridge flags, see above. - br_forwarding_delay=None, # How long to wait until the bridge will start forwarding packets. - br_hello_time=None, # How often does the bridge send out STP hello packets. - br_max_age=None, # How long until STP considers a non-responsive bridge dead. - br_priority=None, # Bridge priority, 16-bit number. - network_devs=None, # Comma-separated list of network devices: eth1,eth2,eth3... - port=None, # Name of the bridge device. - resource=None, # Resource number. - shelf=None, # Shelf number. - debug_=False): + br_aging_time: str = None, # MAC aging time, in seconds, 32-bit number. + br_flags: str = None, # Bridge flags, see above. + br_forwarding_delay: str = None, # How long to wait until the bridge will start forwarding packets. + br_hello_time: str = None, # How often does the bridge send out STP hello packets. + br_max_age: str = None, # How long until STP considers a non-responsive bridge dead. + br_priority: str = None, # Bridge priority, 16-bit number. + network_devs: str = None, # Comma-separated list of network devices: eth1,eth2,eth3... + port: str = None, # Name of the bridge device. [W] + resource: str = None, # Resource number. [W] + shelf: str = None, # Shelf number. [R][D:1] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_add_br(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if br_aging_time is not None: data["br_aging_time"] = br_aging_time @@ -2796,9 +1402,10 @@ class LFJsonPost(LFCliBase): data["shelf"] = shelf if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/add_br", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/add_br", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -2816,22 +1423,22 @@ class LFJsonPost(LFCliBase): RUNNING = 1 # Set to running state. def post_add_cd(self, - alias=None, # Name of Collision Domain. - bps=None, # Maximum speed at which this collision domain can run. - flags=None, # See above. Leave blank or use 'NA' for no default values. - report_timer=None, # How often to report stats. - resource=None, # Resource number. - shelf=None, # Shelf name/id. - state=None, # RUNNING or STOPPED (default is RUNNING). Use this to start/stop. - p_type=None, # CD Type: WIFI, WISER_SURFACE, WISER_SURFACE_AIR, WISER_AIR_AIR, + alias: str = None, # Name of Collision Domain. [W] + bps: str = None, # Maximum speed at which this collision domain can run. + flags: str = None, # See above. Leave blank or use 'NA' for no default values. + report_timer: str = None, # How often to report stats. + resource: str = None, # Resource number. [W] + shelf: str = None, # Shelf name/id. [R][D:1] + state: str = None, # RUNNING or STOPPED (default is RUNNING). Use this to start/stop. + p_type: str = None, # CD Type: WIFI, WISER_SURFACE, WISER_SURFACE_AIR, WISER_AIR_AIR, # WISER_NCW - debug_=False): + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_add_cd(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if alias is not None: data["alias"] = alias @@ -2851,9 +1458,10 @@ class LFJsonPost(LFCliBase): data["type"] = p_type if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/add_cd", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/add_cd", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -2863,15 +1471,15 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#add_cd_endp ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_add_cd_endp(self, - cd=None, # Name of Collision Domain. - endp=None, # Endpoint name/id. - debug_=False): + cd: str = None, # Name of Collision Domain. [R] + endp: str = None, # Endpoint name/id. [R] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_add_cd_endp(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if cd is not None: data["cd"] = cd @@ -2879,9 +1487,10 @@ class LFJsonPost(LFCliBase): data["endp"] = endp if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/add_cd_endp", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/add_cd_endp", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -2891,15 +1500,15 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#add_cd_vr ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_add_cd_vr(self, - cd=None, # Name of Collision Domain. - vr=None, # Virtual-Router name/ID. - debug_=False): + cd: str = None, # Name of Collision Domain. [R] + vr: str = None, # Virtual-Router name/ID. [R] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_add_cd_vr(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if cd is not None: data["cd"] = cd @@ -2907,9 +1516,10 @@ class LFJsonPost(LFCliBase): data["vr"] = vr if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/add_cd_vr", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/add_cd_vr", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -2940,35 +1550,56 @@ class LFJsonPost(LFCliBase): raise ValueError("AddChamberChamberFlags has no member:[%s]" % name) return (cls[member].value for member in cls.__members__ if member == name) + class AddChamberTurntableType(IntFlag): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + This class is stateless. It can do binary flag math, returning the integer value. + Example Usage: + int:flag_val = 0 + flag_val = LFPost.set_flags(AddChamberTurntableType0, flag_names=['bridge', 'dhcp']) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + COMXIM = 0x1 # ComXim stand-alone USB connected turn-table. + CT840A = 0x2 # Modbus API turntable in CT840A 2D chamber. + CT850A = 0x0 # TCP-IP Connected turntable in CT850A 2D chamber. + + # use to get in value of flag + @classmethod + def valueof(cls, name=None): + if name is None: + return name + if name not in cls.__members__: + raise ValueError("AddChamberTurntableType has no member:[%s]" % name) + return (cls[member].value for member in cls.__members__ if member == name) + def post_add_chamber(self, - chamber_type=None, # Chamber type, see above. Use 1 for Medium if uncertain. - dut_name1=None, # Name of first DUT in this chamber or NA - dut_name2=None, # Name of second DUT in this chamber or NA - dut_name3=None, # Name of third DUT in this chamber or NA - dut_name4=None, # Name of fourth DUT in this chamber or NA - flags=None, # Flag field for Chamber, see above. - flags_mask=None, # Mask of what flags to pay attention to, or NA for all. - height=None, # Height to be used when drawn in the LANforge-GUI. - isolation=None, # Estimated isolation in db for this chamber. - lanforge1=None, # EID of first LANforge Resource in this chamber or NA - lanforge2=None, # EID of second LANforge Resource in this chamber or NA - lanforge3=None, # EID of third LANforge Resource in this chamber or NA - lanforge4=None, # EID of fourth LANforge Resource in this chamber or NA - name=None, # Name of Chamber, unique identifier. - resource=None, # LANforge Resource ID for controlling turn-table via serial + chamber_type: str = None, # Chamber type, see above. Use 1 for Medium if uncertain. [W] + dut_name1: str = None, # Name of first DUT in this chamber or NA + dut_name2: str = None, # Name of second DUT in this chamber or NA + dut_name3: str = None, # Name of third DUT in this chamber or NA + dut_name4: str = None, # Name of fourth DUT in this chamber or NA + flags: str = None, # Flag field for Chamber, see above. [W] + flags_mask: str = None, # Mask of what flags to pay attention to, or NA for all. + height: str = None, # Height to be used when drawn in the LANforge-GUI. + isolation: str = None, # Estimated isolation in db for this chamber. + lanforge1: str = None, # EID of first LANforge Resource in this chamber or NA + lanforge2: str = None, # EID of second LANforge Resource in this chamber or NA + lanforge3: str = None, # EID of third LANforge Resource in this chamber or NA + lanforge4: str = None, # EID of fourth LANforge Resource in this chamber or NA + name: str = None, # Name of Chamber, unique identifier. [R] + resource: str = None, # LANforge Resource ID for controlling turn-table via serial # protocol. - sma_count=None, # Number of SMA connectors on this chamber, default is 16. - turntable_type=None, # Turn-Table type: see above. - width=None, # Width to be used when drawn in the LANforge-GUI. - x=None, # X coordinate to be used when drawn in the LANforge-GUI. - y=None, # Y coordinate to be used when drawn in the LANforge-GUI. - debug_=False): + sma_count: str = None, # Number of SMA connectors on this chamber, default is 16. + turntable_type: str = None, # Turn-Table type: see above. + width: str = None, # Width to be used when drawn in the LANforge-GUI. + x: str = None, # X coordinate to be used when drawn in the LANforge-GUI. + y: str = None, # Y coordinate to be used when drawn in the LANforge-GUI. + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_add_chamber(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if chamber_type is not None: data["chamber_type"] = chamber_type @@ -3012,9 +1643,10 @@ class LFJsonPost(LFCliBase): data["y"] = y if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/add_chamber", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/add_chamber", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -3033,30 +1665,30 @@ class LFJsonPost(LFCliBase): TERMINATED = 2 # (2) Connection is terminated, signal shall not pass! def post_add_chamber_cx(self, - a_id=None, # EidAntenna in string format for A side connection. - atten_id=None, # EID for the Attenuator module if one is inline on this + a_id: str = None, # EidAntenna in string format for A side connection. + atten_id: str = None, # EID for the Attenuator module if one is inline on this # connection. - b_id=None, # EidAntenna in string format for B side connection. - connection_idx=None, # Connection index, currently up to 32 connections supported - # (0-31) - flags=None, # Flag field for Chamber Connection, see above. - flags_mask=None, # Mask of what flags to pay attention to, or NA for all. - internal=None, # Internal (1) or not (0): Internal connections are no longer + b_id: str = None, # EidAntenna in string format for B side connection. + connection_idx: str = None, # Connection index, currently up to 32 connections supported + # (0-31) [R] + flags: str = None, # Flag field for Chamber Connection, see above. + flags_mask: str = None, # Mask of what flags to pay attention to, or NA for all. + internal: str = None, # Internal (1) or not (0): Internal connections are no longer # supported. - min_atten=None, # Specify minimum attenuation in 10ths of a db. Distance logic - # will not set atten below this. - name=None, # Name of Chamber, unique identifier. - zrssi2=None, # Specify 2.4Ghz zero-attenuation RSSI in 10ths of a db. + min_atten: str = None, # Specify minimum attenuation in 10ths of a db. Distance + # logic will not set atten below this. + name: str = None, # Name of Chamber, unique identifier. [R] + zrssi2: str = None, # Specify 2.4Ghz zero-attenuation RSSI in 10ths of a db. # Distance logic will consider this in its calculations. - zrssi5=None, # Specify 5Ghz zero-attenuation RSSI in 10ths of a db. Distance - # logic will consider this in its calculations. - debug_=False): + zrssi5: str = None, # Specify 5Ghz zero-attenuation RSSI in 10ths of a db. + # Distance logic will consider this in its calculations. + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_add_chamber_cx(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if a_id is not None: data["a_id"] = a_id @@ -3082,9 +1714,10 @@ class LFJsonPost(LFCliBase): data["zrssi5"] = zrssi5 if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/add_chamber_cx", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/add_chamber_cx", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -3094,17 +1727,17 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#add_chamber_path ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_add_chamber_path(self, - chamber=None, # Chamber Name. - content=None, # [BLANK] will erase all content, any other text will be appended - # to existing text. Unescaped Value - path=None, # Path Name - debug_=False): + chamber: str = None, # Chamber Name. [R] + content: str = None, # [BLANK] will erase all content, any other text will + # be appended to existing text. + path: str = None, # Path Name [R] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_add_chamber_path(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if chamber is not None: data["chamber"] = chamber @@ -3114,9 +1747,10 @@ class LFJsonPost(LFCliBase): data["path"] = path if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/add_chamber_path", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/add_chamber_path", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -3145,22 +1779,23 @@ class LFJsonPost(LFCliBase): unused = "unused" # No signalling is performed, each channel in the list remains idle def post_add_channel_group(self, - alias=None, # Name for this Channel Group. - channels=None, # List of channels to add to this group. - idle_flag=None, # Idle flag (byte) for this channel group, for instance: 0x7e - mtu=None, # MTU (and MRU) for this channel group. Must be a multiple of - # the number of channels if configuring a T1 WanLink. - resource=None, # Resource number. - shelf=None, # Shelf name/id. - span_num=None, # The span number. First span is 1, second is 2... - p_type=None, # The channel-type. Use 'clear' for PPP links. - debug_=False): + alias: str = None, # Name for this Channel Group. [R] + channels: str = None, # List of channels to add to this group. + idle_flag: str = None, # Idle flag (byte) for this channel group, for instance: + # 0x7e + mtu: str = None, # MTU (and MRU) for this channel group. Must be a multiple + # of the number of channels if configuring a T1 WanLink. + resource: str = None, # Resource number. [W] + shelf: str = None, # Shelf name/id. [R][D:1] + span_num: str = None, # The span number. First span is 1, second is 2... [W] + p_type: str = None, # The channel-type. Use 'clear' for PPP links. + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_add_channel_group(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if alias is not None: data["alias"] = alias @@ -3180,9 +1815,10 @@ class LFJsonPost(LFCliBase): data["type"] = p_type if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/add_channel_group", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/add_channel_group", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -3192,17 +1828,17 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#add_cx ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_add_cx(self, - alias=None, # Name of the Cross Connect to create. - rx_endp=None, # Name of Receiving endpoint. - test_mgr=None, # Name of test-manager to create the CX on. - tx_endp=None, # Name of Transmitting endpoint. - debug_=False): + alias: str = None, # Name of the Cross Connect to create. [R] + rx_endp: str = None, # Name of Receiving endpoint. [W] + test_mgr: str = None, # Name of test-manager to create the CX on. [W][D:default_tm] + tx_endp: str = None, # Name of Transmitting endpoint. [R] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_add_cx(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if alias is not None: data["alias"] = alias @@ -3214,9 +1850,10 @@ class LFJsonPost(LFCliBase): data["tx_endp"] = tx_endp if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/add_cx", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/add_cx", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -3258,43 +1895,42 @@ class LFJsonPost(LFCliBase): return (cls[member].value for member in cls.__members__ if member == name) def post_add_dut(self, - antenna_count1=None, # Antenna count for first radio. - antenna_count2=None, # Antenna count for second radio. - antenna_count3=None, # Antenna count for third radio. - api_id=None, # DUT API Identifier (none specified yet) - bssid1=None, # BSSID for first radio. - bssid2=None, # BSSID for second radio. - bssid3=None, # BSSID for third radio. - eap_id=None, # EAP Identifier, for EAP-PEAP. - flags=None, # Flag field for DUT, see above. - flags_mask=None, # Optional mask to specify what DUT flags are being set. - hw_version=None, # DUT Hardware Version information - img_file=None, # File-Name for image to represent DUT. - lan_port=None, # IP/Mask for LAN port - mgt_ip=None, # Management IP Address to access DUT - model_num=None, # DUT Model information - name=None, # Name of DUT, cannot contain '.' - passwd1=None, # WiFi Password that can be used to connect to DUT - passwd2=None, # WiFi Password that can be used to connect to DUT - passwd3=None, # WiFi Password that can be used to connect to DUT - serial_num=None, # DUT Identifier (serial-number, etc) - serial_port=None, # Resource and Serial port name on LANforge that connects to DUT - # (1.2.ttyS0). Serial port does not need to be on resource holding - # wan_port or lan_port - ssid1=None, # WiFi SSID that can be used to connect to DUT - ssid2=None, # WiFi SSID that can be used to connect to DUT - ssid3=None, # WiFi SSID that can be used to connect to DUT - sw_version=None, # DUT Software Version information - top_left_x=None, # X Location for Chamber View. - top_left_y=None, # X Location for Chamber View. - wan_port=None, # IP/Mask for WAN port - debug_=False): + antenna_count1: str = None, # Antenna count for first radio. + antenna_count2: str = None, # Antenna count for second radio. + antenna_count3: str = None, # Antenna count for third radio. + api_id: str = None, # DUT API Identifier (none specified yet) + bssid1: str = None, # BSSID for first radio. + bssid2: str = None, # BSSID for second radio. + bssid3: str = None, # BSSID for third radio. + eap_id: str = None, # EAP Identifier, for EAP-PEAP. + flags: str = None, # Flag field for DUT, see above. [W] + flags_mask: str = None, # Optional mask to specify what DUT flags are being set. + hw_version: str = None, # DUT Hardware Version information + img_file: str = None, # File-Name for image to represent DUT. + lan_port: str = None, # IP/Mask for LAN port + mgt_ip: str = None, # Management IP Address to access DUT + model_num: str = None, # DUT Model information + name: str = None, # Name of DUT, cannot contain '.' [R] + passwd1: str = None, # WiFi Password that can be used to connect to DUT + passwd2: str = None, # WiFi Password that can be used to connect to DUT + passwd3: str = None, # WiFi Password that can be used to connect to DUT + serial_num: str = None, # DUT Identifier (serial-number, etc) + serial_port: str = None, # Resource and Serial port name on LANforge that connects to DUT + # (1.2.ttyS0). + ssid1: str = None, # WiFi SSID that can be used to connect to DUT + ssid2: str = None, # WiFi SSID that can be used to connect to DUT + ssid3: str = None, # WiFi SSID that can be used to connect to DUT + sw_version: str = None, # DUT Software Version information + top_left_x: str = None, # X Location for Chamber View. + top_left_y: str = None, # X Location for Chamber View. + wan_port: str = None, # IP/Mask for WAN port + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_add_dut(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if antenna_count1 is not None: data["antenna_count1"] = antenna_count1 @@ -3354,9 +1990,10 @@ class LFJsonPost(LFCliBase): data["wan_port"] = wan_port if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/add_dut", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/add_dut", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -3366,16 +2003,16 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#add_dut_notes ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_add_dut_notes(self, - dut=None, # DUT Name. - text=None, # [BLANK] will erase all, any other text will be appended to existing - # text. Unescaped Value - debug_=False): + dut: str = None, # DUT Name. [R] + text: str = None, # [BLANK] will erase all, any other text will be appended to + # existing text. + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_add_dut_notes(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if dut is not None: data["dut"] = dut @@ -3383,9 +2020,10 @@ class LFJsonPost(LFCliBase): data["text"] = text if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/add_dut_notes", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/add_dut_notes", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -3421,20 +2059,20 @@ class LFJsonPost(LFCliBase): return (cls[member].value for member in cls.__members__ if member == name) def post_add_dut_ssid(self, - bssid=None, # BSSID for cooresponding SSID. - name=None, # Name of DUT, cannot contain '.' - passwd=None, # WiFi Password that can be used to connect to DUT - ssid=None, # WiFi SSID that can be used to connect to DUT - ssid_flags=None, # SSID flags, see above. - ssid_flags_mask=None, # SSID flags mask - ssid_idx=None, # Index of the SSID. Zero-based indexing: (0 - 7) - debug_=False): + bssid: str = None, # BSSID for cooresponding SSID. + name: str = None, # Name of DUT, cannot contain '.' [R] + passwd: str = None, # WiFi Password that can be used to connect to DUT + ssid: str = None, # WiFi SSID that can be used to connect to DUT + ssid_flags: str = None, # SSID flags, see above. + ssid_flags_mask: str = None, # SSID flags mask + ssid_idx: str = None, # Index of the SSID. Zero-based indexing: (0 - 7) [W] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_add_dut_ssid(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if bssid is not None: data["bssid"] = bssid @@ -3452,9 +2090,10 @@ class LFJsonPost(LFCliBase): data["ssid_idx"] = ssid_idx if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/add_dut_ssid", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/add_dut_ssid", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -3498,36 +2137,36 @@ class LFJsonPost(LFCliBase): mc_udp = "mc_udp" # LF Multicast IPv4 def post_add_endp(self, - alias=None, # Name of endpoint. - ip_port=None, # IP Port: IP port for layer three endpoints. Use -1 to let the - # LANforge server automatically configure the ip_port. Layer 2 - # endpoints will ignore - is_pkt_sz_random=None, # Yes means use random sized packets, anything else means NO. - is_rate_bursty=None, # Yes means bursty, anything else means NO. - max_pkt=None, # Maximum packet size, including all headers. 0 means 'same', -1 - # means AUTO (5.3.2+) - max_rate=None, # Maximum transmit rate (bps), used if in bursty mode. - min_pkt=None, # Minimum packet size, including all headers. -1 means AUTO - # (5.3.2+) - min_rate=None, # Minimum transmit rate (bps), or only rate if not bursty. - multi_conn=None, # If > 0, will create separate process with this many connections - # per endpoint. See AUTO_HELPER flag - payload_pattern=None, # Payload pattern, see above. - port=None, # Port/Interface name or number. - resource=None, # Resource number. - send_bad_crc_per_million=None, # If NIC supports it, will randomly send X per million packets + alias: str = None, # Name of endpoint. [R] + ip_port: str = None, # IP Port: IP port for layer three endpoints. Use -1 to let + # the LANforge server automatically configure the ip_port. + # Layer 2 endpoints will ignore + is_pkt_sz_random: str = None, # Yes means use random sized packets, anything else means NO. + is_rate_bursty: str = None, # Yes means bursty, anything else means NO. + max_pkt: str = None, # Maximum packet size, including all headers. 0 means 'same', + # -1 means AUTO (5.3.2+) [D:0] + max_rate: str = None, # Maximum transmit rate (bps), used if in bursty mode. + min_pkt: str = None, # Minimum packet size, including all headers. -1 means AUTO + # (5.3.2+) [W][D:-1] + min_rate: str = None, # Minimum transmit rate (bps), or only rate if not bursty. [W] + multi_conn: str = None, # If > 0, will create separate process with this many + # connections per endpoint. See AUTO_HELPER flag + payload_pattern: str = None, # Payload pattern, see above. + port: str = None, # Port/Interface name or number. [R] + resource: str = None, # Resource number. [W] + send_bad_crc_per_million: str = None, # If NIC supports it, will randomly send X per million packets # with bad ethernet Frame Check Sum. - shelf=None, # Shelf name/id. - ttl=None, # Time-to-live, used by UDP Multicast Endpoints only. - p_type=None, # Endpoint Type: See above. - use_checksum=None, # Yes means checksum the payload, anything else means NO. - debug_=False): + shelf: str = None, # Shelf name/id. [R][D:1] + ttl: str = None, # Time-to-live, used by UDP Multicast Endpoints only. + p_type: str = None, # Endpoint Type: See above. [W] + use_checksum: str = None, # Yes means checksum the payload, anything else means NO. + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_add_endp(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if alias is not None: data["alias"] = alias @@ -3565,9 +2204,10 @@ class LFJsonPost(LFCliBase): data["use_checksum"] = use_checksum if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/add_endp", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/add_endp", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -3577,17 +2217,18 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#add_event ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_add_event(self, - details=None, # Event text description. Cannot include double-quote characters. - event_id=None, # Numeric ID for the event to modify, or 'new' if creating a new one. - name=None, # Event entity name. - priority=None, # See set_event_priority for available priorities. - debug_=False): + details: str = None, # Event text description. Cannot include double-quote characters. [R] + event_id: str = None, # Numeric ID for the event to modify, or 'new' if creating a new one. + # [W][D:new] + name: str = None, # Event entity name. + priority: str = None, # See set_event_priority for available priorities. + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_add_event(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if details is not None: data["details"] = details @@ -3599,9 +2240,10 @@ class LFJsonPost(LFCliBase): data["priority"] = priority if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/add_event", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/add_event", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -3658,36 +2300,56 @@ class LFJsonPost(LFCliBase): random_fixed = "random_fixed" # Means generate one random payload, and send it over zeros = "zeros" # Payload is all zeros (00). + class AddFileEndpType(Enum): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + fe_cifs = "fe_cifs" # Does a CIFS (Samba) mount + fe_cifs_ip6 = "fe_cifs/ip6" # Does an IPv6 CIFS mount + fe_generic = "fe_generic" # Uses unspecified file protocol + fe_iscsi = "fe_iscsi" # Does a ISCSI mount + fe_nfs = "fe_nfs" # Does an NFSv3 mount + fe_nfs_ip6 = "fe_nfs/ip6" # Does a NFSv3 IPv6 mount + fe_nfs4 = "fe_nfs4" # Does an NFSv4 mount + fe_nfs4_ip6 = "fe_nfs4/ip6" # Does a NFSv4 IPv6 mount + fe_smb2 = "fe_smb2" # Does a SMB v2.0 mount + fe_smb2_ip6 = "fe_smb2/ip6" # Does a SMB v2.0 IPv6 mount + fe_smb21 = "fe_smb21" # Does a SMB v2.1 mount + fe_smb21_ip6 = "fe_smb21/ip6" # Does a SMB v2.1 IPv6 mount + fe_smb30 = "fe_smb30" # Does a SMB v3.0 mount + fe_smb30_ip6 = "fe_smb30/ip6" # Does a SMB v3.0 IPv6 mount + def post_add_file_endp(self, - alias=None, # Name of endpoint. - directory=None, # The directory to read/write in. Absolute path suggested. - fio_flags=None, # File-IO flags, see above for details. - max_read_rate=None, # Maximum read rate, bits-per-second. - max_write_rate=None, # Maximum write rate, bits-per-second. - min_read_rate=None, # Minimum read rate, bits-per-second. - min_write_rate=None, # Minimum write rate, bits-per-second. - mount_dir=None, # Directory to mount/unmount (if blank, will use 'directory'). - mount_options=None, # Optional mount options, passed to the mount command. 'NONE' + alias: str = None, # Name of endpoint. [R] + directory: str = None, # The directory to read/write in. Absolute path suggested. + # [W] + fio_flags: str = None, # File-IO flags, see above for details. + max_read_rate: str = None, # Maximum read rate, bits-per-second. + max_write_rate: str = None, # Maximum write rate, bits-per-second. + min_read_rate: str = None, # Minimum read rate, bits-per-second. + min_write_rate: str = None, # Minimum write rate, bits-per-second. + mount_dir: str = None, # Directory to mount/unmount (if blank, will use + # 'directory'). + mount_options: str = None, # Optional mount options, passed to the mount command. 'NONE' # clears. - payload_pattern=None, # Payload pattern, see above. - port=None, # Port number. - prefix=None, # The prefix of the file(s) to read/write. - resource=None, # Resource number. - retry_timer=None, # Number of miliseconds to retry errored IO calls before giving - # up. - server_mount=None, # The server to mount, ex: 192.168.100.5/exports/test1 - shelf=None, # Shelf name/id. - p_type=None, # Endpoint Type : fe_generic, fe_nfs, fe_nfs4, fe_cifs, fe_iscsi, - # fe_cifs/ip6, fe_nfs/ip6, fe_nfs4/ip6, fe_smb2, fe_smb2/ip6 - # fe_smb21 fe_smb21/ip6 fe_smb30 fe_smb30/ip6 - volume=None, # iSCSI volume to mount - debug_=False): + payload_pattern: str = None, # Payload pattern, see above. + port: str = None, # Port number. [W] + prefix: str = None, # The prefix of the file(s) to read/write. + resource: str = None, # Resource number. [W] + retry_timer: str = None, # Number of miliseconds to retry errored IO calls before + # giving up. + server_mount: str = None, # The server to mount, ex: + # 192.168.100.5/exports/test1 [W] + shelf: str = None, # Shelf name/id. [R][D:1] + p_type: str = None, # Endpoint Type (like fe_nfs) [W] + volume: str = None, # iSCSI volume to mount + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_add_file_endp(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if alias is not None: data["alias"] = alias @@ -3727,9 +2389,10 @@ class LFJsonPost(LFCliBase): data["volume"] = volume if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/add_file_endp", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/add_file_endp", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -3739,18 +2402,18 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#add_gen_endp ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_add_gen_endp(self, - alias=None, # Name of endpoint. - port=None, # Port number. - resource=None, # Resource number. - shelf=None, # Shelf name/id. - p_type=None, # Endpoint Type : gen_generic - debug_=False): + alias: str = None, # Name of endpoint. [R] + port: str = None, # Port number. [W] + resource: str = None, # Resource number. [W] + shelf: str = None, # Shelf name/id. [R][D:1] + p_type: str = None, # Endpoint Type : gen_generic [W][D:gen_generic] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_add_gen_endp(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if alias is not None: data["alias"] = alias @@ -3764,9 +2427,10 @@ class LFJsonPost(LFCliBase): data["type"] = p_type if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/add_gen_endp", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/add_gen_endp", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -3776,19 +2440,19 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#add_gre ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_add_gre(self, - local_lower_ip=None, # The local lower-level IP to use. - port=None, # Name of the GRE to create, suggested to start with 'gre' - remote_lower_ip=None, # The remote lower-level IP to use. - report_timer=None, # Report timer for this port, leave blank or use NA for defaults. - resource=None, # Resource number. - shelf=None, # Shelf number. - debug_=False): + local_lower_ip: str = None, # The local lower-level IP to use. + port: str = None, # Name of the GRE to create, suggested to start with 'gre' [W] + remote_lower_ip: str = None, # The remote lower-level IP to use. + report_timer: str = None, # Report timer for this port, leave blank or use NA for defaults. + resource: str = None, # Resource number. [W] + shelf: str = None, # Shelf number. [R][D:1] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_add_gre(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if local_lower_ip is not None: data["local_lower_ip"] = local_lower_ip @@ -3804,9 +2468,10 @@ class LFJsonPost(LFCliBase): data["shelf"] = shelf if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/add_gre", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/add_gre", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -3836,17 +2501,17 @@ class LFJsonPost(LFCliBase): return (cls[member].value for member in cls.__members__ if member == name) def post_add_group(self, - flags=None, # Flags for this group, see above. - flags_mask=None, # Mask for flags that we care about, use 0xFFFFFFFF or leave blank for - # all. - name=None, # The name of the test group. Must be unique across all groups. - debug_=False): + flags: str = None, # Flags for this group, see above. + flags_mask: str = None, # Mask for flags that we care about, use 0xFFFFFFFF or leave blank + # for all. + name: str = None, # The name of the test group. Must be unique across all groups. [R] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_add_group(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if flags is not None: data["flags"] = flags @@ -3856,9 +2521,10 @@ class LFJsonPost(LFCliBase): data["name"] = name if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/add_group", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/add_group", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -3940,40 +2606,40 @@ class LFJsonPost(LFCliBase): return (cls[member].value for member in cls.__members__ if member == name) def post_add_l4_endp(self, - alias=None, # Name of endpoint. - block_size=None, # TFTP Block size, in bytes. - dns_cache_timeout=None, # In seconds, how long to cache DNS lookups. 0 means no caching at - # all. - http_auth_type=None, # Bit-field for allowable http-authenticate methods. - ip_addr=None, # Local IP address, for binding to specific secondary IP. - max_speed=None, # In bits-per-second, can rate limit upload or download speed of - # the URL contents. 0 means infinite. - port=None, # Port number. - proxy_auth_type=None, # Bit-field for allowable proxy-authenticate methods. - proxy_port=None, # HTTP Proxy port if you are using a proxy. - proxy_server=None, # The name of our proxy server if using one. - proxy_userpwd=None, # The user-name and password for proxy authentication, format: + alias: str = None, # Name of endpoint. [R] + block_size: str = None, # TFTP Block size, in bytes. + dns_cache_timeout: str = None, # In seconds, how long to cache DNS lookups. 0 means no + # caching at all. + http_auth_type: str = None, # Bit-field for allowable http-authenticate methods. + ip_addr: str = None, # Local IP address, for binding to specific secondary IP. + max_speed: str = None, # In bits-per-second, can rate limit upload or download speed + # of the URL contents. 0 means infinite. + port: str = None, # Port number. [W] + proxy_auth_type: str = None, # Bit-field for allowable proxy-authenticate methods. + proxy_port: str = None, # HTTP Proxy port if you are using a proxy. + proxy_server: str = None, # The name of our proxy server if using one. + proxy_userpwd: str = None, # The user-name and password for proxy authentication, format: # user:passwd. - quiesce_after=None, # Quiesce test after this many URLs have been processed. - resource=None, # Resource number. - shelf=None, # Shelf name/id. - smtp_from=None, # SMTP From address. - ssl_cert_fname=None, # Name of SSL Certs file. - timeout=None, # How long to wait for a connection, in milliseconds - p_type=None, # Endpoint Type : l4_generic - url=None, # The URL, see syntax above. Can also be a local file. - url_rate=None, # How often should we process the URL(s), per 10 + quiesce_after: str = None, # Quiesce test after this many URLs have been processed. + resource: str = None, # Resource number. [W] + shelf: str = None, # Shelf name/id. [R][D:1] + smtp_from: str = None, # SMTP From address. + ssl_cert_fname: str = None, # Name of SSL Certs file. + timeout: str = None, # How long to wait for a connection, in milliseconds + p_type: str = None, # Endpoint Type : l4_generic [W] + url: str = None, # The URL, see syntax above. Can also be a local file. + url_rate: str = None, # How often should we process the URL(s), per 10 # minutes.
  • 600: 1/s
  • 1200: 2/s
  • 1800: 3/s
  • 2400: - # 4/s
- user_agent=None, # User-Agent string. Leave blank for default. Also SMTP-TO: + # 4/s [R][D:600] + user_agent: str = None, # User-Agent string. Leave blank for default. Also SMTP-TO: # <a@b.com><c@d.com>...<q@x.com> - debug_=False): + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_add_l4_endp(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if alias is not None: data["alias"] = alias @@ -4019,9 +2685,10 @@ class LFJsonPost(LFCliBase): data["user_agent"] = user_agent if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/add_l4_endp", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/add_l4_endp", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -4053,21 +2720,21 @@ class LFJsonPost(LFCliBase): return (cls[member].value for member in cls.__members__ if member == name) def post_add_monitor(self, - aid=None, # AID, may be used when sniffing on /AX radios. - ap_name=None, # Name for this Monitor interface, for example: moni0 - bssid=None, # BSSID to use when sniffing on /AX radios, optional. - flags=None, # Flags for this monitor interface. - flags_mask=None, # Flags mask for this monitor interface. - radio=None, # Name of the physical radio interface, for example: wiphy0 - resource=None, # Resource number. - shelf=None, # Shelf number. - debug_=False): + aid: str = None, # AID, may be used when sniffing on /AX radios. + ap_name: str = None, # Name for this Monitor interface, for example: moni0 [W] + bssid: str = None, # BSSID to use when sniffing on /AX radios, optional. + flags: str = None, # Flags for this monitor interface. + flags_mask: str = None, # Flags mask for this monitor interface. + radio: str = None, # Name of the physical radio interface, for example: wiphy0 [W] + resource: str = None, # Resource number. [W] + shelf: str = None, # Shelf number. [R][D:1] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_add_monitor(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if aid is not None: data["aid"] = aid @@ -4087,9 +2754,10 @@ class LFJsonPost(LFCliBase): data["shelf"] = shelf if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/add_monitor", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/add_monitor", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -4099,22 +2767,23 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#add_mvlan ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_add_mvlan(self, - flags=None, # 0x1: Create admin-down. - index=None, # Optional: The index of the VLAN, (the 4 in eth0#4) - mac=None, # The MAC address, can also use parent-pattern in 5.3.8 and higher: - # xx:xx:xx:*:*:xx - old_name=None, # The temporary name, used for configuring un-discovered hardware. - port=None, # Port number of an existing Ethernet interface. - report_timer=None, # Report timer for this port, leave blank or use NA for defaults. - resource=None, # Resource number. - shelf=None, # Shelf number. - debug_=False): + flags: str = None, # 0x1: Create admin-down. + index: str = None, # Optional: The index of the VLAN, (the 4 in + # eth0#4) + mac: str = None, # The MAC address, can also use parent-pattern in 5.3.8 and higher: + # xx:xx:xx:*:*:xx [W] + old_name: str = None, # The temporary name, used for configuring un-discovered hardware. + port: str = None, # Port number of an existing Ethernet interface. [W] + report_timer: str = None, # Report timer for this port, leave blank or use NA for defaults. + resource: str = None, # Resource number. [W] + shelf: str = None, # Shelf number. [R][D:1] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_add_mvlan(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if flags is not None: data["flags"] = flags @@ -4134,9 +2803,10 @@ class LFJsonPost(LFCliBase): data["shelf"] = shelf if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/add_mvlan", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/add_mvlan", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -4146,48 +2816,49 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#add_ppp_link ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_add_ppp_link(self, - auth=None, # YES if you want to authenticate. Default is NO. - channel_groups=None, # List of channel groups, see above. - debug=None, # YES for debug, otherwise debugging for the ppp connection is - # off. - down_time_max_ms=None, # Maximum length of downtime (ms) for PPP link between runs, or - # 0 for the link to be always up. - down_time_min_ms=None, # Minimum length of downtime (ms) for PPP link between runs, or - # 0 for the link to be always up. - dst_ip=None, # Destination IP address for this PPP connection. - extra_args=None, # Extra arguments to be passed directly to the pppd server. - holdoff=None, # Seconds between attempt to bring link back up if it dies, + auth: str = None, # YES if you want to authenticate. Default is NO. + channel_groups: str = None, # List of channel groups, see above. + p_debug: str = None, # YES for debug, otherwise debugging for the ppp connection + # is off. + down_time_max_ms: str = None, # Maximum length of downtime (ms) for PPP link between runs, + # or 0 for the link to be always up. + down_time_min_ms: str = None, # Minimum length of downtime (ms) for PPP link between runs, + # or 0 for the link to be always up. + dst_ip: str = None, # Destination IP address for this PPP connection. + extra_args: str = None, # Extra arguments to be passed directly to the pppd server. + holdoff: str = None, # Seconds between attempt to bring link back up if it dies, # suggest 1. - lcp_echo_failure=None, # LCP echo failures before we determine links is dead, suggest - # 5. - lcp_echo_interval=None, # Seconds between LCP echos, suggest 1. - mlppp_descriptor=None, # A unique key for use with multi-link PPP connections. - persist=None, # YES if you want to persist the connection. This is suggested. - pppoe_transport_port=None, # Port number (or name) for underlying PPPoE transport. - resource=None, # Resource (machine) number. - run_time_max_ms=None, # Maximum uptime (ms) for PPP link during an experiment, or 0 - # for the link to be always up. - run_time_min_ms=None, # Minimum uptime (ms) for PPP link during an experiment, or 0 - # for the link to be always up. - shelf=None, # Shelf name/id. - src_ip=None, # Source IP address for this PPP connection. - transport_type=None, # What sort of transport this ppp link uses. - tty_transport_device=None, # TTY device for PPP links associated with TTYs. - unit=None, # Unit number for the PPP link. ie, the 7 in ppp7. - debug_=False): + lcp_echo_failure: str = None, # LCP echo failures before we determine links is dead, + # suggest 5. + lcp_echo_interval: str = None, # Seconds between LCP echos, suggest 1. + mlppp_descriptor: str = None, # A unique key for use with multi-link PPP connections. + persist: str = None, # YES if you want to persist the connection. This is + # suggested. + pppoe_transport_port: str = None, # Port number (or name) for underlying PPPoE transport. + resource: str = None, # Resource (machine) number. [W] + run_time_max_ms: str = None, # Maximum uptime (ms) for PPP link during an experiment, or + # 0 for the link to be always up. + run_time_min_ms: str = None, # Minimum uptime (ms) for PPP link during an experiment, or + # 0 for the link to be always up. + shelf: str = None, # Shelf name/id. [R] + src_ip: str = None, # Source IP address for this PPP connection. + transport_type: str = None, # What sort of transport this ppp link uses. + tty_transport_device: str = None, # TTY device for PPP links associated with TTYs. + unit: str = None, # Unit number for the PPP link. ie, the 7 in ppp7. [W] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_add_ppp_link(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if auth is not None: data["auth"] = auth if channel_groups is not None: data["channel_groups"] = channel_groups - if debug is not None: - data["debug"] = debug + if p_debug is not None: + data["debug"] = p_debug if down_time_max_ms is not None: data["down_time_max_ms"] = down_time_max_ms if down_time_min_ms is not None: @@ -4226,9 +2897,10 @@ class LFJsonPost(LFCliBase): data["unit"] = unit if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/add_ppp_link", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/add_ppp_link", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -4305,28 +2977,28 @@ class LFJsonPost(LFCliBase): vlan = "vlan" # 802.1q VLAN. Specify VID with the 'freq' option. def post_add_profile(self, - alias_prefix=None, # Port alias prefix, aka hostname prefix. - antenna=None, # Antenna count for this profile. - bandwidth=None, # 0 (auto), 20, 40, 80 or 160 - eap_id=None, # EAP Identifier - flags_mask=None, # Specify what flags to set. - freq=None, # WiFi frequency to be used, 0 means default. - instance_count=None, # Number of devices (stations, vdevs, etc) - mac_pattern=None, # Optional MAC-Address pattern, for instance: xx:xx:xx:*:*:xx - name=None, # Profile Name. - passwd=None, # WiFi Password to be used (AP Mode), [BLANK] means no password. - profile_flags=None, # Flags for this profile, see above. - profile_type=None, # Profile type: See above. - ssid=None, # WiFi SSID to be used, [BLANK] means any. - vid=None, # Vlan-ID (only valid for vlan profiles). - wifi_mode=None, # WiFi Mode for this profile. - debug_=False): + alias_prefix: str = None, # Port alias prefix, aka hostname prefix. + antenna: str = None, # Antenna count for this profile. + bandwidth: str = None, # 0 (auto), 20, 40, 80 or 160 + eap_id: str = None, # EAP Identifier + flags_mask: str = None, # Specify what flags to set. + freq: str = None, # WiFi frequency to be used, 0 means default. + instance_count: str = None, # Number of devices (stations, vdevs, etc) + mac_pattern: str = None, # Optional MAC-Address pattern, for instance: xx:xx:xx:*:*:xx + name: str = None, # Profile Name. [R] + passwd: str = None, # WiFi Password to be used (AP Mode), [BLANK] means no password. + profile_flags: str = None, # Flags for this profile, see above. + profile_type: str = None, # Profile type: See above. [W] + ssid: str = None, # WiFi SSID to be used, [BLANK] means any. + vid: str = None, # Vlan-ID (only valid for vlan profiles). + wifi_mode: str = None, # WiFi Mode for this profile. + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_add_profile(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if alias_prefix is not None: data["alias_prefix"] = alias_prefix @@ -4360,9 +3032,10 @@ class LFJsonPost(LFCliBase): data["wifi_mode"] = wifi_mode if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/add_profile", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/add_profile", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -4372,16 +3045,16 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#add_profile_notes ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_add_profile_notes(self, - dut=None, # Profile Name. - text=None, # [BLANK] will erase all, any other text will be appended to + dut: str = None, # Profile Name. [R] + text: str = None, # [BLANK] will erase all, any other text will be appended to # existing text. Unescaped Value - debug_=False): + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_add_profile_notes(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if dut is not None: data["dut"] = dut @@ -4389,9 +3062,10 @@ class LFJsonPost(LFCliBase): data["text"] = text if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/add_profile_notes", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/add_profile_notes", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -4401,18 +3075,18 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#add_rdd ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_add_rdd(self, - peer_ifname=None, # The peer (other) RedirectDevice in this pair. - port=None, # Name of the Redirect Device to create. - report_timer=None, # Report timer for this port, leave blank or use NA for defaults. - resource=None, # Resource number. - shelf=None, # Shelf number. - debug_=False): + peer_ifname: str = None, # The peer (other) RedirectDevice in this pair. + port: str = None, # Name of the Redirect Device to create. [W] + report_timer: str = None, # Report timer for this port, leave blank or use NA for defaults. + resource: str = None, # Resource number. [W] + shelf: str = None, # Shelf number. [R][D:1] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_add_rdd(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if peer_ifname is not None: data["peer_ifname"] = peer_ifname @@ -4426,9 +3100,10 @@ class LFJsonPost(LFCliBase): data["shelf"] = shelf if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/add_rdd", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/add_rdd", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -4438,17 +3113,18 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#add_sec_ip ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_add_sec_ip(self, - ip_list=None, # IP1/prefix,IP2/prefix,...IPZ/prefix. - port=None, # Name of network device (Port) to which these IPs will be added. - resource=None, # Resource number. - shelf=None, # Shelf number. - debug_=False): + ip_list: str = None, # IP1/prefix,IP2/prefix,...IPZ/prefix. [W] + port: str = None, # Name of network device (Port) to which these IPs will be added. + # [W] + resource: str = None, # Resource number. [W] + shelf: str = None, # Shelf number. [R][D:1] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_add_sec_ip(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if ip_list is not None: data["ip_list"] = ip_list @@ -4460,9 +3136,10 @@ class LFJsonPost(LFCliBase): data["shelf"] = shelf if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/add_sec_ip", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/add_sec_ip", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -4567,43 +3244,44 @@ class LFJsonPost(LFCliBase): p_bitmap_ = "[bitmap]" # '0xff 00 ...' to directly specify the MCS bitmap. def post_add_sta(self, - ampdu_density=None, # 0-7, or 0xFF to not set. - ampdu_factor=None, # 0-3, or 0xFF to not set. - ap=None, # The Access Point BSSID this Virtual STA should be associated with - # (example: 00:11:22:33:4:55, or DEFAULT for any). - flags=None, # Flags for this interface (see above.) - flags_mask=None, # If set, only these flags will be considered. - ieee80211w=None, # Management Frame Protection: 0: disabled, 1: optional, 2: Required. - key=None, # Encryption key (WEP, WPA, WPA2, WPA3, etc) for this Virtual STA. + ampdu_density: str = None, # 0-7, or 0xFF to not set. + ampdu_factor: str = None, # 0-3, or 0xFF to not set. + ap: str = None, # The Access Point BSSID this Virtual STA should be associated with + flags: str = None, # Flags for this interface (see above.) [W] + flags_mask: str = None, # If set, only these flags will be considered. + ieee80211w: str = None, # Management Frame Protection: 0: disabled, 1: optional, 2: + # Required. + key: str = None, # Encryption key (WEP, WPA, WPA2, WPA3, etc) for this Virtual STA. # Prepend with 0x for ascii-hex input. - mac=None, # The MAC address, can also use parent-pattern in 5.3.8 and higher: - # xx:xx:xx:*:*:xx - max_amsdu=None, # 1 == enabled, 0 == disabled, 0xFF == do not set. - mode=None, # WiFi mode:
  • 0: AUTO,
  • 1: 802.11a
  • 2: b
  • 3: - # g
  • 4: abg
  • 5: abgn
  • 6: bgn
  • 7: bg
  • - #
  • 8: abgnAC
  • 9 anAC
  • 10 an
  • 11 - # bgnAC
  • 12 abgnAX
  • 13 bgnAX
  • 14 anAX
  • 15 - # aAX
- nickname=None, # Nickname for this Virtual STA. (No longer used) - radio=None, # Name of the physical radio interface, for example: wiphy0 - rate=None, # Max rate, see help above. - resource=None, # Resource number. - shelf=None, # Shelf number. - ssid=None, # SSID for this Virtual STA. Use [BLANK] for empty SSID. Start with - # 0x for HEX interpretation. - sta_br_ip=None, # IP Address for station bridging. Set to 0.0.0.0 to use MAC bridging. - sta_name=None, # Name for this Virtual STA, for example: sta0 - wpa_cfg_file=None, # WPA Supplicant config file. - x_coord=None, # Floating point number. - y_coord=None, # Floating point number. - z_coord=None, # Floating point number. - debug_=False): + mac: str = None, # The MAC address, can also use parent-pattern in 5.3.8 and higher: + # xx:xx:xx:*:*:xx [W] + max_amsdu: str = None, # 1 == enabled, 0 == disabled, 0xFF == do not set. + mode: str = None, # WiFi mode:
  • 0: AUTO,
  • 1: 802.11a
  • 2: b
  • + #
  • 3: g
  • 4: abg
  • 5: abgn
  • 6: bgn
  • + #
  • 7: bg
  • 8: abgnAC
  • 9 anAC
  • 10 + # an
  • 11 bgnAC
  • 12 abgnAX
  • 13 bgnAX
  • 14 + # anAX
  • 15 aAX
[D:0] + nickname: str = None, # Nickname for this Virtual STA. (No longer used) + radio: str = None, # Name of the physical radio interface, for example: wiphy0 [W] + rate: str = None, # Max rate, see help above. + resource: str = None, # Resource number. [W] + shelf: str = None, # Shelf number. [R][D:1] + ssid: str = None, # SSID for this Virtual STA. Use [BLANK] for empty SSID. Start with + # 0x for HEX interpretation. [W] + sta_br_ip: str = None, # IP Address for station bridging. Set to 0.0.0.0 to use MAC + # bridging. + sta_name: str = None, # Name for this Virtual STA, for example: sta0 [W] + wpa_cfg_file: str = None, # WPA Supplicant config file. + x_coord: str = None, # Floating point number. + y_coord: str = None, # Floating point number. + z_coord: str = None, # Floating point number. + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_add_sta(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if ampdu_density is not None: data["ampdu_density"] = ampdu_density @@ -4651,9 +3329,10 @@ class LFJsonPost(LFCliBase): data["z_coord"] = z_coord if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/add_sta", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/add_sta", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -4677,27 +3356,35 @@ class LFJsonPost(LFCliBase): p_533_ft = 3 # 399-533 feet p_655_ft = 4 # 533-655 feet + class AddT1SpanType(Enum): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + Digium_T1 = "Digium_T1" # + Sangoma_E1 = "Sangoma_E1" # + Sangoma_T1 = "Sangoma_T1" # + def post_add_t1_span(self, - buildout=None, # Buildout, Integer, see above. - coding=None, # Coding: T1: ami or b8zs. E1: ami or hdb3 - cpu_id=None, # CPU identifier (A, B, etc) for multiport Sangoma resources. - first_channel=None, # The first DS0 channel for this span. - framing=None, # Framing: T1: esf or d4. E1: cas or ccs. - mtu=None, # MTU for this span (used by in-band management, if at all). - pci_bus=None, # PCI Bus number, needed for Sangoma resources. - pci_slot=None, # PCI slot number, needed for Sangoma resources. - resource=None, # Resource number. - shelf=None, # Shelf name/id. - span_num=None, # The span number. First span is 1, second is 2... - timing=None, # Timing: 0 == do not use, 1 == primary, 2 == secondary.. - p_type=None, # Currently supported types are: Sangoma_T1, Sangoma_E1, Digium_T1 - debug_=False): + buildout: str = None, # Buildout, Integer, see above. + coding: str = None, # Coding: T1: ami or b8zs. E1: ami or hdb3 + cpu_id: str = None, # CPU identifier (A, B, etc) for multiport Sangoma resources. + first_channel: str = None, # The first DS0 channel for this span. + framing: str = None, # Framing: T1: esf or d4. E1: cas or ccs. + mtu: str = None, # MTU for this span (used by in-band management, if at all). + pci_bus: str = None, # PCI Bus number, needed for Sangoma resources. + pci_slot: str = None, # PCI slot number, needed for Sangoma resources. + resource: str = None, # Resource number. [W] + shelf: str = None, # Shelf name/id. [R][D:1] + span_num: str = None, # The span number. First span is 1, second is 2... [W] + timing: str = None, # Timing: 0 == do not use, 1 == primary, 2 == secondary.. + p_type: str = None, # Currently supported types listed above. [W] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_add_t1_span(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if buildout is not None: data["buildout"] = buildout @@ -4727,9 +3414,10 @@ class LFJsonPost(LFCliBase): data["type"] = p_type if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/add_t1_span", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/add_t1_span", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -4739,17 +3427,17 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#add_text_blob ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_add_text_blob(self, - name=None, # Text name, for instance '2-AP-test-case' - text=None, # [BLANK] will erase all, any other text will be appended to existing - # text. Unescaped Value - p_type=None, # Text type identifier stream, for instance 'cv-connectivity' - debug_=False): + name: str = None, # Text name, for instance '2-AP-test-case' [R] + text: str = None, # [BLANK] will erase all, any other text will be appended to + # existing text. Unescaped Value + p_type: str = None, # Text type identifier stream, for instance 'cv-connectivity' [R] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_add_text_blob(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if name is not None: data["name"] = name @@ -4759,9 +3447,10 @@ class LFJsonPost(LFCliBase): data["type"] = p_type if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/add_text_blob", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/add_text_blob", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -4771,15 +3460,15 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#add_tgcx ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_add_tgcx(self, - cxname=None, # The name of the CX. - tgname=None, # The name of the test group. - debug_=False): + cxname: str = None, # The name of the CX. [R] + tgname: str = None, # The name of the test group. [R] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_add_tgcx(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if cxname is not None: data["cxname"] = cxname @@ -4787,9 +3476,10 @@ class LFJsonPost(LFCliBase): data["tgname"] = tgname if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/add_tgcx", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/add_tgcx", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -4821,19 +3511,19 @@ class LFJsonPost(LFCliBase): TX_BPS_RATE_OOR_3S = 0 # tx-bps over last 3 seconds is out of range. def post_add_threshold(self, - endp=None, # Endpoint name or ID. - thresh_id=None, # Threshold ID. If adding new threshold, use -1, otherwise use - # correct ID. - thresh_max=None, # Maximum acceptable value for this threshold. - thresh_min=None, # Minimum acceptable value for this threshold. - thresh_type=None, # Threshold type, integer, (see above). - debug_=False): + endp: str = None, # Endpoint name or ID. [R] + thresh_id: str = None, # Threshold ID. If adding new threshold, use -1, otherwise use + # correct ID. [W] + thresh_max: str = None, # Maximum acceptable value for this threshold. + thresh_min: str = None, # Minimum acceptable value for this threshold. + thresh_type: str = None, # Threshold type, integer, (see above). + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_add_threshold(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if endp is not None: data["endp"] = endp @@ -4847,9 +3537,10 @@ class LFJsonPost(LFCliBase): data["thresh_type"] = thresh_type if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/add_threshold", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/add_threshold", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -4859,22 +3550,23 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#add_tm ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_add_tm(self, - name=None, # The name of the test manager. Must be unique across test managers. - debug_=False): + name: str = None, # The name of the test manager. Must be unique across test managers. [R] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_add_tm(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if name is not None: data["name"] = name if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/add_tm", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/add_tm", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -4918,23 +3610,24 @@ class LFJsonPost(LFCliBase): udp = "udp" # def post_add_traffic_profile(self, - instance_count=None, # Number of connections per device - max_pdu=None, # Minimum PDU size - max_speed=None, # Opposite-Direction Speed in bps. - min_pdu=None, # Minimum PDU size - min_speed=None, # Opposite-Direction Speed in bps. - name=None, # Profile Name. - tos=None, # IP Type-of-Service - traffic_profile_flags=None, # Flags for this profile, none defined at this point. - traffic_profile_flags_mask=None, # Specify what flags to set. - p_type=None, # Profile type: See above.. - debug_=False): + instance_count: str = None, # Number of connections per device + max_pdu: str = None, # Minimum PDU size + max_speed: str = None, # Opposite-Direction Speed in bps. + min_pdu: str = None, # Minimum PDU size + min_speed: str = None, # Opposite-Direction Speed in bps. + name: str = None, # Profile Name. [R] + tos: str = None, # IP Type-of-Service + traffic_profile_flags: str = None, # Flags for this profile, none defined at this + # point. + traffic_profile_flags_mask: str = None, # Specify what flags to set. + p_type: str = None, # Profile type: See above. [W] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_add_traffic_profile(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if instance_count is not None: data["instance_count"] = instance_count @@ -4958,9 +3651,10 @@ class LFJsonPost(LFCliBase): data["type"] = p_type if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/add_traffic_profile", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/add_traffic_profile", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -4970,17 +3664,17 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#add_traffic_profile_notes ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_add_traffic_profile_notes(self, - dut=None, # Profile Name. - text=None, # [BLANK] will erase all, any other text will be appended - # to existing text. Unescaped - # Value - debug_=False): + dut: str = None, # Profile Name. [R] + text: str = None, # [BLANK] will erase all, any other text will be + # appended to existing text. Unescaped Value + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_add_traffic_profile_notes(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if dut is not None: data["dut"] = dut @@ -4988,9 +3682,10 @@ class LFJsonPost(LFCliBase): data["text"] = text if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/add_traffic_profile_notes", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/add_traffic_profile_notes", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -5074,36 +3769,37 @@ class LFJsonPost(LFCliBase): g = 3 # 802.11g def post_add_vap(self, - ap_name=None, # Name for this Virtual AP, for example: vap0 - beacon=None, # The beacon interval, in 1kus (1.024 ms), default 100, range: 15..65535 - custom_cfg=None, # Custom hostapd config file, if you want to craft your own config. - dtim_period=None, # DTIM period, range 1..255. Default 2. - flags=None, # Flags for this interface (see above.) - flags_mask=None, # If set, only these flags will be considered. - frag_thresh=None, # UN-USED, Was Fragmentation threshold, which is now set with - # set_wifi_radio, use NA - ieee80211w=None, # Management Frame Protection: 0: disabled, 1: optional, 2: Required. - key=None, # Encryption key for this Virtual AP. Prepend with 0x for ascii-hex + ap_name: str = None, # Name for this Virtual AP, for example: vap0 [W] + beacon: str = None, # The beacon interval, in 1kus (1.024 ms), default 100, range: + # 15..65535 + custom_cfg: str = None, # Custom hostapd config file, if you want to craft your own config. + dtim_period: str = None, # DTIM period, range 1..255. Default 2. + flags: str = None, # Flags for this interface (see above.) [W] + flags_mask: str = None, # If set, only these flags will be considered. + frag_thresh: str = None, # UN-USED, Was Fragmentation threshold, which is now set with + # set_wifi_radio, use NA [W] + ieee80211w: str = None, # Management Frame Protection: 0: disabled, 1: optional, 2: Required. + key: str = None, # Encryption key for this Virtual AP. Prepend with 0x for ascii-hex # representation. - mac=None, # The MAC address, can also use parent-pattern in 5.3.8 and higher: + mac: str = None, # The MAC address, can also use parent-pattern in 5.3.8 and higher: # xx:xx:xx:*:*:xx - max_sta=None, # Maximum number of Stations allowed to join this AP (1..2007) - mode=None, # WiFi mode: see table - radio=None, # Name of the physical radio interface, for example: wiphy0 - rate=None, # Max rate, see help for add_vsta - resource=None, # Resource number. - shelf=None, # Shelf number. - ssid=None, # SSID for this Virtual AP. - x_coord=None, # Floating point number. - y_coord=None, # Floating point number. - z_coord=None, # Floating point number. - debug_=False): + max_sta: str = None, # Maximum number of Stations allowed to join this AP (1..2007) + mode: str = None, # WiFi mode: see table [W] + radio: str = None, # Name of the physical radio interface, for example: wiphy0 [W] + rate: str = None, # Max rate, see help for add_vsta + resource: str = None, # Resource number. [W] + shelf: str = None, # Shelf number. [R][D:1] + ssid: str = None, # SSID for this Virtual AP. [W] + x_coord: str = None, # Floating point number. + y_coord: str = None, # Floating point number. + z_coord: str = None, # Floating point number. + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_add_vap(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if ap_name is not None: data["ap_name"] = ap_name @@ -5147,9 +3843,10 @@ class LFJsonPost(LFCliBase): data["z_coord"] = z_coord if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/add_vap", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/add_vap", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -5227,24 +3924,24 @@ class LFJsonPost(LFCliBase): return (cls[member].value for member in cls.__members__ if member == name) def post_add_venue(self, - description=None, # User-supplied description, ie: Big City Ball Park; + description: str = None, # User-supplied description, ie: Big City Ball Park; # 47-characters max. - freq_24=None, # Frequency list for 2.4Ghz band, see above. - freq_5=None, # Frequency list for 5Ghz band, see above. - resource=None, # Resource number. - shelf=None, # Shelf number. - venu_id=None, # Number to uniquely identify this venue on this resource. - x1=None, # Floating point coordinate for lower-left corner. - x2=None, # Floating point coordinate for upper-right corner. - y1=None, # Floating point coordinate for lower-left corner. - y2=None, # Floating point coordinate for upper-right corner. - debug_=False): + freq_24: str = None, # Frequency list for 2.4Ghz band, see above. + freq_5: str = None, # Frequency list for 5Ghz band, see above. + resource: str = None, # Resource number. [W] + shelf: str = None, # Shelf number. [R][D:1] + venu_id: str = None, # Number to uniquely identify this venue on this resource. [W] + x1: str = None, # Floating point coordinate for lower-left corner. + x2: str = None, # Floating point coordinate for upper-right corner. + y1: str = None, # Floating point coordinate for lower-left corner. + y2: str = None, # Floating point coordinate for upper-right corner. + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_add_venue(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if description is not None: data["description"] = description @@ -5268,9 +3965,10 @@ class LFJsonPost(LFCliBase): data["y2"] = y2 if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/add_venue", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/add_venue", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -5280,19 +3978,19 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#add_vlan ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_add_vlan(self, - old_name=None, # The temporary name, used for configuring un-discovered hardware. - port=None, # Port number of an existing Ethernet interface. - report_timer=None, # Report timer for this port, leave blank or use NA for defaults. - resource=None, # Resource number. - shelf=None, # Shelf number. - vid=None, # The VLAN-ID for this 802.1Q VLAN interface. - debug_=False): + old_name: str = None, # The temporary name, used for configuring un-discovered hardware. + port: str = None, # Port number of an existing Ethernet interface. [W] + report_timer: str = None, # Report timer for this port, leave blank or use NA for defaults. + resource: str = None, # Resource number. [W] + shelf: str = None, # Shelf number. [R][D:1] + vid: str = None, # The VLAN-ID for this 802.1Q VLAN interface. [W] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_add_vlan(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if old_name is not None: data["old_name"] = old_name @@ -5308,9 +4006,10 @@ class LFJsonPost(LFCliBase): data["vid"] = vid if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/add_vlan", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/add_vlan", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -5320,34 +4019,35 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#add_voip_endp ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_add_voip_endp(self, - alias=None, # Name of endpoint. - auth_user_name=None, # Use this field for authentication user name. AUTO or blank mean - # use phone number. - display_name=None, # User-Name to be displayed. Use AUTO to display phone number. - gateway_port=None, # IP Port for SIP gateway (defaults to 5060). - ip_addr=None, # Use this IP for local IP address. Useful when there are + alias: str = None, # Name of endpoint. [R] + auth_user_name: str = None, # Use this field for authentication user name. AUTO or blank + # mean use phone number. + display_name: str = None, # User-Name to be displayed. Use AUTO to display phone number. + gateway_port: str = None, # IP Port for SIP gateway (defaults to 5060). + ip_addr: str = None, # Use this IP for local IP address. Useful when there are # multiple IPs on a port. - peer_phone_num=None, # Use AUTO to use phone number of peer endpoint, otherwise + peer_phone_num: str = None, # Use AUTO to use phone number of peer endpoint, otherwise # specify a number: user[@host[:port]] - phone_num=None, # Phone number for Endpoint - port=None, # Port number or name. - proxy_passwd=None, # Password to be used when registering with proxy/gateway. - resource=None, # Resource number. - rtp_port=None, # RTP port to use for send and receive. - rx_sound_file=None, # File name to save received PCM data to. Will be in WAV format, - # or AUTO - shelf=None, # Shelf name/id. - sip_gateway=None, # SIP Gateway/Proxy Name, this is who to register with, or AUTO - tx_sound_file=None, # File name containing the sound sample we will be playing. - vad_max_timer=None, # How often should we force a packet, even if VAD is on. - vad_timer=None, # How much silence (milliseconds) before VAD is enabled. - debug_=False): + phone_num: str = None, # Phone number for Endpoint [W] + port: str = None, # Port number or name. [W] + proxy_passwd: str = None, # Password to be used when registering with proxy/gateway. + resource: str = None, # Resource number. [W] + rtp_port: str = None, # RTP port to use for send and receive. + rx_sound_file: str = None, # File name to save received PCM data to. Will be in WAV + # format, or AUTO + shelf: str = None, # Shelf name/id. [R][D:1] + sip_gateway: str = None, # SIP Gateway/Proxy Name, this is who to register with, or + # AUTO + tx_sound_file: str = None, # File name containing the sound sample we will be playing. + vad_max_timer: str = None, # How often should we force a packet, even if VAD is on. + vad_timer: str = None, # How much silence (milliseconds) before VAD is enabled. + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_add_voip_endp(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if alias is not None: data["alias"] = alias @@ -5385,9 +4085,10 @@ class LFJsonPost(LFCliBase): data["vad_timer"] = vad_timer if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/add_voip_endp", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/add_voip_endp", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -5429,25 +4130,25 @@ class LFJsonPost(LFCliBase): return (cls[member].value for member in cls.__members__ if member == name) def post_add_vr(self, - alias=None, # Name of virtual router. - flags=None, # Virtual router flags, see above for definitions. - height=None, # Height to be used when drawn in the LANforge-GUI. - notes=None, # Notes for this Virtual Router. Put in quotes if the notes include + alias: str = None, # Name of virtual router. [R] + flags: str = None, # Virtual router flags, see above for definitions. + height: str = None, # Height to be used when drawn in the LANforge-GUI. + notes: str = None, # Notes for this Virtual Router. Put in quotes if the notes include # white-space. - resource=None, # Resource number. - shelf=None, # Shelf name/id. - vr_id=None, # Leave blank, use NA or 0xFFFF unless you are certain of the value you + resource: str = None, # Resource number. [W] + shelf: str = None, # Shelf name/id. [R][D:1] + vr_id: str = None, # Leave blank, use NA or 0xFFFF unless you are certain of the value you # want to enter. - width=None, # Width to be used when drawn in the LANforge-GUI. - x=None, # X coordinate to be used when drawn in the LANforge-GUI. - y=None, # Y coordinate to be used when drawn in the LANforge-GUI. - debug_=False): + width: str = None, # Width to be used when drawn in the LANforge-GUI. + x: str = None, # X coordinate to be used when drawn in the LANforge-GUI. + y: str = None, # Y coordinate to be used when drawn in the LANforge-GUI. + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_add_vr(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if alias is not None: data["alias"] = alias @@ -5471,9 +4172,10 @@ class LFJsonPost(LFCliBase): data["y"] = y if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/add_vr", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/add_vr", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -5507,25 +4209,25 @@ class LFJsonPost(LFCliBase): return (cls[member].value for member in cls.__members__ if member == name) def post_add_vr_bgp(self, - bgp_id=None, # BGP Identifier: IPv4 Address - cluster_id=None, # Cluster ID, IPv4 Address. Use NA if not clustering. - confed_id=None, # Confederation ID 1-65535. Use NA if not in a confederation. - flags=None, # Virtual router BGP flags, see above for definitions. - half_life=None, # Halflife in minutes for damping configuration. - local_as=None, # BGP Autonomous System number, 1-65535 - max_suppress=None, # Maximum hold down time in minutes for damping configuration. - resource=None, # Resource number. - reuse=None, # Route flag damping reuse threshold, in minutes. - shelf=None, # Shelf name/id. - suppress=None, # Route flag damping cutoff threshold, in minutes. - vr_id=None, # Name of virtual router. - debug_=False): + bgp_id: str = None, # BGP Identifier: IPv4 Address [W] + cluster_id: str = None, # Cluster ID, IPv4 Address. Use NA if not clustering. + confed_id: str = None, # Confederation ID 1-65535. Use NA if not in a confederation. + flags: str = None, # Virtual router BGP flags, see above for definitions. + half_life: str = None, # Halflife in minutes for damping configuration. + local_as: str = None, # BGP Autonomous System number, 1-65535 + max_suppress: str = None, # Maximum hold down time in minutes for damping configuration. + resource: str = None, # Resource number. [W] + reuse: str = None, # Route flag damping reuse threshold, in minutes. + shelf: str = None, # Shelf name/id. [R][D:1] + suppress: str = None, # Route flag damping cutoff threshold, in minutes. + vr_id: str = None, # Name of virtual router. [R] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_add_vr_bgp(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if bgp_id is not None: data["bgp_id"] = bgp_id @@ -5553,9 +4255,10 @@ class LFJsonPost(LFCliBase): data["vr_id"] = vr_id if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/add_vr_bgp", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/add_vr_bgp", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -5598,47 +4301,48 @@ class LFJsonPost(LFCliBase): return (cls[member].value for member in cls.__members__ if member == name) def post_add_vrcx(self, - dhcp_dns=None, # IP Address of DNS server. - dhcp_dns6=None, # IPv6 Address of DNS server. - dhcp_domain=None, # DHCP Domain name to serve. - dhcp_lease_time=None, # DHCP Lease time (in seconds) - dhcp_max=None, # Minimum IP address range to serve. - dhcp_max6=None, # Minimum IPv6 address to serve. - dhcp_min=None, # Minimum IP address range to serve. - dhcp_min6=None, # Minimum IPv6 address to serve. - flags=None, # Flags, specify if subnets 0-7 are in use, see above for others. - height=None, # Height to be used when drawn in the LANforge-GUI. - interface_cost=None, # If using OSPF, this sets the cost for this link (1-65535). - local_dev=None, # Name of port A, the local network device pair. - local_dev_b=None, # Name of port B for the local redirect device pair. - nexthop=None, # The next-hop to use when routing packets out this interface. - ospf_area=None, # If using OSPF, this sets the OSPF area for this interface. Default - # is 0.0.0.0. - remote_dev=None, # Name the remote network device. - remote_dev_b=None, # Name of port B for the remote network device. - resource=None, # Resource number. - rip_metric=None, # If using RIP, this determines the RIP metric (cost), (1-15, 15 is - # infinite). - shelf=None, # Shelf name/id. - subnets=None, # Subnets associated with this link, format: 1.1.1.1/24,1.1.2.1/16... - vr_name=None, # Virtual Router this endpoint belongs to. Use 'FREE_LIST' to add a - # stand-alone endpoint. - vrrp_id=None, # VRRP id, must be unique in this virtual router (1-255) - vrrp_interval=None, # VRRP broadcast message interval, in seconds (1-255) - vrrp_ip=None, # VRRP IPv4 address..ignored if not flagged for VRRP. - vrrp_ip_prefix=None, # Number of bits in subnet mask, ie 24 for 255.255.255.0 - vrrp_priority=None, # VRRP Priority (1-255, higher is more priority.) - wanlink=None, # The name of the WanLink that connects the two B ports. - width=None, # Width to be used when drawn in the LANforge-GUI. - x=None, # X coordinate to be used when drawn in the LANforge-GUI. - y=None, # Y coordinate to be used when drawn in the LANforge-GUI. - debug_=False): + dhcp_dns: str = None, # IP Address of DNS server. + dhcp_dns6: str = None, # IPv6 Address of DNS server. + dhcp_domain: str = None, # DHCP Domain name to serve. + dhcp_lease_time: str = None, # DHCP Lease time (in seconds) + dhcp_max: str = None, # Minimum IP address range to serve. + dhcp_max6: str = None, # Minimum IPv6 address to serve. + dhcp_min: str = None, # Minimum IP address range to serve. + dhcp_min6: str = None, # Minimum IPv6 address to serve. + flags: str = None, # Flags, specify if subnets 0-7 are in use, see above for others. + height: str = None, # Height to be used when drawn in the LANforge-GUI. + interface_cost: str = None, # If using OSPF, this sets the cost for this link (1-65535). + local_dev: str = None, # Name of port A, the local network device pair. [W] + local_dev_b: str = None, # Name of port B for the local redirect device pair. [W] + nexthop: str = None, # The next-hop to use when routing packets out this interface. + ospf_area: str = None, # If using OSPF, this sets the OSPF area for this interface. + # Default is 0.0.0.0. + remote_dev: str = None, # Name the remote network device. [W] + remote_dev_b: str = None, # Name of port B for the remote network device. [W] + resource: str = None, # Resource number. [W] + rip_metric: str = None, # If using RIP, this determines the RIP metric (cost), (1-15, 15 + # is infinite). + shelf: str = None, # Shelf name/id. [R][D:1] + subnets: str = None, # Subnets associated with this link, format: + # 1.1.1.1/24,1.1.2.1/16... + vr_name: str = None, # Virtual Router this endpoint belongs to. Use 'FREE_LIST' to add + # a stand-alone endpoint. [R][D:FREE_LIST] + vrrp_id: str = None, # VRRP id, must be unique in this virtual router (1-255) + vrrp_interval: str = None, # VRRP broadcast message interval, in seconds (1-255) + vrrp_ip: str = None, # VRRP IPv4 address..ignored if not flagged for VRRP. + vrrp_ip_prefix: str = None, # Number of bits in subnet mask, ie 24 for 255.255.255.0 + vrrp_priority: str = None, # VRRP Priority (1-255, higher is more priority.) + wanlink: str = None, # The name of the WanLink that connects the two B ports. [W] + width: str = None, # Width to be used when drawn in the LANforge-GUI. + x: str = None, # X coordinate to be used when drawn in the LANforge-GUI. + y: str = None, # Y coordinate to be used when drawn in the LANforge-GUI. + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_add_vrcx(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if dhcp_dns is not None: data["dhcp_dns"] = dhcp_dns @@ -5704,9 +4408,10 @@ class LFJsonPost(LFCliBase): data["y"] = y if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/add_vrcx", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/add_vrcx", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -5716,21 +4421,21 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#add_vrcx2 ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_add_vrcx2(self, - local_dev=None, # Name of port A for the connection. - nexthop6=None, # The IPv6 next-hop to use when routing packets out this interface. - resource=None, # Resource number. - shelf=None, # Shelf name/id. - subnets6=None, # IPv6 Subnets associated with this link, format: + local_dev: str = None, # Name of port A for the connection. [W] + nexthop6: str = None, # The IPv6 next-hop to use when routing packets out this interface. + resource: str = None, # Resource number. [W] + shelf: str = None, # Shelf name/id. [R][D:1] + subnets6: str = None, # IPv6 Subnets associated with this link, format: # aaaa:bbbb::0/64,cccc:dddd:eeee::0/64... - vr_name=None, # Virtual Router this endpoint belongs to. Use 'FREE_LIST' to add a - # stand-alone endpoint. - debug_=False): + vr_name: str = None, # Virtual Router this endpoint belongs to. Use 'FREE_LIST' to add a + # stand-alone endpoint. [W][D:FREE_LIST] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_add_vrcx2(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if local_dev is not None: data["local_dev"] = local_dev @@ -5746,9 +4451,10 @@ class LFJsonPost(LFCliBase): data["vr_name"] = vr_name if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/add_vrcx2", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/add_vrcx2", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -5765,68 +4471,72 @@ class LFJsonPost(LFCliBase): SHOW_WP = 1 # Show WanPaths in wanlink endpoint table in GUI def post_add_wl_endp(self, - alias=None, # Name of WanPath. - cpu_id=None, # The CPU/thread that this process should run on (kernel-mode - # only). - description=None, # Description for this endpoint, put in single quotes if it + alias: str = None, # Name of WanPath. [R] + cpu_id: str = None, # The CPU/thread that this process should run on + # (kernel-mode only). + description: str = None, # Description for this endpoint, put in single quotes if it # contains spaces. - dest_ip=None, # Selection filter: Destination IP. - dest_ip_mask=None, # Selection filter: Destination IP MASK. - drop_every_xth_pkt=None, # YES to periodically drop every Xth pkt, NO to drop packets + dest_ip: str = None, # Selection filter: Destination IP. + dest_ip_mask: str = None, # Selection filter: Destination IP MASK. + drop_every_xth_pkt: str = None, # YES to periodically drop every Xth pkt, NO to drop packets # randomly. - drop_freq=None, # How often, out of 1,000,000 packets, should we purposefully - # drop a packet. - dup_every_xth_pkt=None, # YES to periodically duplicate every Xth pkt, NO to duplicate - # packets randomly. - dup_freq=None, # How often, out of 1,000,000 packets, should we purposefully - # duplicate a packet. - extra_buffer=None, # The extra amount of bytes to buffer before dropping pkts, in - # units of 1024, use -1 for AUTO. - ignore_bandwidth=None, # Should we ignore the bandwidth settings from the playback + drop_freq: str = None, # How often, out of 1,000,000 packets, should we + # purposefully drop a packet. [W] + dup_every_xth_pkt: str = None, # YES to periodically duplicate every Xth pkt, NO to + # duplicate packets randomly. + dup_freq: str = None, # How often, out of 1,000,000 packets, should we + # purposefully duplicate a packet. [W] + extra_buffer: str = None, # The extra amount of bytes to buffer before dropping pkts, + # in units of 1024, use -1 for AUTO. [D:-1] + ignore_bandwidth: str = None, # Should we ignore the bandwidth settings from the playback # file? YES, NO, or NA. - ignore_dup=None, # Should we ignore the Duplicate Packet settings from the + ignore_dup: str = None, # Should we ignore the Duplicate Packet settings from the # playback file? YES, NO, or NA. - ignore_latency=None, # Should we ignore the latency settings from the playback file? - # YES, NO, or NA. - ignore_loss=None, # Should we ignore the packet-loss settings from the playback + ignore_latency: str = None, # Should we ignore the latency settings from the playback # file? YES, NO, or NA. - jitter_freq=None, # How often, out of 1,000,000 packets, should we apply random - # jitter. - latency=None, # The base latency added to all packets, in milliseconds (or add - # 'us' suffix for microseconds) - max_drop_amt=None, # Maximum amount of packets to drop in a row. Default is 1. - max_jitter=None, # The maximum jitter, in milliseconds (or add 'us' suffix for - # microseconds) - max_lateness=None, # Maximum amount of un-intentional delay before pkt is dropped. - # Default is AUTO - max_rate=None, # Maximum transmit rate (bps) for this WanLink. - max_reorder_amt=None, # Maximum amount of packets by which to reorder, Default is 10. - min_drop_amt=None, # Minimum amount of packets to drop in a row. Default is 1. - min_reorder_amt=None, # Minimum amount of packets by which to reorder, Default is 1. - playback_capture=None, # ON or OFF, should we play back a WAN capture file? - playback_capture_file=None, # Name of the WAN capture file to play back. - playback_loop=None, # Should we loop the playback file, YES or NO or NA. - port=None, # Port number. - reorder_every_xth_pkt=None, # YES to periodically reorder every Xth pkt, NO to reorder + ignore_loss: str = None, # Should we ignore the packet-loss settings from the + # playback file? YES, NO, or NA. + jitter_freq: str = None, # How often, out of 1,000,000 packets, should we apply + # random jitter. + latency: str = None, # The base latency added to all packets, in milliseconds (or + # add 'us' suffix for microseconds) [W] + max_drop_amt: str = None, # Maximum amount of packets to drop in a row. Default is 1. + # [D:1] + max_jitter: str = None, # The maximum jitter, in milliseconds (or add 'us' suffix + # for microseconds) [W] + max_lateness: str = None, # Maximum amount of un-intentional delay before pkt is + # dropped. Default is AUTO + max_rate: str = None, # Maximum transmit rate (bps) for this WanLink. + max_reorder_amt: str = None, # Maximum amount of packets by which to reorder, Default is + # 10. [D:10] + min_drop_amt: str = None, # Minimum amount of packets to drop in a row. Default is 1. + # [D:1] + min_reorder_amt: str = None, # Minimum amount of packets by which to reorder, Default is + # 1. [D:1] + playback_capture: str = None, # ON or OFF, should we play back a WAN capture file? + playback_capture_file: str = None, # Name of the WAN capture file to play back. + playback_loop: str = None, # Should we loop the playback file, YES or NO or NA. + port: str = None, # Port number. [W] + reorder_every_xth_pkt: str = None, # YES to periodically reorder every Xth pkt, NO to reorder # packets randomly. - reorder_freq=None, # How often, out of 1,000,000 packets, should we make a packet - # out of order. - resource=None, # Resource number. - shelf=None, # Shelf name/id. - source_ip=None, # Selection filter: Source IP. - source_ip_mask=None, # Selection filter: Source IP MASK. - speed=None, # The maximum speed this WanLink will accept (bps). - test_mgr=None, # The name of the Test-Manager this WanPath is to use. Leave + reorder_freq: str = None, # How often, out of 1,000,000 packets, should we make a + # packet out of order. [W] + resource: str = None, # Resource number. [W] + shelf: str = None, # Shelf name/id. [R][D:1] + source_ip: str = None, # Selection filter: Source IP. + source_ip_mask: str = None, # Selection filter: Source IP MASK. + speed: str = None, # The maximum speed this WanLink will accept (bps). [W] + test_mgr: str = None, # The name of the Test-Manager this WanPath is to use. Leave # blank for no restrictions. - wanlink=None, # Name of WanLink to which we are adding this WanPath. - wle_flags=None, # WanLink Endpoint specific flags, see above. - debug_=False): + wanlink: str = None, # Name of WanLink to which we are adding this WanPath. [R] + wle_flags: str = None, # WanLink Endpoint specific flags, see above. + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_add_wl_endp(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if alias is not None: data["alias"] = alias @@ -5904,9 +4614,10 @@ class LFJsonPost(LFCliBase): data["wle_flags"] = wle_flags if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/add_wl_endp", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/add_wl_endp", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -5916,20 +4627,20 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#admin ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_admin(self, - arg1=None, # Argument 1: xorp-port | scan-rslts-file | iface-name | iface-eid | + arg1: str = None, # Argument 1: xorp-port | scan-rslts-file | iface-name | iface-eid | # rfgen-message | id - arg2=None, # Argument 2: scan key | message | angle | dest-radio - arg3=None, # Argument 3: noprobe | migrate-sta-mac-pattern - arg5=None, # Argument 4: table-speed - cmd=None, # Admin command: + arg2: str = None, # Argument 2: scan key | message | angle | dest-radio + arg3: str = None, # Argument 3: noprobe | migrate-sta-mac-pattern + arg5: str = None, # Argument 4: table-speed + cmd: str = None, # Admin command: # resync_clock|write_xorp_cfg|scan_complete|ifup_post_complete|flush_complete|req_migrate|rfgen|chamber|clean_logs - debug_=False): + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_admin(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if arg1 is not None: data["arg1"] = arg1 @@ -5943,9 +4654,10 @@ class LFJsonPost(LFCliBase): data["cmd"] = cmd if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/admin", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/admin", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -5955,15 +4667,15 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#apply_vr_cfg ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_apply_vr_cfg(self, - resource=None, # The number of the resource in question, or 'ALL'. - shelf=None, # The number of the shelf in question, or 'ALL'. - debug_=False): + resource: str = None, # The number of the resource in question, or 'ALL'. [W] + shelf: str = None, # The number of the shelf in question, or 'ALL'. [R][D:ALL] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_apply_vr_cfg(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if resource is not None: data["resource"] = resource @@ -5971,9 +4683,10 @@ class LFJsonPost(LFCliBase): data["shelf"] = shelf if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/apply_vr_cfg", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/apply_vr_cfg", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -5983,16 +4696,16 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#blink_attenuator ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_blink_attenuator(self, - resource=None, # Resource number. - serno=None, # Serial number for requested Attenuator, or 'all'. - shelf=None, # Shelf number, usually 1. - debug_=False): + resource: str = None, # Resource number. [W] + serno: str = None, # Serial number for requested Attenuator, or 'all'. [W] + shelf: str = None, # Shelf number, usually 1. [R][D:1] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_blink_attenuator(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if resource is not None: data["resource"] = resource @@ -6002,9 +4715,10 @@ class LFJsonPost(LFCliBase): data["shelf"] = shelf if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/blink_attenuator", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/blink_attenuator", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -6040,18 +4754,18 @@ class LFJsonPost(LFCliBase): return (cls[member].value for member in cls.__members__ if member == name) def post_c_show_ports(self, - port=None, # Port number, or 'all'. - probe_flags=None, # See above, add them together for multiple probings. Leave blank if - # you want stats only. - resource=None, # Resource number, or 'all'. - shelf=None, # Name/id of the shelf, or 'all'. - debug_=False): + port: str = None, # Port number, or 'all'. [W] + probe_flags: str = None, # See above, add them together for multiple probings. Leave + # blank if you want stats only. + resource: str = None, # Resource number, or 'all'. [W] + shelf: str = None, # Name/id of the shelf, or 'all'. [R][D:1] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_c_show_ports(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if port is not None: data["port"] = port @@ -6063,9 +4777,10 @@ class LFJsonPost(LFCliBase): data["shelf"] = shelf if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/c_show_ports", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/c_show_ports", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -6075,15 +4790,15 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#cancel_vr_cfg ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_cancel_vr_cfg(self, - resource=None, # The number of the resource in question, or 'ALL'. - shelf=None, # The number of the shelf in question, or 'ALL'. - debug_=False): + resource: str = None, # The number of the resource in question, or 'ALL'. [W] + shelf: str = None, # The number of the shelf in question, or 'ALL'. [R][D:ALL] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_cancel_vr_cfg(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if resource is not None: data["resource"] = resource @@ -6091,9 +4806,10 @@ class LFJsonPost(LFCliBase): data["shelf"] = shelf if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/cancel_vr_cfg", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/cancel_vr_cfg", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -6103,23 +4819,24 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#clear_cd_counters ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_clear_cd_counters(self, - cd_name=None, # Name of Collision Domain, or 'all'. Null argument is same as - # 'all'. - debug_=False): + cd_name: str = None, # Name of Collision Domain, or 'all'. Null argument is same + # as 'all'. [W][D:all] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_clear_cd_counters(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if cd_name is not None: data["cd_name"] = cd_name if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/clear_cd_counters", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/clear_cd_counters", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -6129,23 +4846,24 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#clear_cx_counters ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_clear_cx_counters(self, - cx_name=None, # Name of Cross Connect, or 'all'. Null argument is same as - # 'all'. - debug_=False): + cx_name: str = None, # Name of Cross Connect, or 'all'. Null argument is same as + # 'all'. [W][D:all] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_clear_cx_counters(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if cx_name is not None: data["cx_name"] = cx_name if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/clear_cx_counters", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/clear_cx_counters", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -6155,19 +4873,19 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#clear_endp_counters ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_clear_endp_counters(self, - endp_name=None, # Name of Endpoint, or 'all'. Null argument is same as - # 'all'. - incr_seqno=None, # Enter 'YES' if you want the target to increment the + endp_name: str = None, # Name of Endpoint, or 'all'. Null argument is same as + # 'all'. [W][D:all] + incr_seqno: str = None, # Enter 'YES' if you want the target to increment the # cfg-seq-no. - just_latency=None, # Enter 'YES' if you only want to clear latency counters, + just_latency: str = None, # Enter 'YES' if you only want to clear latency counters, # and see above for RXGAP. - debug_=False): + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_clear_endp_counters(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if endp_name is not None: data["endp_name"] = endp_name @@ -6177,9 +4895,10 @@ class LFJsonPost(LFCliBase): data["just_latency"] = just_latency if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/clear_endp_counters", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/clear_endp_counters", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -6189,22 +4908,23 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#clear_group ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_clear_group(self, - name=None, # The name of the test group. - debug_=False): + name: str = None, # The name of the test group. [W] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_clear_group(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if name is not None: data["name"] = name if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/clear_group", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/clear_group", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -6223,18 +4943,18 @@ class LFJsonPost(LFCliBase): dhcp_leases = "dhcp_leases" # Remove dhcp lease files for IPv4 and IPv6 DHCP def post_clear_port_counters(self, - extra=None, # Clear something else instead: dhcp4_lease | dhcp6_lease | + extra: str = None, # Clear something else instead: dhcp4_lease | dhcp6_lease | # dhcp_leases - port=None, # The number of the port in question, or 'ALL'. - resource=None, # The number of the resource in question, or 'ALL'. - shelf=None, # The number of the shelf in question, or 'ALL'. - debug_=False): + port: str = None, # The number of the port in question, or 'ALL'. [W] + resource: str = None, # The number of the resource in question, or 'ALL'. [W] + shelf: str = None, # The number of the shelf in question, or 'ALL'. [R][D:1] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_clear_port_counters(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if extra is not None: data["extra"] = extra @@ -6246,9 +4966,10 @@ class LFJsonPost(LFCliBase): data["shelf"] = shelf if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/clear_port_counters", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/clear_port_counters", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -6258,15 +4979,16 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#clear_resource_counters ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_clear_resource_counters(self, - resource=None, # The number of the resource in question, or 'ALL'. - shelf=None, # The number of the shelf in question, or 'ALL'. - debug_=False): + resource: str = None, # The number of the resource in question, or 'ALL'. [W] + shelf: str = None, # The number of the shelf in question, or 'ALL'. + # [R][D:1] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_clear_resource_counters(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if resource is not None: data["resource"] = resource @@ -6274,9 +4996,10 @@ class LFJsonPost(LFCliBase): data["shelf"] = shelf if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/clear_resource_counters", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/clear_resource_counters", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -6286,15 +5009,15 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#clear_wp_counters ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_clear_wp_counters(self, - endp_name=None, # Name of WanLink Endpoint. - wp_name=None, # Name of WanPath to clear. - debug_=False): + endp_name: str = None, # Name of WanLink Endpoint. [W] + wp_name: str = None, # Name of WanPath to clear. + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_clear_wp_counters(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if endp_name is not None: data["endp_name"] = endp_name @@ -6302,9 +5025,10 @@ class LFJsonPost(LFCliBase): data["wp_name"] = wp_name if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/clear_wp_counters", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/clear_wp_counters", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -6314,18 +5038,18 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#create_client ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_create_client(self, - name=None, # A single name with no white-spaces (15 characters or less) - password=None, # Can be blank or 'NA' if no password is set, otherwise must be the - # password. Use IGNORE for no change. - super_user=None, # 1 If you want this user to have Administrative powers, 0 or blank - # otherwise. - debug_=False): + name: str = None, # A single name with no white-spaces (15 characters or less) [W] + password: str = None, # Can be blank or 'NA' if no password is set, otherwise must be + # the password. Use IGNORE for no change. + super_user: str = None, # 1 If you want this user to have Administrative powers, 0 or + # blank otherwise. + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_create_client(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if name is not None: data["name"] = name @@ -6335,9 +5059,10 @@ class LFJsonPost(LFCliBase): data["super_user"] = super_user if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/create_client", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/create_client", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -6346,17 +5071,32 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#diag ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + class DiagType(Enum): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + NA = "NA" # everything (default) + alerts = "alerts" # alert messages + clients = "clients" # connected clients + counters = "counters" # endpoint counters + endpoints = "endpoints" # list of endpoints + fds = "fds" # file descriptors + iobuffer = "iobuffer" # + license = "license" # license contents + shelf = "shelf" # + def post_diag(self, - arg1=None, # Optional: Endpoint name to diag. - p_type=None, # Default (blank) is everything, options: alerts, license, counters, fds, + arg1: str = None, # Optional: Endpoint name to diag. + p_type: str = None, # Default (blank) is everything, options: alerts, license, counters, fds, # clients, endpoints, shelf, iobuffer. - debug_=False): + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_diag(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if arg1 is not None: data["arg1"] = arg1 @@ -6364,9 +5104,10 @@ class LFJsonPost(LFCliBase): data["type"] = p_type if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/diag", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/diag", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -6376,16 +5117,16 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#discover ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_discover(self, - disconnect=None, # Set to 'disconnect' to force disconnect to remote resource process. - resource=None, # Resource ID. Use if discovering Attenuators. - shelf=None, # Shelf-ID, only used if discovering Attenuators. - debug_=False): + disconnect: str = None, # Set to 'disconnect' to force disconnect to remote resource process. + resource: str = None, # Resource ID. Use if discovering Attenuators. [W] + shelf: str = None, # Shelf-ID, only used if discovering Attenuators. [R][D:1] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_discover(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if disconnect is not None: data["disconnect"] = disconnect @@ -6395,9 +5136,10 @@ class LFJsonPost(LFCliBase): data["shelf"] = shelf if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/discover", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/discover", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -6407,15 +5149,15 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#do_pesq ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_do_pesq(self, - endp_name=None, # Name of Endpoint. - result_file_name=None, # The name of the file received by the endpoint. - debug_=False): + endp_name: str = None, # Name of Endpoint. [W] + result_file_name: str = None, # The name of the file received by the endpoint. [W] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_do_pesq(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if endp_name is not None: data["endp_name"] = endp_name @@ -6423,9 +5165,10 @@ class LFJsonPost(LFCliBase): data["result_file_name"] = result_file_name if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/do_pesq", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/do_pesq", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -6435,17 +5178,18 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#file ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_file(self, - card=None, # Card ID - cmd=None, # Only 'Download' supported for now, 'Upload' reserved for future use. - filename=None, # File to transfer. - shelf=None, # Shelf ID - debug_=False): + card: str = None, # Resource ID [W] + cmd: str = None, # Only 'Download' supported for now, 'Upload' reserved for future use. + # [W][D:Download] + filename: str = None, # File to transfer. [W] + shelf: str = None, # Shelf ID [R][D:1] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_file(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if card is not None: data["card"] = card @@ -6457,9 +5201,10 @@ class LFJsonPost(LFCliBase): data["shelf"] = shelf if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/file", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/file", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -6469,17 +5214,17 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#flash_attenuator ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_flash_attenuator(self, - filename=None, # File to use when uploading to attenuator. - resource=None, # Resource number. - serno=None, # Serial number for requested Attenuator, or 'all'. - shelf=None, # Shelf number, usually 1. - debug_=False): + filename: str = None, # File to use when uploading to attenuator. + resource: str = None, # Resource number. [W] + serno: str = None, # Serial number for requested Attenuator, or 'all'. [W] + shelf: str = None, # Shelf number, usually 1. [R][D:1] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_flash_attenuator(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if filename is not None: data["filename"] = filename @@ -6491,9 +5236,10 @@ class LFJsonPost(LFCliBase): data["shelf"] = shelf if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/flash_attenuator", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/flash_attenuator", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -6503,15 +5249,15 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#getavglatency ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_getavglatency(self, - aorb=None, # For AtoB, enter 'B', for BtoA, enter 'A'. - cx=None, # Cross-connect or Test-Group name - debug_=False): + aorb: str = None, # For AtoB, enter 'B', for BtoA, enter 'A'. + cx: str = None, # Cross-connect or Test-Group name [W] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_getavglatency(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if aorb is not None: data["aorb"] = aorb @@ -6519,9 +5265,10 @@ class LFJsonPost(LFCliBase): data["cx"] = cx if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/getavglatency", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/getavglatency", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -6531,15 +5278,15 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#getinrxbps ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_getinrxbps(self, - aorb=None, # For endpoint a, enter 'A', for endpoint b, enter 'B'. - cx=None, # Cross-connect or Test-Group name - debug_=False): + aorb: str = None, # For endpoint a, enter 'A', for endpoint b, enter 'B'. + cx: str = None, # Cross-connect or Test-Group name [W] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_getinrxbps(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if aorb is not None: data["aorb"] = aorb @@ -6547,9 +5294,10 @@ class LFJsonPost(LFCliBase): data["cx"] = cx if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/getinrxbps", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/getinrxbps", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -6559,15 +5307,15 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#getinrxrate ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_getinrxrate(self, - aorb=None, # For endpoint a, enter 'A', for endpoint b, enter 'B'. - cx=None, # Cross-connect or Test-Group name - debug_=False): + aorb: str = None, # For endpoint a, enter 'A', for endpoint b, enter 'B'. + cx: str = None, # Cross-connect or Test-Group name [W] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_getinrxrate(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if aorb is not None: data["aorb"] = aorb @@ -6575,9 +5323,10 @@ class LFJsonPost(LFCliBase): data["cx"] = cx if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/getinrxrate", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/getinrxrate", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -6587,15 +5336,15 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#getintxrate ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_getintxrate(self, - aorb=None, # For endpoint a, enter 'A', for endpoint b, enter 'B'. - cx=None, # Cross-connect or Test-Group name - debug_=False): + aorb: str = None, # For endpoint a, enter 'A', for endpoint b, enter 'B'. + cx: str = None, # Cross-connect or Test-Group name [W] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_getintxrate(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if aorb is not None: data["aorb"] = aorb @@ -6603,9 +5352,10 @@ class LFJsonPost(LFCliBase): data["cx"] = cx if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/getintxrate", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/getintxrate", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -6615,15 +5365,15 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#getipadd ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_getipadd(self, - aorb=None, # For endpoint a, enter 'A', for endpoint b, enter 'B'. - cx=None, # Cross-connect name - debug_=False): + aorb: str = None, # For endpoint a, enter 'A', for endpoint b, enter 'B'. + cx: str = None, # Cross-connect name [W] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_getipadd(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if aorb is not None: data["aorb"] = aorb @@ -6631,9 +5381,10 @@ class LFJsonPost(LFCliBase): data["cx"] = cx if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/getipadd", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/getipadd", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -6643,15 +5394,15 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#getmac ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_getmac(self, - aorb=None, # For endpoint a, enter 'A', for endpoint b, enter 'B'. - cx=None, # Cross-connect name - debug_=False): + aorb: str = None, # For endpoint a, enter 'A', for endpoint b, enter 'B'. + cx: str = None, # Cross-connect name [W] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_getmac(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if aorb is not None: data["aorb"] = aorb @@ -6659,9 +5410,10 @@ class LFJsonPost(LFCliBase): data["cx"] = cx if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/getmac", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/getmac", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -6671,15 +5423,15 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#getmask ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_getmask(self, - aorb=None, # For endpoint a, enter 'A', for endpoint b, enter 'B'. - cx=None, # Cross-connect name - debug_=False): + aorb: str = None, # For endpoint a, enter 'A', for endpoint b, enter 'B'. + cx: str = None, # Cross-connect name + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_getmask(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if aorb is not None: data["aorb"] = aorb @@ -6687,9 +5439,10 @@ class LFJsonPost(LFCliBase): data["cx"] = cx if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/getmask", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/getmask", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -6699,15 +5452,15 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#getpktdrops ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_getpktdrops(self, - aorb=None, # For AtoB, enter 'B', for BtoA, enter 'A'. - cx=None, # Cross-connect or Test-Group name - debug_=False): + aorb: str = None, # For AtoB, enter 'B', for BtoA, enter 'A'. + cx: str = None, # Cross-connect or Test-Group name [W] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_getpktdrops(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if aorb is not None: data["aorb"] = aorb @@ -6715,9 +5468,10 @@ class LFJsonPost(LFCliBase): data["cx"] = cx if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/getpktdrops", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/getpktdrops", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -6727,15 +5481,15 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#getrxendperrpkts ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_getrxendperrpkts(self, - aorb=None, # For AtoB, enter 'B', for BtoA, enter 'A'. - cx=None, # Cross-connect or Test-Group name - debug_=False): + aorb: str = None, # For AtoB, enter 'B', for BtoA, enter 'A'. + cx: str = None, # Cross-connect or Test-Group name [W] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_getrxendperrpkts(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if aorb is not None: data["aorb"] = aorb @@ -6743,9 +5497,10 @@ class LFJsonPost(LFCliBase): data["cx"] = cx if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/getrxendperrpkts", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/getrxendperrpkts", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -6755,15 +5510,15 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#getrxpkts ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_getrxpkts(self, - aorb=None, # For endpoint a, enter 'A', for endpoint b, enter 'B'. - cx=None, # Cross-connect or Test-Group name - debug_=False): + aorb: str = None, # For endpoint a, enter 'A', for endpoint b, enter 'B'. + cx: str = None, # Cross-connect or Test-Group name [W] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_getrxpkts(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if aorb is not None: data["aorb"] = aorb @@ -6771,9 +5526,10 @@ class LFJsonPost(LFCliBase): data["cx"] = cx if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/getrxpkts", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/getrxpkts", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -6783,15 +5539,15 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#getrxporterrpkts ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_getrxporterrpkts(self, - aorb=None, # For AtoB, enter 'B', for BtoA, enter 'A'. - cx=None, # Cross-connect name - debug_=False): + aorb: str = None, # For AtoB, enter 'B', for BtoA, enter 'A'. + cx: str = None, # Cross-connect name [W] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_getrxporterrpkts(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if aorb is not None: data["aorb"] = aorb @@ -6799,9 +5555,10 @@ class LFJsonPost(LFCliBase): data["cx"] = cx if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/getrxporterrpkts", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/getrxporterrpkts", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -6811,15 +5568,15 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#gettxpkts ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_gettxpkts(self, - aorb=None, # For endpoint a, enter 'A', for endpoint b, enter 'B'. - cx=None, # Cross-connect or Test-Group name - debug_=False): + aorb: str = None, # For endpoint a, enter 'A', for endpoint b, enter 'B'. + cx: str = None, # Cross-connect or Test-Group name [W] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_gettxpkts(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if aorb is not None: data["aorb"] = aorb @@ -6827,9 +5584,10 @@ class LFJsonPost(LFCliBase): data["cx"] = cx if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/gettxpkts", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/gettxpkts", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -6839,23 +5597,24 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#gossip ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_gossip(self, - message=None, # Message to show to others currently logged on. Unescaped Value - debug_=False): + message: str = None, # Message to show to others currently logged on. Unescaped Value [W] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_gossip(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if message is not None: data["message"] = message if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/gossip", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/gossip", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -6865,22 +5624,23 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#help ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_help(self, - command=None, # The command to get help for. Can be 'all', or blank. - debug_=False): + command: str = None, # The command to get help for. Can be 'all', or blank. + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_help(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if command is not None: data["command"] = command if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/help", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/help", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -6890,19 +5650,19 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#init_wiser ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_init_wiser(self, - file_name=None, # The WISER file name for the desired emulation, or 'NA' for empty + file_name: str = None, # The WISER file name for the desired emulation, or 'NA' for empty # string. - node_count=None, # The number of WISER nodes for the desired emulation, or 'NA' for + node_count: str = None, # The number of WISER nodes for the desired emulation, or 'NA' for # empty string. - resource=None, # The number of the resource in question. - shelf=None, # The number of the shelf in question. - debug_=False): + resource: str = None, # The number of the resource in question. [W] + shelf: str = None, # The number of the shelf in question. [R][D:1] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_init_wiser(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if file_name is not None: data["file_name"] = file_name @@ -6914,9 +5674,10 @@ class LFJsonPost(LFCliBase): data["shelf"] = shelf if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/init_wiser", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/init_wiser", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -6926,16 +5687,16 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#licenses ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_licenses(self, - popup=None, # If 'popup', then cause a GUI popup msg, otherwise, just show text. - show_file=None, # If 'yes', then show the license file, not the parsed license + popup: str = None, # If 'popup', then cause a GUI popup msg, otherwise, just show text. + show_file: str = None, # If 'yes', then show the license file, not the parsed license # information. - debug_=False): + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_licenses(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if popup is not None: data["popup"] = popup @@ -6943,9 +5704,10 @@ class LFJsonPost(LFCliBase): data["show_file"] = show_file if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/licenses", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/licenses", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -6955,21 +5717,21 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#load ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_load(self, - action=None, # Should be 'append' or 'overwrite'. - clean_chambers=None, # If yes, then Chambers will be cleaned up when overwrite is selected, + action: str = None, # Should be 'append' or 'overwrite'. [W] + clean_chambers: str = None, # If yes, then Chambers will be cleaned up when overwrite is selected, # otherwise they will be kept. - clean_dut=None, # If yes, then DUT will be cleaned up when overwrite is selected, + clean_dut: str = None, # If yes, then DUT will be cleaned up when overwrite is selected, # otherwise they will be kept. - clean_profiles=None, # If yes, then clean all profiles when overwrite is selected, otherwise + clean_profiles: str = None, # If yes, then clean all profiles when overwrite is selected, otherwise # they will be kept. - name=None, # The name of the database to load. (DFLT is the default) - debug_=False): + name: str = None, # The name of the database to load. (DFLT is the default) [W] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_load(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if action is not None: data["action"] = action @@ -6983,9 +5745,10 @@ class LFJsonPost(LFCliBase): data["name"] = name if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/load", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/load", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -7031,15 +5794,15 @@ class LFJsonPost(LFCliBase): return (cls[member].value for member in cls.__members__ if member == name) def post_log_level(self, - level=None, # Integer corresponding to the logging flags. - target=None, # Options: 'gnu' | [file-endp-name]. - debug_=False): + level: str = None, # Integer corresponding to the logging flags. [W] + target: str = None, # Options: 'gnu' | [file-endp-name]. + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_log_level(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if level is not None: data["level"] = level @@ -7047,9 +5810,10 @@ class LFJsonPost(LFCliBase): data["target"] = target if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/log_level", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/log_level", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -7059,22 +5823,23 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#log_msg ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_log_msg(self, - message=None, # Message to log. Unescaped Value - debug_=False): + message: str = None, # Message to log. Unescaped Value [W] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_log_msg(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if message is not None: data["message"] = message if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/log_msg", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/log_msg", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -7084,16 +5849,16 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#login ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_login(self, - name=None, # A single name with no white-spaces (15 characters or less) - password=None, # Can be blank or 'NA' if no password is set, otherwise must be the + name: str = None, # A single name with no white-spaces (15 characters or less) [W] + password: str = None, # Can be blank or 'NA' if no password is set, otherwise must be the # password. - debug_=False): + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_login(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if name is not None: data["name"] = name @@ -7101,9 +5866,10 @@ class LFJsonPost(LFCliBase): data["password"] = password if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/login", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/login", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -7113,17 +5879,18 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#motd ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_motd(self, - debug_=False): + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_motd(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} - response = self.json_post("/cli-json/motd", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/motd", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -7133,16 +5900,16 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#nc_show_cd ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_nc_show_cd(self, - collision_domain=None, # Name of the Collision Domain, or 'all'. - resource=None, # Resource number, or 'all'. - shelf=None, # Name/id of the shelf, or 'all'. - debug_=False): + collision_domain: str = None, # Name of the Collision Domain, or 'all'. [W] + resource: str = None, # Resource number, or 'all'. [W] + shelf: str = None, # Name/id of the shelf, or 'all'. [R][D:1] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_nc_show_cd(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if collision_domain is not None: data["collision_domain"] = collision_domain @@ -7152,9 +5919,10 @@ class LFJsonPost(LFCliBase): data["shelf"] = shelf if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/nc_show_cd", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/nc_show_cd", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -7164,16 +5932,16 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#nc_show_channel_groups ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_nc_show_channel_groups(self, - channel_name=None, # Name of the channel, or 'all'. - resource=None, # Resource number, or 'all'. - shelf=None, # Name/id of the shelf, or 'all'. - debug_=False): + channel_name: str = None, # Name of the channel, or 'all'. [W] + resource: str = None, # Resource number, or 'all'. [W] + shelf: str = None, # Name/id of the shelf, or 'all'. [R][D:1] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_nc_show_channel_groups(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if channel_name is not None: data["channel_name"] = channel_name @@ -7183,9 +5951,10 @@ class LFJsonPost(LFCliBase): data["shelf"] = shelf if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/nc_show_channel_groups", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/nc_show_channel_groups", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -7195,15 +5964,15 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#nc_show_endpoints ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_nc_show_endpoints(self, - endpoint=None, # Name of endpoint, or 'all'. - extra=None, # See above. - debug_=False): + endpoint: str = None, # Name of endpoint, or 'all'. [W] + extra: str = None, # See above. + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_nc_show_endpoints(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if endpoint is not None: data["endpoint"] = endpoint @@ -7211,9 +5980,10 @@ class LFJsonPost(LFCliBase): data["extra"] = extra if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/nc_show_endpoints", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/nc_show_endpoints", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -7223,22 +5993,23 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#nc_show_pesq ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_nc_show_pesq(self, - endpoint=None, # Name of endpoint, or 'all'. - debug_=False): + endpoint: str = None, # Name of endpoint, or 'all'. [W] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_nc_show_pesq(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if endpoint is not None: data["endpoint"] = endpoint if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/nc_show_pesq", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/nc_show_pesq", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -7274,18 +6045,18 @@ class LFJsonPost(LFCliBase): return (cls[member].value for member in cls.__members__ if member == name) def post_nc_show_ports(self, - port=None, # Port number, or 'all'. - probe_flags=None, # See above, add them together for multiple probings. Leave blank - # if you want stats only. - resource=None, # Resource number, or 'all'. - shelf=None, # Name/id of the shelf, or 'all'. - debug_=False): + port: str = None, # Port number, or 'all'. [W] + probe_flags: str = None, # See above, add them together for multiple probings. Leave + # blank if you want stats only. + resource: str = None, # Resource number, or 'all'. [W] + shelf: str = None, # Name/id of the shelf, or 'all'. [R][D:1] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_nc_show_ports(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if port is not None: data["port"] = port @@ -7297,9 +6068,10 @@ class LFJsonPost(LFCliBase): data["shelf"] = shelf if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/nc_show_ports", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/nc_show_ports", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -7309,16 +6081,16 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#nc_show_ppp_links ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_nc_show_ppp_links(self, - link_num=None, # Ppp-Link number of the span, or 'all'. - resource=None, # Resource number, or 'all'. - shelf=None, # Name/id of the shelf, or 'all'. - debug_=False): + link_num: str = None, # Ppp-Link number of the span, or 'all'. [W] + resource: str = None, # Resource number, or 'all'. [W] + shelf: str = None, # Name/id of the shelf, or 'all'. [R][D:1] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_nc_show_ppp_links(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if link_num is not None: data["link_num"] = link_num @@ -7328,9 +6100,10 @@ class LFJsonPost(LFCliBase): data["shelf"] = shelf if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/nc_show_ppp_links", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/nc_show_ppp_links", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -7340,16 +6113,16 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#nc_show_spans ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_nc_show_spans(self, - resource=None, # Resource number, or 'all'. - shelf=None, # Name/id of the shelf, or 'all'. - span_number=None, # Span-Number of the span, or 'all'. - debug_=False): + resource: str = None, # Resource number, or 'all'. [W] + shelf: str = None, # Name/id of the shelf, or 'all'. [R][D:1] + span_number: str = None, # Span-Number of the span, or 'all'. [W] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_nc_show_spans(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if resource is not None: data["resource"] = resource @@ -7359,9 +6132,10 @@ class LFJsonPost(LFCliBase): data["span_number"] = span_number if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/nc_show_spans", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/nc_show_spans", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -7371,16 +6145,16 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#nc_show_vr ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_nc_show_vr(self, - resource=None, # Resource number, or 'all'. - router=None, # Name of the Virtual Router, or 'all'. - shelf=None, # Name/id of the shelf, or 'all'. - debug_=False): + resource: str = None, # Resource number, or 'all'. [W] + router: str = None, # Name of the Virtual Router, or 'all'. [W] + shelf: str = None, # Name/id of the shelf, or 'all'. [R][D:1] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_nc_show_vr(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if resource is not None: data["resource"] = resource @@ -7390,9 +6164,10 @@ class LFJsonPost(LFCliBase): data["shelf"] = shelf if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/nc_show_vr", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/nc_show_vr", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -7402,16 +6177,16 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#nc_show_vrcx ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_nc_show_vrcx(self, - cx_name=None, # Name of the Virtual Router Connection, or 'all'. - resource=None, # Resource number, or 'all'. - shelf=None, # Name/id of the shelf, or 'all'. - debug_=False): + cx_name: str = None, # Name of the Virtual Router Connection, or 'all'. [W] + resource: str = None, # Resource number, or 'all'. [W] + shelf: str = None, # Name/id of the shelf, or 'all'. [R][D:1] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_nc_show_vrcx(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if cx_name is not None: data["cx_name"] = cx_name @@ -7421,9 +6196,10 @@ class LFJsonPost(LFCliBase): data["shelf"] = shelf if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/nc_show_vrcx", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/nc_show_vrcx", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -7433,22 +6209,23 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#notify_dhcp ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_notify_dhcp(self, - cmd=None, # set/down/timeout/info: What does DHCP want us to do? - netmask=None, # New subnet mask. - new_dns=None, # New DNS server(s) for use by this interface. - new_ip=None, # New IP address. - new_ip6=None, # New Global IPv6 address: ipv6/prefix - new_mtu=None, # New MTU. - new_router=None, # One or more default routers. LANforge will only use the first one. - port=None, # Interface name. - reason=None, # DHCP reason, informational mostly. - debug_=False): + cmd: str = None, # set/down/timeout/info: What does DHCP want us to do? [W] + netmask: str = None, # New subnet mask. + new_dns: str = None, # New DNS server(s) for use by this interface. + new_ip: str = None, # New IP address. + new_ip6: str = None, # New Global IPv6 address: ipv6/prefix + new_mtu: str = None, # New MTU. + new_router: str = None, # One or more default routers. LANforge will only use the first + # one. + port: str = None, # Interface name. [W] + reason: str = None, # DHCP reason, informational mostly. + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_notify_dhcp(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if cmd is not None: data["cmd"] = cmd @@ -7470,9 +6247,10 @@ class LFJsonPost(LFCliBase): data["reason"] = reason if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/notify_dhcp", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/notify_dhcp", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -7482,17 +6260,17 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#port_reset_completed ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_port_reset_completed(self, - extra=None, # IP for SECIP, blank for others. - port=None, # The port in question. - p_type=None, # SUNOS, NORMAL, or SECIP..let us know what kind of reset + extra: str = None, # IP for SECIP, blank for others. + port: str = None, # The port in question. [W] + p_type: str = None, # SUNOS, NORMAL, or SECIP..let us know what kind of reset # completed. - debug_=False): + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_port_reset_completed(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if extra is not None: data["extra"] = extra @@ -7502,9 +6280,10 @@ class LFJsonPost(LFCliBase): data["type"] = p_type if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/port_reset_completed", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/port_reset_completed", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -7514,17 +6293,17 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#probe_port ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_probe_port(self, - key=None, # Unique identifier for this request. Usually left blank.
- port=None, # Port number or name - resource=None, # Resource number. - shelf=None, # Shelf number. - debug_=False): + key: str = None, # Unique identifier for this request. Usually left blank.
+ port: str = None, # Port number or name [W] + resource: str = None, # Resource number. [W] + shelf: str = None, # Shelf number. [R][D:1] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_probe_port(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if key is not None: data["key"] = key @@ -7536,9 +6315,10 @@ class LFJsonPost(LFCliBase): data["shelf"] = shelf if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/probe_port", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/probe_port", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -7548,15 +6328,15 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#probe_ports ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_probe_ports(self, - resource=None, # Resource number, or 'all'. - shelf=None, # Name/id of the shelf, or 'all'. - debug_=False): + resource: str = None, # Resource number, or 'all'. [W] + shelf: str = None, # Name/id of the shelf, or 'all'. [R][D:1] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_probe_ports(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if resource is not None: data["resource"] = resource @@ -7564,9 +6344,10 @@ class LFJsonPost(LFCliBase): data["shelf"] = shelf if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/probe_ports", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/probe_ports", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -7576,22 +6357,23 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#quiesce_endp ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_quiesce_endp(self, - endp_name=None, # Name of the endpoint, or 'all'. - debug_=False): + endp_name: str = None, # Name of the endpoint, or 'all'. [R] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_quiesce_endp(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if endp_name is not None: data["endp_name"] = endp_name if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/quiesce_endp", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/quiesce_endp", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -7601,22 +6383,23 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#quiesce_group ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_quiesce_group(self, - name=None, # The name of the test group, or 'all' - debug_=False): + name: str = None, # The name of the test group, or 'all' [R] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_quiesce_group(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if name is not None: data["name"] = name if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/quiesce_group", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/quiesce_group", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -7626,17 +6409,18 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#quit ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_quit(self, - debug_=False): + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_quit(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} - response = self.json_post("/cli-json/quit", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/quit", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -7646,15 +6430,15 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#reboot_os ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_reboot_os(self, - resource=None, # Resource number, or ALL. - shelf=None, # Shelf number, or ALL. - debug_=False): + resource: str = None, # Resource number, or ALL. [W] + shelf: str = None, # Shelf number, or ALL. [R][D:1] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_reboot_os(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if resource is not None: data["resource"] = resource @@ -7662,9 +6446,10 @@ class LFJsonPost(LFCliBase): data["shelf"] = shelf if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/reboot_os", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/reboot_os", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -7674,18 +6459,18 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#report ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_report(self, - reporting_on=None, # Should we globally enable/disable reporting. (YES, NO or NA) - rpt_dir=None, # Directory in which reports should be saved. - save_endps=None, # Should we save endpoint reports or not. (YES, NO or NA) - save_ports=None, # Should we save Port reports or not. (YES, NO or NA) - save_resource=None, # Should we save Resource reports or not. (YES, NO or NA) - debug_=False): + reporting_on: str = None, # Should we globally enable/disable reporting. (YES, NO or NA) + rpt_dir: str = None, # Directory in which reports should be saved. [W] + save_endps: str = None, # Should we save endpoint reports or not. (YES, NO or NA) + save_ports: str = None, # Should we save Port reports or not. (YES, NO or NA) + save_resource: str = None, # Should we save Resource reports or not. (YES, NO or NA) + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_report(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if reporting_on is not None: data["reporting_on"] = reporting_on @@ -7699,9 +6484,10 @@ class LFJsonPost(LFCliBase): data["save_resource"] = save_resource if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/report", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/report", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -7720,19 +6506,19 @@ class LFJsonPost(LFCliBase): YES = "YES" # (include logout) Call portal-bot.pl ... --logout before going down. def post_reset_port(self, - port=None, # Port number to reset, or ALL. - pre_ifdown=None, # See above. Leave blank or use NA if unsure. - reset_ospf=None, # If set to 'NO' or 'NA', then OSPF will not be updated. Otherwise, it - # will be updated. - resource=None, # Resource number, or ALL. - shelf=None, # Shelf number, or ALL. - debug_=False): + port: str = None, # Port number to reset, or ALL. [W] + pre_ifdown: str = None, # See above. Leave blank or use NA if unsure. + reset_ospf: str = None, # If set to 'NO' or 'NA', then OSPF will not be updated. Otherwise, + # it will be updated. + resource: str = None, # Resource number, or ALL. [W] + shelf: str = None, # Shelf number, or ALL. [R][D:1] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_reset_port(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if port is not None: data["port"] = port @@ -7746,9 +6532,10 @@ class LFJsonPost(LFCliBase): data["shelf"] = shelf if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/reset_port", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/reset_port", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -7758,16 +6545,16 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#reset_serial_span ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_reset_serial_span(self, - resource=None, # Resource (machine) number. - shelf=None, # Shelf number - span=None, # Serial-Span number to reset. - debug_=False): + resource: str = None, # Resource (machine) number. [W] + shelf: str = None, # Shelf number [R][D:1] + span: str = None, # Serial-Span number to reset. [W] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_reset_serial_span(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if resource is not None: data["resource"] = resource @@ -7777,9 +6564,10 @@ class LFJsonPost(LFCliBase): data["span"] = span if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/reset_serial_span", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/reset_serial_span", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -7789,16 +6577,16 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#rm_attenuator ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_rm_attenuator(self, - resource=None, # Resource number - serno=None, # Serial number for requested Attenuator. - shelf=None, # Shelf number, usually 1 - debug_=False): + resource: str = None, # Resource number [W] + serno: str = None, # Serial number for requested Attenuator. [W] + shelf: str = None, # Shelf number, usually 1 [R][D:1] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_rm_attenuator(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if resource is not None: data["resource"] = resource @@ -7808,9 +6596,10 @@ class LFJsonPost(LFCliBase): data["shelf"] = shelf if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/rm_attenuator", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/rm_attenuator", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -7820,22 +6609,23 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#rm_cd ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_rm_cd(self, - cd=None, # Name of Collision Domain. - debug_=False): + cd: str = None, # Name of Collision Domain. [W] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_rm_cd(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if cd is not None: data["cd"] = cd if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/rm_cd", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/rm_cd", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -7845,15 +6635,15 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#rm_cd_endp ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_rm_cd_endp(self, - cd=None, # Name of Collision Domain. - endp=None, # Endpoint name/id. - debug_=False): + cd: str = None, # Name of Collision Domain. [W] + endp: str = None, # Endpoint name/id. [W] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_rm_cd_endp(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if cd is not None: data["cd"] = cd @@ -7861,9 +6651,10 @@ class LFJsonPost(LFCliBase): data["endp"] = endp if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/rm_cd_endp", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/rm_cd_endp", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -7873,15 +6664,15 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#rm_cd_vr ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_rm_cd_vr(self, - cd=None, # Name of Collision Domain. - endp=None, # Virtual-Router name/id. - debug_=False): + cd: str = None, # Name of Collision Domain. [W] + endp: str = None, # Virtual-Router name/id. [W] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_rm_cd_vr(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if cd is not None: data["cd"] = cd @@ -7889,9 +6680,10 @@ class LFJsonPost(LFCliBase): data["endp"] = endp if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/rm_cd_vr", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/rm_cd_vr", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -7901,22 +6693,23 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#rm_chamber ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_rm_chamber(self, - chamber=None, # Chamber name, or 'ALL' - debug_=False): + chamber: str = None, # Chamber name, or 'ALL' [W] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_rm_chamber(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if chamber is not None: data["chamber"] = chamber if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/rm_chamber", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/rm_chamber", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -7926,15 +6719,15 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#rm_chamber_path ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_rm_chamber_path(self, - chamber=None, # Chamber Name. - path=None, # Path Name, use 'ALL' to delete all paths. - debug_=False): + chamber: str = None, # Chamber Name. [W] + path: str = None, # Path Name, use 'ALL' to delete all paths. [W] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_rm_chamber_path(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if chamber is not None: data["chamber"] = chamber @@ -7942,9 +6735,10 @@ class LFJsonPost(LFCliBase): data["path"] = path if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/rm_chamber_path", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/rm_chamber_path", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -7954,16 +6748,16 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#rm_channel_group ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_rm_channel_group(self, - channel_name=None, # Name of the channel, or 'all'. - resource=None, # Resource number, or 'all'. - shelf=None, # Name/id of the shelf, or 'all'. - debug_=False): + channel_name: str = None, # Name of the channel, or 'all'. [W] + resource: str = None, # Resource number, or 'all'. [W] + shelf: str = None, # Name/id of the shelf, or 'all'. [R][D:1] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_rm_channel_group(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if channel_name is not None: data["channel_name"] = channel_name @@ -7973,9 +6767,10 @@ class LFJsonPost(LFCliBase): data["shelf"] = shelf if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/rm_channel_group", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/rm_channel_group", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -7985,15 +6780,15 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#rm_client ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_rm_client(self, - client_name=None, # Name of the client profile you wish to remove. - client_password=None, # Client password. Not required if we are super-user. - debug_=False): + client_name: str = None, # Name of the client profile you wish to remove. [W] + client_password: str = None, # Client password. Not required if we are super-user. + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_rm_client(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if client_name is not None: data["client_name"] = client_name @@ -8001,9 +6796,10 @@ class LFJsonPost(LFCliBase): data["client_password"] = client_password if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/rm_client", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/rm_client", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -8013,15 +6809,15 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#rm_cx ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_rm_cx(self, - cx_name=None, # Name of the cross-connect, or 'all'. - test_mgr=None, # Name of test-mgr, or 'all'. - debug_=False): + cx_name: str = None, # Name of the cross-connect, or 'all'. [W] + test_mgr: str = None, # Name of test-mgr, or 'all'. [W] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_rm_cx(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if cx_name is not None: data["cx_name"] = cx_name @@ -8029,9 +6825,10 @@ class LFJsonPost(LFCliBase): data["test_mgr"] = test_mgr if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/rm_cx", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/rm_cx", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -8041,22 +6838,23 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#rm_db ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_rm_db(self, - db_name=None, # Name of the database to delete. - debug_=False): + db_name: str = None, # Name of the database to delete. [W] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_rm_db(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if db_name is not None: data["db_name"] = db_name if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/rm_db", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/rm_db", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -8066,22 +6864,23 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#rm_dut ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_rm_dut(self, - shelf=None, # DUT name, or 'ALL' - debug_=False): + shelf: str = None, # DUT name, or 'ALL' [W] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_rm_dut(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if shelf is not None: data["shelf"] = shelf if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/rm_dut", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/rm_dut", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -8091,22 +6890,23 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#rm_endp ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_rm_endp(self, - endp_name=None, # Name of the endpoint, or 'YES_ALL'. - debug_=False): + endp_name: str = None, # Name of the endpoint, or 'YES_ALL'. [W] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_rm_endp(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if endp_name is not None: data["endp_name"] = endp_name if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/rm_endp", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/rm_endp", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -8116,22 +6916,23 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#rm_event ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_rm_event(self, - event_id=None, # Numeric event-id, or 'all' - debug_=False): + event_id: str = None, # Numeric event-id, or 'all' [W] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_rm_event(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if event_id is not None: data["event_id"] = event_id if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/rm_event", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/rm_event", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -8141,22 +6942,23 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#rm_group ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_rm_group(self, - name=None, # The name of the test group. - debug_=False): + name: str = None, # The name of the test group. [W] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_rm_group(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if name is not None: data["name"] = name if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/rm_group", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/rm_group", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -8166,16 +6968,16 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#rm_ppp_link ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_rm_ppp_link(self, - resource=None, # Resource number that holds this PppLink. - shelf=None, # Name/id of the shelf. - unit_num=None, # Unit-Number for the PppLink to be deleted. - debug_=False): + resource: str = None, # Resource number that holds this PppLink. [W] + shelf: str = None, # Name/id of the shelf. [R][D:1] + unit_num: str = None, # Unit-Number for the PppLink to be deleted. [W] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_rm_ppp_link(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if resource is not None: data["resource"] = resource @@ -8185,9 +6987,10 @@ class LFJsonPost(LFCliBase): data["unit_num"] = unit_num if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/rm_ppp_link", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/rm_ppp_link", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -8197,22 +7000,23 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#rm_profile ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_rm_profile(self, - name=None, # Profile name, or 'ALL' - debug_=False): + name: str = None, # Profile name, or 'ALL' [W] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_rm_profile(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if name is not None: data["name"] = name if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/rm_profile", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/rm_profile", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -8222,15 +7026,15 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#rm_resource ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_rm_resource(self, - resource=None, # Resource number. - shelf=None, # Shelf number. - debug_=False): + resource: str = None, # Resource number. [W] + shelf: str = None, # Shelf number. [R][D:1] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_rm_resource(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if resource is not None: data["resource"] = resource @@ -8238,9 +7042,10 @@ class LFJsonPost(LFCliBase): data["shelf"] = shelf if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/rm_resource", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/rm_resource", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -8250,15 +7055,15 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#rm_rfgen ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_rm_rfgen(self, - resource=None, # Resource number - shelf=None, # Shelf number, usually 1 - debug_=False): + resource: str = None, # Resource number [W] + shelf: str = None, # Shelf number, usually 1 [R][D:1] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_rm_rfgen(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if resource is not None: data["resource"] = resource @@ -8266,9 +7071,10 @@ class LFJsonPost(LFCliBase): data["shelf"] = shelf if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/rm_rfgen", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/rm_rfgen", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -8278,17 +7084,18 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#rm_sec_ip ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_rm_sec_ip(self, - ip_list=None, # IP1/prefix,IP2/prefix,...IPZ/prefix, or ALL - port=None, # Name of network device (Port) from which these IPs will be removed. - resource=None, # Resource number. - shelf=None, # Shelf number. - debug_=False): + ip_list: str = None, # IP1/prefix,IP2/prefix,...IPZ/prefix, or ALL [W] + port: str = None, # Name of network device (Port) from which these IPs will be removed. + # [W] + resource: str = None, # Resource number. [W] + shelf: str = None, # Shelf number. [R][D:1] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_rm_sec_ip(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if ip_list is not None: data["ip_list"] = ip_list @@ -8300,9 +7107,10 @@ class LFJsonPost(LFCliBase): data["shelf"] = shelf if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/rm_sec_ip", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/rm_sec_ip", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -8312,16 +7120,16 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#rm_span ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_rm_span(self, - resource=None, # Resource number, or 'all'. - shelf=None, # Name/id of the shelf, or 'all'. - span_num=None, # Span-Number of the channel, or 'all'. - debug_=False): + resource: str = None, # Resource number, or 'all'. [W] + shelf: str = None, # Name/id of the shelf, or 'all'. [R][D:1] + span_num: str = None, # Span-Number of the channel, or 'all'. [W] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_rm_span(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if resource is not None: data["resource"] = resource @@ -8331,9 +7139,10 @@ class LFJsonPost(LFCliBase): data["span_num"] = span_num if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/rm_span", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/rm_span", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -8343,22 +7152,23 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#rm_test_mgr ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_rm_test_mgr(self, - test_mgr=None, # Name of the test manager to be removed. - debug_=False): + test_mgr: str = None, # Name of the test manager to be removed. [W] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_rm_test_mgr(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if test_mgr is not None: data["test_mgr"] = test_mgr if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/rm_test_mgr", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/rm_test_mgr", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -8368,15 +7178,15 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#rm_text_blob ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_rm_text_blob(self, - name=None, # Text Blob Name, or 'ALL' - p_type=None, # Text Blob type, or 'ALL' - debug_=False): + name: str = None, # Text Blob Name, or 'ALL' [W] + p_type: str = None, # Text Blob type, or 'ALL' [W] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_rm_text_blob(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if name is not None: data["name"] = name @@ -8384,9 +7194,10 @@ class LFJsonPost(LFCliBase): data["type"] = p_type if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/rm_text_blob", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/rm_text_blob", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -8396,15 +7207,15 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#rm_tgcx ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_rm_tgcx(self, - cxname=None, # The name of the CX. - tgname=None, # The name of the test group. - debug_=False): + cxname: str = None, # The name of the CX. [W] + tgname: str = None, # The name of the test group. [W] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_rm_tgcx(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if cxname is not None: data["cxname"] = cxname @@ -8412,9 +7223,10 @@ class LFJsonPost(LFCliBase): data["tgname"] = tgname if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/rm_tgcx", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/rm_tgcx", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -8424,15 +7236,15 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#rm_threshold ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_rm_threshold(self, - endp=None, # Endpoint name or ID. - thresh_id=None, # Threshold ID to remove. Use 'all' to remove all. - debug_=False): + endp: str = None, # Endpoint name or ID. [W] + thresh_id: str = None, # Threshold ID to remove. Use 'all' to remove all. [W] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_rm_threshold(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if endp is not None: data["endp"] = endp @@ -8440,9 +7252,10 @@ class LFJsonPost(LFCliBase): data["thresh_id"] = thresh_id if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/rm_threshold", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/rm_threshold", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -8452,22 +7265,23 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#rm_traffic_profile ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_rm_traffic_profile(self, - name=None, # Profile name, or 'ALL' - debug_=False): + name: str = None, # Profile name, or 'ALL' [W] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_rm_traffic_profile(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if name is not None: data["name"] = name if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/rm_traffic_profile", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/rm_traffic_profile", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -8477,16 +7291,17 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#rm_venue ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_rm_venue(self, - resource=None, # Resource number, or 'ALL' - shelf=None, # Shelf number. - venu_id=None, # Number to uniquely identify this venue on this resource, or 'ALL' - debug_=False): + resource: str = None, # Resource number, or 'ALL' [W] + shelf: str = None, # Shelf number. [R][D:1] + venu_id: str = None, # Number to uniquely identify this venue on this resource, or 'ALL' + # [W] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_rm_venue(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if resource is not None: data["resource"] = resource @@ -8496,9 +7311,10 @@ class LFJsonPost(LFCliBase): data["venu_id"] = venu_id if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/rm_venue", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/rm_venue", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -8508,16 +7324,16 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#rm_vlan ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_rm_vlan(self, - port=None, # Port number or name of the virtual interface. - resource=None, # Resource number. - shelf=None, # Shelf number. - debug_=False): + port: str = None, # Port number or name of the virtual interface. [W] + resource: str = None, # Resource number. [W] + shelf: str = None, # Shelf number. [R][D:1] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_rm_vlan(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if port is not None: data["port"] = port @@ -8527,9 +7343,10 @@ class LFJsonPost(LFCliBase): data["shelf"] = shelf if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/rm_vlan", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/rm_vlan", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -8539,16 +7356,16 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#rm_vr ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_rm_vr(self, - resource=None, # Resource number, or 'all'. - router_name=None, # Virtual Router name, or 'all'. - shelf=None, # Name/id of the shelf, or 'all'. - debug_=False): + resource: str = None, # Resource number, or 'all'. [W] + router_name: str = None, # Virtual Router name, or 'all'. [W] + shelf: str = None, # Name/id of the shelf, or 'all'. [R][D:1] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_rm_vr(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if resource is not None: data["resource"] = resource @@ -8558,9 +7375,10 @@ class LFJsonPost(LFCliBase): data["shelf"] = shelf if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/rm_vr", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/rm_vr", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -8570,20 +7388,20 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#rm_vrcx ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_rm_vrcx(self, - connection_name=None, # Virtual Router Connection name, or 'all'. - resource=None, # Resource number, or 'all'. - shelf=None, # Name/id of the shelf, or 'all'. - vr_id=None, # If not removing from the free-list, then supply the virtual-router - # name/ID here. Leave blank or use NA for free-list. - vrcx_only=None, # If we should NOT delete underlying auto-created objects, enter + connection_name: str = None, # Virtual Router Connection name, or 'all'. [W] + resource: str = None, # Resource number, or 'all'. [W] + shelf: str = None, # Name/id of the shelf, or 'all'. [R][D:1] + vr_id: str = None, # If not removing from the free-list, then supply the + # virtual-router name/ID here. Leave blank or use NA for free-list. + vrcx_only: str = None, # If we should NOT delete underlying auto-created objects, enter # 'vrcx_only' here, otherwise leave blank or use NA. - debug_=False): + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_rm_vrcx(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if connection_name is not None: data["connection_name"] = connection_name @@ -8597,9 +7415,10 @@ class LFJsonPost(LFCliBase): data["vrcx_only"] = vrcx_only if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/rm_vrcx", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/rm_vrcx", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -8609,15 +7428,15 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#rm_wanpath ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_rm_wanpath(self, - endp_name=None, # Name of the endpoint. - wp_name=None, # Name of the wanpath. - debug_=False): + endp_name: str = None, # Name of the endpoint. [W] + wp_name: str = None, # Name of the wanpath. [W] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_rm_wanpath(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if endp_name is not None: data["endp_name"] = endp_name @@ -8625,9 +7444,10 @@ class LFJsonPost(LFCliBase): data["wp_name"] = wp_name if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/rm_wanpath", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/rm_wanpath", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -8637,20 +7457,20 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#rpt_script ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_rpt_script(self, - endp=None, # Endpoint name or ID. - flags=None, # See above for description of the defined flags. - group_action=None, # All or Sequential. - loop_count=None, # How many times to loop before stopping (0 is infinite). - name=None, # Script name. - private=None, # Private encoding for the particular script. - p_type=None, # One of: NONE, Script2544, ScriptHunt, ScriptWL - debug_=False): + endp: str = None, # Endpoint name or ID. [W] + flags: str = None, # See above for description of the defined flags. + group_action: str = None, # All or Sequential. + loop_count: str = None, # How many times to loop before stopping (0 is infinite). + name: str = None, # Script name. [W] + private: str = None, # Private encoding for the particular script. + p_type: str = None, # One of: NONE, Script2544, ScriptHunt, ScriptWL + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_rpt_script(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if endp is not None: data["endp"] = endp @@ -8668,9 +7488,10 @@ class LFJsonPost(LFCliBase): data["type"] = p_type if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/rpt_script", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/rpt_script", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -8689,18 +7510,18 @@ class LFJsonPost(LFCliBase): trigger_freq__freq_ = "trigger freq [freq]" # scan exactly those frequencies def post_scan_wifi(self, - extra=None, # Extra arguments to the scan script, see above. - key=None, # Unique identifier for this request. Usually left blank. - port=None, # Port number or name of the virtual interface. - resource=None, # Resource number. - shelf=None, # Shelf number. - debug_=False): + extra: str = None, # Extra arguments to the scan script, see above. + key: str = None, # Unique identifier for this request. Usually left blank. + port: str = None, # Port number or name of the virtual interface. [W] + resource: str = None, # Resource number. [W] + shelf: str = None, # Shelf number. [R][D:1] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_scan_wifi(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if extra is not None: data["extra"] = extra @@ -8714,9 +7535,10 @@ class LFJsonPost(LFCliBase): data["shelf"] = shelf if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/scan_wifi", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/scan_wifi", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -8751,37 +7573,37 @@ class LFJsonPost(LFCliBase): return (cls[member].value for member in cls.__members__ if member == name) def post_set_arm_info(self, - arm_flags=None, # Armageddon-related flags, see above for details. - burst=None, # Burst amount, can significantly improve throughput with some - # modern drivers, similar to 'multi_pkts', and uses the 'xmit_more' - # linux skb option. - dst_mac=None, # The destination MAC address. - dst_mac_count=None, # How many destination MACs to iterate through. - ip_dst_max=None, # Maximum destination IP address to use. - ip_dst_min=None, # Minimum destination IP address to use. - ip_src_max=None, # Maximum source IP address to use. - ip_src_min=None, # Minimum source IP address to use. - max_pkt_size=None, # Maximum packet size, including all Ethernet headers (but not + arm_flags: str = None, # Armageddon-related flags, see above for details. + burst: str = None, # Burst amount, can significantly improve throughput with some + # modern drivers, similar to 'multi_pkts', and uses the + # 'xmit_more' linux skb option. + dst_mac: str = None, # The destination MAC address. + dst_mac_count: str = None, # How many destination MACs to iterate through. + ip_dst_max: str = None, # Maximum destination IP address to use. + ip_dst_min: str = None, # Minimum destination IP address to use. + ip_src_max: str = None, # Maximum source IP address to use. + ip_src_min: str = None, # Minimum source IP address to use. + max_pkt_size: str = None, # Maximum packet size, including all Ethernet headers (but not # CRC). - min_pkt_size=None, # Minimum packet size, including all Ethernet headers (but not + min_pkt_size: str = None, # Minimum packet size, including all Ethernet headers (but not # CRC). - multi_pkts=None, # The number of identical packets to send before creating a new + multi_pkts: str = None, # The number of identical packets to send before creating a new # one. - name=None, # Name of the Endpoint we are setting. - pkts_to_send=None, # The number of packets to send. Set to zero for infinite. - src_mac=None, # The source MAC address. - src_mac_count=None, # How many source MACs to iterate through. - udp_dst_max=None, # Minimum destination UDP port. - udp_dst_min=None, # Minimum destination UDP port. - udp_src_max=None, # Maximum source UDP port. - udp_src_min=None, # Minimum source UDP port. - debug_=False): + name: str = None, # Name of the Endpoint we are setting. [R] + pkts_to_send: str = None, # The number of packets to send. Set to zero for infinite. + src_mac: str = None, # The source MAC address. + src_mac_count: str = None, # How many source MACs to iterate through. + udp_dst_max: str = None, # Minimum destination UDP port. + udp_dst_min: str = None, # Minimum destination UDP port. + udp_src_max: str = None, # Maximum source UDP port. + udp_src_min: str = None, # Minimum source UDP port. + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_set_arm_info(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if arm_flags is not None: data["arm_flags"] = arm_flags @@ -8823,9 +7645,10 @@ class LFJsonPost(LFCliBase): data["udp_src_min"] = udp_src_min if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/set_arm_info", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/set_arm_info", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -8834,26 +7657,35 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#set_attenuator ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + class SetAttenuatorMode(Enum): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + p_0 = "0" # Normal + p_1 = "1" # Pulse mode (API Tech 4205A modules directly connected via USB only) + def post_set_attenuator(self, - atten_idx=None, # Attenuator index, or 'all'. - mode=None, # 0 == normal attenuator, 1 == pulse mode (API Tech 4205A + atten_idx: str = None, # Attenuator index, or 'all'. [W] + mode: str = None, # 0 == normal attenuator, 1 == pulse mode (API Tech 4205A # modules directly connected via USB only) - pulse_count=None, # Number of pulses (0-255) - pulse_interval_ms=None, # Time between pulses, in mili-seconds (0-60000). - pulse_time_ms=None, # Time interval between pulse groups in miliseconds (1-60000) - pulse_width_us5=None, # Pulse width in units of 1/2 micro second. So, if you want + pulse_count: str = None, # Number of pulses (0-255) + pulse_interval_ms: str = None, # Time between pulses, in mili-seconds (0-60000). + pulse_time_ms: str = None, # Time interval between pulse groups in miliseconds + # (1-60000) + pulse_width_us5: str = None, # Pulse width in units of 1/2 micro second. So, if you want # 1.5us, use value 3 (0-60000) - resource=None, # Resource number. - serno=None, # Serial number for requested Attenuator, or 'all'. - shelf=None, # Shelf number, usually 1. - val=None, # Requested attenution in 1/10ths of dB (ddB). - debug_=False): + resource: str = None, # Resource number. [W] + serno: str = None, # Serial number for requested Attenuator, or 'all'. [W] + shelf: str = None, # Shelf number, usually 1. [R][D:1] + val: str = None, # Requested attenution in 1/10ths of dB (ddB). [W] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_set_attenuator(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if atten_idx is not None: data["atten_idx"] = atten_idx @@ -8877,9 +7709,10 @@ class LFJsonPost(LFCliBase): data["val"] = val if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/set_attenuator", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/set_attenuator", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -8889,21 +7722,20 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#set_chamber ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_set_chamber(self, - chamber=None, # Chamber name - cur_rotation=None, # Primarily used to store the last known rotation for turntables - # that do not report absolute position. Use NA or leave blank if - # unsure. - position=None, # Absolute position in degrees. - speed_rpm=None, # Speed in rpm (floating point number is accepted - tilt=None, # Absolute tilt in degrees. - turntable=None, # Turn-table address, for instance: 192.168.1.22:3001 - debug_=False): + chamber: str = None, # Chamber name [W] + cur_rotation: str = None, # Primarily used to store the last known rotation for turntables + # that do not report absolute position. + position: str = None, # Absolute position in degrees. + speed_rpm: str = None, # Speed in rpm (floating point number is accepted + tilt: str = None, # Absolute tilt in degrees. + turntable: str = None, # Turn-table address, for instance: 192.168.1.22:3001 + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_set_chamber(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if chamber is not None: data["chamber"] = chamber @@ -8919,9 +7751,10 @@ class LFJsonPost(LFCliBase): data["turntable"] = turntable if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/set_chamber", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/set_chamber", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -8931,17 +7764,18 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#set_cx_report_timer ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_set_cx_report_timer(self, - cx_name=None, # Name of cross-connect, or 'all'. - cxonly=None, # If you want to set the timer for ONLY the CX, and not - milliseconds=None, # Report timer length in milliseconds. - test_mgr=None, # Name of the test manager, or 'all'. - debug_=False): + cx_name: str = None, # Name of cross-connect, or 'all'. [W] + cxonly: str = None, # If you want to set the timer for ONLY the CX, and not + milliseconds: str = None, # Report timer length in milliseconds. + # [W,250-60000][D:5000] + test_mgr: str = None, # Name of the test manager, or 'all'. [W] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_set_cx_report_timer(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if cx_name is not None: data["cx_name"] = cx_name @@ -8953,9 +7787,10 @@ class LFJsonPost(LFCliBase): data["test_mgr"] = test_mgr if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/set_cx_report_timer", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/set_cx_report_timer", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -8976,16 +7811,16 @@ class LFJsonPost(LFCliBase): SWITCH = "SWITCH" # Sets the CX(s) in the running state, stopping any conflicting tests. def post_set_cx_state(self, - cx_name=None, # Name of the cross-connect, or 'all'. - cx_state=None, # One of: RUNNING, SWITCH, QUIESCE, STOPPED, or DELETED. - test_mgr=None, # Name of the test-manager, or 'all'. - debug_=False): + cx_name: str = None, # Name of the cross-connect, or 'all'. [W] + cx_state: str = None, # One of: RUNNING, SWITCH, QUIESCE, STOPPED, or DELETED. [W] + test_mgr: str = None, # Name of the test-manager, or 'all'. [W] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_set_cx_state(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if cx_name is not None: data["cx_name"] = cx_name @@ -8995,9 +7830,10 @@ class LFJsonPost(LFCliBase): data["test_mgr"] = test_mgr if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/set_cx_state", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/set_cx_state", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -9007,18 +7843,18 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#set_endp_addr ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_set_endp_addr(self, - ip=None, # The IP Address. Used for TCP/IP and UDP/IP protocols. - mac=None, # The MAC address. Only needed for LANforge protocol Endpoints. - max_port=None, # The Maximum IP Port. Used for TCP/IP and UDP/IP protocols. - min_port=None, # The Minimum IP Port. Used for TCP/IP and UDP/IP protocols. - name=None, # The name of the endpoint we are configuring. - debug_=False): + ip: str = None, # The IP Address. Used for TCP/IP and UDP/IP protocols. + mac: str = None, # The MAC address. Only needed for LANforge protocol Endpoints. + max_port: str = None, # The Maximum IP Port. Used for TCP/IP and UDP/IP protocols. + min_port: str = None, # The Minimum IP Port. Used for TCP/IP and UDP/IP protocols. + name: str = None, # The name of the endpoint we are configuring. [R] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_set_endp_addr(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if ip is not None: data["ip"] = ip @@ -9032,9 +7868,10 @@ class LFJsonPost(LFCliBase): data["name"] = name if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/set_endp_addr", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/set_endp_addr", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -9044,40 +7881,41 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#set_endp_details ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_set_endp_details(self, - conn_timeout=None, # For TCP, the max time in miliseconds to wait for connection - # to establish. - dst_mac=None, # Destination MAC address, used for custom Ethernet replays. - max_conn_timer=None, # The maximum duration (in ms) this connection should run + conn_timeout: str = None, # For TCP, the max time in miliseconds to wait for + # connection to establish. + dst_mac: str = None, # Destination MAC address, used for custom Ethernet + # replays. + max_conn_timer: str = None, # The maximum duration (in ms) this connection should run # before re-establishing. - max_ip_port=None, # The maximum IP Port value. (The value for min ip port is + max_ip_port: str = None, # The maximum IP Port value. (The value for min ip port is # set through the add_endp/ip_port parameter.) If greater - # than min, each connection will use a random value between - # min and max. - max_reconn_pause=None, # The maximum time between re-connects, in ms. - mcast_src_ip=None, # Multicast source address (used in SSM mode, multicast + # than min, each connection will use a random value + # between min and max. + max_reconn_pause: str = None, # The maximum time between re-connects, in ms. + mcast_src_ip: str = None, # Multicast source address (used in SSM mode, multicast # endpoints only) - mcast_src_port=None, # Multicast source address (used in SSM mode, multicast + mcast_src_port: str = None, # Multicast source address (used in SSM mode, multicast # endpoints only) - min_conn_timer=None, # The minimum duration (in ms) this connection should run + min_conn_timer: str = None, # The minimum duration (in ms) this connection should run # before re-establishing. - min_reconn_pause=None, # The minimum time between re-connects, in ms. - name=None, # The name of the endpoint we are configuring. - pkts_to_send=None, # Number of packets to send before stopping. 0 means + min_reconn_pause: str = None, # The minimum time between re-connects, in ms. + name: str = None, # The name of the endpoint we are configuring. [R] + pkts_to_send: str = None, # Number of packets to send before stopping. 0 means # infinite. - rcvbuf_size=None, # The receive buffer (window) size. Zero for AUTO - sndbuf_size=None, # The sending buffer (window) size. Zero for AUTO - tcp_delack_segs=None, # NA: No longer supported. - tcp_max_delack=None, # NA: No longer supported. - tcp_min_delack=None, # NA: No longer supported. - tcp_mss=None, # TCP Maximum Segment Size, affects packet size on the wire - # (88 - 32767). - debug_=False): + rcvbuf_size: str = None, # The receive buffer (window) size. Zero for AUTO + sndbuf_size: str = None, # The sending buffer (window) size. Zero for AUTO + tcp_delack_segs: str = None, # NA: No longer supported. + tcp_max_delack: str = None, # NA: No longer supported. + tcp_min_delack: str = None, # NA: No longer supported. + tcp_mss: str = None, # TCP Maximum Segment Size, affects packet size on the + # wire (88 - 32767). + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_set_endp_details(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if conn_timeout is not None: data["conn_timeout"] = conn_timeout @@ -9115,9 +7953,10 @@ class LFJsonPost(LFCliBase): data["tcp_mss"] = tcp_mss if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/set_endp_details", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/set_endp_details", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -9126,17 +7965,25 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#set_endp_file ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + class SetEndpFilePlayback(Enum): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + OFF = "OFF" # off + ON = "ON" # on + def post_set_endp_file(self, - file=None, # The file name to read the playback packets from. - name=None, # The name of the endpoint we are configuring. - playback=None, # Should we playback the capture or not? ON or OFF. - debug_=False): + file: str = None, # The file name to read the playback packets from. + name: str = None, # The name of the endpoint we are configuring. [R] + playback: str = None, # Should we playback the capture or not? ON or OFF. [R] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_set_endp_file(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if file is not None: data["file"] = file @@ -9146,9 +7993,10 @@ class LFJsonPost(LFCliBase): data["playback"] = playback if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/set_endp_file", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/set_endp_file", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -9176,16 +8024,16 @@ class LFJsonPost(LFCliBase): UseAutoNAT = "UseAutoNAT" # NAT friendly behavior def post_set_endp_flag(self, - flag=None, # The name of the flag. - name=None, # The name of the endpoint we are configuring. - val=None, # Either 1 (for on), or 0 (for off). - debug_=False): + flag: str = None, # The name of the flag. [R] + name: str = None, # The name of the endpoint we are configuring. [R] + val: str = None, # Either 1 (for on), or 0 (for off). [R,0-1] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_set_endp_flag(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if flag is not None: data["flag"] = flag @@ -9195,9 +8043,10 @@ class LFJsonPost(LFCliBase): data["val"] = val if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/set_endp_flag", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/set_endp_flag", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -9224,17 +8073,17 @@ class LFJsonPost(LFCliBase): zeros = "zeros" # Payload is all zeros (00). def post_set_endp_payload(self, - name=None, # The name of the endpoint we are configuring. - payload=None, # For custom payloads, enter the payload in hex, up to 2048 + name: str = None, # The name of the endpoint we are configuring. [R] + payload: str = None, # For custom payloads, enter the payload in hex, up to 2048 # bytes. Unescaped Value - payload_type=None, # The payload type. See help for add_endp. - debug_=False): + payload_type: str = None, # The payload type. See help for add_endp. [W][D:increasing] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_set_endp_payload(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if name is not None: data["name"] = name @@ -9244,9 +8093,10 @@ class LFJsonPost(LFCliBase): data["payload_type"] = payload_type if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/set_endp_payload", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/set_endp_payload", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -9256,18 +8106,18 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#set_endp_pld_bounds ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_set_endp_pld_bounds(self, - is_random=None, # YES if random, anything else for NO. - max_pld_size=None, # The maximum payload size, in bytes. - min_pld_size=None, # The minimum payload size, in bytes. - name=None, # The name of the endpoint we are configuring. - use_checksum=None, # YES if use checksum on payload, anything else for NO. - debug_=False): + is_random: str = None, # YES if random, anything else for NO. + max_pld_size: str = None, # The maximum payload size, in bytes. + min_pld_size: str = None, # The minimum payload size, in bytes. + name: str = None, # The name of the endpoint we are configuring. [R] + use_checksum: str = None, # YES if use checksum on payload, anything else for NO. + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_set_endp_pld_bounds(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if is_random is not None: data["is_random"] = is_random @@ -9281,9 +8131,10 @@ class LFJsonPost(LFCliBase): data["use_checksum"] = use_checksum if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/set_endp_pld_bounds", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/set_endp_pld_bounds", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -9293,17 +8144,17 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#set_endp_proxy ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_set_endp_proxy(self, - enabled=None, # YES or NO to enable or disable proxying. - endp_name=None, # Name of endpoint. - proxy_ip=None, # Proxy IP Address. - proxy_ip_port=None, # Proxy IP Port. - debug_=False): + enabled: str = None, # YES or NO to enable or disable proxying. + endp_name: str = None, # Name of endpoint. [W] + proxy_ip: str = None, # Proxy IP Address. + proxy_ip_port: str = None, # Proxy IP Port. + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_set_endp_proxy(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if enabled is not None: data["enabled"] = enabled @@ -9315,9 +8166,10 @@ class LFJsonPost(LFCliBase): data["proxy_ip_port"] = proxy_ip_port if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/set_endp_proxy", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/set_endp_proxy", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -9327,16 +8179,16 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#set_endp_quiesce ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_set_endp_quiesce(self, - name=None, # The name of the endpoint we are configuring. - quiesce=None, # The number of seconds to quiesce this endpoint when told to - # quiesce. - debug_=False): + name: str = None, # The name of the endpoint we are configuring. [R] + quiesce: str = None, # The number of seconds to quiesce this endpoint when told to + # quiesce. [R] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_set_endp_quiesce(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if name is not None: data["name"] = name @@ -9344,9 +8196,10 @@ class LFJsonPost(LFCliBase): data["quiesce"] = quiesce if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/set_endp_quiesce", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/set_endp_quiesce", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -9356,15 +8209,16 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#set_endp_report_timer ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_set_endp_report_timer(self, - endp_name=None, # Name of endpoint. - milliseconds=None, # Report timer length in milliseconds. - debug_=False): + endp_name: str = None, # Name of endpoint. [R] + milliseconds: str = None, # Report timer length in milliseconds. + # [W,250-60000][D:5000] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_set_endp_report_timer(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if endp_name is not None: data["endp_name"] = endp_name @@ -9372,9 +8226,10 @@ class LFJsonPost(LFCliBase): data["milliseconds"] = milliseconds if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/set_endp_report_timer", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/set_endp_report_timer", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -9394,16 +8249,16 @@ class LFJsonPost(LFCliBase): THROUGHPUT = "THROUGHPUT" # def post_set_endp_tos(self, - name=None, # The name of the endpoint we are configuring. - priority=None, # The socket priority, can be any positive number. - tos=None, # The Type of Service, can be HEX, see above. - debug_=False): + name: str = None, # The name of the endpoint we are configuring. [R] + priority: str = None, # The socket priority, can be any positive number. + tos: str = None, # The Type of Service, can be HEX, see above. + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_set_endp_tos(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if name is not None: data["name"] = name @@ -9413,9 +8268,10 @@ class LFJsonPost(LFCliBase): data["tos"] = tos if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/set_endp_tos", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/set_endp_tos", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -9425,17 +8281,17 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#set_endp_tx_bounds ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_set_endp_tx_bounds(self, - is_bursty=None, # YES if bursty, anything else for NO. - max_tx_rate=None, # The maximum transmit rate, in bits per second (bps). - min_tx_rate=None, # The minimum transmit rate, in bits per second (bps). - name=None, # The name of the endpoint we are configuring. - debug_=False): + is_bursty: str = None, # YES if bursty, anything else for NO. + max_tx_rate: str = None, # The maximum transmit rate, in bits per second (bps). + min_tx_rate: str = None, # The minimum transmit rate, in bits per second (bps). + name: str = None, # The name of the endpoint we are configuring. [R] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_set_endp_tx_bounds(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if is_bursty is not None: data["is_bursty"] = is_bursty @@ -9447,9 +8303,10 @@ class LFJsonPost(LFCliBase): data["name"] = name if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/set_endp_tx_bounds", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/set_endp_tx_bounds", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -9565,20 +8422,20 @@ class LFJsonPost(LFCliBase): return (cls[member].value for member in cls.__members__ if member == name) def post_set_event_interest(self, - ei_flags=None, # Event Interest flags, see above. - event_cnt=None, # Maximum number of events to store. - events1=None, # See description for possible values. - events2=None, # See description for possible values. - events3=None, # See description for possible values. - events4=None, # See description for possible values. - var1=None, # Currently un-used. - debug_=False): + ei_flags: str = None, # Event Interest flags, see above. [W] + event_cnt: str = None, # Maximum number of events to store. + events1: str = None, # See description for possible values. + events2: str = None, # See description for possible values. + events3: str = None, # See description for possible values. + events4: str = None, # See description for possible values. + var1: str = None, # Currently un-used. + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_set_event_interest(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if ei_flags is not None: data["ei_flags"] = ei_flags @@ -9596,9 +8453,10 @@ class LFJsonPost(LFCliBase): data["var1"] = var1 if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/set_event_interest", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/set_event_interest", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -9647,15 +8505,15 @@ class LFJsonPost(LFCliBase): WARNING = "WARNING" # def post_set_event_priority(self, - event=None, # Number or name for the event, see above. - priority=None, # Number or name for the priority. - debug_=False): + event: str = None, # Number or name for the event, see above. [R,0-21] + priority: str = None, # Number or name for the priority. [R,0-5] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_set_event_priority(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if event is not None: data["event"] = event @@ -9663,9 +8521,10 @@ class LFJsonPost(LFCliBase): data["priority"] = priority if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/set_event_priority", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/set_event_priority", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -9675,24 +8534,24 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#set_fe_info ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_set_fe_info(self, - directory=None, # The directory to read/write in. Absolute path suggested. - io_direction=None, # Should we be reading or writing: options: read, write - max_file_size=None, # The maximum file size, in bytes. - max_rw_sz=None, # Maximum read/write size, in bytes. - min_file_size=None, # The minimum file size, in bytes. - min_rw_sz=None, # Minimum read/write size, in bytes. - name=None, # The name of the file endpoint we are configuring. - num_files=None, # Number of files to create when writing. - prefix=None, # The prefix of the file(s) to read/write. - quiesce_after_files=None, # If non-zero, quiesce test after this many files have been + directory: str = None, # The directory to read/write in. Absolute path suggested. + io_direction: str = None, # Should we be reading or writing: options: read, write + max_file_size: str = None, # The maximum file size, in bytes. + max_rw_sz: str = None, # Maximum read/write size, in bytes. + min_file_size: str = None, # The minimum file size, in bytes. + min_rw_sz: str = None, # Minimum read/write size, in bytes. + name: str = None, # The name of the file endpoint we are configuring. [R] + num_files: str = None, # Number of files to create when writing. + prefix: str = None, # The prefix of the file(s) to read/write. + quiesce_after_files: str = None, # If non-zero, quiesce test after this many files have been # read/written. - debug_=False): + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_set_fe_info(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if directory is not None: data["directory"] = directory @@ -9716,9 +8575,10 @@ class LFJsonPost(LFCliBase): data["quiesce_after_files"] = quiesce_after_files if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/set_fe_info", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/set_fe_info", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -9741,17 +8601,17 @@ class LFJsonPost(LFCliBase): # +Event def post_set_flag(self, - client=None, # Specify the user, if it is not the current user. Requires admin + client: str = None, # Specify the user, if it is not the current user. Requires admin # privileges. - flag=None, # The name of the flag. - val=None, # Either 1 (for on), or 0 (for off). - debug_=False): + flag: str = None, # The name of the flag. [R] + val: str = None, # Either 1 (for on), or 0 (for off). [R,0-1] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_set_flag(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if client is not None: data["client"] = client @@ -9761,9 +8621,10 @@ class LFJsonPost(LFCliBase): data["val"] = val if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/set_flag", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/set_flag", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -9773,16 +8634,16 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#set_gen_cmd ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_set_gen_cmd(self, - command=None, # The rest of the command line arguments. Unescaped Value - name=None, # The name of the file endpoint we are configuring. - debug_=False): + command: str = None, # The rest of the command line arguments. Unescaped Value [R] + name: str = None, # The name of the file endpoint we are configuring. [R] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_set_gen_cmd(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if command is not None: data["command"] = command @@ -9790,9 +8651,10 @@ class LFJsonPost(LFCliBase): data["name"] = name if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/set_gen_cmd", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/set_gen_cmd", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -9802,20 +8664,20 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#set_gps_info ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_set_gps_info(self, - altitude=None, # Altitude, assumes units are Meters. - ew=None, # East or west (Longitude). - lattitude=None, # The lattitude, as read from a GPS device. - longitude=None, # The longitude, as ready from a GPS device. - ns=None, # North or South (Latitude). - resource=None, # Resource number for the port to be modified. - shelf=None, # Shelf number for the port to be modified, or SELF. - debug_=False): + altitude: str = None, # Altitude, assumes units are Meters. + ew: str = None, # East or west (Longitude). + lattitude: str = None, # The lattitude, as read from a GPS device. + longitude: str = None, # The longitude, as ready from a GPS device. + ns: str = None, # North or South (Latitude). + resource: str = None, # Resource number for the port to be modified. [W] + shelf: str = None, # Shelf number for the port to be modified, or SELF. [R][D:1] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_set_gps_info(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if altitude is not None: data["altitude"] = altitude @@ -9833,9 +8695,10 @@ class LFJsonPost(LFCliBase): data["shelf"] = shelf if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/set_gps_info", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/set_gps_info", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -9845,20 +8708,19 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#set_ifup_script ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_set_ifup_script(self, - flags=None, # Currently un-defined, use NA - port=None, # WiFi interface name or number. - post_ifup_script=None, # Script name with optional args, will run after interface - # comes up and gets IP. Unescaped - # Value - resource=None, # Resource number. - shelf=None, # Shelf number. - debug_=False): + flags: str = None, # Currently un-defined, use NA + port: str = None, # WiFi interface name or number. [W] + post_ifup_script: str = None, # Script name with optional args, will run after interface + # comes up and gets IP. + resource: str = None, # Resource number. [W] + shelf: str = None, # Shelf number. [R][D:1] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_set_ifup_script(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if flags is not None: data["flags"] = flags @@ -9872,9 +8734,10 @@ class LFJsonPost(LFCliBase): data["shelf"] = shelf if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/set_ifup_script", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/set_ifup_script", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -9884,23 +8747,24 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#set_license ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_set_license(self, - licenses=None, # License keys all appended into a single line. Unescaped Value - debug_=False): + licenses: str = None, # License keys all appended into a single line. Unescaped Value [W] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_set_license(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if licenses is not None: data["licenses"] = licenses if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/set_license", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/set_license", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -9910,18 +8774,18 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#set_mc_endp ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_set_mc_endp(self, - mcast_dest_port=None, # Multicast destination IP Port, for example: 55000 - mcast_group=None, # Multicast group IP, ie: 224.1.1.2 IPv6 supported as well. - name=None, # The name of the endpoint we are configuring. - rcv_mcast=None, # Should we attempt to receive? Values: Yes or No - ttl=None, # Time to live for the multicast packets generated. - debug_=False): + mcast_dest_port: str = None, # Multicast destination IP Port, for example: 55000 + mcast_group: str = None, # Multicast group IP, ie: 224.1.1.2 IPv6 supported as well. + name: str = None, # The name of the endpoint we are configuring. [R] + rcv_mcast: str = None, # Should we attempt to receive? Values: Yes or No + ttl: str = None, # Time to live for the multicast packets generated. + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_set_mc_endp(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if mcast_dest_port is not None: data["mcast_dest_port"] = mcast_dest_port @@ -9935,9 +8799,10 @@ class LFJsonPost(LFCliBase): data["ttl"] = ttl if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/set_mc_endp", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/set_mc_endp", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -9947,16 +8812,16 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#set_password ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_set_password(self, - client=None, # Specify the client. If left blank, will use current client. - new_password=None, # New password, or 'NA' for blank password. - old_password=None, # Old password, or 'NA' for blank password. - debug_=False): + client: str = None, # Specify the client. If left blank, will use current client. + new_password: str = None, # New password, or 'NA' for blank password. [W] + old_password: str = None, # Old password, or 'NA' for blank password. [W] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_set_password(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if client is not None: data["client"] = client @@ -9966,9 +8831,10 @@ class LFJsonPost(LFCliBase): data["old_password"] = old_password if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/set_password", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/set_password", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -9977,23 +8843,32 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#set_poll_mode ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + class SetPollModeMode(Enum): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + polling = "polling" # + push = "push" # + def post_set_poll_mode(self, - mode=None, # 'polling' or 'push'. - debug_=False): + mode: str = None, # 'polling' or 'push'. [R] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_set_poll_mode(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if mode is not None: data["mode"] = mode if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/set_poll_mode", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/set_poll_mode", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -10190,65 +9065,68 @@ class LFJsonPost(LFCliBase): return (cls[member].value for member in cls.__members__ if member == name) def post_set_port(self, - alias=None, # A user-defined name for this interface. Can be BLANK or NA. - br_aging_time=None, # MAC aging time, in seconds, 32-bit number (or peer IP for GRE). - br_forwarding_delay=None, # How long to wait until the bridge will start forwarding packets. - br_hello_time=None, # How often does the bridge send out STP hello packets. - br_max_age=None, # How long until STP considers a non-responsive bridge dead. - br_port_cost=None, # STP Port cost for a port (this applies only to NON-BRIDGE + alias: str = None, # A user-defined name for this interface. Can be BLANK or NA. + br_aging_time: str = None, # MAC aging time, in seconds, 32-bit number (or peer IP for + # GRE). + br_forwarding_delay: str = None, # How long to wait until the bridge will start forwarding + # packets. + br_hello_time: str = None, # How often does the bridge send out STP hello packets. + br_max_age: str = None, # How long until STP considers a non-responsive bridge dead. + br_port_cost: str = None, # STP Port cost for a port (this applies only to NON-BRIDGE # interfaces). - br_port_priority=None, # STP Port priority for a port (this applies only to NON-BRIDGE + br_port_priority: str = None, # STP Port priority for a port (this applies only to NON-BRIDGE # interfaces). - br_priority=None, # Bridge priority, 16-bit number. - bypass_wdt=None, # Watch Dog Timer (in seconds) for this port. Zero (0) to disable. - cmd_flags=None, # Command Flags: See above, or NA. - cpu_mask=None, # CPU Mask for CPUs that should service this interface. Zero is - # don't set (let OS make the decision). This value will be applied - # to the proper /proc/irq/[irq-num]/smp_affinity file by the - # pin_irq.pl script. - current_flags=None, # See above, or NA. - current_flags_msk=None, # This sets 'interest' for flags 'Enable RADIUS service' and higher. - # See above, or NA. - dhcp_client_id=None, # Optional string of up to 63 bytes in length to be passed to the - # dhclient process. See above. - dhcp_hostname=None, # Optional string of up to 63 bytes in length to be passed to the - # dhclient process. Option 12, see above. - dhcp_vendor_id=None, # Optional string of up to 63 bytes in length to be passed to the - # dhclient process. See above. - dns_servers=None, # DNS servers for use by traffic on this port, comma-separated list, - # BLANK means zero-length string. - flags2=None, # Bridge & other flags, see above. - gateway=None, # IP address of the gateway device - used for IP routing, or NA. - interest=None, # Which things are we really interested in setting. Can over-ride - # defaults based on the other arguments. - ip_addr=None, # IP address for the port, or NA. - ipsec_concentrator=None, # IP Address of IPSec concentrator. - ipsec_local_id=None, # Local Identifier for this IPSec tunnel. - ipsec_passwd=None, # Password for IPSec, for pubkey, use: pubkey:[pem-file-name], for - # instance: pubkey:station.pem - ipsec_remote_id=None, # Remote Identifier for this IPSec tunnel. - ipv6_addr_global=None, # Global scoped IPv6 address. - ipv6_addr_link=None, # Link scoped IPv6 address. - ipv6_dflt_gw=None, # IPv6 default gateway. - mac=None, # MAC address to set this port to, or leave blank to not set it, or - # NA. - mtu=None, # Maximum Transmit Unit (MTU) for this interface. Can be blank or - # NA. - netmask=None, # Netmask which this port should use, or NA. - port=None, # Port number for the port to be modified. - report_timer=None, # How often, in milliseconds, should we poll stats on this + br_priority: str = None, # Bridge priority, 16-bit number. + bypass_wdt: str = None, # Watch Dog Timer (in seconds) for this port. Zero (0) to + # disable. + cmd_flags: str = None, # Command Flags: See above, or NA. + cpu_mask: str = None, # CPU Mask for CPUs that should service this interface. Zero is + # don't set (let OS make the decision). This value will be + # applied to the proper /proc/irq/[irq-num]/smp_affinity file by + # the pin_irq.pl script. + current_flags: str = None, # See above, or NA. + current_flags_msk: str = None, # This sets 'interest' for flags 'Enable RADIUS service' and + # higher. See above, or NA. + dhcp_client_id: str = None, # Optional string of up to 63 bytes in length to be passed to + # the dhclient process. See above. + dhcp_hostname: str = None, # Optional string of up to 63 bytes in length to be passed to + # the dhclient process. Option 12, see above. + dhcp_vendor_id: str = None, # Optional string of up to 63 bytes in length to be passed to + # the dhclient process. See above. + dns_servers: str = None, # DNS servers for use by traffic on this port, comma-separated + # list, BLANK means zero-length string. + flags2: str = None, # Bridge & other flags, see above. + gateway: str = None, # IP address of the gateway device - used for IP routing, or NA. + interest: str = None, # Which things are we really interested in setting. Can + # over-ride defaults based on the other arguments. + ip_addr: str = None, # IP address for the port, or NA. + ipsec_concentrator: str = None, # IP Address of IPSec concentrator. + ipsec_local_id: str = None, # Local Identifier for this IPSec tunnel. + ipsec_passwd: str = None, # Password for IPSec, for pubkey, use: pubkey:[pem-file-name], + # for instance: pubkey:station.pem + ipsec_remote_id: str = None, # Remote Identifier for this IPSec tunnel. + ipv6_addr_global: str = None, # Global scoped IPv6 address. + ipv6_addr_link: str = None, # Link scoped IPv6 address. + ipv6_dflt_gw: str = None, # IPv6 default gateway. + mac: str = None, # MAC address to set this port to, or leave blank to not set it, + # or NA. + mtu: str = None, # Maximum Transmit Unit (MTU) for this interface. Can be blank + # or NA. + netmask: str = None, # Netmask which this port should use, or NA. + port: str = None, # Port number for the port to be modified. [W] + report_timer: str = None, # How often, in milliseconds, should we poll stats on this # interface? - resource=None, # Resource number for the port to be modified. - shelf=None, # Shelf number for the port to be modified. - sta_br_id=None, # WiFi STAtion bridge ID. Zero means none. - tx_queue_len=None, # Transmit Queue Length for this interface. Can be blank or NA. - debug_=False): + resource: str = None, # Resource number for the port to be modified. [W] + shelf: str = None, # Shelf number for the port to be modified. [R][D:1] + sta_br_id: str = None, # WiFi STAtion bridge ID. Zero means none. + tx_queue_len: str = None, # Transmit Queue Length for this interface. Can be blank or NA. + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_set_port(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if alias is not None: data["alias"] = alias @@ -10326,9 +9204,10 @@ class LFJsonPost(LFCliBase): data["tx_queue_len"] = tx_queue_len if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/set_port", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/set_port", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -10338,19 +9217,19 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#set_port_alias ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_set_port_alias(self, - alias=None, # New alias to assign to this virtual interface. - port=None, # Physical Port identifier that owns the virtual interface. - resource=None, # Resource number for the port to be modified. - shelf=None, # Shelf number for the port to be modified. - vport=None, # Virtual port identifier. MAC for MAC-VLANs, VLAN-ID for 802.1Q + alias: str = None, # New alias to assign to this virtual interface. [W] + port: str = None, # Physical Port identifier that owns the virtual interface. [R] + resource: str = None, # Resource number for the port to be modified. [W] + shelf: str = None, # Shelf number for the port to be modified. [R][D:1] + vport: str = None, # Virtual port identifier. MAC for MAC-VLANs, VLAN-ID for 802.1Q # vlans. - debug_=False): + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_set_port_alias(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if alias is not None: data["alias"] = alias @@ -10364,9 +9243,10 @@ class LFJsonPost(LFCliBase): data["vport"] = vport if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/set_port_alias", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/set_port_alias", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -10376,17 +9256,17 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#set_ppp_link_state ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_set_ppp_link_state(self, - link=None, # Unit Number of the PPP Link, or 'all'. - ppp_state=None, # One of: RUNNING, STOPPED, or DELETED. - resource=None, # Number of the Resource, or 'all'. - shelf=None, # Name of the Shelf, or 'all'. - debug_=False): + link: str = None, # Unit Number of the PPP Link, or 'all'. [W] + ppp_state: str = None, # One of: RUNNING, STOPPED, or DELETED. [R] + resource: str = None, # Number of the Resource, or 'all'. [W] + shelf: str = None, # Name of the Shelf, or 'all'. [R][D:1] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_set_ppp_link_state(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if link is not None: data["link"] = link @@ -10398,9 +9278,10 @@ class LFJsonPost(LFCliBase): data["shelf"] = shelf if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/set_ppp_link_state", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/set_ppp_link_state", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -10417,29 +9298,29 @@ class LFJsonPost(LFCliBase): skip_load_db_on_start = 1 # Should we skip loading the DB on start? def post_set_resource(self, - device_profiles=None, # List of profiles, see above - max_helper_count=None, # Maximum number of helper traffic generation processes. 0 means - # CPU-core-count (AUTO). - max_staged_bringup=None, # Maximum amount of interfaces attempting to come up at once. - # Default is 50 - max_station_bringup=None, # Maximum amount of stations to bring up per radio per tick. + device_profiles: str = None, # List of profiles, see above + max_helper_count: str = None, # Maximum number of helper traffic generation processes. 0 + # means CPU-core-count (AUTO). + max_staged_bringup: str = None, # Maximum amount of interfaces attempting to come up at + # once. Default is 50 + max_station_bringup: str = None, # Maximum amount of stations to bring up per radio per tick. # Default is 12. - max_trying_ifup=None, # Maximum amount of interfaces running the network config 'ifup' - # logic. Default is 15 - resource=None, # Number of the Resource, or all. - resource_flags=None, # System wide flags, often requires a reboot for changes to take - # effect. - resource_flags_mask=None, # What flags to change. If unset, default is all. - shelf=None, # Name of the Shelf, or all. - top_left_x=None, # X Location for Chamber View. - top_left_y=None, # X Location for Chamber View. - debug_=False): + max_trying_ifup: str = None, # Maximum amount of interfaces running the network config + # 'ifup' logic. Default is 15 + resource: str = None, # Number of the Resource, or all. [W] + resource_flags: str = None, # System wide flags, often requires a reboot for changes to + # take effect. + resource_flags_mask: str = None, # What flags to change. If unset, default is all. + shelf: str = None, # Name of the Shelf, or all. [R][D:1] + top_left_x: str = None, # X Location for Chamber View. + top_left_y: str = None, # X Location for Chamber View. + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_set_resource(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if device_profiles is not None: data["device_profiles"] = device_profiles @@ -10465,9 +9346,10 @@ class LFJsonPost(LFCliBase): data["top_left_y"] = top_left_y if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/set_resource", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/set_resource", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -10498,26 +9380,27 @@ class LFJsonPost(LFCliBase): return (cls[member].value for member in cls.__members__ if member == name) def post_set_rfgen(self, - bb_gain=None, # RX Gain, 0 - 62 in 2dB steps - freq_khz=None, # Center frequency in Khz - gain=None, # Main TX/RX Amp, 0 or 14 (dB), default is 14 - p_id=None, # RF Generator ID, not used at this time, enter 'NA' or 0. - if_gain=None, # Fine-tune TX/RX Gain, 0 - 40 dB - pulse_count=None, # Number of pulses (0-255) - pulse_interval_us=None, # Time between pulses, in micro-seconds. - pulse_width_us=None, # Requested pulse width, units are in micro-seconds. - resource=None, # Resource number. - rfgen_flags=None, # RF Generator flags, see above. - rfgen_flags_mask=None, # Mask of what flags to set, see above. - shelf=None, # Shelf number, usually 1. - sweep_time_ms=None, # Time interval between pulse groups in miliseconds - debug_=False): + bb_gain: str = None, # RX Gain, 0 - 62 in 2dB steps + freq_khz: str = None, # Center frequency in Khz + gain: str = None, # Main TX/RX Amp, 0 or 14 (dB), default is 14 + p_id: str = None, # RF Generator ID, not used at this time, enter 'NA' or 0. + # [D:NA] + if_gain: str = None, # Fine-tune TX/RX Gain, 0 - 40 dB + pulse_count: str = None, # Number of pulses (0-255) + pulse_interval_us: str = None, # Time between pulses, in micro-seconds. + pulse_width_us: str = None, # Requested pulse width, units are in micro-seconds. + resource: str = None, # Resource number. [W] + rfgen_flags: str = None, # RF Generator flags, see above. + rfgen_flags_mask: str = None, # Mask of what flags to set, see above. + shelf: str = None, # Shelf number, usually 1. [R][D:1] + sweep_time_ms: str = None, # Time interval between pulse groups in miliseconds + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_set_rfgen(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if bb_gain is not None: data["bb_gain"] = bb_gain @@ -10547,9 +9430,10 @@ class LFJsonPost(LFCliBase): data["sweep_time_ms"] = sweep_time_ms if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/set_rfgen", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/set_rfgen", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -10607,20 +9491,20 @@ class LFJsonPost(LFCliBase): ScriptWL = "ScriptWL" # For iterating through WanLink settings def post_set_script(self, - endp=None, # Endpoint, Test Group or Attenuator name or ID. - flags=None, # See above for description of the defined flags. - group_action=None, # How to handle group script operations: ALL, Sequential - loop_count=None, # How many times to loop before stopping (0 is infinite). - name=None, # Script name. - private=None, # Private encoding for the particular script. - p_type=None, # One of: NONE, Script2544, ScriptHunt, ScriptWL, ScriptAtten - debug_=False): + endp: str = None, # Endpoint, Test Group or Attenuator name or ID. [R] + flags: str = None, # See above for description of the defined flags. + group_action: str = None, # How to handle group script operations: ALL, Sequential + loop_count: str = None, # How many times to loop before stopping (0 is infinite). + name: str = None, # Script name. [W] + private: str = None, # Private encoding for the particular script. + p_type: str = None, # One of: NONE, Script2544, ScriptHunt, ScriptWL, ScriptAtten + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_set_script(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if endp is not None: data["endp"] = endp @@ -10638,9 +9522,10 @@ class LFJsonPost(LFCliBase): data["type"] = p_type if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/set_script", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/set_script", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -10650,17 +9535,18 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#set_sec_ip ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_set_sec_ip(self, - ip_list=None, # IP1/prefix,IP2/prefix,...IPZ/prefix. - port=None, # Name of network device (Port) to which these IPs will be added. - resource=None, # Resource number. - shelf=None, # Shelf number. - debug_=False): + ip_list: str = None, # IP1/prefix,IP2/prefix,...IPZ/prefix. [W] + port: str = None, # Name of network device (Port) to which these IPs will be added. + # [R] + resource: str = None, # Resource number. [W] + shelf: str = None, # Shelf number. [R][D:1] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_set_sec_ip(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if ip_list is not None: data["ip_list"] = ip_list @@ -10672,9 +9558,10 @@ class LFJsonPost(LFCliBase): data["shelf"] = shelf if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/set_sec_ip", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/set_sec_ip", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -10684,35 +9571,38 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#set_voip_info ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_set_voip_info(self, - codec=None, # Codec to use for the voice stream, supported values: G711U, - # G711A, SPEEX, g726-16, g726-24, g726-32, g726-40, g729a. - first_call_delay=None, # How long to wait before making first call, in seconds. - jitter_buffer_sz=None, # The size of the jitter buffer in packets. Default value is 8. - local_sip_port=None, # Local SIP UDP port. Default is min-rtp-port + 2. - loop_call_count=None, # How many calls to make, zero means infinite. - loop_wavefile_count=None, # How many times to play the wave file, zero means infinite. - max_call_duration=None, # How long should the call be, in seconds. - max_inter_call_gap=None, # Maximum time to wait between calls, in seconds. - messaging_protocol=None, # Messaging protocol, supported values: SIP. - min_call_duration=None, # How long should the call be, in seconds. - min_inter_call_gap=None, # Minimum time to wait between calls, in seconds. - name=None, # The name of the endpoint we are configuring. - pesq_server_ip=None, # LANforge PESQ server IP address. - pesq_server_passwd=None, # LANforge PESQ server password. Default is to use no + codec: str = None, # Codec to use for the voice stream, supported values: + # G711U, G711A, SPEEX, g726-16, g726-24, g726-32, g726-40, + # g729a. + first_call_delay: str = None, # How long to wait before making first call, in seconds. + jitter_buffer_sz: str = None, # The size of the jitter buffer in packets. Default value + # is 8. + local_sip_port: str = None, # Local SIP UDP port. Default is min-rtp-port + 2. + loop_call_count: str = None, # How many calls to make, zero means infinite. + loop_wavefile_count: str = None, # How many times to play the wave file, zero means + # infinite. + max_call_duration: str = None, # How long should the call be, in seconds. + max_inter_call_gap: str = None, # Maximum time to wait between calls, in seconds. + messaging_protocol: str = None, # Messaging protocol, supported values: SIP. + min_call_duration: str = None, # How long should the call be, in seconds. + min_inter_call_gap: str = None, # Minimum time to wait between calls, in seconds. + name: str = None, # The name of the endpoint we are configuring. [R] + pesq_server_ip: str = None, # LANforge PESQ server IP address. + pesq_server_passwd: str = None, # LANforge PESQ server password. Default is to use no # authentication (blank entry). - pesq_server_port=None, # LANforge PESQ server port, default is 3998. - reg_expire_timer=None, # SIP Registration expire timer, in seconds. - ringing_timer=None, # How long (milliseconds) to wait in the ringing state before - # flagging call as no-answer. - sound_dev=None, # Which sound device should we play sound to. (see + pesq_server_port: str = None, # LANforge PESQ server port, default is 3998. + reg_expire_timer: str = None, # SIP Registration expire timer, in seconds. + ringing_timer: str = None, # How long (milliseconds) to wait in the ringing state + # before flagging call as no-answer. + sound_dev: str = None, # Which sound device should we play sound to. (see # set_endp_flags). - debug_=False): + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_set_voip_info(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if codec is not None: data["codec"] = codec @@ -10752,9 +9642,10 @@ class LFJsonPost(LFCliBase): data["sound_dev"] = sound_dev if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/set_voip_info", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/set_voip_info", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -10764,23 +9655,23 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#set_vrcx_cost ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_set_vrcx_cost(self, - interface_cost=None, # If using OSPF, this sets the cost for this link (1-65535). - local_dev=None, # Name of port A for the local redirect device pair. - local_dev_b=None, # Name of port B for the local redirect device pair. - remote_dev=None, # Name of port B for the remote redirect device pair. - remote_dev_b=None, # Name of port B for the remote redirect device pair. - resource=None, # Resource number. - shelf=None, # Shelf name/id. - vr_name=None, # Virtual Router this endpoint belongs to. Use 'FREE_LIST' to add - # a stand-alone endpoint. - wanlink=None, # The name of the WanLink that connects the two B ports. - debug_=False): + interface_cost: str = None, # If using OSPF, this sets the cost for this link (1-65535). + local_dev: str = None, # Name of port A for the local redirect device pair. + local_dev_b: str = None, # Name of port B for the local redirect device pair. + remote_dev: str = None, # Name of port B for the remote redirect device pair. + remote_dev_b: str = None, # Name of port B for the remote redirect device pair. + resource: str = None, # Resource number. [W] + shelf: str = None, # Shelf name/id. [R][D:1] + vr_name: str = None, # Virtual Router this endpoint belongs to. Use 'FREE_LIST' to + # add a stand-alone endpoint. [W][D:FREE_LIST] + wanlink: str = None, # The name of the WanLink that connects the two B ports. + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_set_vrcx_cost(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if interface_cost is not None: data["interface_cost"] = interface_cost @@ -10802,9 +9693,10 @@ class LFJsonPost(LFCliBase): data["wanlink"] = wanlink if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/set_vrcx_cost", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/set_vrcx_cost", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -10814,39 +9706,41 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#set_wanlink_info ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_set_wanlink_info(self, - drop_freq=None, # How often, out of 1,000,000 packets, should we + drop_freq: str = None, # How often, out of 1,000,000 packets, should we # purposefully drop a packet. - dup_freq=None, # How often, out of 1,000,000 packets, should we + dup_freq: str = None, # How often, out of 1,000,000 packets, should we # purposefully duplicate a packet. - extra_buffer=None, # The extra amount of bytes to buffer before dropping pkts, - # in units of 1024. Use -1 for AUTO. - jitter_freq=None, # How often, out of 1,000,000 packets, should we apply + extra_buffer: str = None, # The extra amount of bytes to buffer before dropping + # pkts, in units of 1024. Use -1 for AUTO. + jitter_freq: str = None, # How often, out of 1,000,000 packets, should we apply # jitter. - latency=None, # The base latency added to all packets, in milliseconds - # (or add 'us' suffix for microseconds - max_drop_amt=None, # Maximum amount of packets to drop in a row. Default is 1. - max_jitter=None, # The maximum jitter, in milliseconds (or ad 'us' suffix - # for microseconds) - max_lateness=None, # Maximum amount of un-intentional delay before pkt is + latency: str = None, # The base latency added to all packets, in + # milliseconds (or add 'us' suffix for microseconds + max_drop_amt: str = None, # Maximum amount of packets to drop in a row. Default + # is 1. + max_jitter: str = None, # The maximum jitter, in milliseconds (or ad 'us' + # suffix for microseconds) + max_lateness: str = None, # Maximum amount of un-intentional delay before pkt is # dropped. Default is AUTO - max_reorder_amt=None, # Maximum amount of packets by which to reorder, Default is - # 10. - min_drop_amt=None, # Minimum amount of packets to drop in a row. Default is 1. - min_reorder_amt=None, # Minimum amount of packets by which to reorder, Default is - # 1. - name=None, # The name of the endpoint we are configuring. - playback_capture_file=None, # Name of the WAN capture file to play back. - reorder_freq=None, # How often, out of 1,000,000 packets, should we make a + max_reorder_amt: str = None, # Maximum amount of packets by which to reorder, + # Default is 10. + min_drop_amt: str = None, # Minimum amount of packets to drop in a row. Default + # is 1. + min_reorder_amt: str = None, # Minimum amount of packets by which to reorder, + # Default is 1. + name: str = None, # The name of the endpoint we are configuring. [R] + playback_capture_file: str = None, # Name of the WAN capture file to play back. + reorder_freq: str = None, # How often, out of 1,000,000 packets, should we make a # packet out of order. - speed=None, # The maximum speed of traffic this endpoint will accept - # (bps). - debug_=False): + speed: str = None, # The maximum speed of traffic this endpoint will + # accept (bps). + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_set_wanlink_info(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if drop_freq is not None: data["drop_freq"] = drop_freq @@ -10880,9 +9774,10 @@ class LFJsonPost(LFCliBase): data["speed"] = speed if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/set_wanlink_info", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/set_wanlink_info", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -10891,18 +9786,26 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#set_wanlink_pcap ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + class SetWanlinkPcapCapture(Enum): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Example Usage: + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + OFF = "OFF" # stop capturing + ON = "ON" # start capturing + def post_set_wanlink_pcap(self, - capture=None, # Should we capture or not? ON or OFF. - directory=None, # The directory name in which packet capture files will be + capture: str = None, # Should we capture or not? ON or OFF. [R] + directory: str = None, # The directory name in which packet capture files will be # written. - name=None, # The name of the endpoint we are configuring. - debug_=False): + name: str = None, # The name of the endpoint we are configuring. [R] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_set_wanlink_pcap(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if capture is not None: data["capture"] = capture @@ -10912,9 +9815,10 @@ class LFJsonPost(LFCliBase): data["name"] = name if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/set_wanlink_pcap", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/set_wanlink_pcap", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -10949,24 +9853,24 @@ class LFJsonPost(LFCliBase): return (cls[member].value for member in cls.__members__ if member == name) def post_set_wanpath_corruption(self, - byte=None, # The byte to use for OVERWRITE_FIXED (or NA). - flags=None, # The flags for this corruption. - index=None, # The corruption to modify (0-5). - max_offset=None, # The maximum offset from start of Ethernet packet for the - # byte to be modified. - min_offset=None, # The minimum offset from start of Ethernet packet for the - # byte to be modified. - name=None, # WanLink name - path=None, # WanPath name - rate=None, # Specifies how often, per million, this corruption should - # be applied. - debug_=False): + byte: str = None, # The byte to use for OVERWRITE_FIXED (or NA). + flags: str = None, # The flags for this corruption. + index: str = None, # The corruption to modify (0-5). [R,0-5] + max_offset: str = None, # The maximum offset from start of Ethernet packet for + # the byte to be modified. + min_offset: str = None, # The minimum offset from start of Ethernet packet for + # the byte to be modified. + name: str = None, # WanLink name [R] + path: str = None, # WanPath name [R] + rate: str = None, # Specifies how often, per million, this corruption + # should be applied. + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_set_wanpath_corruption(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if byte is not None: data["byte"] = byte @@ -10986,9 +9890,10 @@ class LFJsonPost(LFCliBase): data["rate"] = rate if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/set_wanpath_corruption", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/set_wanpath_corruption", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -10998,23 +9903,25 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#set_wanpath_filter ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_set_wanpath_filter(self, - defer_flush=None, # Enter 'YES' if you do NOT want this flushed to the remote. - dst_filter=None, # The destination MAC or IP/Mask, 'NA' for PCAP. - filter_type=None, # The filter type, one of: MAC, IP, PCAP. - passive=None, # Enter 'YES' if you do NOT want to use this filter currently. - reverse=None, # If you want the logic reversed, use 'ON', otherwise set to - # 'OFF' - src_filter=None, # The source MAC or IP/Mask. For PCAP, this is the only + defer_flush: str = None, # Enter 'YES' if you do NOT want this flushed to the + # remote. + dst_filter: str = None, # The destination MAC or IP/Mask, 'NA' for PCAP. + filter_type: str = None, # The filter type, one of: MAC, IP, PCAP. + passive: str = None, # Enter 'YES' if you do NOT want to use this filter + # currently. + reverse: str = None, # If you want the logic reversed, use 'ON', otherwise set + # to 'OFF' + src_filter: str = None, # The source MAC or IP/Mask. For PCAP, this is the only # filter. - wl_name=None, # The name of the WanLink endpoint we are configuring. - wp_name=None, # The name of the WanPath we are configuring. - debug_=False): + wl_name: str = None, # The name of the WanLink endpoint we are configuring. [R] + wp_name: str = None, # The name of the WanPath we are configuring. [R] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_set_wanpath_filter(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if defer_flush is not None: data["defer_flush"] = defer_flush @@ -11034,9 +9941,10 @@ class LFJsonPost(LFCliBase): data["wp_name"] = wp_name if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/set_wanpath_filter", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/set_wanpath_filter", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -11055,16 +9963,16 @@ class LFJsonPost(LFCliBase): STOPPED = "STOPPED" # then it will not be running at any time. def post_set_wanpath_running(self, - running=None, # The state, one of: AS_PARENT, RUNNING, STOPPED. - wl_name=None, # The name of the WanLink endpoint we are configuring. - wp_name=None, # The name of the WanPath we are configuring. - debug_=False): + running: str = None, # The state, one of: AS_PARENT, RUNNING, STOPPED. [R] + wl_name: str = None, # The name of the WanLink endpoint we are configuring. [R] + wp_name: str = None, # The name of the WanPath we are configuring. [R] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_set_wanpath_running(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if running is not None: data["running"] = running @@ -11074,9 +9982,10 @@ class LFJsonPost(LFCliBase): data["wp_name"] = wp_name if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/set_wanpath_running", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/set_wanpath_running", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -11119,31 +10028,31 @@ class LFJsonPost(LFCliBase): return (cls[member].value for member in cls.__members__ if member == name) def post_set_wifi_corruptions(self, - corrupt_flags=None, # Specify packet types to corrupt (see flags above). - corrupt_per_mil=None, # Per-million: Station to randomly corrupt selected + corrupt_flags: str = None, # Specify packet types to corrupt (see flags above). + corrupt_per_mil: str = None, # Per-million: Station to randomly corrupt selected # message types by this amount. - delay_flags=None, # Specify packet types to delay (see flags above). - delay_max=None, # miliseconds: Station to randomly delay processing + delay_flags: str = None, # Specify packet types to delay (see flags above). + delay_max: str = None, # miliseconds: Station to randomly delay processing # received messages, max time - delay_min=None, # miliseconds: Station to randomly delay processing + delay_min: str = None, # miliseconds: Station to randomly delay processing # received messages, min time - dup_flags=None, # Specify packet types to duplicate (see flags above). - dup_per_65535=None, # Percentage, represented as x per 65535 of packets we + dup_flags: str = None, # Specify packet types to duplicate (see flags above). + dup_per_65535: str = None, # Percentage, represented as x per 65535 of packets we # should duplicate. - ignore_flags=None, # Specify packet types to ignore (see flags above). - ignore_per_mil=None, # Per-million: Station to randomly ignore selected message - # types by this amount. - port=None, # WiFi interface name or number. - req_flush=None, # Set to 1 if you wish to flush changes to kernel now. - resource=None, # Resource number. - shelf=None, # Shelf number. - debug_=False): + ignore_flags: str = None, # Specify packet types to ignore (see flags above). + ignore_per_mil: str = None, # Per-million: Station to randomly ignore selected + # message types by this amount. + port: str = None, # WiFi interface name or number. [W] + req_flush: str = None, # Set to 1 if you wish to flush changes to kernel now. + resource: str = None, # Resource number. [W] + shelf: str = None, # Shelf number. [R][D:1] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_set_wifi_corruptions(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if corrupt_flags is not None: data["corrupt_flags"] = corrupt_flags @@ -11173,9 +10082,10 @@ class LFJsonPost(LFCliBase): data["shelf"] = shelf if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/set_wifi_corruptions", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/set_wifi_corruptions", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -11185,19 +10095,19 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#set_wifi_custom ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_set_wifi_custom(self, - port=None, # WiFi interface name or number. - resource=None, # Resource number. - shelf=None, # Shelf number. - text=None, # [BLANK] will erase all, any other text will be appended to - # existing text. Unescaped Value - p_type=None, # NA for now, may specify specific locations later. - debug_=False): + port: str = None, # WiFi interface name or number. [W] + resource: str = None, # Resource number. [W] + shelf: str = None, # Shelf number. [R][D:1] + text: str = None, # [BLANK] will erase all, any other text will be appended to + # existing text. + p_type: str = None, # NA for now, may specify specific locations later. [D:NA] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_set_wifi_custom(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if port is not None: data["port"] = port @@ -11211,9 +10121,10 @@ class LFJsonPost(LFCliBase): data["type"] = p_type if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/set_wifi_custom", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/set_wifi_custom", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -11223,55 +10134,55 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#set_wifi_extra ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_set_wifi_extra(self, - anonymous_identity=None, # Anonymous identity string for EAP. - anqp_3gpp_cell_net=None, # 802.11u 3GCPP Cellular Network Info, VAP only. - ca_cert=None, # CA-CERT file name. - client_cert=None, # 802.11u Client cert file: /etc/wpa_supplicant/ca.pem - domain=None, # 802.11u domain: mytelco.com - eap=None, # EAP method: MD5, MSCHAPV2, OTP, GTC, TLS, PEAP, TTLS. - group=None, # Group cyphers: CCMP, TKIP, WEP104, WEP40, or combination. - hessid=None, # 802.11u HESSID (MAC address format) (or peer for WDS + anonymous_identity: str = None, # Anonymous identity string for EAP. + anqp_3gpp_cell_net: str = None, # 802.11u 3GCPP Cellular Network Info, VAP only. + ca_cert: str = None, # CA-CERT file name. + client_cert: str = None, # 802.11u Client cert file: /etc/wpa_supplicant/ca.pem + domain: str = None, # 802.11u domain: mytelco.com + eap: str = None, # EAP method: MD5, MSCHAPV2, OTP, GTC, TLS, PEAP, TTLS. + group: str = None, # Group cyphers: CCMP, TKIP, WEP104, WEP40, or combination. + hessid: str = None, # 802.11u HESSID (MAC address format) (or peer for WDS # stations). - identity=None, # EAP Identity string. - imsi=None, # 802.11u IMSI: 310026-000000000 - ipaddr_type_avail=None, # 802.11u network type available, integer, VAP only. - key=None, # WEP key0. This should be entered in ascii-hex. Use this only - # for WEP. - key_mgmt=None, # Key management: WPA-PSK, WPA-EAP, IEEE8021X, NONE, + identity: str = None, # EAP Identity string. + imsi: str = None, # 802.11u IMSI: 310026-000000000 + ipaddr_type_avail: str = None, # 802.11u network type available, integer, VAP only. + key: str = None, # WEP key0. This should be entered in ascii-hex. Use this + # only for WEP. + key_mgmt: str = None, # Key management: WPA-PSK, WPA-EAP, IEEE8021X, NONE, # WPA-PSK-SHA256, WPA-EAP-SHA256 or combo. - milenage=None, # 802.11u milenage: + milenage: str = None, # 802.11u milenage: # 90dca4eda45b53cf0f12d7c9c3bc6a89:cb9cccc4b9258e6dca4760379fb82 - network_auth_type=None, # 802.11u network authentication type, VAP only. - network_type=None, # 802.11u network type, integer, VAP only. - pac_file=None, # EAP-FAST PAC-File name. (For AP, this field is the RADIUS + network_auth_type: str = None, # 802.11u network authentication type, VAP only. + network_type: str = None, # 802.11u network type, integer, VAP only. + pac_file: str = None, # EAP-FAST PAC-File name. (For AP, this field is the RADIUS # secret password) - pairwise=None, # Pairwise ciphers: CCMP, TKIP, NONE, or combination. - password=None, # EAP Password string. - phase1=None, # Outer-authentication, ie TLS tunnel parameters. - phase2=None, # Inner authentication with TLS tunnel. - pin=None, # EAP-SIM pin string. (For AP, this field is HS20 Operating + pairwise: str = None, # Pairwise ciphers: CCMP, TKIP, NONE, or combination. + password: str = None, # EAP Password string. + phase1: str = None, # Outer-authentication, ie TLS tunnel parameters. + phase2: str = None, # Inner authentication with TLS tunnel. + pin: str = None, # EAP-SIM pin string. (For AP, this field is HS20 Operating # Class) - pk_passwd=None, # EAP private key password. (For AP, this field is HS20 + pk_passwd: str = None, # EAP private key password. (For AP, this field is HS20 # connection capability) - port=None, # WiFi interface name or number. - private_key=None, # EAP private key certificate file name. (For AP, this field - # is HS20 WAN Metrics) - psk=None, # WPA(2) pre-shared key. If unsure, use this field for any + port: str = None, # WiFi interface name or number. [W] + private_key: str = None, # EAP private key certificate file name. (For AP, this + # field is HS20 WAN Metrics) + psk: str = None, # WPA(2) pre-shared key. If unsure, use this field for any # password entry. Prepend with 0x for ascii-hex # representation. - realm=None, # 802.11u realm: mytelco.com - resource=None, # Resource number. - roaming_consortium=None, # 802.11u roaming consortium: 223344 (15 characters max) - shelf=None, # Shelf number. - venue_group=None, # 802.11u Venue Group, integer. VAP only. - venue_type=None, # 802.11u Venue Type, integer. VAP only. - debug_=False): + realm: str = None, # 802.11u realm: mytelco.com + resource: str = None, # Resource number. [W] + roaming_consortium: str = None, # 802.11u roaming consortium: 223344 (15 characters max) + shelf: str = None, # Shelf number. [R][D:1] + venue_group: str = None, # 802.11u Venue Group, integer. VAP only. + venue_type: str = None, # 802.11u Venue Type, integer. VAP only. + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_set_wifi_extra(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if anonymous_identity is not None: data["anonymous_identity"] = anonymous_identity @@ -11339,9 +10250,10 @@ class LFJsonPost(LFCliBase): data["venue_type"] = venue_type if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/set_wifi_extra", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/set_wifi_extra", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -11351,34 +10263,34 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#set_wifi_extra2 ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_set_wifi_extra2(self, - corrupt_gtk_rekey_mic=None, # Per-million: AP corrupts GTK Rekey MIC. - freq_24=None, # Frequency list for 2.4Ghz band, see above. - freq_5=None, # Frequency list for 5Ghz band, see above. - ignore_assoc=None, # Per-million: AP ignore assoc request percentage. - ignore_auth=None, # Per-million: AP ignore auth request percentage. - ignore_probe=None, # Per-million: AP ignore probe percentage. - ignore_reassoc=None, # Per-million: AP ignore re-assoc request percentage. - ocsp=None, # OCSP settings: 0=disabled, 1=try, but to not require + corrupt_gtk_rekey_mic: str = None, # Per-million: AP corrupts GTK Rekey MIC. + freq_24: str = None, # Frequency list for 2.4Ghz band, see above. + freq_5: str = None, # Frequency list for 5Ghz band, see above. + ignore_assoc: str = None, # Per-million: AP ignore assoc request percentage. + ignore_auth: str = None, # Per-million: AP ignore auth request percentage. + ignore_probe: str = None, # Per-million: AP ignore probe percentage. + ignore_reassoc: str = None, # Per-million: AP ignore re-assoc request percentage. + ocsp: str = None, # OCSP settings: 0=disabled, 1=try, but to not require # response, 2=require valid OCSP stapling response. - port=None, # WiFi interface name or number. - post_ifup_script=None, # Script name with optional args, will run after interface - # comes up and gets IP. - radius_ip=None, # RADIUS server IP Address (AP Only) - radius_port=None, # RADIUS server IP Port (AP Only) - req_flush=None, # Set to 1 if you wish to flush changes to kernel now. - resource=None, # Resource number. - sae_pwe=None, # Set SAE-PWE, 0 == hunting-and-pecking, 1 == + port: str = None, # WiFi interface name or number. [W] + post_ifup_script: str = None, # Script name with optional args, will run after + # interface comes up and gets IP. + radius_ip: str = None, # RADIUS server IP Address (AP Only) + radius_port: str = None, # RADIUS server IP Port (AP Only) + req_flush: str = None, # Set to 1 if you wish to flush changes to kernel now. + resource: str = None, # Resource number. [W] + sae_pwe: str = None, # Set SAE-PWE, 0 == hunting-and-pecking, 1 == # hash-to-element, 2 allow both. - shelf=None, # Shelf number. - venue_id=None, # Venue-ID for this wifi device. VAP in same venue will + shelf: str = None, # Shelf number. [R][D:1] + venue_id: str = None, # Venue-ID for this wifi device. VAP in same venue will # share neigh reports as appropriate. - debug_=False): + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_set_wifi_extra2(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if corrupt_gtk_rekey_mic is not None: data["corrupt_gtk_rekey_mic"] = corrupt_gtk_rekey_mic @@ -11416,9 +10328,10 @@ class LFJsonPost(LFCliBase): data["venue_id"] = venue_id if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/set_wifi_extra2", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/set_wifi_extra2", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -11478,57 +10391,58 @@ class LFJsonPost(LFCliBase): g = 3 # 802.11g def post_set_wifi_radio(self, - active_peer_count=None, # Number of locally-cached peer objects for this radio. - ampdu_factor=None, # ax200/ax210 only, currently. Requires module reload. OS + active_peer_count: str = None, # Number of locally-cached peer objects for this radio. + ampdu_factor: str = None, # ax200/ax210 only, currently. Requires module reload. OS # Default: 0xFF - antenna=None, # Antenna configuration: 0 Diversity/All, 1 Fixed-A (1x1), 4 - # AB (2x2), 7 ABC (3x3), 8 ABCD (4x4), 9 8x8 - channel=None, # Channel number for this radio device. Frequency takes + antenna: str = None, # Antenna configuration: 0 Diversity/All, 1 Fixed-A (1x1), + # 4 AB (2x2), 7 ABC (3x3), 8 ABCD (4x4), 9 8x8 + channel: str = None, # Channel number for this radio device. Frequency takes # precedence if both are set to non-default values. - # 0xFFFF, AUTO or DEFAULT means ANY. - const_tx=None, # RF Pattern Generator , encoded as a single 32-bit integer. - # See above. - country=None, # Country number for this radio device. - flags=None, # Flags for this interface (see above.) - flags_mask=None, # If set, only these flags will be considered. - frag_thresh=None, # Fragmentation Threshold (256 - 2346, 2346 == disabled). - frequency=None, # Frequency for this radio. 0xFFFF, AUTO or DEFAULT - # means ANY. - fwname=None, # Firmware name (for example: firmware-5.bin) - fwver=None, # Firmware API version (for example, 5 if firmware is based on - # firmware-5.bin - mac=None, # Used to identify when name cannot be trusted (2.6.34+ + const_tx: str = None, # RF Pattern Generator , encoded as a single 32-bit + # integer. See above. + country: str = None, # Country number for this radio device. + flags: str = None, # Flags for this interface (see above.) + flags_mask: str = None, # If set, only these flags will be considered. + frag_thresh: str = None, # Fragmentation Threshold (256 - 2346, 2346 == disabled). + frequency: str = None, # Frequency for this radio. 0xFFFF, AUTO or + # DEFAULT means ANY. + fwname: str = None, # Firmware name (for example: firmware-5.bin) + fwver: str = None, # Firmware API version (for example, 5 if firmware is based + # on firmware-5.bin + mac: str = None, # Used to identify when name cannot be trusted (2.6.34+ # kernels). - max_amsdu=None, # Maximum number of frames per AMSDU that may be transmitted. - # See above. - mode=None, # WiFi mode, see table - peer_count=None, # Number of peer objects for this radio. - pref_ap=None, # Preferred AP BSSID for all station vdevs on this radio. - pulse2_interval_us=None, # Pause between pattern burst for RF noise generator. - pulse_interval=None, # RF Pattern generator: interval between pulses in usecs. - pulse_width=None, # RF Pattern generator: pulse width in usecs. - radio=None, # Name of the physical radio interface, for example: wiphy0 - rate=None, # No longer used, specify the rate on the virtual station(s) - # instead. - rate_ctrl_count=None, # Number of rate-ctrl objects for this radio. - resource=None, # Resource number. - rts=None, # The RTS Threshold for this radio (off, or 1-2347). - shelf=None, # Shelf number. - skid_limit=None, # Firmware hash-table Skid Limit for this radio. - stations_count=None, # Number of stations supported by this radio. - tids_count=None, # TIDs count for this radio. - tx_pulses=None, # Number of pattern pulses per burst for RF noise generator. - txdesc_count=None, # Transmit descriptor count for this radio. - txpower=None, # The transmit power setting for this radio. (AUTO for system - # defaults) - vdev_count=None, # Configure radio vdev count. - debug_=False): + max_amsdu: str = None, # Maximum number of frames per AMSDU that may be + # transmitted. See above. + mode: str = None, # WiFi mode, see table + peer_count: str = None, # Number of peer objects for this radio. + pref_ap: str = None, # Preferred AP BSSID for all station vdevs on this radio. + pulse2_interval_us: str = None, # Pause between pattern burst for RF noise generator. + pulse_interval: str = None, # RF Pattern generator: interval between pulses in usecs. + pulse_width: str = None, # RF Pattern generator: pulse width in usecs. + radio: str = None, # Name of the physical radio interface, for example: wiphy0 + # [W] + rate: str = None, # No longer used, specify the rate on the virtual + # station(s) instead. + rate_ctrl_count: str = None, # Number of rate-ctrl objects for this radio. + resource: str = None, # Resource number. [W] + rts: str = None, # The RTS Threshold for this radio (off, or 1-2347). + shelf: str = None, # Shelf number. [R][D:1] + skid_limit: str = None, # Firmware hash-table Skid Limit for this radio. + stations_count: str = None, # Number of stations supported by this radio. + tids_count: str = None, # TIDs count for this radio. + tx_pulses: str = None, # Number of pattern pulses per burst for RF noise + # generator. + txdesc_count: str = None, # Transmit descriptor count for this radio. + txpower: str = None, # The transmit power setting for this radio. (AUTO for + # system defaults) + vdev_count: str = None, # Configure radio vdev count. + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_set_wifi_radio(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if active_peer_count is not None: data["active_peer_count"] = active_peer_count @@ -11598,9 +10512,10 @@ class LFJsonPost(LFCliBase): data["vdev_count"] = vdev_count if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/set_wifi_radio", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/set_wifi_radio", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -11610,27 +10525,29 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#set_wifi_txo ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_set_wifi_txo(self, - port=None, # WiFi interface name or number. - resource=None, # Resource number. - shelf=None, # Shelf number. - txo_bw=None, # Configure bandwidth: 0 == 20, 1 == 40, 2 == 80, 3 == 160, 4 == + port: str = None, # WiFi interface name or number. [W] + resource: str = None, # Resource number. [W] + shelf: str = None, # Shelf number. [R][D:1] + txo_bw: str = None, # Configure bandwidth: 0 == 20, 1 == 40, 2 == 80, 3 == 160, 4 == # 80+80. - txo_enable=None, # Set to 1 if you wish to enable transmit override, 0 to disable. - txo_mcs=None, # Configure the MCS (0-3 for CCK, 0-7 for OFDM, 0-7 for HT, 0-9 for - # VHT, 0-11 for HE - txo_nss=None, # Configure number of spatial streams (0 == nss1, 1 == nss2, ...). - txo_pream=None, # Select rate preamble: 0 == OFDM, 1 == CCK, 2 == HT, 3 == VHT, 4 == - # HE_SU. - txo_retries=None, # Configure number of retries. 0 or 1 means no retries). - txo_sgi=None, # Should rates be sent with short-guard-interval or not? - txo_txpower=None, # Configure TX power in db. Use 255 for system defaults. - debug_=False): + txo_enable: str = None, # Set to 1 if you wish to enable transmit override, 0 to + # disable. + txo_mcs: str = None, # Configure the MCS (0-3 for CCK, 0-7 for OFDM, 0-7 for HT, 0-9 + # for VHT, 0-11 for HE + txo_nss: str = None, # Configure number of spatial streams (0 == nss1, 1 == nss2, + # ...). + txo_pream: str = None, # Select rate preamble: 0 == OFDM, 1 == CCK, 2 == HT, 3 == VHT, + # 4 == HE_SU. + txo_retries: str = None, # Configure number of retries. 0 or 1 means no retries). + txo_sgi: str = None, # Should rates be sent with short-guard-interval or not? + txo_txpower: str = None, # Configure TX power in db. Use 255 for system defaults. + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_set_wifi_txo(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if port is not None: data["port"] = port @@ -11656,9 +10573,10 @@ class LFJsonPost(LFCliBase): data["txo_txpower"] = txo_txpower if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/set_wifi_txo", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/set_wifi_txo", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -11693,23 +10611,23 @@ class LFJsonPost(LFCliBase): return (cls[member].value for member in cls.__members__ if member == name) def post_set_wl_corruption(self, - byte=None, # The byte to use for OVERWRITE_FIXED (or NA). - flags=None, # The flags for this corruption. - index=None, # The corruption to modify (0-5). - max_offset=None, # The maximum offset from start of Ethernet packet for the byte - # to be modified. - min_offset=None, # The minimum offset from start of Ethernet packet for the byte - # to be modified. - name=None, # WanLink name - rate=None, # Specifies how often, per million, this corruption should be - # applied. - debug_=False): + byte: str = None, # The byte to use for OVERWRITE_FIXED (or NA). + flags: str = None, # The flags for this corruption. + index: str = None, # The corruption to modify (0-5). [R,0-5] + max_offset: str = None, # The maximum offset from start of Ethernet packet for the + # byte to be modified. + min_offset: str = None, # The minimum offset from start of Ethernet packet for the + # byte to be modified. + name: str = None, # WanLink name [R] + rate: str = None, # Specifies how often, per million, this corruption should + # be applied. + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_set_wl_corruption(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if byte is not None: data["byte"] = byte @@ -11727,9 +10645,10 @@ class LFJsonPost(LFCliBase): data["rate"] = rate if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/set_wl_corruption", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/set_wl_corruption", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -11747,15 +10666,15 @@ class LFJsonPost(LFCliBase): WRR__queue_queue_____ = "WRR,[queue,queue,...]" # Weighted Round Robbin is also available def post_set_wl_qdisc(self, - name=None, # WanLink name - qdisc=None, # FIFO, WRR,a,b,c,d,e,f,g etc - debug_=False): + name: str = None, # WanLink name [R] + qdisc: str = None, # FIFO, WRR,a,b,c,d,e,f,g etc [R] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_set_wl_qdisc(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if name is not None: data["name"] = name @@ -11763,9 +10682,10 @@ class LFJsonPost(LFCliBase): data["qdisc"] = qdisc if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/set_wl_qdisc", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/set_wl_qdisc", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -11793,19 +10713,19 @@ class LFJsonPost(LFCliBase): Test_Mgr = "Test_Mgr" # def post_show_alerts(self, - card=None, # Alert resource filter. - endp=None, # Alert endpoint filter. - extra=None, # Extra filter, currently ignored. - port=None, # Alert port filter (can be port name or number). - shelf=None, # Alert shelf filter. - p_type=None, # Alert type filter. - debug_=False): + card: str = None, # Alert resource filter. + endp: str = None, # Alert endpoint filter. + extra: str = None, # Extra filter, currently ignored. + port: str = None, # Alert port filter (can be port name or number). + shelf: str = None, # Alert shelf filter. + p_type: str = None, # Alert type filter. [R] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_show_alerts(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if card is not None: data["card"] = card @@ -11821,9 +10741,10 @@ class LFJsonPost(LFCliBase): data["type"] = p_type if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/show_alerts", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/show_alerts", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -11833,16 +10754,16 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#show_attenuators ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_show_attenuators(self, - resource=None, # Resource number, or 'all'. - serno=None, # Serial number for requested Attenuator, or 'all'. - shelf=None, # Shelf number or alias, can be 'all'. - debug_=False): + resource: str = None, # Resource number, or 'all'. [W] + serno: str = None, # Serial number for requested Attenuator, or 'all'. [W] + shelf: str = None, # Shelf number or alias, can be 'all'. [R][D:1] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_show_attenuators(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if resource is not None: data["resource"] = resource @@ -11852,9 +10773,10 @@ class LFJsonPost(LFCliBase): data["shelf"] = shelf if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/show_attenuators", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/show_attenuators", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -11864,16 +10786,16 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#show_cd ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_show_cd(self, - collision_domain=None, # Name of the Collision Domain, or 'all'. - resource=None, # Resource number, or 'all'. - shelf=None, # Name/id of the shelf, or 'all'. - debug_=False): + collision_domain: str = None, # Name of the Collision Domain, or 'all'. [W] + resource: str = None, # Resource number, or 'all'. [W] + shelf: str = None, # Name/id of the shelf, or 'all'. [R][D:1] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_show_cd(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if collision_domain is not None: data["collision_domain"] = collision_domain @@ -11883,9 +10805,10 @@ class LFJsonPost(LFCliBase): data["shelf"] = shelf if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/show_cd", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/show_cd", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -11895,22 +10818,23 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#show_chamber ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_show_chamber(self, - name=None, # Chamber Name or 'ALL'. - debug_=False): + name: str = None, # Chamber Name or 'ALL'. [W][D:ALL] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_show_chamber(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if name is not None: data["name"] = name if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/show_chamber", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/show_chamber", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -11920,16 +10844,16 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#show_channel_groups ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_show_channel_groups(self, - channel_name=None, # Name of the channel, or 'all'. - resource=None, # Resource number, or 'all'. - shelf=None, # Name/id of the shelf, or 'all'. - debug_=False): + channel_name: str = None, # Name of the channel, or 'all'. [W] + resource: str = None, # Resource number, or 'all'. [W] + shelf: str = None, # Name/id of the shelf, or 'all'. [R][D:1] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_show_channel_groups(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if channel_name is not None: data["channel_name"] = channel_name @@ -11939,9 +10863,10 @@ class LFJsonPost(LFCliBase): data["shelf"] = shelf if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/show_channel_groups", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/show_channel_groups", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -11951,17 +10876,18 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#show_clients ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_show_clients(self, - debug_=False): + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_show_clients(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} - response = self.json_post("/cli-json/show_clients", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/show_clients", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -11971,15 +10897,15 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#show_cx ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_show_cx(self, - cross_connect=None, # Specify cross-connect to act on, or 'all'. - test_mgr=None, # Specify test-mgr to act on, or 'all'. - debug_=False): + cross_connect: str = None, # Specify cross-connect to act on, or 'all'. [W] + test_mgr: str = None, # Specify test-mgr to act on, or 'all'. [R] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_show_cx(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if cross_connect is not None: data["cross_connect"] = cross_connect @@ -11987,9 +10913,10 @@ class LFJsonPost(LFCliBase): data["test_mgr"] = test_mgr if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/show_cx", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/show_cx", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -11999,15 +10926,15 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#show_cxe ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_show_cxe(self, - cross_connect=None, # Specify cross-connect to show, or 'all'. - test_mgr=None, # Specify test-mgr to use, or 'all'. - debug_=False): + cross_connect: str = None, # Specify cross-connect to show, or 'all'. [W] + test_mgr: str = None, # Specify test-mgr to use, or 'all'. [R] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_show_cxe(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if cross_connect is not None: data["cross_connect"] = cross_connect @@ -12015,9 +10942,10 @@ class LFJsonPost(LFCliBase): data["test_mgr"] = test_mgr if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/show_cxe", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/show_cxe", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -12027,17 +10955,18 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#show_dbs ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_show_dbs(self, - debug_=False): + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_show_dbs(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} - response = self.json_post("/cli-json/show_dbs", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/show_dbs", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -12047,22 +10976,23 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#show_dut ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_show_dut(self, - name=None, # DUT Name or 'ALL'. - debug_=False): + name: str = None, # DUT Name or 'ALL'. [W][D:ALL] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_show_dut(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if name is not None: data["name"] = name if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/show_dut", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/show_dut", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -12072,15 +11002,16 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#show_endp_payload ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_show_endp_payload(self, - max_bytes=None, # The max number of payload bytes to print out, default is 128. - name=None, # The name of the endpoint we are configuring. - debug_=False): + max_bytes: str = None, # The max number of payload bytes to print out, default is + # 128. [R][D:128] + name: str = None, # The name of the endpoint we are configuring. [R] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_show_endp_payload(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if max_bytes is not None: data["max_bytes"] = max_bytes @@ -12088,9 +11019,10 @@ class LFJsonPost(LFCliBase): data["name"] = name if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/show_endp_payload", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/show_endp_payload", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -12100,15 +11032,15 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#show_endpoints ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_show_endpoints(self, - endpoint=None, # Name of endpoint, or 'all'. - extra=None, # See above. - debug_=False): + endpoint: str = None, # Name of endpoint, or 'all'. [R] + extra: str = None, # See above. + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_show_endpoints(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if endpoint is not None: data["endpoint"] = endpoint @@ -12116,9 +11048,10 @@ class LFJsonPost(LFCliBase): data["extra"] = extra if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/show_endpoints", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/show_endpoints", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -12128,23 +11061,24 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#show_err ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_show_err(self, - message=None, # Message to show to others currently logged on. Unescaped Value - debug_=False): + message: str = None, # Message to show to others currently logged on. Unescaped Value [R] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_show_err(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if message is not None: data["message"] = message if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/show_err", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/show_err", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -12154,17 +11088,18 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#show_event_interest ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_show_event_interest(self, - debug_=False): + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_show_event_interest(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} - response = self.json_post("/cli-json/show_event_interest", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/show_event_interest", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -12192,19 +11127,19 @@ class LFJsonPost(LFCliBase): Test_Mgr = "Test_Mgr" # def post_show_events(self, - card=None, # Event resource filter. - endp=None, # Event endpoint filter. - extra=None, # Extra filter, currently ignored. - port=None, # Event port filter (can be port name or number). - shelf=None, # Event shelf filter. - p_type=None, # Event type filter. - debug_=False): + card: str = None, # Event resource filter. + endp: str = None, # Event endpoint filter. + extra: str = None, # Extra filter, currently ignored. + port: str = None, # Event port filter (can be port name or number). + shelf: str = None, # Event shelf filter. + p_type: str = None, # Event type filter. [R] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_show_events(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if card is not None: data["card"] = card @@ -12220,9 +11155,10 @@ class LFJsonPost(LFCliBase): data["type"] = p_type if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/show_events", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/show_events", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -12232,19 +11168,20 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#show_files ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_show_files(self, - dir_flags=None, # Determines format of listing, see above. - directory=None, # The sub-directory in which to list. - p_filter=None, # An optional filter, as used by the 'ls' command. - key=None, # A special key, can be used for scripting. - resource=None, # The machine to search in. - shelf=None, # The virtual shelf to search in. Use 0 for manager machine. - debug_=False): + dir_flags: str = None, # Determines format of listing, see above. + directory: str = None, # The sub-directory in which to list. + p_filter: str = None, # An optional filter, as used by the 'ls' command. + key: str = None, # A special key, can be used for scripting. + resource: str = None, # The machine to search in. [W] + shelf: str = None, # The virtual shelf to search in. Use 0 for manager machine. + # [R,0-1] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_show_files(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if dir_flags is not None: data["dir_flags"] = dir_flags @@ -12260,9 +11197,10 @@ class LFJsonPost(LFCliBase): data["shelf"] = shelf if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/show_files", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/show_files", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -12272,22 +11210,23 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#show_group ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_show_group(self, - group=None, # Can be name of test group. Use 'all' or leave blank for all groups. - debug_=False): + group: str = None, # Can be name of test group. Use 'all' or leave blank for all groups. + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_show_group(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if group is not None: data["group"] = group if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/show_group", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/show_group", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -12297,22 +11236,23 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#show_pesq ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_show_pesq(self, - endpoint=None, # Name of endpoint, or 'all'. - debug_=False): + endpoint: str = None, # Name of endpoint, or 'all'. [R] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_show_pesq(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if endpoint is not None: data["endpoint"] = endpoint if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/show_pesq", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/show_pesq", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -12322,18 +11262,18 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#show_ports ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_show_ports(self, - port=None, # Port number, or 'all'. - probe_flags=None, # See above, add them together for multiple probings. Leave blank if - # you want stats only. - resource=None, # Resource number, or 'all'. - shelf=None, # Name/id of the shelf, or 'all'. - debug_=False): + port: str = None, # Port number, or 'all'. [W] + probe_flags: str = None, # See above, add them together for multiple probings. Leave blank + # if you want stats only. + resource: str = None, # Resource number, or 'all'. [W] + shelf: str = None, # Name/id of the shelf, or 'all'. [R][D:1] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_show_ports(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if port is not None: data["port"] = port @@ -12345,9 +11285,10 @@ class LFJsonPost(LFCliBase): data["shelf"] = shelf if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/show_ports", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/show_ports", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -12357,16 +11298,16 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#show_ppp_links ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_show_ppp_links(self, - link_num=None, # Ppp-Link number of the span, or 'all'. - resource=None, # Resource number, or 'all'. - shelf=None, # Name/id of the shelf, or 'all'. - debug_=False): + link_num: str = None, # Ppp-Link number of the span, or 'all'. [W] + resource: str = None, # Resource number, or 'all'. [W] + shelf: str = None, # Name/id of the shelf, or 'all'. [R][D:1] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_show_ppp_links(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if link_num is not None: data["link_num"] = link_num @@ -12376,9 +11317,10 @@ class LFJsonPost(LFCliBase): data["shelf"] = shelf if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/show_ppp_links", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/show_ppp_links", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -12388,22 +11330,23 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#show_profile ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_show_profile(self, - name=None, # Profile Name or 'ALL'. - debug_=False): + name: str = None, # Profile Name or 'ALL'. [R] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_show_profile(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if name is not None: data["name"] = name if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/show_profile", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/show_profile", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -12413,15 +11356,15 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#show_resources ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_show_resources(self, - resource=None, # Resource number, or 'all'. - shelf=None, # Shelf number or alias, can be 'all'. - debug_=False): + resource: str = None, # Resource number, or 'all'. [W] + shelf: str = None, # Shelf number or alias, can be 'all'. [R][D:1] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_show_resources(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if resource is not None: data["resource"] = resource @@ -12429,9 +11372,10 @@ class LFJsonPost(LFCliBase): data["shelf"] = shelf if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/show_resources", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/show_resources", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -12441,15 +11385,15 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#show_rfgen ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_show_rfgen(self, - resource=None, # Resource number, or 'all'. - shelf=None, # Shelf number or alias, can be 'all'. - debug_=False): + resource: str = None, # Resource number, or 'all'. [W] + shelf: str = None, # Shelf number or alias, can be 'all'. [R][D:1] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_show_rfgen(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if resource is not None: data["resource"] = resource @@ -12457,9 +11401,10 @@ class LFJsonPost(LFCliBase): data["shelf"] = shelf if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/show_rfgen", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/show_rfgen", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -12469,17 +11414,17 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#show_rt ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_show_rt(self, - key=None, # Unique identifier for this request. Usually left blank. - resource=None, # Resource number. - shelf=None, # Shelf number. - virtual_router=None, # Name of the virtual router. - debug_=False): + key: str = None, # Unique identifier for this request. Usually left blank. + resource: str = None, # Resource number. [W] + shelf: str = None, # Shelf number. [R][D:1] + virtual_router: str = None, # Name of the virtual router. [W] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_show_rt(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if key is not None: data["key"] = key @@ -12491,9 +11436,10 @@ class LFJsonPost(LFCliBase): data["virtual_router"] = virtual_router if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/show_rt", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/show_rt", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -12503,15 +11449,15 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#show_script_results ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_show_script_results(self, - endpoint=None, # Name of endpoint, test-group, or 'all'. - key=None, # Optional 'key' to be used in keyed-text message result. - debug_=False): + endpoint: str = None, # Name of endpoint, test-group, or 'all'. [R] + key: str = None, # Optional 'key' to be used in keyed-text message result. + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_show_script_results(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if endpoint is not None: data["endpoint"] = endpoint @@ -12519,9 +11465,10 @@ class LFJsonPost(LFCliBase): data["key"] = key if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/show_script_results", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/show_script_results", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -12531,16 +11478,16 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#show_spans ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_show_spans(self, - resource=None, # Resource number, or 'all'. - shelf=None, # Name/id of the shelf, or 'all'. - span_number=None, # Span-Number of the span, or 'all'. - debug_=False): + resource: str = None, # Resource number, or 'all'. [W] + shelf: str = None, # Name/id of the shelf, or 'all'. [R][D:1] + span_number: str = None, # Span-Number of the span, or 'all'. [W] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_show_spans(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if resource is not None: data["resource"] = resource @@ -12550,9 +11497,10 @@ class LFJsonPost(LFCliBase): data["span_number"] = span_number if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/show_spans", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/show_spans", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -12562,16 +11510,16 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#show_text_blob ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_show_text_blob(self, - brief=None, # Set to 'brief' for a brief listing of all text blobs. - name=None, # Text Blob Name or 'ALL'. - p_type=None, # Text Blob type or 'ALL'. - debug_=False): + brief: str = None, # Set to 'brief' for a brief listing of all text blobs. + name: str = None, # Text Blob Name or 'ALL'. [R] + p_type: str = None, # Text Blob type or 'ALL'. [R] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_show_text_blob(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if brief is not None: data["brief"] = brief @@ -12581,9 +11529,10 @@ class LFJsonPost(LFCliBase): data["type"] = p_type if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/show_text_blob", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/show_text_blob", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -12593,22 +11542,23 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#show_tm ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_show_tm(self, - test_mgr=None, # Can be name of test manager, or 'all'. - debug_=False): + test_mgr: str = None, # Can be name of test manager, or 'all'. [R] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_show_tm(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if test_mgr is not None: data["test_mgr"] = test_mgr if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/show_tm", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/show_tm", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -12618,22 +11568,23 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#show_traffic_profile ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_show_traffic_profile(self, - name=None, # Profile Name or 'ALL'. - debug_=False): + name: str = None, # Profile Name or 'ALL'. [R] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_show_traffic_profile(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if name is not None: data["name"] = name if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/show_traffic_profile", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/show_traffic_profile", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -12643,16 +11594,17 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#show_venue ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_show_venue(self, - resource=None, # Resource number, or 'ALL' - shelf=None, # Shelf number. - venu_id=None, # Number to uniquely identify this venue on this resource, or 'ALL' - debug_=False): + resource: str = None, # Resource number, or 'ALL' [W] + shelf: str = None, # Shelf number. [R][D:1] + venu_id: str = None, # Number to uniquely identify this venue on this resource, or 'ALL' + # [W] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_show_venue(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if resource is not None: data["resource"] = resource @@ -12662,9 +11614,10 @@ class LFJsonPost(LFCliBase): data["venu_id"] = venu_id if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/show_venue", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/show_venue", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -12674,16 +11627,16 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#show_vr ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_show_vr(self, - resource=None, # Resource number, or 'all'. - router=None, # Name of the Virtual Router, or 'all'. - shelf=None, # Name/id of the shelf, or 'all'. - debug_=False): + resource: str = None, # Resource number, or 'all'. [W] + router: str = None, # Name of the Virtual Router, or 'all'. [W] + shelf: str = None, # Name/id of the shelf, or 'all'. [R][D:1] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_show_vr(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if resource is not None: data["resource"] = resource @@ -12693,9 +11646,10 @@ class LFJsonPost(LFCliBase): data["shelf"] = shelf if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/show_vr", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/show_vr", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -12705,16 +11659,16 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#show_vrcx ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_show_vrcx(self, - cx_name=None, # Name of the Virtual Router Connection, or 'all'. - resource=None, # Resource number, or 'all'. - shelf=None, # Name/id of the shelf, or 'all'. - debug_=False): + cx_name: str = None, # Name of the Virtual Router Connection, or 'all'. [W] + resource: str = None, # Resource number, or 'all'. [W] + shelf: str = None, # Name/id of the shelf, or 'all'. [R][D:1] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_show_vrcx(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if cx_name is not None: data["cx_name"] = cx_name @@ -12724,9 +11678,10 @@ class LFJsonPost(LFCliBase): data["shelf"] = shelf if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/show_vrcx", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/show_vrcx", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -12736,15 +11691,15 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#show_wanpaths ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_show_wanpaths(self, - endpoint=None, # Name of endpoint, or 'all'. - wanpath=None, # Name of wanpath, or 'all'. - debug_=False): + endpoint: str = None, # Name of endpoint, or 'all'. [W] + wanpath: str = None, # Name of wanpath, or 'all'. [W] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_show_wanpaths(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if endpoint is not None: data["endpoint"] = endpoint @@ -12752,9 +11707,10 @@ class LFJsonPost(LFCliBase): data["wanpath"] = wanpath if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/show_wanpaths", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/show_wanpaths", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -12764,18 +11720,18 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#shutdown ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_shutdown(self, - chdir=None, # Directory to cd to before dying. Only useful when using gprof to debug, - # or 'NA' to ignore. - really=None, # Must be 'YES' for command to really work. - serverctl=None, # Enter 'YES' to do a ./serverctl.bash restart to restart all LANforge - # processes. - debug_=False): + chdir: str = None, # Directory to cd to before dying. Only useful when using gprof to + # debug, or 'NA' to ignore. + really: str = None, # Must be 'YES' for command to really work. + serverctl: str = None, # Enter 'YES' to do a ./serverctl.bash restart to restart all + # LANforge processes. + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_shutdown(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if chdir is not None: data["chdir"] = chdir @@ -12785,9 +11741,10 @@ class LFJsonPost(LFCliBase): data["serverctl"] = serverctl if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/shutdown", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/shutdown", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -12797,15 +11754,15 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#shutdown_os ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_shutdown_os(self, - resource=None, # Resource number, or ALL. - shelf=None, # Shelf number, or ALL. - debug_=False): + resource: str = None, # Resource number, or ALL. [W] + shelf: str = None, # Shelf number, or ALL. [R][D:1] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_shutdown_os(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if resource is not None: data["resource"] = resource @@ -12813,9 +11770,10 @@ class LFJsonPost(LFCliBase): data["shelf"] = shelf if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/shutdown_os", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/shutdown_os", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -12825,15 +11783,15 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#shutdown_resource ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_shutdown_resource(self, - resource=None, # Resource number, or ALL. - shelf=None, # Shelf number, or ALL. - debug_=False): + resource: str = None, # Resource number, or ALL. [W] + shelf: str = None, # Shelf number, or ALL. [R][D:1] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_shutdown_resource(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if resource is not None: data["resource"] = resource @@ -12841,9 +11799,10 @@ class LFJsonPost(LFCliBase): data["shelf"] = shelf if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/shutdown_resource", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/shutdown_resource", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -12876,22 +11835,22 @@ class LFJsonPost(LFCliBase): return (cls[member].value for member in cls.__members__ if member == name) def post_sniff_port(self, - display=None, # The DISPLAY option, for example: 192.168.1.5:0.0. Will guess if left - # blank. - duration=None, # Duration for doing a capture (in seconds). Default is 5 minutes for - # dumpcap/tshark, and forever for wireshark - flags=None, # Flags that control how the sniffing is done. - outfile=None, # Optional file location for saving a capture. - port=None, # The port we are trying to run the packet sniffer on. - resource=None, # Resource number. - shelf=None, # Shelf number. - debug_=False): + display: str = None, # The DISPLAY option, for example: 192.168.1.5:0.0. Will guess if + # left blank. + duration: str = None, # Duration for doing a capture (in seconds). Default is 5 minutes + # for dumpcap/tshark, and forever for wireshark + flags: str = None, # Flags that control how the sniffing is done. + outfile: str = None, # Optional file location for saving a capture. + port: str = None, # The port we are trying to run the packet sniffer on. [R] + resource: str = None, # Resource number. [W] + shelf: str = None, # Shelf number. [R][D:1] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_sniff_port(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if display is not None: data["display"] = display @@ -12909,9 +11868,10 @@ class LFJsonPost(LFCliBase): data["shelf"] = shelf if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/sniff_port", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/sniff_port", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -12921,22 +11881,23 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#start_endp ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_start_endp(self, - endp_name=None, # Name of the cross-connect, or 'all'. - debug_=False): + endp_name: str = None, # Name of the cross-connect, or 'all'. [R] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_start_endp(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if endp_name is not None: data["endp_name"] = endp_name if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/start_endp", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/start_endp", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -12946,22 +11907,23 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#start_group ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_start_group(self, - name=None, # The name of the test group. - debug_=False): + name: str = None, # The name of the test group. [R] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_start_group(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if name is not None: data["name"] = name if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/start_group", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/start_group", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -12971,16 +11933,16 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#start_ppp_link ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_start_ppp_link(self, - resource=None, # Resource number that holds this PppLink. - shelf=None, # Name/id of the shelf. - unit_num=None, # Unit-Number for the PppLink to be started. - debug_=False): + resource: str = None, # Resource number that holds this PppLink. [W] + shelf: str = None, # Name/id of the shelf. [R][D:1] + unit_num: str = None, # Unit-Number for the PppLink to be started. [R] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_start_ppp_link(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if resource is not None: data["resource"] = resource @@ -12990,9 +11952,10 @@ class LFJsonPost(LFCliBase): data["unit_num"] = unit_num if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/start_ppp_link", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/start_ppp_link", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -13002,22 +11965,23 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#stop_endp ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_stop_endp(self, - endp_name=None, # Name of the endpoint, or 'all'. - debug_=False): + endp_name: str = None, # Name of the endpoint, or 'all'. [R] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_stop_endp(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if endp_name is not None: data["endp_name"] = endp_name if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/stop_endp", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/stop_endp", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -13027,22 +11991,23 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#stop_group ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_stop_group(self, - name=None, # The name of the test group, or 'all' - debug_=False): + name: str = None, # The name of the test group, or 'all' [R] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_stop_group(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if name is not None: data["name"] = name if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/stop_group", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/stop_group", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -13052,16 +12017,16 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#stop_ppp_link ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_stop_ppp_link(self, - resource=None, # Resource number that holds this PppLink. - shelf=None, # Name/id of the shelf. - unit_num=None, # Unit-Number for the PppLink to be stopped. - debug_=False): + resource: str = None, # Resource number that holds this PppLink. [W] + shelf: str = None, # Name/id of the shelf. [R][D:1] + unit_num: str = None, # Unit-Number for the PppLink to be stopped. [W] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_stop_ppp_link(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if resource is not None: data["resource"] = resource @@ -13071,9 +12036,10 @@ class LFJsonPost(LFCliBase): data["unit_num"] = unit_num if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/stop_ppp_link", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/stop_ppp_link", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -13083,19 +12049,19 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#tail ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_tail(self, - cmd=None, # Command: start, stop, results - key=None, # File-name that we should be tailing. - message=None, # The contents to display (for results only) Unescaped - # Value - resource=None, # Resource that holds the file. - shelf=None, # Shelf that holds the resource that holds the file. - debug_=False): + cmd: str = None, # Command: start, stop, results + key: str = None, # File-name that we should be tailing. + message: str = None, # The contents to display (for results only) Unescaped Value + resource: str = None, # Resource that holds the file. [W] + shelf: str = None, # Shelf that holds the resource that holds the file. [R][D:1] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_tail(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if cmd is not None: data["cmd"] = cmd @@ -13109,9 +12075,10 @@ class LFJsonPost(LFCliBase): data["shelf"] = shelf if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/tail", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/tail", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -13121,15 +12088,15 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#tm_register ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_tm_register(self, - client_name=None, # Name of client to be registered. (dflt is current client) - test_mgr=None, # Name of test manager (can be all.) - debug_=False): + client_name: str = None, # Name of client to be registered. (dflt is current client) [W] + test_mgr: str = None, # Name of test manager (can be all.) [R] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_tm_register(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if client_name is not None: data["client_name"] = client_name @@ -13137,9 +12104,10 @@ class LFJsonPost(LFCliBase): data["test_mgr"] = test_mgr if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/tm_register", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/tm_register", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -13149,15 +12117,16 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#tm_unregister ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_tm_unregister(self, - client_name=None, # Name of client to be un-registered. (dflt is current client) - test_mgr=None, # Name of test manager (can be all.) - debug_=False): + client_name: str = None, # Name of client to be un-registered. (dflt is current client) + # [W] + test_mgr: str = None, # Name of test manager (can be all.) [R] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_tm_unregister(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if client_name is not None: data["client_name"] = client_name @@ -13165,9 +12134,10 @@ class LFJsonPost(LFCliBase): data["test_mgr"] = test_mgr if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/tm_unregister", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/tm_unregister", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -13177,17 +12147,18 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#version ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_version(self, - debug_=False): + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_version(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} - response = self.json_post("/cli-json/version", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/version", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -13197,17 +12168,18 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#who ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_who(self, - debug_=False): + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_who(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} - response = self.json_post("/cli-json/who", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/who", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -13217,19 +12189,19 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#wifi_cli_cmd ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_wifi_cli_cmd(self, - port=None, # Name of the WiFi station or AP interface to which this command - # will be directed. - resource=None, # Resource number. - shelf=None, # Shelf number. - wpa_cli_cmd=None, # Command to pass to wpa_cli or hostap_cli. This must be - # single-quoted. - debug_=False): + port: str = None, # Name of the WiFi station or AP interface to which this command + # will be directed. [R] + resource: str = None, # Resource number. [W] + shelf: str = None, # Shelf number. [R][D:1] + wpa_cli_cmd: str = None, # Command to pass to wpa_cli or hostap_cli. This must be + # single-quoted. [R] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_wifi_cli_cmd(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if port is not None: data["port"] = port @@ -13241,9 +12213,10 @@ class LFJsonPost(LFCliBase): data["wpa_cli_cmd"] = wpa_cli_cmd if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/wifi_cli_cmd", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/wifi_cli_cmd", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -13253,17 +12226,17 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#wifi_event ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_wifi_event(self, - device=None, # Interface or PHY in most cases. - event=None, # What happened. - msg=None, # Entire event in human readable form. - status=None, # Status on what happened. - debug_=False): + device: str = None, # Interface or PHY in most cases. [R] + event: str = None, # What happened. [R] + msg: str = None, # Entire event in human readable form. + status: str = None, # Status on what happened. + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_wifi_event(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if device is not None: data["device"] = device @@ -13275,9 +12248,10 @@ class LFJsonPost(LFCliBase): data["status"] = status if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/wifi_event", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/wifi_event", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -13287,15 +12261,15 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#wiser_reset ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_wiser_reset(self, - resource=None, # Resource number, or ALL. - shelf=None, # Shelf number, or ALL. - debug_=False): + resource: str = None, # Resource number, or ALL. [W] + shelf: str = None, # Shelf number, or ALL. [R][D:1] + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_wiser_reset(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if resource is not None: data["resource"] = resource @@ -13303,9 +12277,10 @@ class LFJsonPost(LFCliBase): data["shelf"] = shelf if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/wiser_reset", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/wiser_reset", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # @@ -13315,21 +12290,3090 @@ class LFJsonPost(LFCliBase): https://www.candelatech.com/lfcli_ug.php#write ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" def post_write(self, - db_name=None, # The name the backup shall be saved as (blank means dflt) - debug_=False): + db_name: str = None, # The name the backup shall be saved as (blank means dflt) + debug=False): """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- Example Usage: result = post_write(param=value ...) pprint.pprint( result ) ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" - debug_ |= self.debug + debug |= self.debug_on data = {} if db_name is not None: data["db_name"] = db_name if len(data) < 1: raise ValueError(__name__+": no parameters to submit") - response = self.json_post("/cli-json/write", - data, - debug_=debug_) + response = self.json_post(url="/cli-json/write", + post_data=data, + die_on_error=self.die_on_error, + debug=debug) return response # + + + +class LFJsonQuery(JsonQuery): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + LFJsonQuery inherits from JsonQuery. + Queries are used for GET requests. + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + def __init__(self, + session_obj: object = None, + debug: bool = False, + exit_on_error: bool = False): + super().__init__(session_obj=session_obj, + debug=debug, + exit_on_error=exit_on_error) + + # Auto generated methods follow: + + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + If you need to call the URL directly, + request one of these URLs: + /attenuator/ + /attenuator/$shelf_id + /attenuator/$shelf_id/$resource_id + /attenuator/$shelf_id/$resource_id/$port_id + /attenuators/ + /attenuators/$shelf_id + /attenuators/$shelf_id/$resource_id + /attenuators/$shelf_id/$resource_id/$port_id + + When requesting specific column names, they need to be URL encoded: + entity+id, module+1, module+2, module+3, module+4, module+5, module+6, module+7, + module+8, name, script, state, temperature + Example URL: /attenuator?fields=entity+id,module+1 + + Example py-json call (it knows the URL): + record = LFJsonGet.get_attenuator(eid_list=['1.234', '1.344'], + requested_col_names=['entity id'], + debug=True) + + The record returned will have these members: + { + 'entity id': # Entity ID + 'module 1': # Reported attenuator dB settings. + 'module 2': # Reported attenuator dB settings. + 'module 3': # Reported attenuator dB settings. + 'module 4': # Reported attenuator dB settings. + 'module 5': # Reported attenuator dB settings. + 'module 6': # Reported attenuator dB settings. + 'module 7': # Reported attenuator dB settings. + 'module 8': # Reported attenuator dB settings. + 'name': # Attenuator module identifier (shelf . resource . serial-num). + 'script': # Attenuator script state. + 'state': # Attenuator state. + 'temperature': # Temperature in degres Farenheight reported in Attenuator unit. + } + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + def get_attenuator(self, + eid_list: list = None, + requested_col_names: list = None, + wait_sec: float = 0.01, + timeout_sec: float = 5.0, + errors_warnings: list = None, + debug: bool = False): + """ + :param eid_list: list of entity IDs to query for + :param requested_col_names: list of column names to return + :param wait_sec: duration to wait between retries if no response or response is HTTP 404 + :param timeout_sec: duration in which to keep querying before returning + :param errors_warnings: optional list to extend with errors and warnings from response + :param debug: print diagnostic info if true + :return: dictionary of results + """ + debug |= self.debug_on + url = "/attenuator" + if (eid_list is None) or (len(eid_list) < 1): + raise ValueError("no entity id in request") + trimmed_fields = [] + if isinstance(requested_col_names, str): + if not requested_col_names.strip(): + raise ValueError("column name cannot be blank") + trimmed_fields.append(requested_col_names.strip()) + if isinstance(requested_col_names, list): + for field in requested_col_names: + if not field.strip(): + raise ValueError("column names cannot be blank") + field = field.strip() + if field.find(" ") > -1: + raise ValueError("field should be URL encoded: [%s]" % field) + trimmed_fields.append(field) + url += self.create_port_eid_url(eid_list=eid_list) + + if len(trimmed_fields) > 0: + url += "?fields=%s" % (",".join(trimmed_fields)) + + response = self.json_get(url=url, + debug=debug, + wait_sec=wait_sec, + request_timeout_sec=timeout_sec, + max_timeout_sec=timeout_sec, + errors_warnings=errors_warnings) + if response is None: + return None + return self.extract_values(response=response, + singular_key="attenuator", + plural_key="attenuators") + # + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + If you need to call the URL directly, + request one of these URLs: + /chamber/ + /chamber/$chamber_name + + When requesting specific column names, they need to be URL encoded: + chamber, chamber+connections, chamber+resources, chamber+type, duts, entity+id, + flags, hide, isolation, marked, open, reported+rotation+%28deg%29, reported+rpm, + reported+tilt+%28deg%29, resource, rotation+%28deg%29, rpm, smas, tilt+%28deg%29, turntable, + turntable+type, virtual + Example URL: /chamber?fields=chamber,chamber+connections + + Example py-json call (it knows the URL): + record = LFJsonGet.get_chamber(eid_list=['1.234', '1.344'], + requested_col_names=['entity id'], + debug=True) + + The record returned will have these members: + { + 'chamber': # - + 'chamber connections': # - + 'chamber resources': # - + 'chamber type': # - + 'duts': # - + 'entity id': # - + 'flags': # - + 'hide': # - + 'isolation': # - + 'marked': # - + 'open': # - + 'reported rotation (deg)': # - + 'reported rpm ': # - + 'reported tilt (deg)': # - + 'resource': # - + 'rotation (deg)': # - + 'rpm': # - + 'smas': # - + 'tilt (deg)': # - + 'turntable': # - + 'turntable type': # - + 'virtual': # - + } + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + def get_chamber(self, + eid_list: list = None, + requested_col_names: list = None, + wait_sec: float = 0.01, + timeout_sec: float = 5.0, + errors_warnings: list = None, + debug: bool = False): + """ + :param eid_list: list of entity IDs to query for + :param requested_col_names: list of column names to return + :param wait_sec: duration to wait between retries if no response or response is HTTP 404 + :param timeout_sec: duration in which to keep querying before returning + :param errors_warnings: optional list to extend with errors and warnings from response + :param debug: print diagnostic info if true + :return: dictionary of results + """ + debug |= self.debug_on + url = "/chamber" + if (eid_list is None) or (len(eid_list) < 1): + raise ValueError("no entity id in request") + trimmed_fields = [] + if isinstance(requested_col_names, str): + if not requested_col_names.strip(): + raise ValueError("column name cannot be blank") + trimmed_fields.append(requested_col_names.strip()) + if isinstance(requested_col_names, list): + for field in requested_col_names: + if not field.strip(): + raise ValueError("column names cannot be blank") + field = field.strip() + if field.find(" ") > -1: + raise ValueError("field should be URL encoded: [%s]" % field) + trimmed_fields.append(field) + url += self.create_port_eid_url(eid_list=eid_list) + + if len(trimmed_fields) > 0: + url += "?fields=%s" % (",".join(trimmed_fields)) + + response = self.json_get(url=url, + debug=debug, + wait_sec=wait_sec, + request_timeout_sec=timeout_sec, + max_timeout_sec=timeout_sec, + errors_warnings=errors_warnings) + if response is None: + return None + return self.extract_values(response=response, + singular_key="chamber", + plural_key="chambers") + # + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + If you need to call the URL directly, + request one of these URLs: + /control/$command + + + Example py-json call (it knows the URL): + record = LFJsonGet.get_control(eid_list=['1.234', '1.344'], + debug=True) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + def get_control(self, + eid_list: list = None, + requested_col_names: list = None, + wait_sec: float = 0.01, + timeout_sec: float = 5.0, + errors_warnings: list = None, + debug: bool = False): + """ + :param eid_list: list of entity IDs to query for + :param requested_col_names: list of column names to return + :param wait_sec: duration to wait between retries if no response or response is HTTP 404 + :param timeout_sec: duration in which to keep querying before returning + :param errors_warnings: optional list to extend with errors and warnings from response + :param debug: print diagnostic info if true + :return: dictionary of results + """ + debug |= self.debug_on + url = "/control" + if (eid_list is None) or (len(eid_list) < 1): + raise ValueError("no entity id in request") + trimmed_fields = [] + if isinstance(requested_col_names, str): + if not requested_col_names.strip(): + raise ValueError("column name cannot be blank") + trimmed_fields.append(requested_col_names.strip()) + if isinstance(requested_col_names, list): + for field in requested_col_names: + if not field.strip(): + raise ValueError("column names cannot be blank") + field = field.strip() + if field.find(" ") > -1: + raise ValueError("field should be URL encoded: [%s]" % field) + trimmed_fields.append(field) + url += self.create_port_eid_url(eid_list=eid_list) + + if len(trimmed_fields) > 0: + url += "?fields=%s" % (",".join(trimmed_fields)) + + response = self.json_get(url=url, + debug=debug, + wait_sec=wait_sec, + request_timeout_sec=timeout_sec, + max_timeout_sec=timeout_sec, + errors_warnings=errors_warnings) + if response is None: + return None + return self.extract_values(response=response, + singular_key="", + plural_key="") + # + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + If you need to call the URL directly, + request one of these URLs: + /cx/ + /cx/$cx_id + + When requesting specific column names, they need to be URL encoded: + avg+rtt, bps+rx+a, bps+rx+b, drop+pkts+a, drop+pkts+b, eid, endpoints+%28a%C2%A0%E2%86%94%C2%A0b%29, + entity+id, name, pkt+rx+a, pkt+rx+b, rpt+timer, rx+drop+%25+a, rx+drop+%25+b, + state, type + Example URL: /cx?fields=avg+rtt,bps+rx+a + + Example py-json call (it knows the URL): + record = LFJsonGet.get_cx(eid_list=['1.234', '1.344'], + requested_col_names=['entity id'], + debug=True) + + The record returned will have these members: + { + 'avg rtt': # Average Round-Trip-Time (latency) for this connection (ms). + 'bps rx a': # Endpoint A's real receive rate (bps). + 'bps rx b': # Endpoint B's real receive rate (bps). + 'drop pkts a': # The number of packets Endpoint B sent minus the number Endpoint A + # received.This number is not 100% correct as long as packets are in + # flight.After a Quiesce of the test, the number should be perfectly + # accurate. + 'drop pkts b': # The number of packets Endpoint A sent minus the number Endpoint B + # received.This number is not 100% correct as long as packets are in + # flight.After a Quiesce of the test, the number should be perfectly + # accurate. + 'eid': # Cross Connect's Name. + 'endpoints (a ↔ b)': # Endpoints that make up this Cross Connect. + 'entity id': # Cross Connect's Name. + 'name': # Cross Connect's Name. + 'pkt rx a': # Endpoint A's Packets Recieved. + 'pkt rx b': # Endpoint B's Packets Recieved. + 'rpt timer': # Cross Connect's Report Timer (milliseconds).This is how often the GUI + # will ask for updates from the LANforge processes.If the GUI is sluggish, + # increasing the report timers may help. + 'rx drop % a': # Endpoint A percentage packet loss.Calculated using the number of PDUs + # Endpoint B sent minus the number Endpoint A received.This number is not + # 100% correct as long as packets are in flight.After a Quiesce of the + # test, the number should be perfectly accurate. + 'rx drop % b': # Endpoint B percentage packet loss.Calculated using the number of PDUs + # Endpoint A sent minus the number Endpoint B received.This number is not + # 100% correct as long as packets are in flight.After a Quiesce of the + # test, the number should be perfectly accurate. + 'state': # Current State of the connection.UninitializedHas not yet been + # started/stopped.InitializingBeing set up.StartingStarting the + # test.RunningTest is actively running.StoppedTest has been + # stopped.QuiesceTest will gracefully stop soon.HW-BYPASSTest is in + # hardware-bypass mode (WanLinks only)FTM_WAITTest wants to run, but is + # phantom, probably due to non-existent interface or resource.WAITINGWill + # restart as soon as resources are available.PHANTOMTest is stopped, and + # is phantom, probably due to non-existent interface or resource. + 'type': # Cross-Connect type. + } + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + def get_cx(self, + eid_list: list = None, + requested_col_names: list = None, + wait_sec: float = 0.01, + timeout_sec: float = 5.0, + errors_warnings: list = None, + debug: bool = False): + """ + :param eid_list: list of entity IDs to query for + :param requested_col_names: list of column names to return + :param wait_sec: duration to wait between retries if no response or response is HTTP 404 + :param timeout_sec: duration in which to keep querying before returning + :param errors_warnings: optional list to extend with errors and warnings from response + :param debug: print diagnostic info if true + :return: dictionary of results + """ + debug |= self.debug_on + url = "/cx" + if (eid_list is None) or (len(eid_list) < 1): + raise ValueError("no entity id in request") + trimmed_fields = [] + if isinstance(requested_col_names, str): + if not requested_col_names.strip(): + raise ValueError("column name cannot be blank") + trimmed_fields.append(requested_col_names.strip()) + if isinstance(requested_col_names, list): + for field in requested_col_names: + if not field.strip(): + raise ValueError("column names cannot be blank") + field = field.strip() + if field.find(" ") > -1: + raise ValueError("field should be URL encoded: [%s]" % field) + trimmed_fields.append(field) + url += self.create_port_eid_url(eid_list=eid_list) + + if len(trimmed_fields) > 0: + url += "?fields=%s" % (",".join(trimmed_fields)) + + response = self.json_get(url=url, + debug=debug, + wait_sec=wait_sec, + request_timeout_sec=timeout_sec, + max_timeout_sec=timeout_sec, + errors_warnings=errors_warnings) + if response is None: + return None + return self.extract_values(response=response, + singular_key="", + plural_key="") + # + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + If you need to call the URL directly, + request one of these URLs: + /dut/ + /dut/$name + + When requesting specific column names, they need to be URL encoded: + api+version, bssid-1, bssid-2, bssid-3, bssid-4, bssid-5, bssid-6, bssid-7, + bssid-8, dut, eap-id, entity+id, hw+info, image+file, lan, mgt+ip, model+number, + notes, num+ant+radio+1, num+ant+radio+2, num+ant+radio+3, password-1, password-2, + password-3, password-4, password-5, password-6, password-7, password-8, serial+number, + serial+port, ssid-1, ssid-2, ssid-3, ssid-4, ssid-5, ssid-6, ssid-7, ssid-8, + sw+info, wan + Example URL: /dut?fields=api+version,bssid-1 + + Example py-json call (it knows the URL): + record = LFJsonGet.get_dut(eid_list=['1.234', '1.344'], + requested_col_names=['entity id'], + debug=True) + + The record returned will have these members: + { + 'api version': # API Version + 'bssid-1': # WiFi BSSID for DUT. + 'bssid-2': # WiFi BSSID for DUT. + 'bssid-3': # WiFi BSSID for DUT. + 'bssid-4': # WiFi BSSID for DUT. + 'bssid-5': # WiFi BSSID for DUT. + 'bssid-6': # WiFi BSSID for DUT. + 'bssid-7': # WiFi BSSID for DUT. + 'bssid-8': # WiFi BSSID for DUT. + 'dut': # Devices Under Test + 'eap-id': # EAP Identifier, only used when one of the EAP options are selected. + 'entity id': # Entity ID + 'hw info': # DUT Hardware Info + 'image file': # Image file name. Relative paths assume directory /home/lanforge. Fully + # qualified pathnames begin with a slash (eg + # /usr/lib/share/icons/icon.png).File format should be PNG, JPG or BMP. + 'lan': # IP/Mask for LAN port (192.168.2.1/24). + 'mgt ip': # DUT Management IP address. + 'model number': # DUT model number or product name + 'notes': # Notes + 'num ant radio 1': # Antenna count for DUT radio(s). + 'num ant radio 2': # Antenna count for DUT radio(s). + 'num ant radio 3': # Antenna count for DUT radio(s). + 'password-1': # WiFi Password needed to connect to DUT. + 'password-2': # WiFi Password needed to connect to DUT. + 'password-3': # WiFi Password needed to connect to DUT. + 'password-4': # WiFi Password needed to connect to DUT. + 'password-5': # WiFi Password needed to connect to DUT. + 'password-6': # WiFi Password needed to connect to DUT. + 'password-7': # WiFi Password needed to connect to DUT. + 'password-8': # WiFi Password needed to connect to DUT. + 'serial number': # DUT Identifier (serial-number, or similar) + 'serial port': # Resource and name of LANforge serial port that connects to this DUT. + # (1.1.ttyS0). Does not need to belong to lan_port or wan_port resource. + 'ssid-1': # WiFi SSID advertised by DUT. + 'ssid-2': # WiFi SSID advertised by DUT. + 'ssid-3': # WiFi SSID advertised by DUT. + 'ssid-4': # WiFi SSID advertised by DUT. + 'ssid-5': # WiFi SSID advertised by DUT. + 'ssid-6': # WiFi SSID advertised by DUT. + 'ssid-7': # WiFi SSID advertised by DUT. + 'ssid-8': # WiFi SSID advertised by DUT. + 'sw info': # DUT Software Info + 'wan': # IP/Mask for WAN port (192.168.3.2/24). + } + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + def get_dut(self, + eid_list: list = None, + requested_col_names: list = None, + wait_sec: float = 0.01, + timeout_sec: float = 5.0, + errors_warnings: list = None, + debug: bool = False): + """ + :param eid_list: list of entity IDs to query for + :param requested_col_names: list of column names to return + :param wait_sec: duration to wait between retries if no response or response is HTTP 404 + :param timeout_sec: duration in which to keep querying before returning + :param errors_warnings: optional list to extend with errors and warnings from response + :param debug: print diagnostic info if true + :return: dictionary of results + """ + debug |= self.debug_on + url = "/dut" + if (eid_list is None) or (len(eid_list) < 1): + raise ValueError("no entity id in request") + trimmed_fields = [] + if isinstance(requested_col_names, str): + if not requested_col_names.strip(): + raise ValueError("column name cannot be blank") + trimmed_fields.append(requested_col_names.strip()) + if isinstance(requested_col_names, list): + for field in requested_col_names: + if not field.strip(): + raise ValueError("column names cannot be blank") + field = field.strip() + if field.find(" ") > -1: + raise ValueError("field should be URL encoded: [%s]" % field) + trimmed_fields.append(field) + url += self.create_port_eid_url(eid_list=eid_list) + + if len(trimmed_fields) > 0: + url += "?fields=%s" % (",".join(trimmed_fields)) + + response = self.json_get(url=url, + debug=debug, + wait_sec=wait_sec, + request_timeout_sec=timeout_sec, + max_timeout_sec=timeout_sec, + errors_warnings=errors_warnings) + if response is None: + return None + return self.extract_values(response=response, + singular_key="dut", + plural_key="duts") + # + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + If you need to call the URL directly, + request one of these URLs: + /endp/ + /endp/$endp_id + + When requesting specific column names, they need to be URL encoded: + 1st+rx, a%2Fb, bursty, crc+fail, cwnd, cx+active, cx+estab, cx+estab%2Fs, cx+to, + delay, destination+addr, dropped, dup+pkts, eid, elapsed, entity+id, jitter, + max+pdu, max+rate, min+pdu, min+rate, mng, name, ooo+pkts, pattern, pdu%2Fs+rx, + pdu%2Fs+tx, pps+rx+ll, pps+tx+ll, rcv+buf, replays, run, rx+ber, rx+bytes, + rx+drop+%25, rx+dup+%25, rx+ooo+%25, rx+pdus, rx+pkts+ll, rx+rate, rx+rate+%281%C2%A0min%29, + rx+rate+%28last%29, rx+rate+ll, rx+wrong+dev, script, send+buf, source+addr, + tcp+mss, tcp+rtx, tx+bytes, tx+pdus, tx+pkts+ll, tx+rate, tx+rate+%281%C2%A0min%29, + tx+rate+%28last%29, tx+rate+ll # hidden columns: + drop-count-5m, latency-5m, rt-latency-5m, rx-silence-5m + Example URL: /endp?fields=1st+rx,a%2Fb + + Example py-json call (it knows the URL): + record = LFJsonGet.get_endp(eid_list=['1.234', '1.344'], + requested_col_names=['entity id'], + debug=True) + + The record returned will have these members: + { + '1st rx': # Miliseconds between starting the endpoint and receiving the first + # packet.Note that LANforge UDP connections (not including multicast) will + # wait 20msbefore sending first frame to make sure receiver has adequate + # time to start. + 'a/b': # Display side (A or B) for the endpoint. + 'bursty': # Is the transmit rate bursty or not? + 'crc fail': # Total packets received with a bad payload CRC. + 'cwnd': # Sender's TCP Current Window Size. In units of Maximum Segment Size. + 'cx active': # Total number of active connections for this endpoint. + 'cx estab': # Total times the connection between the endpoints has been established. + 'cx estab/s': # Connections established per second, averaged over the last 30 seconds. + 'cx to': # Number of TCP connection attemtps timed out by LANforge. + 'delay': # Average latency in milliseconds for packets received by this endpoint. + 'destination addr': # Destination Address (MAC, ip/port, VoIP destination). + 'dropped': # Total dropped packets, as identified by gaps in packet sequence numbers. + 'dup pkts': # Total duplicate packets received. Only an estimate, but never less than + # this value. + 'eid': # Entity ID + 'elapsed': # Amount of time (seconds) this endpoint has been running (or ran.) + 'entity id': # Entity ID + 'jitter': # Exponential decaying average jitter calculated per RFC3393(old_jitter * + # 15/16 + new_jitter * 1/16) + 'max pdu': # The maximum write size.For Ethernet protocols, this is the entire + # Ethernet frame. For UDP, it is the UDP payload size, and for TCP, it + # just means the maximum amount of data that is written per socket + # write.In all cases, the packets on the wire will not exceed theport's + # MTU + Ethernet-Header-Size (typically 1514 for Ethernet) + 'max rate': # Maximum desired transmit rate, in bits per second (bps). + 'min pdu': # The minimum write size.For Ethernet protocols, this is the entire + # Ethernet frame. For UDP, it is the UDP payload size, and for TCP, it + # just means the maximum amount of data that is written per socket + # write.In all cases, the packets on the wire will not exceed theport's + # MTU + Ethernet-Header-Size (typically 1514 for Ethernet) + 'min rate': # Minimum desired transmit rate, in bits per second (bps). + 'mng': # Is the Endpoint managed or not? + 'name': # Endpoint's Name. + 'ooo pkts': # Total out of order packets received. Only an estimate, but never less + # than this value. + 'pattern': # Pattern of bytes this endpoint transmits. + 'pdu/s rx': # Received PDU per second.This counts the protocol reads, such as UDP + # PDUs. + 'pdu/s tx': # Transmitted PDU per second.This counts the protocol writes, such as UDP + # PDUs. + 'pps rx ll': # Estimated total received packets per second (on the wire).For TCP, this + # is an estimate.UDP and Ethernet protocols should be quite accurate on + # normal networks. + 'pps tx ll': # Estimated total transmitted packets per second (on the wire).For TCP, + # this is an estimate.UDP and Ethernet protocols should be quite accurate + # on normal networks. + 'rcv buf': # Configured/Actual values for receiving buffer size (bytes). + 'replays': # Total number of files replayed. + 'run': # Is the Endpoint is Running or not. + 'rx ber': # Received bit-errors. These are only calculated in the LANforge payload + # portion starting 28 bytes into the UDP or TCP payload. In addition, the + # bit-errors are only checked when LANforge CRCis enabled and detected to + # be invalid. If the 28-byte header is corrupted, LANforge will not + # detectit, and may also give false positives for other packet errors. + # Bit-Errors are only calculated forcertain payload patterns: Increasing, + # Decreasing, Zeros, Ones, and the PRBS patterns. + 'rx bytes': # Total received bytes count. + 'rx drop %': # Percentage of packets that should have been received by Endpoint, but + # were not, as calculated by the Cross-Connect. + 'rx dup %': # Percentage of duplicate packets, as detected by sequence numbers. + 'rx ooo %': # Percentage of packets received out of order, as detected by sequence + # numbers. + 'rx pdus': # Total received PDU count.This counts the protocol reads, such as UDP + # PDUs (aka goodput). + 'rx pkts ll': # Estimated total received packet count (on the wire).For TCP, this is an + # estimate.UDP and Ethernet protocols should be quite accurate on normal + # networks. + 'rx rate': # Real receive rate (bps) for this run.This includes only the protocol + # payload (goodput). + 'rx rate (1 min)': # Real receive rate (bps) over the last minute.This includes only the + # protocol payload (goodput). + 'rx rate (last)': # Real receive rate (bps) over the last report interval.This includes only + # the protocol payload (goodput). + 'rx rate ll': # Estimated low-level receive rate (bps) over the last minute.This + # includes any Ethernet, IP, TCP, UDP or similar headers. + 'rx wrong dev': # Total packets received on the wrong device (port). + 'script': # Endpoint script state. + 'send buf': # Configured/Actual values for sending buffer size (bytes). + 'source addr': # + 'tcp mss': # Sender's TCP-MSS (max segment size) setting.This cooresponds to the + # TCP_MAXSEGS socket option,and TCP-MSS plus 54 is the maximum packet size + # on the wirefor Ethernet frames.This is a good option to efficiently + # limit TCP packet size. + 'tcp rtx': # Total packets retransmitted by the TCP stack for this connection.These + # were likely dropped or corrupted in transit. + 'tx bytes': # Total transmitted bytes count. + 'tx pdus': # Total transmitted PDU count.This counts the protocol writes, such as UDP + # PDUs (aka goodput). + 'tx pkts ll': # Estimated total transmitted packet count (on the wire).For TCP, this is + # an estimate.UDP and Ethernet protocols should be quite accurate on + # normal networks. + 'tx rate': # Real transmit rate (bps) for this run.This includes only the protocol + # payload (goodput). + 'tx rate (1 min)': # Real transmit rate (bps) over the last minute.This includes only the + # protocol payload (goodput). + 'tx rate (last)': # Real transmit rate (bps) over the last report interval.This includes + # only the protocol payload (goodput). + 'tx rate ll': # Estimated low-level transmit rate (bps) over the last minute.This + # includes any Ethernet, IP, TCP, UDP or similar headers. + } + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + def get_endp(self, + eid_list: list = None, + requested_col_names: list = None, + wait_sec: float = 0.01, + timeout_sec: float = 5.0, + errors_warnings: list = None, + debug: bool = False): + """ + :param eid_list: list of entity IDs to query for + :param requested_col_names: list of column names to return + :param wait_sec: duration to wait between retries if no response or response is HTTP 404 + :param timeout_sec: duration in which to keep querying before returning + :param errors_warnings: optional list to extend with errors and warnings from response + :param debug: print diagnostic info if true + :return: dictionary of results + """ + debug |= self.debug_on + url = "/endp" + if (eid_list is None) or (len(eid_list) < 1): + raise ValueError("no entity id in request") + trimmed_fields = [] + if isinstance(requested_col_names, str): + if not requested_col_names.strip(): + raise ValueError("column name cannot be blank") + trimmed_fields.append(requested_col_names.strip()) + if isinstance(requested_col_names, list): + for field in requested_col_names: + if not field.strip(): + raise ValueError("column names cannot be blank") + field = field.strip() + if field.find(" ") > -1: + raise ValueError("field should be URL encoded: [%s]" % field) + trimmed_fields.append(field) + url += self.create_port_eid_url(eid_list=eid_list) + + if len(trimmed_fields) > 0: + url += "?fields=%s" % (",".join(trimmed_fields)) + + response = self.json_get(url=url, + debug=debug, + wait_sec=wait_sec, + request_timeout_sec=timeout_sec, + max_timeout_sec=timeout_sec, + errors_warnings=errors_warnings) + if response is None: + return None + return self.extract_values(response=response, + singular_key="endpoint", + plural_key="endpoint") + # + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + If you need to call the URL directly, + request one of these URLs: + /endsession + + + Example py-json call (it knows the URL): + record = LFJsonGet.get_endsession(eid_list=['1.234', '1.344'], + debug=True) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + def get_endsession(self, + eid_list: list = None, + requested_col_names: list = None, + wait_sec: float = 0.01, + timeout_sec: float = 5.0, + errors_warnings: list = None, + debug: bool = False): + """ + :param eid_list: list of entity IDs to query for + :param requested_col_names: list of column names to return + :param wait_sec: duration to wait between retries if no response or response is HTTP 404 + :param timeout_sec: duration in which to keep querying before returning + :param errors_warnings: optional list to extend with errors and warnings from response + :param debug: print diagnostic info if true + :return: dictionary of results + """ + debug |= self.debug_on + url = "/endsession" + if (eid_list is None) or (len(eid_list) < 1): + raise ValueError("no entity id in request") + trimmed_fields = [] + if isinstance(requested_col_names, str): + if not requested_col_names.strip(): + raise ValueError("column name cannot be blank") + trimmed_fields.append(requested_col_names.strip()) + if isinstance(requested_col_names, list): + for field in requested_col_names: + if not field.strip(): + raise ValueError("column names cannot be blank") + field = field.strip() + if field.find(" ") > -1: + raise ValueError("field should be URL encoded: [%s]" % field) + trimmed_fields.append(field) + url += self.create_port_eid_url(eid_list=eid_list) + + if len(trimmed_fields) > 0: + url += "?fields=%s" % (",".join(trimmed_fields)) + + response = self.json_get(url=url, + debug=debug, + wait_sec=wait_sec, + request_timeout_sec=timeout_sec, + max_timeout_sec=timeout_sec, + errors_warnings=errors_warnings) + if response is None: + return None + return self.extract_values(response=response, + singular_key="", + plural_key="") + # + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + If you need to call the URL directly, + request one of these URLs: + /events/ + /events/$event_id + /events/before/$event_id + /events/between/$start_event_id/$end_event_id + /events/last/$event_count + /events/since/$event_id + + When requesting specific column names, they need to be URL encoded: + eid, entity+id, event, event+description, id, name, priority, time-stamp, + type + Example URL: /events?fields=eid,entity+id + + Example py-json call (it knows the URL): + record = LFJsonGet.get_events(eid_list=['1.234', '1.344'], + requested_col_names=['entity id'], + debug=True) + + The record returned will have these members: + { + 'eid': # Time at which this event was created.This uses the clock on the source + # machine. + 'entity id': # Entity IdentifierExact format depends on the + # type.(shelf.resource.port.endpoint.extra) + 'event': # Event Type + 'event description': # Text description for this event. + 'id': # Unique ID for this event. + 'name': # Name of the entity associated with this event. + 'priority': # Event priority. + 'time-stamp': # Time at which this event was created.This uses the clock on the source + # machine. + 'type': # Entity type. + } + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + def get_events(self, + eid_list: list = None, + requested_col_names: list = None, + wait_sec: float = 0.01, + timeout_sec: float = 5.0, + errors_warnings: list = None, + debug: bool = False): + """ + :param eid_list: list of entity IDs to query for + :param requested_col_names: list of column names to return + :param wait_sec: duration to wait between retries if no response or response is HTTP 404 + :param timeout_sec: duration in which to keep querying before returning + :param errors_warnings: optional list to extend with errors and warnings from response + :param debug: print diagnostic info if true + :return: dictionary of results + """ + debug |= self.debug_on + url = "/events" + if (eid_list is None) or (len(eid_list) < 1): + raise ValueError("no entity id in request") + trimmed_fields = [] + if isinstance(requested_col_names, str): + if not requested_col_names.strip(): + raise ValueError("column name cannot be blank") + trimmed_fields.append(requested_col_names.strip()) + if isinstance(requested_col_names, list): + for field in requested_col_names: + if not field.strip(): + raise ValueError("column names cannot be blank") + field = field.strip() + if field.find(" ") > -1: + raise ValueError("field should be URL encoded: [%s]" % field) + trimmed_fields.append(field) + url += self.create_port_eid_url(eid_list=eid_list) + + if len(trimmed_fields) > 0: + url += "?fields=%s" % (",".join(trimmed_fields)) + + response = self.json_get(url=url, + debug=debug, + wait_sec=wait_sec, + request_timeout_sec=timeout_sec, + max_timeout_sec=timeout_sec, + errors_warnings=errors_warnings) + if response is None: + return None + return self.extract_values(response=response, + singular_key="alert", + plural_key="alerts") + # + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + If you need to call the URL directly, + request one of these URLs: + /fileio/ + /fileio/$endp_id + + When requesting specific column names, they need to be URL encoded: + buf-rd, buf-wr, bytes-rd, bytes-wr, crc+fail, eid, entity+id, files+%23, files-read, + files-wr, io+fail, max-file-sz, max-rd-bps, max-rw-sz, max-wr-bps, min-file-sz, + min-rd-bps, min-rw-sz, min-wr-bps, name, read-bps, rpt+timer, rx-bps-20s, + status, tx-bps-20s, type, write-bps + Example URL: /fileio?fields=buf-rd,buf-wr + + Example py-json call (it knows the URL): + record = LFJsonGet.get_fileio(eid_list=['1.234', '1.344'], + requested_col_names=['entity id'], + debug=True) + + The record returned will have these members: + { + 'buf-rd': # Buffer reads. When doing CRC, it takes two reads per 'packet', because + # we first read the header, then the payload. Non-CRC reads ignore the + # header. + 'buf-wr': # Buffer writes. + 'bytes-rd': # Bytes read. + 'bytes-wr': # Bytes written. + 'crc fail': # 32-bit CRC Errors detected upon READ. + 'eid': # Entity ID + 'entity id': # Entity ID + 'files #': # Number of files to write. + 'files-read': # Files read. + 'files-wr': # Files written. + 'io fail': # Amount of time in miliseconds this test has been experiencing IO + # failures. + 'max-file-sz': # Maximum configured file size (bytes). + 'max-rd-bps': # Maximum configured read rate (bps). + 'max-rw-sz': # Maximum configured size for each call to read(2) or write(2) (bytes). + 'max-wr-bps': # Maximum configured write rate (bps). + 'min-file-sz': # Minimum configured file size (bytes). + 'min-rd-bps': # Minimum configured read rate (bps). + 'min-rw-sz': # Minimum configured size for each call to read(2) or write(2) (bytes). + 'min-wr-bps': # Minimum configured write rate (bps). + 'name': # File Endpoint's Name. + 'read-bps': # File read rate for this endpoint over the duration of the test. + 'rpt timer': # Report Timer (milliseconds).This is how often the GUI will ask for + # updates from the LANforge processes.If the GUI is sluggish, increasing + # the report timers may help. + 'rx-bps-20s': # File read rate for this endpoint over the last 20 seconds. + 'status': # Current State of the connection.UninitializedHas not yet been + # started/stopped.InitializingBeing set up.StartingStarting the + # test.RunningTest is actively running.StoppedTest has been + # stopped.QuiesceTest will gracefully stop soon.HW-BYPASSTest is in + # hardware-bypass mode (WanLinks only)FTM_WAITTest wants to run, but is + # phantom, probably due to non-existent interface or resource.WAITINGWill + # restart as soon as resources are available.PHANTOMTest is stopped, and + # is phantom, probably due to non-existent interface or resource. + 'tx-bps-20s': # File write rate for this endpoint over the last 20 seconds. + 'type': # The specific type of this File Endpoint. + 'write-bps': # File write rate for this endpoint over the duration of the test. + } + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + def get_fileio(self, + eid_list: list = None, + requested_col_names: list = None, + wait_sec: float = 0.01, + timeout_sec: float = 5.0, + errors_warnings: list = None, + debug: bool = False): + """ + :param eid_list: list of entity IDs to query for + :param requested_col_names: list of column names to return + :param wait_sec: duration to wait between retries if no response or response is HTTP 404 + :param timeout_sec: duration in which to keep querying before returning + :param errors_warnings: optional list to extend with errors and warnings from response + :param debug: print diagnostic info if true + :return: dictionary of results + """ + debug |= self.debug_on + url = "/fileio" + if (eid_list is None) or (len(eid_list) < 1): + raise ValueError("no entity id in request") + trimmed_fields = [] + if isinstance(requested_col_names, str): + if not requested_col_names.strip(): + raise ValueError("column name cannot be blank") + trimmed_fields.append(requested_col_names.strip()) + if isinstance(requested_col_names, list): + for field in requested_col_names: + if not field.strip(): + raise ValueError("column names cannot be blank") + field = field.strip() + if field.find(" ") > -1: + raise ValueError("field should be URL encoded: [%s]" % field) + trimmed_fields.append(field) + url += self.create_port_eid_url(eid_list=eid_list) + + if len(trimmed_fields) > 0: + url += "?fields=%s" % (",".join(trimmed_fields)) + + response = self.json_get(url=url, + debug=debug, + wait_sec=wait_sec, + request_timeout_sec=timeout_sec, + max_timeout_sec=timeout_sec, + errors_warnings=errors_warnings) + if response is None: + return None + return self.extract_values(response=response, + singular_key="endpoint", + plural_key="endpoint") + # + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + If you need to call the URL directly, + request one of these URLs: + /generic/ + /generic/$endp_id + + When requesting specific column names, they need to be URL encoded: + bps+rx, bps+tx, command, dropped, eid, elapsed, entity+id, last+results, + name, pdu%2Fs+rx, pdu%2Fs+tx, rpt+timer, rpt%23, rx+bytes, rx+pkts, status, tx+bytes, + tx+pkts, type + Example URL: /generic?fields=bps+rx,bps+tx + + Example py-json call (it knows the URL): + record = LFJsonGet.get_generic(eid_list=['1.234', '1.344'], + requested_col_names=['entity id'], + debug=True) + + The record returned will have these members: + { + 'bps rx': # Receive rate reported by this endpoint. + 'bps tx': # Transmit rate reported by this endpoint. + 'command': # The command that this endpoint executes. + 'dropped': # Dropped PDUs reported by this endpoint. + 'eid': # Entity ID + 'elapsed': # Amount of time (seconds) this endpoint has been running (or ran.) + 'entity id': # Entity ID + 'last results': # Latest output from the Generic Endpoint. + 'name': # Endpoint's Name. + 'pdu/s rx': # Received packets-per-second reported by this endpoint. + 'pdu/s tx': # Transmitted packets-per-second reported by this endpoint. + 'rpt timer': # Report Timer (milliseconds).This is how often the GUI will ask for + # updates from the LANforge processes.If the GUI is sluggish, increasing + # the report timers may help. + 'rpt#': # The N_th report that we have received. (Some cmds will produce only one + # report, others will produce continuous reports.) + 'rx bytes': # Received bytes reported by this endpoint. + 'rx pkts': # Received PDUs reported by this endpoint. + 'status': # Current State of the connection.UninitializedHas not yet been + # started/stopped.InitializingBeing set up.StartingStarting the + # test.RunningTest is actively running.StoppedTest has been + # stopped.QuiesceTest will gracefully stop soon.HW-BYPASSTest is in + # hardware-bypass mode (WanLinks only)FTM_WAITTest wants to run, but is + # phantom, probably due to non-existent interface or resource.WAITINGWill + # restart as soon as resources are available.PHANTOMTest is stopped, and + # is phantom, probably due to non-existent interface or resource. + 'tx bytes': # Transmitted bytes reported by this endpoint. + 'tx pkts': # Transmitted PDUs reported by this endpoint. + 'type': # The specific type of this Generic Endpoint. + } + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + def get_generic(self, + eid_list: list = None, + requested_col_names: list = None, + wait_sec: float = 0.01, + timeout_sec: float = 5.0, + errors_warnings: list = None, + debug: bool = False): + """ + :param eid_list: list of entity IDs to query for + :param requested_col_names: list of column names to return + :param wait_sec: duration to wait between retries if no response or response is HTTP 404 + :param timeout_sec: duration in which to keep querying before returning + :param errors_warnings: optional list to extend with errors and warnings from response + :param debug: print diagnostic info if true + :return: dictionary of results + """ + debug |= self.debug_on + url = "/generic" + if (eid_list is None) or (len(eid_list) < 1): + raise ValueError("no entity id in request") + trimmed_fields = [] + if isinstance(requested_col_names, str): + if not requested_col_names.strip(): + raise ValueError("column name cannot be blank") + trimmed_fields.append(requested_col_names.strip()) + if isinstance(requested_col_names, list): + for field in requested_col_names: + if not field.strip(): + raise ValueError("column names cannot be blank") + field = field.strip() + if field.find(" ") > -1: + raise ValueError("field should be URL encoded: [%s]" % field) + trimmed_fields.append(field) + url += self.create_port_eid_url(eid_list=eid_list) + + if len(trimmed_fields) > 0: + url += "?fields=%s" % (",".join(trimmed_fields)) + + response = self.json_get(url=url, + debug=debug, + wait_sec=wait_sec, + request_timeout_sec=timeout_sec, + max_timeout_sec=timeout_sec, + errors_warnings=errors_warnings) + if response is None: + return None + return self.extract_values(response=response, + singular_key="endpoint", + plural_key="endpoints") + # + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + If you need to call the URL directly, + request one of these URLs: + /gui-cli/ + + + Example py-json call (it knows the URL): + record = LFJsonGet.get_gui_cli(eid_list=['1.234', '1.344'], + debug=True) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + def get_gui_cli(self, + eid_list: list = None, + requested_col_names: list = None, + wait_sec: float = 0.01, + timeout_sec: float = 5.0, + errors_warnings: list = None, + debug: bool = False): + """ + :param eid_list: list of entity IDs to query for + :param requested_col_names: list of column names to return + :param wait_sec: duration to wait between retries if no response or response is HTTP 404 + :param timeout_sec: duration in which to keep querying before returning + :param errors_warnings: optional list to extend with errors and warnings from response + :param debug: print diagnostic info if true + :return: dictionary of results + """ + debug |= self.debug_on + url = "/gui-cli" + if (eid_list is None) or (len(eid_list) < 1): + raise ValueError("no entity id in request") + trimmed_fields = [] + if isinstance(requested_col_names, str): + if not requested_col_names.strip(): + raise ValueError("column name cannot be blank") + trimmed_fields.append(requested_col_names.strip()) + if isinstance(requested_col_names, list): + for field in requested_col_names: + if not field.strip(): + raise ValueError("column names cannot be blank") + field = field.strip() + if field.find(" ") > -1: + raise ValueError("field should be URL encoded: [%s]" % field) + trimmed_fields.append(field) + url += self.create_port_eid_url(eid_list=eid_list) + + if len(trimmed_fields) > 0: + url += "?fields=%s" % (",".join(trimmed_fields)) + + response = self.json_get(url=url, + debug=debug, + wait_sec=wait_sec, + request_timeout_sec=timeout_sec, + max_timeout_sec=timeout_sec, + errors_warnings=errors_warnings) + if response is None: + return None + return self.extract_values(response=response, + singular_key="", + plural_key="") + # + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + If you need to call the URL directly, + request one of these URLs: + /layer4/ + /layer4/$endp_id + + When requesting specific column names, they need to be URL encoded: + %21conn, acc.+denied, bad-proto, bad-url, bytes-rd, bytes-wr, dns-avg, dns-max, + dns-min, eid, elapsed, entity+id, fb-avg, fb-max, fb-min, ftp-host, ftp-port, + ftp-stor, http-p, http-r, http-t, login-denied, name, nf+%284xx%29, other-err, + read, redir, rpt+timer, rslv-h, rslv-p, rx+rate, rx+rate+%281%C2%A0min%29, status, + timeout, total-err, total-urls, tx+rate, tx+rate+%281%C2%A0min%29, type, uc-avg, + uc-max, uc-min, urls%2Fs, write # hidden columns: + rpt-time + Example URL: /layer4?fields=%21conn,acc.+denied + + Example py-json call (it knows the URL): + record = LFJsonGet.get_layer4(eid_list=['1.234', '1.344'], + requested_col_names=['entity id'], + debug=True) + + The record returned will have these members: + { + '!conn': # Could not establish connection. + 'acc. denied': # Access Access Denied Error.This could be password, user-name, + # file-permissions or other error. + 'bad-proto': # Bad protocol. + 'bad-url': # Bad URL format. + 'bytes-rd': # Bytes read. + 'bytes-wr': # Bytes written. + 'dns-avg': # Average time in milliseconds to complete resolving the DNS lookupfor the + # last 100 requests. + 'dns-max': # Maximum time in milliseconds to complete resolving the DNS lookupfor + # requests made in the last 30 seconds. + 'dns-min': # Minimum time in milliseconds to complete resolving the DNS lookupfor + # requests made in the last 30 seconds. + 'eid': # EID + 'elapsed': # Amount of time (seconds) this endpoint has been running (or ran.) + 'entity id': # Entity ID + 'fb-avg': # Average time in milliseconds for receiving the first byte of the URLfor + # the last 100 requests. + 'fb-max': # Maximum time in milliseconds for receiving the first byte of the URLfor + # requests made in the last 30 seconds. + 'fb-min': # Minimum time in milliseconds for receiving the first byte of the URLfor + # requests made in the last 30 seconds. + 'ftp-host': # FTP HOST Error + 'ftp-port': # FTP PORT Error. + 'ftp-stor': # FTP STOR Error. + 'http-p': # HTTP Post error. + 'http-r': # HTTP RANGE error. + 'http-t': # HTTP PORT Error. + 'login-denied': # Login attempt was denied.Probable cause is user-name or password errors. + 'name': # Endpoint's Name. + 'nf (4xx)': # File not found.For HTTP, an HTTP 4XX error was returned. This is only + # counted when the endpoint has 'Enable 4XX' selected.Includes 403 + # permission denied and 404 not found errors.For other protocols, it + # should be returned any time a file is not found. + 'other-err': # Error not otherwise specified. The actual error code may be found + # inl4helper logs. Contact support if you see these errors:we would like + # to account for all possible errors. + 'read': # Error attempting to read file or URL. + 'redir': # Noticed redirect loop! + 'rpt timer': # Cross Connect's Report Timer (milliseconds).This is how often the GUI + # will ask for updates from the LANforge processes.If the GUI is sluggish, + # increasing the report timers may help. + 'rslv-h': # Couldn't resolve host. + 'rslv-p': # Couldn't resolve Proxy. + 'rx rate': # Payload receive rate (bps). + 'rx rate (1 min)': # Payload receive rate over the last minute (bps). + 'status': # Current State of the connection.UninitializedHas not yet been + # started/stopped.InitializingBeing set up.StartingStarting the + # test.RunningTest is actively running.StoppedTest has been + # stopped.QuiesceTest will gracefully stop soon.HW-BYPASSTest is in + # hardware-bypass mode (WanLinks only)FTM_WAITTest wants to run, but is + # phantom, probably due to non-existent interface or resource.WAITINGWill + # restart as soon as resources are available.PHANTOMTest is stopped, and + # is phantom, probably due to non-existent interface or resource. + 'timeout': # Operation timed out. + 'total-err': # Total Errors. + 'total-urls': # URLs processed. + 'tx rate': # Payload transmit rate (bps). + 'tx rate (1 min)': # Payload transmit rate over the last minute (bps). + 'type': # The specific type of this Layer 4-7 Endpoint. + 'uc-avg': # Average time in milliseconds to complete processing of the URLfor the + # last 100 requests. + 'uc-max': # Maximum time in milliseconds to complete processing of the URLfor + # requests made in the last 30 seconds. + 'uc-min': # Minimum time in milliseconds to complete processing of the URLfor + # requests made in the last 30 seconds. + 'urls/s': # URLs processed per second over the last minute. + 'write': # Error attempting to write file or URL. + } + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + def get_layer4(self, + eid_list: list = None, + requested_col_names: list = None, + wait_sec: float = 0.01, + timeout_sec: float = 5.0, + errors_warnings: list = None, + debug: bool = False): + """ + :param eid_list: list of entity IDs to query for + :param requested_col_names: list of column names to return + :param wait_sec: duration to wait between retries if no response or response is HTTP 404 + :param timeout_sec: duration in which to keep querying before returning + :param errors_warnings: optional list to extend with errors and warnings from response + :param debug: print diagnostic info if true + :return: dictionary of results + """ + debug |= self.debug_on + url = "/layer4" + if (eid_list is None) or (len(eid_list) < 1): + raise ValueError("no entity id in request") + trimmed_fields = [] + if isinstance(requested_col_names, str): + if not requested_col_names.strip(): + raise ValueError("column name cannot be blank") + trimmed_fields.append(requested_col_names.strip()) + if isinstance(requested_col_names, list): + for field in requested_col_names: + if not field.strip(): + raise ValueError("column names cannot be blank") + field = field.strip() + if field.find(" ") > -1: + raise ValueError("field should be URL encoded: [%s]" % field) + trimmed_fields.append(field) + url += self.create_port_eid_url(eid_list=eid_list) + + if len(trimmed_fields) > 0: + url += "?fields=%s" % (",".join(trimmed_fields)) + + response = self.json_get(url=url, + debug=debug, + wait_sec=wait_sec, + request_timeout_sec=timeout_sec, + max_timeout_sec=timeout_sec, + errors_warnings=errors_warnings) + if response is None: + return None + return self.extract_values(response=response, + singular_key="endpoint", + plural_key="endpoint") + # + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + If you need to call the URL directly, + request one of these URLs: + /newsession + + + Example py-json call (it knows the URL): + record = LFJsonGet.get_newsession(eid_list=['1.234', '1.344'], + debug=True) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + def get_newsession(self, + eid_list: list = None, + requested_col_names: list = None, + wait_sec: float = 0.01, + timeout_sec: float = 5.0, + errors_warnings: list = None, + debug: bool = False): + """ + :param eid_list: list of entity IDs to query for + :param requested_col_names: list of column names to return + :param wait_sec: duration to wait between retries if no response or response is HTTP 404 + :param timeout_sec: duration in which to keep querying before returning + :param errors_warnings: optional list to extend with errors and warnings from response + :param debug: print diagnostic info if true + :return: dictionary of results + """ + debug |= self.debug_on + url = "/newsession" + if (eid_list is None) or (len(eid_list) < 1): + raise ValueError("no entity id in request") + trimmed_fields = [] + if isinstance(requested_col_names, str): + if not requested_col_names.strip(): + raise ValueError("column name cannot be blank") + trimmed_fields.append(requested_col_names.strip()) + if isinstance(requested_col_names, list): + for field in requested_col_names: + if not field.strip(): + raise ValueError("column names cannot be blank") + field = field.strip() + if field.find(" ") > -1: + raise ValueError("field should be URL encoded: [%s]" % field) + trimmed_fields.append(field) + url += self.create_port_eid_url(eid_list=eid_list) + + if len(trimmed_fields) > 0: + url += "?fields=%s" % (",".join(trimmed_fields)) + + response = self.json_get(url=url, + debug=debug, + wait_sec=wait_sec, + request_timeout_sec=timeout_sec, + max_timeout_sec=timeout_sec, + errors_warnings=errors_warnings) + if response is None: + return None + return self.extract_values(response=response, + singular_key="", + plural_key="") + # + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + If you need to call the URL directly, + request one of these URLs: + /port/ + /port/$shelf_id + /port/$shelf_id/$resource_id + /port/$shelf_id/$resource_id/$port_id + /portprobe/ + /portprobe/$shelf_id/$resource_id/$port_id + /ports/ + /ports/$shelf_id + /ports/$shelf_id/$resource_id + /ports/$shelf_id/$resource_id/$port_id + + When requesting specific column names, they need to be URL encoded: + 4way+time+%28us%29, activity, alias, anqp+time+%28us%29, ap, beacon, bps+rx, bps+rx+ll, + bps+tx, bps+tx+ll, bytes+rx+ll, bytes+tx+ll, channel, collisions, connections, + crypt, cx+ago, cx+time+%28us%29, device, dhcp+%28ms%29, down, entity+id, gateway+ip, + ip, ipv6+address, ipv6+gateway, key%2Fphrase, login-fail, login-ok, logout-fail, + logout-ok, mac, mask, misc, mode, mtu, no+cx+%28us%29, noise, parent+dev, phantom, + port, port+type, pps+rx, pps+tx, qlen, reset, retry+failed, rx+bytes, rx+crc, + rx+drop, rx+errors, rx+fifo, rx+frame, rx+length, rx+miss, rx+over, rx+pkts, + rx-rate, sec, signal, ssid, status, time-stamp, tx+abort, tx+bytes, tx+crr, + tx+errors, tx+fifo, tx+hb, tx+pkts, tx+wind, tx-failed+%25, tx-rate, wifi+retries, + # hidden columns: + beacon_rx_signal, port_cur_flags_h, port_cur_flags_l, port_supported_flags_h, + port_supported_flags_l, resource, rx_multicast, tx_dropped + Example URL: /port?fields=4way+time+%28us%29,activity + + Example py-json call (it knows the URL): + record = LFJsonGet.get_port(eid_list=['1.234', '1.344'], + requested_col_names=['entity id'], + debug=True) + + The record returned will have these members: + { + '4way time (us)': # TIme (in micro-seconds) it took to complete the last WiFi 4-way + # authentication. + 'activity': # Percent of the channel that is utilized over the last minute.This + # includes locally generated traffic as well as anyother systems active on + # this channel.This is a per-radio value. + 'alias': # User-specified alias for this Port. + 'anqp time (us)': # Time (in micro-seconds) it took to complete the last WiFi ANQP + # request/response session. + 'ap': # BSSID of AP for connected stations. + 'beacon': # Number of Wireless beacons from Cell or AP that have been missed. + 'bps rx': # Average bits per second received for the last 30 seconds. + 'bps rx ll': # Bits per second received, including low-level framing (Ethernet Only). + 'bps tx': # Average bits per second transmitted for the last 30 seconds. + 'bps tx ll': # Bits per second transmitted, including low-level framing (Ethernet + # Only). + 'bytes rx ll': # Bytes received, including low-level framing (Ethernet Only). + 'bytes tx ll': # Bytes transmitted, including low-level framing (Ethernet Only). + 'channel': # Channel at the device is currently on, if known. + 'collisions': # Total number of collisions reported by this Interface.For WiFi devices, + # this is number of re-transmit attempts. + 'connections': # Number of wireless connections completed. + 'crypt': # Number of Wireless packets dropped due to inability to decrypt. + 'cx ago': # How long ago was the last WiFi connection attempt started?This relates + # only to the network interface, not any higher level protocol traffic + # upon it. + 'cx time (us)': # Time (in micro-seconds) it took to complete the last WiFi connection to + # the AP. + 'device': # Ethernet device name, as seen by the kernel. + 'dhcp (ms)': # Time (in miliseconds) it took to acquire DHCP lease,or to time out while + # trying to acquire lease. + 'down': # The interface is configured DOWN. It must be configured UP to be in + # active use. + 'entity id': # Entity ID + 'gateway ip': # Default Router/Gateway IP for the Interface. + 'ip': # IP Address of the Interface. + 'ipv6 address': # IPv6 Address for this interface. If global-scope address exists, it + # will be displayed,otherwise link-local will be displayed. + 'ipv6 gateway': # IPv6 default gateway. + 'key/phrase': # WEP Key or WPA Phrase (if enabled). + 'login-fail': # The 'ifup-post' script reported failure. This is usually used for WiFi + # portallogins, but may be customized by the user for other needs. + 'login-ok': # The 'ifup-post' script reported OK. This is usually used for WiFi + # portallogins, but may be customized by the user for other needs. + 'logout-fail': # The 'ifup-post --logout' script reported failure. This is usually used + # for WiFi portallogouts, but may be customized by the user for other + # needs. + 'logout-ok': # The 'ifup-post --logout' script reported OK. This is usually used for + # WiFi portallogouts, but may be customized by the user for other needs. + 'mac': # Ethernet MAC address of the Interface. + 'mask': # IP Mask of the Interface. + 'misc': # Number of Wireless packets dropped on receive due to unspecified + # reasons. + 'mode': # Wireless radio mode (802.11a/b/g). + 'mtu': # MTU (Maximum Transmit Unit) size, in bytes. + 'no cx (us)': # How long was the WiFi disconnect duration for the last disconnection? + 'noise': # Wireless noise level. + 'parent dev': # Parent device or port of this port. Blank if this device is not a child + # of another device or port. + 'phantom': # Is the port PHANTOM (no hardware found) or not. + 'port': # Entity ID + 'port type': # Ports can be Ethernet, Radio, vAP, vSTA, Redirect, or Bridges + 'pps rx': # Average packets per second received for the last 30 seconds. + 'pps tx': # Average packets per second transmitted for the last 30 seconds. + 'qlen': # "Transmit Queue Length for this Interface. + 'reset': # Current Reset-State. + 'retry failed': # Number of Wireless packets that the interface failed to send due to + # excessive retries. + 'rx bytes': # Total number of bytes received by this Interface. + 'rx crc': # Total number of packets dropped because of a bad CRC/FCS. + 'rx drop': # Total number of dropped packets on recieve. Usually means driver/kernel + # is being over-worked. + 'rx errors': # Total number of all types of Receive Errors. + 'rx fifo': # Total number of packets dropped because driver/kernel queues are full. + 'rx frame': # Total number of packets dropped because of framing errors at the + # physical layer. + 'rx length': # Total number of packets dropped because their length was invalid. + 'rx miss': # Total number of packets dropped because of a missed interrupt. + 'rx over': # Total number of packets dropped because of framing errors at the + # physical layer. + 'rx pkts': # Total number of packets received by this Interface. + 'rx-rate': # Reported network device RX link speed. + 'sec': # Number of secondary IP addresses configured or detected. + 'signal': # Wireless signal strength (RSSI). + 'ssid': # WiFi SSID identifier.Use [BLANK] for empty SSID, which means use any + # available SSID when associating. + 'status': # Wireless link status. + 'time-stamp': # Time-Stamp + 'tx abort': # Total packets dropped on transmit because of driver abort. + 'tx bytes': # Total number of bytes sent by this Interface. + 'tx crr': # Total packets dropped on transmit because of carrier error. + 'tx errors': # Total number of all types of Transmit Errors. + 'tx fifo': # Total packets dropped on transmit because outgoing queue was full. + 'tx hb': # Total packets dropped on transmit because of transceiver heartbeat + # errors. + 'tx pkts': # Total number of packets sent by this Interface. + 'tx wind': # Total number dropped on transmit because of Out-of-Window collision. + 'tx-failed %': # Percentage of transmitted Wireless packets that were not ACKed.They + # might have succeeded on retry. + 'tx-rate': # Reported network device TX link speed. + 'wifi retries': # Number of Wireless packets that the wifi radio retried.One packet may be + # tried multiple times and each try would be counted in this stat.Not all + # radios can properly report this statistic. + } + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + def get_port(self, + eid_list: list = None, + requested_col_names: list = None, + wait_sec: float = 0.01, + timeout_sec: float = 5.0, + errors_warnings: list = None, + debug: bool = False): + """ + :param eid_list: list of entity IDs to query for + :param requested_col_names: list of column names to return + :param wait_sec: duration to wait between retries if no response or response is HTTP 404 + :param timeout_sec: duration in which to keep querying before returning + :param errors_warnings: optional list to extend with errors and warnings from response + :param debug: print diagnostic info if true + :return: dictionary of results + """ + debug |= self.debug_on + url = "/port" + if (eid_list is None) or (len(eid_list) < 1): + raise ValueError("no entity id in request") + trimmed_fields = [] + if isinstance(requested_col_names, str): + if not requested_col_names.strip(): + raise ValueError("column name cannot be blank") + trimmed_fields.append(requested_col_names.strip()) + if isinstance(requested_col_names, list): + for field in requested_col_names: + if not field.strip(): + raise ValueError("column names cannot be blank") + field = field.strip() + if field.find(" ") > -1: + raise ValueError("field should be URL encoded: [%s]" % field) + trimmed_fields.append(field) + url += self.create_port_eid_url(eid_list=eid_list) + + if len(trimmed_fields) > 0: + url += "?fields=%s" % (",".join(trimmed_fields)) + + response = self.json_get(url=url, + debug=debug, + wait_sec=wait_sec, + request_timeout_sec=timeout_sec, + max_timeout_sec=timeout_sec, + errors_warnings=errors_warnings) + if response is None: + return None + return self.extract_values(response=response, + singular_key="interface", + plural_key="interfaces") + # + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + If you need to call the URL directly, + request one of these URLs: + /probe/ + /probe/$shelf_id/$resource_id/$port_id + + When requesting specific column names, they need to be URL encoded: + entity+id, probe+results + Example URL: /probe?fields=entity+id,probe+results + + Example py-json call (it knows the URL): + record = LFJsonGet.get_probe(eid_list=['1.234', '1.344'], + requested_col_names=['probe results'], + debug=True) + + The record returned will have these members: + { + 'entity id': # Entity ID + 'probe results': # Probe the low level information about the port. + } + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + def get_probe(self, + eid_list: list = None, + requested_col_names: list = None, + wait_sec: float = 0.01, + timeout_sec: float = 5.0, + errors_warnings: list = None, + debug: bool = False): + """ + :param eid_list: list of entity IDs to query for + :param requested_col_names: list of column names to return + :param wait_sec: duration to wait between retries if no response or response is HTTP 404 + :param timeout_sec: duration in which to keep querying before returning + :param errors_warnings: optional list to extend with errors and warnings from response + :param debug: print diagnostic info if true + :return: dictionary of results + """ + debug |= self.debug_on + url = "/probe" + if (eid_list is None) or (len(eid_list) < 1): + raise ValueError("no entity id in request") + trimmed_fields = [] + if isinstance(requested_col_names, str): + if not requested_col_names.strip(): + raise ValueError("column name cannot be blank") + trimmed_fields.append(requested_col_names.strip()) + if isinstance(requested_col_names, list): + for field in requested_col_names: + if not field.strip(): + raise ValueError("column names cannot be blank") + field = field.strip() + if field.find(" ") > -1: + raise ValueError("field should be URL encoded: [%s]" % field) + trimmed_fields.append(field) + url += self.create_port_eid_url(eid_list=eid_list) + + if len(trimmed_fields) > 0: + url += "?fields=%s" % (",".join(trimmed_fields)) + + response = self.json_get(url=url, + debug=debug, + wait_sec=wait_sec, + request_timeout_sec=timeout_sec, + max_timeout_sec=timeout_sec, + errors_warnings=errors_warnings) + if response is None: + return None + return self.extract_values(response=response, + singular_key="probe-results", + plural_key="probe-results") + # + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + If you need to call the URL directly, + request one of these URLs: + /quit + + + Example py-json call (it knows the URL): + record = LFJsonGet.get_quit(eid_list=['1.234', '1.344'], + debug=True) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + def get_quit(self, + eid_list: list = None, + requested_col_names: list = None, + wait_sec: float = 0.01, + timeout_sec: float = 5.0, + errors_warnings: list = None, + debug: bool = False): + """ + :param eid_list: list of entity IDs to query for + :param requested_col_names: list of column names to return + :param wait_sec: duration to wait between retries if no response or response is HTTP 404 + :param timeout_sec: duration in which to keep querying before returning + :param errors_warnings: optional list to extend with errors and warnings from response + :param debug: print diagnostic info if true + :return: dictionary of results + """ + debug |= self.debug_on + url = "/quit" + if (eid_list is None) or (len(eid_list) < 1): + raise ValueError("no entity id in request") + trimmed_fields = [] + if isinstance(requested_col_names, str): + if not requested_col_names.strip(): + raise ValueError("column name cannot be blank") + trimmed_fields.append(requested_col_names.strip()) + if isinstance(requested_col_names, list): + for field in requested_col_names: + if not field.strip(): + raise ValueError("column names cannot be blank") + field = field.strip() + if field.find(" ") > -1: + raise ValueError("field should be URL encoded: [%s]" % field) + trimmed_fields.append(field) + url += self.create_port_eid_url(eid_list=eid_list) + + if len(trimmed_fields) > 0: + url += "?fields=%s" % (",".join(trimmed_fields)) + + response = self.json_get(url=url, + debug=debug, + wait_sec=wait_sec, + request_timeout_sec=timeout_sec, + max_timeout_sec=timeout_sec, + errors_warnings=errors_warnings) + if response is None: + return None + return self.extract_values(response=response, + singular_key="", + plural_key="") + # + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + If you need to call the URL directly, + request one of these URLs: + /radiostatus/ + /radiostatus/$eid + /radiostatus/$shelf_id/$resource_id/$port_id + + When requesting specific column names, they need to be URL encoded: + _links, antenna, ap, capabilities, channel, country, driver, entity+id, firmware+version, + frag, frequency, max_sta, max_vap, max_vifs, monitors_down, monitors_up, + phantom, port, resource, rts, stations_down, stations_up, tx-power, vaps_down, + vaps_up, verbose+debug + Example URL: /radiostatus?fields=_links,antenna + + Example py-json call (it knows the URL): + record = LFJsonGet.get_radiostatus(eid_list=['1.234', '1.344'], + requested_col_names=['firmware version'], + debug=True) + + The record returned will have these members: + { + '_links': # - + 'antenna': # - + 'ap': # - + 'capabilities': # - + 'channel': # - + 'country': # - + 'driver': # - + 'entity id': # - + 'firmware version': # - + 'frag': # - + 'frequency': # - + 'max_sta': # - + 'max_vap': # - + 'max_vifs': # - + 'monitors_down': # - + 'monitors_up': # - + 'phantom': # - + 'port': # - + 'resource': # - + 'rts': # - + 'stations_down': # - + 'stations_up': # - + 'tx-power': # - + 'vaps_down': # - + 'vaps_up': # - + 'verbose debug': # - + } + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + def get_radiostatus(self, + eid_list: list = None, + requested_col_names: list = None, + wait_sec: float = 0.01, + timeout_sec: float = 5.0, + errors_warnings: list = None, + debug: bool = False): + """ + :param eid_list: list of entity IDs to query for + :param requested_col_names: list of column names to return + :param wait_sec: duration to wait between retries if no response or response is HTTP 404 + :param timeout_sec: duration in which to keep querying before returning + :param errors_warnings: optional list to extend with errors and warnings from response + :param debug: print diagnostic info if true + :return: dictionary of results + """ + debug |= self.debug_on + url = "/radiostatus" + if (eid_list is None) or (len(eid_list) < 1): + raise ValueError("no entity id in request") + trimmed_fields = [] + if isinstance(requested_col_names, str): + if not requested_col_names.strip(): + raise ValueError("column name cannot be blank") + trimmed_fields.append(requested_col_names.strip()) + if isinstance(requested_col_names, list): + for field in requested_col_names: + if not field.strip(): + raise ValueError("column names cannot be blank") + field = field.strip() + if field.find(" ") > -1: + raise ValueError("field should be URL encoded: [%s]" % field) + trimmed_fields.append(field) + url += self.create_port_eid_url(eid_list=eid_list) + + if len(trimmed_fields) > 0: + url += "?fields=%s" % (",".join(trimmed_fields)) + + response = self.json_get(url=url, + debug=debug, + wait_sec=wait_sec, + request_timeout_sec=timeout_sec, + max_timeout_sec=timeout_sec, + errors_warnings=errors_warnings) + if response is None: + return None + return self.extract_values(response=response, + singular_key="radio", + plural_key="radios") + # + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + If you need to call the URL directly, + request one of these URLs: + /resource/ + /resource/$shelf_id + /resource/$shelf_id/$resource_id + + When requesting specific column names, they need to be URL encoded: + bps-rx-3s, bps-tx-3s, cli-port, cpu, ctrl-ip, ctrl-port, eid, entity+id, + free+mem, free+swap, gps, hostname, hw+version, load, max+if-up, max+staged, + mem, phantom, ports, rx+bytes, shelf, sta+up, sw+version, swap, tx+bytes, + # hidden columns: + timestamp + Example URL: /resource?fields=bps-rx-3s,bps-tx-3s + + Example py-json call (it knows the URL): + record = LFJsonGet.get_resource(eid_list=['1.234', '1.344'], + requested_col_names=['entity id'], + debug=True) + + The record returned will have these members: + { + 'bps-rx-3s': # Rate in bits-per-second that the manager issending management data to + # the resource, averaged over the last 3 seconds.This is TCP payload data, + # and does not count the IP and Ethernet overhead. + 'bps-tx-3s': # Rate in bits-per-second that the manager isreceiving management data + # from the resource, averaged over the last 3 seconds.This is TCP payload + # data, and does not count the IP and Ethernet overhead. + 'cli-port': # Text (telnet) interface IP Port. + 'cpu': # CPU information for the machine. + 'ctrl-ip': # IP Address of the Control Interface. + 'ctrl-port': # Binary interface IP Port. + 'eid': # Resource EID (Shelf.Resource). + 'entity id': # Entity ID + 'free mem': # Free Memory (Kbytes) in the machine. If this is too low, performance + # will be degraded. + 'free swap': # Free Swap (Kbytes) in the machine. If this is too low, performance will + # be degraded. + 'gps': # GPS Info for this machine, if GPS is attached. + 'hostname': # The name for this resource, as reported by the resource. + 'hw version': # Hardware version on the machine. + 'load': # Unix process load.. + 'max if-up': # Max number of interface-config scripts try to run at once. + 'max staged': # Max number of interfaces the system will try to bringup at once. + 'mem': # Total memory (Kbytes) on the machine. + 'phantom': # Is the resource PHANTOM (undiscovered) or not. + 'ports': # All real and phantom ports on this machine. + 'rx bytes': # Total management TCP payload bytes received from the manager process by + # this resource. + 'shelf': # Number of shelf that this resource belongs to. + 'sta up': # Max number of stations to bring up per radio per 0.25s tick. + 'sw version': # LANforge Software version running on the machine. + 'swap': # Total swap space (Kbytes) on the machine. + 'tx bytes': # Total management TCP payload bytes sent from this resource to the + # manager process. + } + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + def get_resource(self, + eid_list: list = None, + requested_col_names: list = None, + wait_sec: float = 0.01, + timeout_sec: float = 5.0, + errors_warnings: list = None, + debug: bool = False): + """ + :param eid_list: list of entity IDs to query for + :param requested_col_names: list of column names to return + :param wait_sec: duration to wait between retries if no response or response is HTTP 404 + :param timeout_sec: duration in which to keep querying before returning + :param errors_warnings: optional list to extend with errors and warnings from response + :param debug: print diagnostic info if true + :return: dictionary of results + """ + debug |= self.debug_on + url = "/resource" + if (eid_list is None) or (len(eid_list) < 1): + raise ValueError("no entity id in request") + trimmed_fields = [] + if isinstance(requested_col_names, str): + if not requested_col_names.strip(): + raise ValueError("column name cannot be blank") + trimmed_fields.append(requested_col_names.strip()) + if isinstance(requested_col_names, list): + for field in requested_col_names: + if not field.strip(): + raise ValueError("column names cannot be blank") + field = field.strip() + if field.find(" ") > -1: + raise ValueError("field should be URL encoded: [%s]" % field) + trimmed_fields.append(field) + url += self.create_port_eid_url(eid_list=eid_list) + + if len(trimmed_fields) > 0: + url += "?fields=%s" % (",".join(trimmed_fields)) + + response = self.json_get(url=url, + debug=debug, + wait_sec=wait_sec, + request_timeout_sec=timeout_sec, + max_timeout_sec=timeout_sec, + errors_warnings=errors_warnings) + if response is None: + return None + return self.extract_values(response=response, + singular_key="resource", + plural_key="resources") + # + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + If you need to call the URL directly, + request one of these URLs: + /scan-results/ + /scan-results/$shelf_id/$resource_id/$port_id + /scan-results/$shelf_id/$resource_id/$port_id/$bssid + /scan/ + /scan/$shelf_id/$resource_id/$port_id + /scan/$shelf_id/$resource_id/$port_id/$bssid + /scanresults/ + /scanresults/$shelf_id/$resource_id/$port_id + /scanresults/$shelf_id/$resource_id/$port_id/$bssid + + + Example py-json call (it knows the URL): + record = LFJsonGet.get_scan(eid_list=['1.234', '1.344'], + debug=True) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + def get_scan(self, + eid_list: list = None, + requested_col_names: list = None, + wait_sec: float = 0.01, + timeout_sec: float = 5.0, + errors_warnings: list = None, + debug: bool = False): + """ + :param eid_list: list of entity IDs to query for + :param requested_col_names: list of column names to return + :param wait_sec: duration to wait between retries if no response or response is HTTP 404 + :param timeout_sec: duration in which to keep querying before returning + :param errors_warnings: optional list to extend with errors and warnings from response + :param debug: print diagnostic info if true + :return: dictionary of results + """ + debug |= self.debug_on + url = "/scan" + if (eid_list is None) or (len(eid_list) < 1): + raise ValueError("no entity id in request") + trimmed_fields = [] + if isinstance(requested_col_names, str): + if not requested_col_names.strip(): + raise ValueError("column name cannot be blank") + trimmed_fields.append(requested_col_names.strip()) + if isinstance(requested_col_names, list): + for field in requested_col_names: + if not field.strip(): + raise ValueError("column names cannot be blank") + field = field.strip() + if field.find(" ") > -1: + raise ValueError("field should be URL encoded: [%s]" % field) + trimmed_fields.append(field) + url += self.create_port_eid_url(eid_list=eid_list) + + if len(trimmed_fields) > 0: + url += "?fields=%s" % (",".join(trimmed_fields)) + + response = self.json_get(url=url, + debug=debug, + wait_sec=wait_sec, + request_timeout_sec=timeout_sec, + max_timeout_sec=timeout_sec, + errors_warnings=errors_warnings) + if response is None: + return None + return self.extract_values(response=response, + singular_key="scan-results", + plural_key="scan-results") + # + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + If you need to call the URL directly, + request one of these URLs: + /stations/ + /stations/$mac + + When requesting specific column names, they need to be URL encoded: + ap, auth-for, capabilities, entity+id, idle, roam-duration, rx+bytes, rx+pkts, + rx+rate, signal, station+bssid, tx+bytes, tx+pkts, tx+rate, tx+retries, tx-failed, + + Example URL: /stations?fields=ap,auth-for + + Example py-json call (it knows the URL): + record = LFJsonGet.get_stations(eid_list=['1.234', '1.344'], + requested_col_names=['entity id'], + debug=True) + + The record returned will have these members: + { + 'ap': # The Port that owns this station. + 'auth-for': # Duration in seconds this station has been authenticated. + 'capabilities': # Station's negotiated capabilities. + 'entity id': # Entity ID + 'idle': # Miliseconds since this station last received a frame from the peer. + 'roam-duration': # The difference between the authenticate-time on the new APand the last + # frame received on old AP, in milliseconds.It is not always possible to + # compute this accurately,especially if traffic is not flowing during the + # roam. + 'rx bytes': # RX Byte counter for this station. + 'rx pkts': # RX Packets counter for this station. + 'rx rate': # Station last received encoding rate. + 'signal': # Station signal quality. + 'station bssid': # Station's MAC address (BSSID). + 'tx bytes': # TX Byte counter for this station. + 'tx pkts': # TX Packets counter for this station. + 'tx rate': # Station transmit encoding rate. + 'tx retries': # TX Retries counter for this station.This counts retries at the driver + # level.Retries made by the WiFi hardware and/or firmware is not counted. + 'tx-failed': # TX Failed counter for this station.This counts TX failures at the driver + # level.The hardware and/or firmware may have made several failed attempts + # that are not included in this counter. + } + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + def get_stations(self, + eid_list: list = None, + requested_col_names: list = None, + wait_sec: float = 0.01, + timeout_sec: float = 5.0, + errors_warnings: list = None, + debug: bool = False): + """ + :param eid_list: list of entity IDs to query for + :param requested_col_names: list of column names to return + :param wait_sec: duration to wait between retries if no response or response is HTTP 404 + :param timeout_sec: duration in which to keep querying before returning + :param errors_warnings: optional list to extend with errors and warnings from response + :param debug: print diagnostic info if true + :return: dictionary of results + """ + debug |= self.debug_on + url = "/stations" + if (eid_list is None) or (len(eid_list) < 1): + raise ValueError("no entity id in request") + trimmed_fields = [] + if isinstance(requested_col_names, str): + if not requested_col_names.strip(): + raise ValueError("column name cannot be blank") + trimmed_fields.append(requested_col_names.strip()) + if isinstance(requested_col_names, list): + for field in requested_col_names: + if not field.strip(): + raise ValueError("column names cannot be blank") + field = field.strip() + if field.find(" ") > -1: + raise ValueError("field should be URL encoded: [%s]" % field) + trimmed_fields.append(field) + url += self.create_port_eid_url(eid_list=eid_list) + + if len(trimmed_fields) > 0: + url += "?fields=%s" % (",".join(trimmed_fields)) + + response = self.json_get(url=url, + debug=debug, + wait_sec=wait_sec, + request_timeout_sec=timeout_sec, + max_timeout_sec=timeout_sec, + errors_warnings=errors_warnings) + if response is None: + return None + return self.extract_values(response=response, + singular_key="station", + plural_key="stations") + # + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + If you need to call the URL directly, + request one of these URLs: + /status-msg/ + /status-msg/$session + /status-msg/$session/$id + /status-msg/$session/$id/ws-msg,... + /status-msg/$session/all + /status-msg/$session/this + /status-msg/sessions + + + Example py-json call (it knows the URL): + record = LFJsonGet.get_status_msg(eid_list=['1.234', '1.344'], + debug=True) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + def get_status_msg(self, + eid_list: list = None, + requested_col_names: list = None, + wait_sec: float = 0.01, + timeout_sec: float = 5.0, + errors_warnings: list = None, + debug: bool = False): + """ + :param eid_list: list of entity IDs to query for + :param requested_col_names: list of column names to return + :param wait_sec: duration to wait between retries if no response or response is HTTP 404 + :param timeout_sec: duration in which to keep querying before returning + :param errors_warnings: optional list to extend with errors and warnings from response + :param debug: print diagnostic info if true + :return: dictionary of results + """ + debug |= self.debug_on + url = "/status-msg" + if (eid_list is None) or (len(eid_list) < 1): + raise ValueError("no entity id in request") + trimmed_fields = [] + if isinstance(requested_col_names, str): + if not requested_col_names.strip(): + raise ValueError("column name cannot be blank") + trimmed_fields.append(requested_col_names.strip()) + if isinstance(requested_col_names, list): + for field in requested_col_names: + if not field.strip(): + raise ValueError("column names cannot be blank") + field = field.strip() + if field.find(" ") > -1: + raise ValueError("field should be URL encoded: [%s]" % field) + trimmed_fields.append(field) + url += self.create_port_eid_url(eid_list=eid_list) + + if len(trimmed_fields) > 0: + url += "?fields=%s" % (",".join(trimmed_fields)) + + response = self.json_get(url=url, + debug=debug, + wait_sec=wait_sec, + request_timeout_sec=timeout_sec, + max_timeout_sec=timeout_sec, + errors_warnings=errors_warnings) + if response is None: + return None + return self.extract_values(response=response, + singular_key="sessions/messages", + plural_key="sessions/messages") + # + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + If you need to call the URL directly, + request one of these URLs: + /test-group/ + /test-group/$id + /test-groups/ + /test-groups/$id + + When requesting specific column names, they need to be URL encoded: + cross+connects, entity+id, name, run, script + Example URL: /test-group?fields=cross+connects,entity+id + + Example py-json call (it knows the URL): + record = LFJsonGet.get_test_group(eid_list=['1.234', '1.344'], + requested_col_names=['entity id'], + debug=True) + + The record returned will have these members: + { + 'cross connects': # List of Test Manager's Cross-Connects. + 'entity id': # Entity ID + 'name': # Test Group's Name. + 'run': # Is Test Group running or not. + 'script': # Endpoint script state. + } + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + def get_test_group(self, + eid_list: list = None, + requested_col_names: list = None, + wait_sec: float = 0.01, + timeout_sec: float = 5.0, + errors_warnings: list = None, + debug: bool = False): + """ + :param eid_list: list of entity IDs to query for + :param requested_col_names: list of column names to return + :param wait_sec: duration to wait between retries if no response or response is HTTP 404 + :param timeout_sec: duration in which to keep querying before returning + :param errors_warnings: optional list to extend with errors and warnings from response + :param debug: print diagnostic info if true + :return: dictionary of results + """ + debug |= self.debug_on + url = "/test-group" + if (eid_list is None) or (len(eid_list) < 1): + raise ValueError("no entity id in request") + trimmed_fields = [] + if isinstance(requested_col_names, str): + if not requested_col_names.strip(): + raise ValueError("column name cannot be blank") + trimmed_fields.append(requested_col_names.strip()) + if isinstance(requested_col_names, list): + for field in requested_col_names: + if not field.strip(): + raise ValueError("column names cannot be blank") + field = field.strip() + if field.find(" ") > -1: + raise ValueError("field should be URL encoded: [%s]" % field) + trimmed_fields.append(field) + url += self.create_port_eid_url(eid_list=eid_list) + + if len(trimmed_fields) > 0: + url += "?fields=%s" % (",".join(trimmed_fields)) + + response = self.json_get(url=url, + debug=debug, + wait_sec=wait_sec, + request_timeout_sec=timeout_sec, + max_timeout_sec=timeout_sec, + errors_warnings=errors_warnings) + if response is None: + return None + return self.extract_values(response=response, + singular_key="groups", + plural_key="groups") + # + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + If you need to call the URL directly, + request one of these URLs: + /text/ + /text/$group + /text/$group/$class + /text/$group/$class/$key + + When requesting specific column names, they need to be URL encoded: + eid, name, text, type + Example URL: /text?fields=eid,name + + Example py-json call (it knows the URL): + record = LFJsonGet.get_text(eid_list=['1.234', '1.344'], + requested_col_names=['text'], + debug=True) + + The record returned will have these members: + { + 'eid': # - + 'name': # - + 'text': # - + 'type': # - + } + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + def get_text(self, + eid_list: list = None, + requested_col_names: list = None, + wait_sec: float = 0.01, + timeout_sec: float = 5.0, + errors_warnings: list = None, + debug: bool = False): + """ + :param eid_list: list of entity IDs to query for + :param requested_col_names: list of column names to return + :param wait_sec: duration to wait between retries if no response or response is HTTP 404 + :param timeout_sec: duration in which to keep querying before returning + :param errors_warnings: optional list to extend with errors and warnings from response + :param debug: print diagnostic info if true + :return: dictionary of results + """ + debug |= self.debug_on + url = "/text" + if (eid_list is None) or (len(eid_list) < 1): + raise ValueError("no entity id in request") + trimmed_fields = [] + if isinstance(requested_col_names, str): + if not requested_col_names.strip(): + raise ValueError("column name cannot be blank") + trimmed_fields.append(requested_col_names.strip()) + if isinstance(requested_col_names, list): + for field in requested_col_names: + if not field.strip(): + raise ValueError("column names cannot be blank") + field = field.strip() + if field.find(" ") > -1: + raise ValueError("field should be URL encoded: [%s]" % field) + trimmed_fields.append(field) + url += self.create_port_eid_url(eid_list=eid_list) + + if len(trimmed_fields) > 0: + url += "?fields=%s" % (",".join(trimmed_fields)) + + response = self.json_get(url=url, + debug=debug, + wait_sec=wait_sec, + request_timeout_sec=timeout_sec, + max_timeout_sec=timeout_sec, + errors_warnings=errors_warnings) + if response is None: + return None + return self.extract_values(response=response, + singular_key="record", + plural_key="records") + # + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + If you need to call the URL directly, + request one of these URLs: + /voip-endp/ + /voip-endp/$endp_id + /voip-ep/ + /voip-ep/$endp_id + /voip/ + /voip/$cx_id + /voip_endp/ + /voip_endp/$endp_id + /voip_ep/ + /voip_ep/$endp_id + + When requesting specific column names, they need to be URL encoded: + bps+rx+a, bps+rx+b, delay+a+%E2%86%90+b, delay+a+%E2%86%92+b, eid, endpoints+%28a%C2%A0%E2%86%94%C2%A0b%29, + entity+id, jitter+a+%E2%86%90+b, jitter+a+%E2%86%92+b, name, pkt+tx+a%C2%A0%E2%86%90%C2%A0b, + pkt+tx+a%C2%A0%E2%86%92%C2%A0b, rpt+timer, rx+drop+%25+a, rx+drop+%25+b, state, + type + Example URL: /voip?fields=bps+rx+a,bps+rx+b + + Example py-json call (it knows the URL): + record = LFJsonGet.get_voip(eid_list=['1.234', '1.344'], + requested_col_names=['entity id'], + debug=True) + + The record returned will have these members: + { + 'bps rx a': # Endpoint B's real transmit rate (bps).Measured at the CX Type layer. + 'bps rx b': # Endpoint A's real transmit rate (bps).Measured at the CX Type layer. + 'delay a ← b': # Average Latency in milliseconds for traffic from Endpoint B to Endpoint + # A + 'delay a → b': # Average Latency in milliseconds for traffic from Endpoint A to Endpoint + # B + 'eid': # Entity ID + 'endpoints (a ↔ b)': # Endpoints that make up this Cross Connect. + 'entity id': # Entity ID + 'jitter a ← b': # Average Jitter in milliseconds for traffic from Endpoint B to Endpoint A + 'jitter a → b': # Average Jitter in milliseconds for traffic from Endpoint A to Endpoint B + 'name': # Cross Connect's Name. + 'pkt tx a ← b': # Endpoint B's Packets Transmitted. + 'pkt tx a → b': # Endpoint A's Packets Transmitted. + 'rpt timer': # Cross Connect's Report Timer (milliseconds).This is how often the GUI + # will ask for updates from the LANforge processes.If the GUI is sluggish, + # increasing the report timers may help. + 'rx drop % a': # Endpoint A percentage packet loss.Calculated using the number of PDUs + # Endpoint B sent minus the number Endpoint A received.This number is not + # 100% correct as long as packets are in flight.After a Quiesce of the + # test, the number should be perfectly accurate. + 'rx drop % b': # Endpoint B percentage packet loss.Calculated using the number of PDUs + # Endpoint A sent minus the number Endpoint B received.This number is not + # 100% correct as long as packets are in flight.After a Quiesce of the + # test, the number should be perfectly accurate. + 'state': # Current State of the connection.UninitializedHas not yet been + # started/stopped.InitializingBeing set up.StartingStarting the + # test.RunningTest is actively running.StoppedTest has been + # stopped.QuiesceTest will gracefully stop soon.HW-BYPASSTest is in + # hardware-bypass mode (WanLinks only)FTM_WAITTest wants to run, but is + # phantom, probably due to non-existent interface or resource.WAITINGWill + # restart as soon as resources are available.PHANTOMTest is stopped, and + # is phantom, probably due to non-existent interface or resource. + 'type': # Cross-Connect type. + } + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + def get_voip(self, + eid_list: list = None, + requested_col_names: list = None, + wait_sec: float = 0.01, + timeout_sec: float = 5.0, + errors_warnings: list = None, + debug: bool = False): + """ + :param eid_list: list of entity IDs to query for + :param requested_col_names: list of column names to return + :param wait_sec: duration to wait between retries if no response or response is HTTP 404 + :param timeout_sec: duration in which to keep querying before returning + :param errors_warnings: optional list to extend with errors and warnings from response + :param debug: print diagnostic info if true + :return: dictionary of results + """ + debug |= self.debug_on + url = "/voip" + if (eid_list is None) or (len(eid_list) < 1): + raise ValueError("no entity id in request") + trimmed_fields = [] + if isinstance(requested_col_names, str): + if not requested_col_names.strip(): + raise ValueError("column name cannot be blank") + trimmed_fields.append(requested_col_names.strip()) + if isinstance(requested_col_names, list): + for field in requested_col_names: + if not field.strip(): + raise ValueError("column names cannot be blank") + field = field.strip() + if field.find(" ") > -1: + raise ValueError("field should be URL encoded: [%s]" % field) + trimmed_fields.append(field) + url += self.create_port_eid_url(eid_list=eid_list) + + if len(trimmed_fields) > 0: + url += "?fields=%s" % (",".join(trimmed_fields)) + + response = self.json_get(url=url, + debug=debug, + wait_sec=wait_sec, + request_timeout_sec=timeout_sec, + max_timeout_sec=timeout_sec, + errors_warnings=errors_warnings) + if response is None: + return None + return self.extract_values(response=response, + singular_key="connection", + plural_key="connections") + # + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + If you need to call the URL directly, + request one of these URLs: + /voip-endp/ + /voip-endp/$endp_id + + When requesting specific column names, they need to be URL encoded: + calls+answered, calls+attempted, calls+completed, calls+failed, cf+404, cf+408, + cf+busy, cf+canceled, delay, destination+addr, dropped, dup+pkts, eid, elapsed, + entity+id, jb+cur, jb+over, jb+silence, jb+under, jitter, mng, name, ooo+pkts, + pesq, pesq+bklg, pesq%23, reg+state, rst, rtp+rtt, run, rx+bytes, rx+pkts, + source+addr, state, tx+bytes, tx+pkts, vad+pkts + Example URL: /voip-endp?fields=calls+answered,calls+attempted + + Example py-json call (it knows the URL): + record = LFJsonGet.get_voip_endp(eid_list=['1.234', '1.344'], + requested_col_names=['entity id'], + debug=True) + + The record returned will have these members: + { + 'calls answered': # Number of calls that where the remote answered + 'calls attempted': # Number of calls that have been attempted + 'calls completed': # Number of calls that have been successfully completed + 'calls failed': # Number of calls that did not succeed for any reason. + 'cf 404': # Number of calls failed for '404': callee not found. + 'cf 408': # Number of calls failed for '408': callee did not answer. + 'cf busy': # Number of calls failed because callee is busy. + 'cf canceled': # Number of calls failed because they were canceled. + 'delay': # Average latency in milliseconds for packets received by this endpoint. + 'destination addr': # Destination Address (MAC, ip/port, VoIP destination). + 'dropped': # Total dropped packets, as identified by gaps in RTP sequence numbers + # (pre jitter buffer). + 'dup pkts': # Total duplicate packets, as identified by RTP sequence numbers (pre + # jitter buffer). + 'eid': # Entity ID + 'elapsed': # Amount of time (seconds) this endpoint has been running (or ran.) + 'entity id': # Entity ID + 'jb cur': # Current number of packets in the jitter buffer waiting to be played / + # Jitter Buffer Size. + 'jb over': # Total times the jitter buffer was given more packets than it could hold. + 'jb silence': # Silence is played when there is no valid voice packet, due to drop, or + # reorder/jitter/latency out of range of the jitter buffer. + 'jb under': # Total times the reader asked for a packet to play but the jitter buffer + # was empty. + 'jitter': # Average interpacket variation, calculated per RFC 1889 A.8. + 'mng': # Is the Endpoint managed or not? + 'name': # Endpoint's Name. + 'ooo pkts': # Total out-of-order packets, as identified by RTP sequence numbers (pre + # jitter buffer). + 'pesq': # PESQ Report score for the PESQ report number (PESQ#). + 'pesq bklg': # PESQ server call processing backlog. + 'pesq#': # The pesq-report-number to which the PESQ value cooresponds. + 'reg state': # Current State of the Endpoint. + 'rst': # How many times has the endpoint been restarted due to abnormal + # termination. + 'rtp rtt': # Round trip latency as reported by RTCP + 'run': # Is the Endpoint is Running or not. + 'rx bytes': # Total received bytes count. + 'rx pkts': # Total received packet count. + 'source addr': # Source Address (MAC, ip/port, VoIP source). + 'state': # Phone registration state + 'tx bytes': # Total transmitted bytes count. + 'tx pkts': # Total transmitted packet count. + 'vad pkts': # Total VAD (Silence Suppression) packets suppressed before transmit. + } + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + def get_voip_endp(self, + eid_list: list = None, + requested_col_names: list = None, + wait_sec: float = 0.01, + timeout_sec: float = 5.0, + errors_warnings: list = None, + debug: bool = False): + """ + :param eid_list: list of entity IDs to query for + :param requested_col_names: list of column names to return + :param wait_sec: duration to wait between retries if no response or response is HTTP 404 + :param timeout_sec: duration in which to keep querying before returning + :param errors_warnings: optional list to extend with errors and warnings from response + :param debug: print diagnostic info if true + :return: dictionary of results + """ + debug |= self.debug_on + url = "/voip-endp" + if (eid_list is None) or (len(eid_list) < 1): + raise ValueError("no entity id in request") + trimmed_fields = [] + if isinstance(requested_col_names, str): + if not requested_col_names.strip(): + raise ValueError("column name cannot be blank") + trimmed_fields.append(requested_col_names.strip()) + if isinstance(requested_col_names, list): + for field in requested_col_names: + if not field.strip(): + raise ValueError("column names cannot be blank") + field = field.strip() + if field.find(" ") > -1: + raise ValueError("field should be URL encoded: [%s]" % field) + trimmed_fields.append(field) + url += self.create_port_eid_url(eid_list=eid_list) + + if len(trimmed_fields) > 0: + url += "?fields=%s" % (",".join(trimmed_fields)) + + response = self.json_get(url=url, + debug=debug, + wait_sec=wait_sec, + request_timeout_sec=timeout_sec, + max_timeout_sec=timeout_sec, + errors_warnings=errors_warnings) + if response is None: + return None + return self.extract_values(response=response, + singular_key="endpoint", + plural_key="endpoints") + # + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + If you need to call the URL directly, + request one of these URLs: + /vr-cx/ + /vr-cx/$shelf_id/$resource_id/$port_id + /vr/ + /vr/$shelf_id/$resource_id + /vrcx/ + /vrcx/$shelf_id/$resource_id/$port_id + + When requesting specific column names, they need to be URL encoded: + active+ipv6+router, bgp+4byte+as, bgp+damping, bgp+peers, cluster+id, collision+domain+id, + confederation+id, damping+half+life, damping+max+suppress, damping+reuse, + damping+suppress, entity+id, height, ipv6+radv, is+bgp+reflector, local+as, + multicast+routing, name, netsmith-state, notes, pad, ripv2, router+connections, + router+id, router+id, use+confederation, use+existing+cfg, use+ospf, use+rip+dft+route, + using+bgp, using+olsr, width, x, xorp+sha, y + Example URL: /vr?fields=active+ipv6+router,bgp+4byte+as + + Example py-json call (it knows the URL): + record = LFJsonGet.get_vr(eid_list=['1.234', '1.344'], + requested_col_names=['netsmith-state'], + debug=True) + + The record returned will have these members: + { + 'active ipv6 router': # - + 'bgp 4byte as': # - + 'bgp damping': # lc_key > lc_col_name- + 'bgp peers': # - + 'cluster id': # - + 'collision domain id': # - + 'confederation id': # - + 'damping half life': # - + 'damping max suppress': # - + 'damping reuse': # - + 'damping suppress': # - + 'entity id': # Entity ID + 'height': # - + 'ipv6 radv': # - + 'is bgp reflector': # - + 'local as': # - + 'multicast routing': # - + 'name': # Name + 'netsmith-state': # - + 'notes': # - + 'pad': # - + 'ripv2': # - + 'router connections': # - + 'router id': # - + 'router id': # - + 'use confederation ': # - + 'use existing cfg': # - + 'use ospf': # - + 'use rip dft route': # - + 'using bgp': # - + 'using olsr': # - + 'width': # - + 'x': # - + 'xorp sha': # - + 'y': # - + } + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + def get_vr(self, + eid_list: list = None, + requested_col_names: list = None, + wait_sec: float = 0.01, + timeout_sec: float = 5.0, + errors_warnings: list = None, + debug: bool = False): + """ + :param eid_list: list of entity IDs to query for + :param requested_col_names: list of column names to return + :param wait_sec: duration to wait between retries if no response or response is HTTP 404 + :param timeout_sec: duration in which to keep querying before returning + :param errors_warnings: optional list to extend with errors and warnings from response + :param debug: print diagnostic info if true + :return: dictionary of results + """ + debug |= self.debug_on + url = "/vr" + if (eid_list is None) or (len(eid_list) < 1): + raise ValueError("no entity id in request") + trimmed_fields = [] + if isinstance(requested_col_names, str): + if not requested_col_names.strip(): + raise ValueError("column name cannot be blank") + trimmed_fields.append(requested_col_names.strip()) + if isinstance(requested_col_names, list): + for field in requested_col_names: + if not field.strip(): + raise ValueError("column names cannot be blank") + field = field.strip() + if field.find(" ") > -1: + raise ValueError("field should be URL encoded: [%s]" % field) + trimmed_fields.append(field) + url += self.create_port_eid_url(eid_list=eid_list) + + if len(trimmed_fields) > 0: + url += "?fields=%s" % (",".join(trimmed_fields)) + + response = self.json_get(url=url, + debug=debug, + wait_sec=wait_sec, + request_timeout_sec=timeout_sec, + max_timeout_sec=timeout_sec, + errors_warnings=errors_warnings) + if response is None: + return None + return self.extract_values(response=response, + singular_key="virtual-routers", + plural_key="virtual-routers") + # + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + If you need to call the URL directly, + request one of these URLs: + /vrcx/ + /vrcx/$shelf_id/$resource_id/$port_id + + When requesting specific column names, they need to be URL encoded: + entity+id, height, interface+cost, local-a, local-b, netsmith-state, remote-a, + remote-b, resource, rip+metric, vrrp+id, vrrp+interval, vrrp+ip, vrrp+ip-prefix, + vrrp+priority, wan+link, width, x, y + Example URL: /vrcx?fields=entity+id,height + + Example py-json call (it knows the URL): + record = LFJsonGet.get_vrcx(eid_list=['1.234', '1.344'], + requested_col_names=['netsmith-state'], + debug=True) + + The record returned will have these members: + { + 'entity id': # - + 'height': # - + 'interface cost': # - + 'local-a': # - + 'local-b': # - + 'netsmith-state': # - + 'remote-a': # - + 'remote-b': # - + 'resource': # - + 'rip metric': # - + 'vrrp id': # - + 'vrrp interval': # - + 'vrrp ip': # - + 'vrrp ip-prefix': # - + 'vrrp priority': # - + 'wan link': # - + 'width': # - + 'x': # - + 'y': # - + } + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + def get_vrcx(self, + eid_list: list = None, + requested_col_names: list = None, + wait_sec: float = 0.01, + timeout_sec: float = 5.0, + errors_warnings: list = None, + debug: bool = False): + """ + :param eid_list: list of entity IDs to query for + :param requested_col_names: list of column names to return + :param wait_sec: duration to wait between retries if no response or response is HTTP 404 + :param timeout_sec: duration in which to keep querying before returning + :param errors_warnings: optional list to extend with errors and warnings from response + :param debug: print diagnostic info if true + :return: dictionary of results + """ + debug |= self.debug_on + url = "/vrcx" + if (eid_list is None) or (len(eid_list) < 1): + raise ValueError("no entity id in request") + trimmed_fields = [] + if isinstance(requested_col_names, str): + if not requested_col_names.strip(): + raise ValueError("column name cannot be blank") + trimmed_fields.append(requested_col_names.strip()) + if isinstance(requested_col_names, list): + for field in requested_col_names: + if not field.strip(): + raise ValueError("column names cannot be blank") + field = field.strip() + if field.find(" ") > -1: + raise ValueError("field should be URL encoded: [%s]" % field) + trimmed_fields.append(field) + url += self.create_port_eid_url(eid_list=eid_list) + + if len(trimmed_fields) > 0: + url += "?fields=%s" % (",".join(trimmed_fields)) + + response = self.json_get(url=url, + debug=debug, + wait_sec=wait_sec, + request_timeout_sec=timeout_sec, + max_timeout_sec=timeout_sec, + errors_warnings=errors_warnings) + if response is None: + return None + return self.extract_values(response=response, + singular_key="router-connections", + plural_key="router-connections") + # + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + If you need to call the URL directly, + request one of these URLs: + /wl-endp/ + /wl-endp/$wl_ep_id + /wl-ep/ + /wl-ep/$wl_ep_id + /wl/ + /wl/$wl_id + /wl_endp/ + /wl_endp/$wl_ep_id + /wl_ep/ + /wl_ep/$wl_ep_id + /wlendp/$wl_ep_id + + When requesting specific column names, they need to be URL encoded: + bps+rx+a, bps+rx+b, eid, endpoints+%28a%C2%A0%E2%86%94%C2%A0b%29, entity+id, k-m, + name, pkt+tx+a%C2%A0%E2%86%90%C2%A0b, pkt+tx+a%C2%A0%E2%86%92%C2%A0b, rpt+timer, + state + Example URL: /wl?fields=bps+rx+a,bps+rx+b + + Example py-json call (it knows the URL): + record = LFJsonGet.get_wl(eid_list=['1.234', '1.344'], + requested_col_names=['entity id'], + debug=True) + + The record returned will have these members: + { + 'bps rx a': # Endpoint B's Max transmit rate (bps). + 'bps rx b': # Endpoint A's Max transmit rate (bps). + 'eid': # Entity ID + 'endpoints (a ↔ b)': # Endpoints that make up this WanLink. + 'entity id': # Entity ID + 'k-m': # Whether the WanLink is Kernel-Mode or not. + 'name': # WanLink's Name. + 'pkt tx a ← b': # Packets received on endpoint B and transmitted out endpoint A. + 'pkt tx a → b': # Packets received on endpoint A and transmitted out endpoint B. + 'rpt timer': # Cross Connect's Report Timer (milliseconds).This is how often the GUI + # will ask for updates from the LANforge processes.If the GUI is sluggish, + # increasing the report timers may help. + 'state': # Current State of the connection.UninitializedHas not yet been + # started/stopped.InitializingBeing set up.StartingStarting the + # test.RunningTest is actively running.StoppedTest has been + # stopped.QuiesceTest will gracefully stop soon.HW-BYPASSTest is in + # hardware-bypass mode (WanLinks only)FTM_WAITTest wants to run, but is + # phantom, probably due to non-existent interface or resource.WAITINGWill + # restart as soon as resources are available.PHANTOMTest is stopped, and + # is phantom, probably due to non-existent interface or resource. + } + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + def get_wl(self, + eid_list: list = None, + requested_col_names: list = None, + wait_sec: float = 0.01, + timeout_sec: float = 5.0, + errors_warnings: list = None, + debug: bool = False): + """ + :param eid_list: list of entity IDs to query for + :param requested_col_names: list of column names to return + :param wait_sec: duration to wait between retries if no response or response is HTTP 404 + :param timeout_sec: duration in which to keep querying before returning + :param errors_warnings: optional list to extend with errors and warnings from response + :param debug: print diagnostic info if true + :return: dictionary of results + """ + debug |= self.debug_on + url = "/wl" + if (eid_list is None) or (len(eid_list) < 1): + raise ValueError("no entity id in request") + trimmed_fields = [] + if isinstance(requested_col_names, str): + if not requested_col_names.strip(): + raise ValueError("column name cannot be blank") + trimmed_fields.append(requested_col_names.strip()) + if isinstance(requested_col_names, list): + for field in requested_col_names: + if not field.strip(): + raise ValueError("column names cannot be blank") + field = field.strip() + if field.find(" ") > -1: + raise ValueError("field should be URL encoded: [%s]" % field) + trimmed_fields.append(field) + url += self.create_port_eid_url(eid_list=eid_list) + + if len(trimmed_fields) > 0: + url += "?fields=%s" % (",".join(trimmed_fields)) + + response = self.json_get(url=url, + debug=debug, + wait_sec=wait_sec, + request_timeout_sec=timeout_sec, + max_timeout_sec=timeout_sec, + errors_warnings=errors_warnings) + if response is None: + return None + return self.extract_values(response=response, + singular_key="", + plural_key="") + # + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + If you need to call the URL directly, + request one of these URLs: + /wl-endp/ + /wl-endp/$wl_ep_id + + When requesting specific column names, they need to be URL encoded: + buffer, corrupt+1, corrupt+2, corrupt+3, corrupt+4, corrupt+5, corrupt+6, + delay, dropfreq+%25, dropped, dup+pkts, dupfreq+%25, eid, elapsed, extrabuf, + failed-late, jitfreq+%25, max+rate, maxjitter, maxlate, name, ooo+pkts, qdisc, + reordfrq+%25, run, rx+bytes, rx+pkts, script, serdelay, tx+bytes, tx+drop+%25, + tx+pkts, tx+rate, tx-failed, wps + Example URL: /wl-endp?fields=buffer,corrupt+1 + + Example py-json call (it knows the URL): + record = LFJsonGet.get_wl_endp(eid_list=['1.234', '1.344'], + requested_col_names=['eid'], + debug=True) + + The record returned will have these members: + { + 'buffer': # Maximum size of receive buffer, in bytes.This is the sum of the amount + # needed for the transit buffers (delay * bandwidth)plus the WanLink + # "Backlog Buffer:" queue size which handles bursts. + 'corrupt 1': # Counters for how many times this corruption has been applied. + 'corrupt 2': # Counters for how many times this corruption has been applied. + 'corrupt 3': # Counters for how many times this corruption has been applied. + 'corrupt 4': # Counters for how many times this corruption has been applied. + 'corrupt 5': # Counters for how many times this corruption has been applied. + 'corrupt 6': # Counters for how many times this corruption has been applied. + 'delay': # Base induced latency on received packets, in microseconds. + 'dropfreq %': # Frequency out of 1,000,000 to drop a received packet.Select a preset + # value or enter your own. + 'dropped': # Total dropped packets on receive.This does not include the tx-failed + # counters. + 'dup pkts': # Total duplicate packets generated. + 'dupfreq %': # Frequency out of 1,000,000 to duplicate a received packet.Select a + # preset value or enter your own. + 'eid': # Entity ID + 'elapsed': # Amount of time (seconds) this endpoint has been running (or ran.) + 'extrabuf': # Size of "Backlog Buffer:" setting in WanLink configuration in bytes. + 'failed-late': # Total amount of received packets that could not be transmitted out the + # peer becausethe emulator was overloaded and could not transmit within + # the specified 'lateness' + 'jitfreq %': # Frequency out of 1,000,000 that packets should have jitter applied to + # them.Select a preset value or enter your own. + 'max rate': # Max transmit rate (bps) for this Endpoint. + 'maxjitter': # Maximum additional delay, in microseconds. See Jitter-Frequency as + # well. + 'maxlate': # The maximum lateness in milliseconds allowed before packets will be + # dropped on transmit.If lateness is configured to be automatic, this + # variable will change based onconfigured bandwidth and backlog buffer, + # but will not go below 10ms. + 'name': # Endpoint's Name. + 'ooo pkts': # Total out of order packets generated. + 'qdisc': # Queueing discipline (FIFO, WRR, etc). + 'reordfrq %': # Frequency out of 1,000,000 to re-order a received packet.Select a preset + # value or enter your own. + 'run': # Is the Endpoint is Running or not. + 'rx bytes': # Total received bytes count. + 'rx pkts': # Total received packet count. + 'script': # Endpoint script state. + 'serdelay': # Additional serialization delay for a 1514 byte packet at the configured + # speed (microseconds). + 'tx bytes': # Total transmitted bytes count. + 'tx drop %': # Packet drop percentage over the last 1 minute. + 'tx pkts': # Packets received on the peer interface and transmitted out this + # endpoint's interface. + 'tx rate': # The average speed over the last 30 seconds at which we are + # transmittingout the peer interface.This can be thought of as the actual + # transfer rate for packets entering the interfaceassociated with this + # Endpoint. + 'tx-failed': # Total amount of received packets that could not be transmitted out the + # peer.This includes any tx-failed-late packets. + 'wps': # Enable/Disable showing of WanPaths for individual endpoints. + } + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + def get_wl_endp(self, + eid_list: list = None, + requested_col_names: list = None, + wait_sec: float = 0.01, + timeout_sec: float = 5.0, + errors_warnings: list = None, + debug: bool = False): + """ + :param eid_list: list of entity IDs to query for + :param requested_col_names: list of column names to return + :param wait_sec: duration to wait between retries if no response or response is HTTP 404 + :param timeout_sec: duration in which to keep querying before returning + :param errors_warnings: optional list to extend with errors and warnings from response + :param debug: print diagnostic info if true + :return: dictionary of results + """ + debug |= self.debug_on + url = "/wl-endp" + if (eid_list is None) or (len(eid_list) < 1): + raise ValueError("no entity id in request") + trimmed_fields = [] + if isinstance(requested_col_names, str): + if not requested_col_names.strip(): + raise ValueError("column name cannot be blank") + trimmed_fields.append(requested_col_names.strip()) + if isinstance(requested_col_names, list): + for field in requested_col_names: + if not field.strip(): + raise ValueError("column names cannot be blank") + field = field.strip() + if field.find(" ") > -1: + raise ValueError("field should be URL encoded: [%s]" % field) + trimmed_fields.append(field) + url += self.create_port_eid_url(eid_list=eid_list) + + if len(trimmed_fields) > 0: + url += "?fields=%s" % (",".join(trimmed_fields)) + + response = self.json_get(url=url, + debug=debug, + wait_sec=wait_sec, + request_timeout_sec=timeout_sec, + max_timeout_sec=timeout_sec, + errors_warnings=errors_warnings) + if response is None: + return None + return self.extract_values(response=response, + singular_key="endpoint", + plural_key="endpoint") + # + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + Notes for type requests + + If you need to call the URL directly, + request one of these URLs: + /ws-msg/ + /ws-msg/$sessionid + + + Example py-json call (it knows the URL): + record = LFJsonGet.get_ws_msg(eid_list=['1.234', '1.344'], + debug=True) + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + + def get_ws_msg(self, + eid_list: list = None, + requested_col_names: list = None, + wait_sec: float = 0.01, + timeout_sec: float = 5.0, + errors_warnings: list = None, + debug: bool = False): + """ + :param eid_list: list of entity IDs to query for + :param requested_col_names: list of column names to return + :param wait_sec: duration to wait between retries if no response or response is HTTP 404 + :param timeout_sec: duration in which to keep querying before returning + :param errors_warnings: optional list to extend with errors and warnings from response + :param debug: print diagnostic info if true + :return: dictionary of results + """ + debug |= self.debug_on + url = "/ws-msg" + if (eid_list is None) or (len(eid_list) < 1): + raise ValueError("no entity id in request") + trimmed_fields = [] + if isinstance(requested_col_names, str): + if not requested_col_names.strip(): + raise ValueError("column name cannot be blank") + trimmed_fields.append(requested_col_names.strip()) + if isinstance(requested_col_names, list): + for field in requested_col_names: + if not field.strip(): + raise ValueError("column names cannot be blank") + field = field.strip() + if field.find(" ") > -1: + raise ValueError("field should be URL encoded: [%s]" % field) + trimmed_fields.append(field) + url += self.create_port_eid_url(eid_list=eid_list) + + if len(trimmed_fields) > 0: + url += "?fields=%s" % (",".join(trimmed_fields)) + + response = self.json_get(url=url, + debug=debug, + wait_sec=wait_sec, + request_timeout_sec=timeout_sec, + max_timeout_sec=timeout_sec, + errors_warnings=errors_warnings) + if response is None: + return None + return self.extract_values(response=response, + singular_key="", + plural_key="") + # + +class LFSession(BaseSession): + """----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- + This subclass of BaseSession knows about LFJsonQuery and LFJsonCommand + ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----""" + def __init__(self, lfclient_url: str = 'http://localhost:8080', + debug: bool = False, + proxy_map: dict = None, + connection_timeout_sec: float = None, + stream_errors: bool = True, + stream_warnings: bool = False, + require_session: bool = False, + exit_on_error: bool = False): + """ + :param debug: turn on diagnostic information + :param proxy_map: a dict with addresses of proxies to route requests through. + E.G.: { 'http':'http://192.168.1.253:3128', 'https':'https://192.168.1.253:443' } + :param connection_timeout_sec: timeout in second to wait for a connect to the LANforge client (GUI) + This timeout does should not apply to long running client requests, there are individual + timeouts for those conditions, such as max_timeout_sec. + :param stream_errors: print HTTP JSON API errors to system out and logging stream + :param stream_warnings: print HTTP JSON API warnings to system out and logging stream + :param require_session: exit(1) if unable to establish a session_id + :param exit_on_error: on requests failing HTTP requests on besides error 404, + exit(1). This does not include failing to establish a session_id + """ + super().__init__(lfclient_url=lfclient_url, + debug=debug, + proxy_map=proxy_map, + connection_timeout_sec=connection_timeout_sec, + stream_errors=stream_errors, + stream_warnings=stream_warnings, + exit_on_error=exit_on_error) + self.command_instance = LFJsonCommand(session_obj=self, debug=debug, exit_on_error=exit_on_error) + self.query_instance = LFJsonQuery(session_obj=self, debug=debug, exit_on_error=exit_on_error) + self.session_connection_check = \ + self.command_instance.start_session(debug=debug, + die_without_session_id_=require_session) + if self.session_connection_check: + self.session_id = self.command_instance.session_id + self.query_instance.session_id = self.session_id + else: + self.logger.error('LFSession failed to establish session_id') + if require_session and ((not self.command_instance.session_id) or (not self.session_id)): + self.logger.error('LFSession failed to setup session_id correctly') + + def get_command(self) -> LFJsonCommand: + """ + Remember to override this method with your session subclass, it should return LFJsonCommand + :return: registered instance of JsonCommand + """ + if self.command_instance: + return self.command_instance + self.command_instance = LFJsonCommand(session_obj=self) + return self.command_instance + + def get_query(self) -> LFJsonQuery: + """ + Remember to override this method with your session subclass, it should return LFJsonQuery + :return: registered instance of JsonQuery + """ + if self.query_instance: + return self.query_instance + self.query_instance = LFJsonQuery(session_obj=self, debug=self.debug_on) + return self.query_instance