def _set_config(setcfg: SetConfig, library: str = None): req_data = setcfg.dict(exclude_none=True) if library is not None: req_data["library"] = library r = reds.execute_task(method="setconfig", kwargs=req_data) resp = jsonable_encoder(r) return resp
def _get_config(getcfg: GetConfig, library: str = None): req_data = getcfg.dict() if library is not None: req_data["library"] = library r = reds.execute_task(method="getconfig", kwargs=req_data) resp = jsonable_encoder(r) return resp
def ncclient_get(getcfg: NcclientGet, library: str = "ncclient"): req_data = getcfg.dict(exclude_none=True) if library is not None: req_data["library"] = library r = reds.execute_task(method="ncclient_get", kwargs=req_data) resp = jsonable_encoder(r) return resp
def set_config_dry_run(setcfg: SetConfig): req_data = setcfg.dict(exclude_none=True) r = reds.execute_task(method="dryrun", kwargs=req_data) resp = jsonable_encoder(r) return resp
def execute_script(script: model): req_data = script.dict() r = reds.execute_task(method="script", kwargs=req_data) resp = jsonable_encoder(r) return resp