__ __ __ __ _____ _ _ _____ _ _ _ | \/ | \ \ / / | __ \ (_) | | / ____| | | | | | \ / |_ __\ V / | |__) | __ ___ ____ _| |_ ___ | (___ | |__ ___| | | | |\/| | '__|> < | ___/ '__| \ \ / / _` | __/ _ \ \___ \| '_ \ / _ \ | | | | | | |_ / . \ | | | | | |\ V / (_| | || __/ ____) | | | | __/ | | |_| |_|_(_)_/ \_\ |_| |_| |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1 if you need WebShell for Seo everyday contact me on Telegram Telegram Address : @jackleetFor_More_Tools:
import json
import sys
from collections import OrderedDict
from typing import Any, Optional # noqa: F401
from uaclient import exceptions, messages
from uaclient.api import AbstractProgress
from uaclient.api.api import call_api
from uaclient.cli.commands import ProArgument, ProArgumentGroup, ProCommand
from uaclient.cli.parser import HelpCategory
class CLIAPIProgress(AbstractProgress):
def progress(
self,
*,
total_steps: int,
done_steps: int,
previous_step_message: Optional[str],
current_step_message: Optional[str]
):
d = OrderedDict() # type: OrderedDict[str, Any]
d["total_steps"] = total_steps
d["done_steps"] = done_steps
d["previous_step_message"] = previous_step_message
d["current_step_message"] = current_step_message
print(json.dumps(d))
def action_api(args, *, cfg, **kwargs):
if args.options and args.data:
raise exceptions.CLIAPIOptionsXORData()
if args.data and args.data == "-":
if not sys.stdin.isatty():
args.data = sys.stdin.read()
if args.show_progress:
progress = CLIAPIProgress()
else:
progress = None
result = call_api(
args.endpoint_path, args.options, args.data, cfg, progress
)
print(result.to_json())
return 0 if result.result == "success" else 1
api_command = ProCommand(
"api",
help=messages.CLI_ROOT_API,
description=messages.CLI_API_DESC,
action=action_api,
help_category=HelpCategory.OTHER,
preserve_description=True,
argument_groups=[
ProArgumentGroup(
arguments=[
ProArgument(
"endpoint_path",
help=messages.CLI_API_ENDPOINT,
metavar="endpoint",
),
ProArgument(
"--show-progress",
help=messages.CLI_API_SHOW_PROGRESS,
action="store_true",
),
ProArgument(
"--args",
help=messages.CLI_API_ARGS,
dest="options",
default=[],
nargs="*",
),
ProArgument(
"--data",
help=messages.CLI_API_DATA,
dest="data",
default="",
),
]
)
],
)
| Name | Type | Size | Permission | Actions |
|---|---|---|---|---|
| __pycache__ | Folder | 0755 |
|
|
| __init__.py | File | 9.28 KB | 0644 |
|
| api.py | File | 2.4 KB | 0644 |
|
| attach.py | File | 5.48 KB | 0644 |
|
| auto_attach.py | File | 958 B | 0644 |
|
| cli_util.py | File | 8.08 KB | 0644 |
|
| collect_logs.py | File | 1.6 KB | 0644 |
|
| commands.py | File | 3.68 KB | 0644 |
|
| config.py | File | 10.72 KB | 0644 |
|
| cve.py | File | 6.73 KB | 0644 |
|
| cves.py | File | 3.78 KB | 0644 |
|
| detach.py | File | 3.38 KB | 0644 |
|
| disable.py | File | 10.65 KB | 0644 |
|
| enable.py | File | 18.81 KB | 0644 |
|
| fix.py | File | 28.63 KB | 0644 |
|
| formatter.py | File | 8.75 KB | 0644 |
|
| help.py | File | 1.67 KB | 0644 |
|
| parser.py | File | 2.72 KB | 0644 |
|
| refresh.py | File | 2.42 KB | 0644 |
|
| security_status.py | File | 2.79 KB | 0644 |
|
| status.py | File | 2.37 KB | 0644 |
|
| system.py | File | 1.05 KB | 0644 |
|