kaqing 2.0.77__py3-none-any.whl → 2.0.79__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of kaqing might be problematic. Click here for more details.
- adam/commands/show/show.py +2 -1
- adam/commands/show/show_host.py +33 -0
- adam/repl.py +8 -1
- adam/repl_commands.py +2 -1
- adam/utils_net.py +24 -0
- adam/version.py +1 -1
- {kaqing-2.0.77.dist-info → kaqing-2.0.79.dist-info}/METADATA +1 -1
- {kaqing-2.0.77.dist-info → kaqing-2.0.79.dist-info}/RECORD +11 -9
- {kaqing-2.0.77.dist-info → kaqing-2.0.79.dist-info}/WHEEL +0 -0
- {kaqing-2.0.77.dist-info → kaqing-2.0.79.dist-info}/entry_points.txt +0 -0
- {kaqing-2.0.77.dist-info → kaqing-2.0.79.dist-info}/top_level.txt +0 -0
adam/commands/show/show.py
CHANGED
|
@@ -5,6 +5,7 @@ from adam.commands.medusa.medusa_show_backupjobs import MedusaShowBackupJobs
|
|
|
5
5
|
from adam.commands.medusa.medusa_show_restorejobs import MedusaShowRestoreJobs
|
|
6
6
|
from adam.commands.show.show_app_actions import ShowAppActions
|
|
7
7
|
from adam.commands.show.show_app_queues import ShowAppQueues
|
|
8
|
+
from adam.commands.show.show_host import ShowHost
|
|
8
9
|
from adam.commands.show.show_login import ShowLogin
|
|
9
10
|
from .show_params import ShowParams
|
|
10
11
|
from .show_app_id import ShowAppId
|
|
@@ -39,7 +40,7 @@ class Show(Command):
|
|
|
39
40
|
return super().intermediate_run(cmd, state, args, Show.cmd_list())
|
|
40
41
|
|
|
41
42
|
def cmd_list():
|
|
42
|
-
return [ShowAppActions(), ShowAppId(), ShowAppQueues(), ShowLogin(), ShowKubectlCommands(),
|
|
43
|
+
return [ShowAppActions(), ShowAppId(), ShowAppQueues(), ShowHost(), ShowLogin(), ShowKubectlCommands(),
|
|
43
44
|
ShowParams(), ShowProcesses(), ShowRepairs(), ShowStorage(), ShowAdam(),
|
|
44
45
|
ShowCassandraStatus(), ShowCassandraVersion(), MedusaShowRestoreJobs(), MedusaShowBackupJobs()]
|
|
45
46
|
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
from adam.commands.command import Command
|
|
2
|
+
from adam.repl_state import ReplState
|
|
3
|
+
from adam.utils import log
|
|
4
|
+
from adam.utils_net import get_my_host
|
|
5
|
+
|
|
6
|
+
class ShowHost(Command):
|
|
7
|
+
COMMAND = 'show host'
|
|
8
|
+
|
|
9
|
+
# the singleton pattern
|
|
10
|
+
def __new__(cls, *args, **kwargs):
|
|
11
|
+
if not hasattr(cls, 'instance'): cls.instance = super(ShowHost, cls).__new__(cls)
|
|
12
|
+
|
|
13
|
+
return cls.instance
|
|
14
|
+
|
|
15
|
+
def __init__(self, successor: Command=None):
|
|
16
|
+
super().__init__(successor)
|
|
17
|
+
|
|
18
|
+
def command(self):
|
|
19
|
+
return ShowHost.COMMAND
|
|
20
|
+
|
|
21
|
+
def run(self, cmd: str, state: ReplState):
|
|
22
|
+
if not(args := self.args(cmd)):
|
|
23
|
+
return super().run(cmd, state)
|
|
24
|
+
|
|
25
|
+
log(get_my_host())
|
|
26
|
+
|
|
27
|
+
return state
|
|
28
|
+
|
|
29
|
+
def completion(self, state: ReplState):
|
|
30
|
+
return super().completion(state)
|
|
31
|
+
|
|
32
|
+
def help(self, _: ReplState):
|
|
33
|
+
return f'{ShowHost.COMMAND}\t show host'
|
adam/repl.py
CHANGED
|
@@ -23,6 +23,7 @@ from adam.repl_session import ReplSession
|
|
|
23
23
|
from adam.repl_state import ReplState
|
|
24
24
|
from adam.utils import deep_merge_dicts, deep_sort_dict, lines_to_tabular, log2
|
|
25
25
|
from adam.apps import Apps
|
|
26
|
+
from adam.utils_net import get_my_host
|
|
26
27
|
from . import __version__
|
|
27
28
|
|
|
28
29
|
def enter_repl(state: ReplState):
|
|
@@ -169,7 +170,13 @@ def enter_repl(state: ReplState):
|
|
|
169
170
|
executor.submit(audit_log, cmd, state)
|
|
170
171
|
|
|
171
172
|
def audit_log(cmd: str, state: ReplState):
|
|
172
|
-
payload = {
|
|
173
|
+
payload = {
|
|
174
|
+
'cluster': state.namespace if state.namespace else 'NA',
|
|
175
|
+
'ts': time.time(),
|
|
176
|
+
'host': get_my_host(),
|
|
177
|
+
'user': getpass.getuser(),
|
|
178
|
+
'line': cmd.replace('"', '""').replace('\n', ' '),
|
|
179
|
+
}
|
|
173
180
|
audit_endpoint = Config().get("audit.endpoint", "https://sex7je4h2e.execute-api.us-west-2.amazonaws.com/prod")
|
|
174
181
|
response = requests.post(audit_endpoint, json=payload, timeout=Config().get("audit.timeout", 10))
|
|
175
182
|
if response.status_code in [200, 201]:
|
adam/repl_commands.py
CHANGED
|
@@ -46,6 +46,7 @@ from adam.commands.show.show_app_id import ShowAppId
|
|
|
46
46
|
from adam.commands.show.show_cassandra_status import ShowCassandraStatus
|
|
47
47
|
from adam.commands.show.show_cassandra_version import ShowCassandraVersion
|
|
48
48
|
from adam.commands.show.show_commands import ShowKubectlCommands
|
|
49
|
+
from adam.commands.show.show_host import ShowHost
|
|
49
50
|
from adam.commands.show.show_login import ShowLogin
|
|
50
51
|
from adam.commands.show.show_params import ShowParams
|
|
51
52
|
from adam.commands.show.show_processes import ShowProcesses
|
|
@@ -77,7 +78,7 @@ class ReplCommands:
|
|
|
77
78
|
|
|
78
79
|
def navigation() -> list[Command]:
|
|
79
80
|
return [Ls(), PreviewTable(), DeviceApp(), DevicePostgres(), DeviceCass(), Cd(), Pwd(), ClipboardCopy(),
|
|
80
|
-
GetParam(), SetParam(), ShowParams(), ShowKubectlCommands(), ShowLogin(), ShowAdam()]
|
|
81
|
+
GetParam(), SetParam(), ShowParams(), ShowKubectlCommands(), ShowLogin(), ShowAdam(), ShowHost()]
|
|
81
82
|
|
|
82
83
|
def cassandra_check() -> list[Command]:
|
|
83
84
|
return Describe.cmd_list() + [ShowCassandraStatus(),
|
adam/utils_net.py
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import socket
|
|
2
|
+
|
|
3
|
+
MY_HOST = None
|
|
4
|
+
|
|
5
|
+
def get_my_host():
|
|
6
|
+
global MY_HOST
|
|
7
|
+
|
|
8
|
+
if MY_HOST:
|
|
9
|
+
return MY_HOST
|
|
10
|
+
|
|
11
|
+
MY_HOST = get_ip_from_hostname('host.docker.internal')
|
|
12
|
+
if not MY_HOST:
|
|
13
|
+
MY_HOST = socket.gethostname()
|
|
14
|
+
|
|
15
|
+
if not MY_HOST:
|
|
16
|
+
MY_HOST = 'NA'
|
|
17
|
+
|
|
18
|
+
return MY_HOST
|
|
19
|
+
|
|
20
|
+
def get_ip_from_hostname(hostname):
|
|
21
|
+
try:
|
|
22
|
+
return socket.gethostbyname(hostname)
|
|
23
|
+
except socket.gaierror:
|
|
24
|
+
return None
|
adam/version.py
CHANGED
|
@@ -9,12 +9,13 @@ adam/embedded_apps.py,sha256=lKPx63mKzJbNmwz0rgL4gF76M9fDGxraYTtNAIGnZ_s,419
|
|
|
9
9
|
adam/embedded_params.py,sha256=ajRQgWmPbomay3GnncDby_qV0GezKOUaDVcuMMuE7Xc,4701
|
|
10
10
|
adam/log.py,sha256=gg5DK52wLPc9cjykeh0WFHyAk1qI3HEpGaAK8W2dzXY,1146
|
|
11
11
|
adam/pod_exec_result.py,sha256=nq0xnCNOpUGBSijGF0H-YNrwBc9vUQs4DkvLMIFS5LQ,951
|
|
12
|
-
adam/repl.py,sha256=
|
|
13
|
-
adam/repl_commands.py,sha256=
|
|
12
|
+
adam/repl.py,sha256=FEFrCD7Z4jZ76Q5d2EiJ8KrC8_ZXF-CrL3arndLnc74,8792
|
|
13
|
+
adam/repl_commands.py,sha256=NtV4F4aCAw1CkKjPfMDbatsdJQq-bJcc0iUkYBYQ-c8,4785
|
|
14
14
|
adam/repl_session.py,sha256=uIogcvWBh7wd8QQ-p_JgLsyJ8YJgINw5vOd6JIsd7Vo,472
|
|
15
15
|
adam/repl_state.py,sha256=nZO5CucSIGz68f4JreadGphRzMXPUzkTn-4XcoJJOug,8643
|
|
16
16
|
adam/utils.py,sha256=sbsNZP3qGJtb6fXCa4dDXHry5ay9ev583cCZIQzy07s,7382
|
|
17
|
-
adam/
|
|
17
|
+
adam/utils_net.py,sha256=65fhBnWMCkhGtyHqz95qcHaCo35q-WX1RBkkXG8dKpI,416
|
|
18
|
+
adam/version.py,sha256=RbV0DuU5awpyFbG3SCKNHZ4zyNytZ1jsHzLViKPTdsg,139
|
|
18
19
|
adam/checks/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
19
20
|
adam/checks/check.py,sha256=Qopr3huYcMu2bzQgb99dEUYjFzkjKHRI76S6KA9b9Rk,702
|
|
20
21
|
adam/checks/check_context.py,sha256=FEHkQ32jY1EDopQ2uYWqy9v7aEEX1orLpJWhopwAlh4,402
|
|
@@ -135,7 +136,7 @@ adam/commands/repair/repair_run.py,sha256=C9F86ia46rBCwkP8BFM5nw-AJ05jm4Bx9wnMny
|
|
|
135
136
|
adam/commands/repair/repair_scan.py,sha256=m6PErrbuQgryCMm_2pbGAwQdKNQvXLahcHXFfNKoU-s,2439
|
|
136
137
|
adam/commands/repair/repair_stop.py,sha256=on3jHmOwtWOL7SJlFd8ryBflzqDsxwJNwtAbhDjYUNc,1193
|
|
137
138
|
adam/commands/show/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
138
|
-
adam/commands/show/show.py,sha256=
|
|
139
|
+
adam/commands/show/show.py,sha256=JQn1j9XQ8xZVl_TtI_qFzYBcsUZd3JMNrPgKx5XKUqU,2043
|
|
139
140
|
adam/commands/show/show_adam.py,sha256=osuafMipN2My4O7bLdukBLsDHtTKguDfTagmgz7aZvw,1314
|
|
140
141
|
adam/commands/show/show_app_actions.py,sha256=3knASTOIecvdLEJusbsGEGXVxeCpqHozbnFAEq_2pqY,1925
|
|
141
142
|
adam/commands/show/show_app_id.py,sha256=-2hxOUv_Rm_j6d6PWVcHW-w-_alfGrOB4chmVQS48Bs,1384
|
|
@@ -143,6 +144,7 @@ adam/commands/show/show_app_queues.py,sha256=GvVbyFbdFegHQFTHhn-fl0NaxHgJqPc44fc
|
|
|
143
144
|
adam/commands/show/show_cassandra_status.py,sha256=cIHHvbAPZAUcMJGsQnUSGvlSspSjlPgdligWTsAQZVU,5157
|
|
144
145
|
adam/commands/show/show_cassandra_version.py,sha256=R22f8zIk_WvvrDP4DkPcqlTx1MVboeyQHDvv1dScUcc,1633
|
|
145
146
|
adam/commands/show/show_commands.py,sha256=ivjY3u3Ph969zOh0dYi0KjAfm7ClUGdQpkJLJAvpeUc,1893
|
|
147
|
+
adam/commands/show/show_host.py,sha256=nJZdk3guvHNZqoy5QDW9xff9bmqPgYVVpteXBp9RE8U,877
|
|
146
148
|
adam/commands/show/show_login.py,sha256=-sF93qA9LmRNWehz1pEXdhxWvHrWAD_ZDalqQsXJhyQ,1868
|
|
147
149
|
adam/commands/show/show_params.py,sha256=LoBj_ScmtsPrXSUH59p3IYAlmL-0Q_Gb01bp_7zrwQA,1008
|
|
148
150
|
adam/commands/show/show_processes.py,sha256=jAesWDD_l0T6ql6LawnGpev-Glz21tFkegtCbYDCTdc,1770
|
|
@@ -177,8 +179,8 @@ adam/sso/idp.py,sha256=fvcwUw_URTgsO6ySaqTIw0zQT2qRO1IPSGhf6rPtybo,5804
|
|
|
177
179
|
adam/sso/idp_login.py,sha256=QAtCUeDTVWliJy40RK_oac8Vgybr13xH8wzeBoxPaa8,1754
|
|
178
180
|
adam/sso/idp_session.py,sha256=9BUHNRf70u4rVKrVY1HKPOEmOviXvkjam8WJxmXSKIM,1735
|
|
179
181
|
adam/sso/sso_config.py,sha256=5N8WZgIJQBtHUy585XLRWKjpU87_v6QluyNK9E27D5s,2459
|
|
180
|
-
kaqing-2.0.
|
|
181
|
-
kaqing-2.0.
|
|
182
|
-
kaqing-2.0.
|
|
183
|
-
kaqing-2.0.
|
|
184
|
-
kaqing-2.0.
|
|
182
|
+
kaqing-2.0.79.dist-info/METADATA,sha256=GzuIGrzuuHyxAEeVo1pCKRcHnP52ug7O8uyx8SoEDc4,132
|
|
183
|
+
kaqing-2.0.79.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
|
|
184
|
+
kaqing-2.0.79.dist-info/entry_points.txt,sha256=SkzhuQJUWsXOzHeZ5TgQ2c3_g53UGK23zzJU_JTZOZI,39
|
|
185
|
+
kaqing-2.0.79.dist-info/top_level.txt,sha256=8_2PZkwBb-xDcnc8a2rAbQeJhXKXskc7zTP7pSPa1fw,5
|
|
186
|
+
kaqing-2.0.79.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|