eFdZddlZddlZddlmZd dZd dZ d d ZdS) zl This module contains an argparse command line parser for cloudlinux-ssa-manager and cloudlinux-autotracing N)is_cl_solo_editionreturnargparse.ArgumentParserctjdd}|ddd}|dd tj }t d sx|d d d|ddd|ddd|ddd|ddd|ddd|dd d!|d"d#d$|d%d&d'|d(d)tj |d*d+tj |d,d-tj |d.d/tj |d0d1tj |d2d3tj |S)4zh Command line parser for SSA manager utility using built-in argparse module :return: parser zcloudlinux-ssa-managerzUtility to manage SSAprog descriptionCommandscommandTtitledestrequiredz set-configzSet SSA configuration)helpargument_default)skip_jwt_checkz--domains-numberDOMAINS_NUMBERz!Size of TOP list for slow domains)metavarrz--request-numberREQUEST_NUMBERz[The threshold value of slow requests number in the period of time to mark URL as a slow onez--timeTIMEz:Period of time in hours required to analyze these requestsz --correlation CORRELATIONz%Flag to enable or disable correlationz--correlation-coefficientCORRELATION_COEFFICIENTz.The threshold value of correlation coefficientz --urls-number URLS_NUMBERzSize of TOP list for slow urlsz--requests-durationREQUESTS_DURATIONz2The threshold value of request duration in secondsz --ignore-list IGNORE_LISTzGList of URLs or domains that should not be included in the daily reportz--summary-notification-enabledSUMMARY_NOTIFICATIONz.Turn on|off sending the daily report by e-mailz get-configzGet SSA configurationzget-ssa-statuszGet current status of SSAz enable-ssaz Enable SSAz disable-ssaz Disable SSAz get-reportzGet the latest reportzget-statzGet the SSA statistics)argparseArgumentParseradd_subparsers add_parserSUPPRESSr add_argument)parser subparsersset_config_parsers S/opt/cloudlinux/venv/lib64/python3.11/site-packages/ssa/ssa_utils/cmdline_parser.pycmd_parser_managerr's  $*B1HJJJF&&Zi04'66J#--l3J?G?P.RR T 2 2 2 ^&&'9CS,O ' Q Q Q&&'9CS-J ' K K K&&x,h ' j j j&& ,S ' U U U&&'BLe,\ ' ^ ^ ^""?M(H#JJJ""#8BU(\#^^^""?M(q#sss""#CMc(X#ZZZ,-D+3+<>>>*1L+3+<>>>,\+3+<>>>-m+3+<>>>,-D+3+<>>>*+C+3+<>>> Mctjdd}|ddd}|dd }|d d d d|dddd|dd }|d d d d|dddd|dd }|dd d d|dddd|S)z` Command line parser for Autotracing using built-in argparse module :return: parser zcloudlinux-autotracingzUtility to manage Auto Tracingrr r Tr enablezEnable Auto Tracing feature)rz--all store_trueFzenable for all users)actiondefaultruser?Nzenable for a particular user)nargsr-rdisablezDisable Auto Tracing featurezdisable for all userszdisable for a particular userstatusz"Get status of Auto Tracing featurez--list-disabledzlist disabled userszstatus of a particular user)rrrr r")r#r$e_parserd_parsers_parsers r&cmd_parser_autotracing_utilr6Bs  $*B1QSSSF&&Zi04'66J$$X*G%IIH ',5777 &T=???$$Y*H%JJH ',6888 &T>@@@$$X*N%PPH +L"'.CEEE &T<>>> Mr(r#argparse.Namespacec |}|S#t$r+}tjddt |id}~wwxYw)z} Parse arguments with given parser :param parser: an instance of ArgumentParser :return: arguments Namespace zInvalid utility invocationerr)extraN) parse_args SystemExitloggingerrorstr)r#argses r&parse_cmd_argumentsrBds_  ""  25#a&&/JJJJ s A &AA )rr)r#rrr7)__doc__rr=clcommon.lib.cleditionrr'r6rBr(r&rFs555555----`D ) .B      r(