kaqing 2.0.90__tar.gz → 2.0.91__tar.gz
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.
- {kaqing-2.0.90 → kaqing-2.0.91}/PKG-INFO +1 -1
- kaqing-2.0.91/adam/commands/cat.py +54 -0
- {kaqing-2.0.90 → kaqing-2.0.91}/adam/commands/nodetool.py +12 -5
- {kaqing-2.0.90 → kaqing-2.0.91}/adam/embedded_params.py +1 -1
- {kaqing-2.0.90 → kaqing-2.0.91}/adam/k8s_utils/pods.py +4 -2
- {kaqing-2.0.90 → kaqing-2.0.91}/adam/pod_exec_result.py +3 -1
- {kaqing-2.0.90 → kaqing-2.0.91}/adam/repl_commands.py +2 -1
- kaqing-2.0.91/adam/version.py +5 -0
- {kaqing-2.0.90 → kaqing-2.0.91}/kaqing.egg-info/PKG-INFO +1 -1
- {kaqing-2.0.90 → kaqing-2.0.91}/kaqing.egg-info/SOURCES.txt +1 -0
- {kaqing-2.0.90 → kaqing-2.0.91}/setup.py +1 -1
- kaqing-2.0.90/adam/version.py +0 -5
- {kaqing-2.0.90 → kaqing-2.0.91}/README +0 -0
- {kaqing-2.0.90 → kaqing-2.0.91}/adam/__init__.py +0 -0
- {kaqing-2.0.90 → kaqing-2.0.91}/adam/app_session.py +0 -0
- {kaqing-2.0.90 → kaqing-2.0.91}/adam/apps.py +0 -0
- {kaqing-2.0.90 → kaqing-2.0.91}/adam/batch.py +0 -0
- {kaqing-2.0.90 → kaqing-2.0.91}/adam/checks/__init__.py +0 -0
- {kaqing-2.0.90 → kaqing-2.0.91}/adam/checks/check.py +0 -0
- {kaqing-2.0.90 → kaqing-2.0.91}/adam/checks/check_context.py +0 -0
- {kaqing-2.0.90 → kaqing-2.0.91}/adam/checks/check_result.py +0 -0
- {kaqing-2.0.90 → kaqing-2.0.91}/adam/checks/check_utils.py +0 -0
- {kaqing-2.0.90 → kaqing-2.0.91}/adam/checks/compactionstats.py +0 -0
- {kaqing-2.0.90 → kaqing-2.0.91}/adam/checks/cpu.py +0 -0
- {kaqing-2.0.90 → kaqing-2.0.91}/adam/checks/disk.py +0 -0
- {kaqing-2.0.90 → kaqing-2.0.91}/adam/checks/gossip.py +0 -0
- {kaqing-2.0.90 → kaqing-2.0.91}/adam/checks/issue.py +0 -0
- {kaqing-2.0.90 → kaqing-2.0.91}/adam/checks/memory.py +0 -0
- {kaqing-2.0.90 → kaqing-2.0.91}/adam/checks/status.py +0 -0
- {kaqing-2.0.90 → kaqing-2.0.91}/adam/cli.py +0 -0
- {kaqing-2.0.90 → kaqing-2.0.91}/adam/cli_group.py +0 -0
- {kaqing-2.0.90 → kaqing-2.0.91}/adam/columns/__init__.py +0 -0
- {kaqing-2.0.90 → kaqing-2.0.91}/adam/columns/column.py +0 -0
- {kaqing-2.0.90 → kaqing-2.0.91}/adam/columns/columns.py +0 -0
- {kaqing-2.0.90 → kaqing-2.0.91}/adam/columns/compactions.py +0 -0
- {kaqing-2.0.90 → kaqing-2.0.91}/adam/columns/cpu.py +0 -0
- {kaqing-2.0.90 → kaqing-2.0.91}/adam/columns/dir_data.py +0 -0
- {kaqing-2.0.90 → kaqing-2.0.91}/adam/columns/dir_snapshots.py +0 -0
- {kaqing-2.0.90 → kaqing-2.0.91}/adam/columns/gossip.py +0 -0
- {kaqing-2.0.90 → kaqing-2.0.91}/adam/columns/host_id.py +0 -0
- {kaqing-2.0.90 → kaqing-2.0.91}/adam/columns/memory.py +0 -0
- {kaqing-2.0.90 → kaqing-2.0.91}/adam/columns/node_address.py +0 -0
- {kaqing-2.0.90 → kaqing-2.0.91}/adam/columns/node_load.py +0 -0
- {kaqing-2.0.90 → kaqing-2.0.91}/adam/columns/node_owns.py +0 -0
- {kaqing-2.0.90 → kaqing-2.0.91}/adam/columns/node_status.py +0 -0
- {kaqing-2.0.90 → kaqing-2.0.91}/adam/columns/node_tokens.py +0 -0
- {kaqing-2.0.90 → kaqing-2.0.91}/adam/columns/node_utils.py +0 -0
- {kaqing-2.0.90 → kaqing-2.0.91}/adam/columns/pod_name.py +0 -0
- {kaqing-2.0.90 → kaqing-2.0.91}/adam/columns/volume_cassandra.py +0 -0
- {kaqing-2.0.90 → kaqing-2.0.91}/adam/columns/volume_root.py +0 -0
- {kaqing-2.0.90 → kaqing-2.0.91}/adam/commands/__init__.py +0 -0
- {kaqing-2.0.90 → kaqing-2.0.91}/adam/commands/alter_tables.py +0 -0
- {kaqing-2.0.90 → kaqing-2.0.91}/adam/commands/app.py +0 -0
- {kaqing-2.0.90 → kaqing-2.0.91}/adam/commands/app_ping.py +0 -0
- {kaqing-2.0.90 → kaqing-2.0.91}/adam/commands/audit/__init__.py +0 -0
- {kaqing-2.0.90 → kaqing-2.0.91}/adam/commands/audit/audit.py +0 -0
- {kaqing-2.0.90 → kaqing-2.0.91}/adam/commands/audit/audit_repair_tables.py +0 -0
- {kaqing-2.0.90 → kaqing-2.0.91}/adam/commands/bash.py +0 -0
- {kaqing-2.0.90 → kaqing-2.0.91}/adam/commands/cd.py +0 -0
- {kaqing-2.0.90 → kaqing-2.0.91}/adam/commands/check.py +0 -0
- {kaqing-2.0.90 → kaqing-2.0.91}/adam/commands/cli_commands.py +0 -0
- {kaqing-2.0.90 → kaqing-2.0.91}/adam/commands/command.py +0 -0
- {kaqing-2.0.90 → kaqing-2.0.91}/adam/commands/command_helpers.py +0 -0
- {kaqing-2.0.90 → kaqing-2.0.91}/adam/commands/commands_utils.py +0 -0
- {kaqing-2.0.90 → kaqing-2.0.91}/adam/commands/cp.py +0 -0
- {kaqing-2.0.90 → kaqing-2.0.91}/adam/commands/cql/__init__.py +0 -0
- {kaqing-2.0.90 → kaqing-2.0.91}/adam/commands/cql/cql_completions.py +0 -0
- {kaqing-2.0.90 → kaqing-2.0.91}/adam/commands/cql/cql_table_completer.py +0 -0
- {kaqing-2.0.90 → kaqing-2.0.91}/adam/commands/cql/cql_utils.py +0 -0
- {kaqing-2.0.90 → kaqing-2.0.91}/adam/commands/cql/cqlsh.py +0 -0
- {kaqing-2.0.90 → kaqing-2.0.91}/adam/commands/deploy/__init__.py +0 -0
- {kaqing-2.0.90 → kaqing-2.0.91}/adam/commands/deploy/code_start.py +0 -0
- {kaqing-2.0.90 → kaqing-2.0.91}/adam/commands/deploy/code_stop.py +0 -0
- {kaqing-2.0.90 → kaqing-2.0.91}/adam/commands/deploy/code_utils.py +0 -0
- {kaqing-2.0.90 → kaqing-2.0.91}/adam/commands/deploy/deploy.py +0 -0
- {kaqing-2.0.90 → kaqing-2.0.91}/adam/commands/deploy/deploy_frontend.py +0 -0
- {kaqing-2.0.90 → kaqing-2.0.91}/adam/commands/deploy/deploy_pg_agent.py +0 -0
- {kaqing-2.0.90 → kaqing-2.0.91}/adam/commands/deploy/deploy_pod.py +0 -0
- {kaqing-2.0.90 → kaqing-2.0.91}/adam/commands/deploy/deploy_utils.py +0 -0
- {kaqing-2.0.90 → kaqing-2.0.91}/adam/commands/deploy/undeploy.py +0 -0
- {kaqing-2.0.90 → kaqing-2.0.91}/adam/commands/deploy/undeploy_frontend.py +0 -0
- {kaqing-2.0.90 → kaqing-2.0.91}/adam/commands/deploy/undeploy_pg_agent.py +0 -0
- {kaqing-2.0.90 → kaqing-2.0.91}/adam/commands/deploy/undeploy_pod.py +0 -0
- {kaqing-2.0.90 → kaqing-2.0.91}/adam/commands/describe/__init__.py +0 -0
- {kaqing-2.0.90 → kaqing-2.0.91}/adam/commands/describe/describe.py +0 -0
- {kaqing-2.0.90 → kaqing-2.0.91}/adam/commands/describe/describe_keyspace.py +0 -0
- {kaqing-2.0.90 → kaqing-2.0.91}/adam/commands/describe/describe_keyspaces.py +0 -0
- {kaqing-2.0.90 → kaqing-2.0.91}/adam/commands/describe/describe_table.py +0 -0
- {kaqing-2.0.90 → kaqing-2.0.91}/adam/commands/describe/describe_tables.py +0 -0
- {kaqing-2.0.90 → kaqing-2.0.91}/adam/commands/devices.py +0 -0
- {kaqing-2.0.90 → kaqing-2.0.91}/adam/commands/exit.py +0 -0
- {kaqing-2.0.90 → kaqing-2.0.91}/adam/commands/help.py +0 -0
- {kaqing-2.0.90 → kaqing-2.0.91}/adam/commands/issues.py +0 -0
- {kaqing-2.0.90 → kaqing-2.0.91}/adam/commands/login.py +0 -0
- {kaqing-2.0.90 → kaqing-2.0.91}/adam/commands/logs.py +0 -0
- {kaqing-2.0.90 → kaqing-2.0.91}/adam/commands/ls.py +0 -0
- {kaqing-2.0.90 → kaqing-2.0.91}/adam/commands/medusa/__init__.py +0 -0
- {kaqing-2.0.90 → kaqing-2.0.91}/adam/commands/medusa/medusa.py +0 -0
- {kaqing-2.0.90 → kaqing-2.0.91}/adam/commands/medusa/medusa_backup.py +0 -0
- {kaqing-2.0.90 → kaqing-2.0.91}/adam/commands/medusa/medusa_restore.py +0 -0
- {kaqing-2.0.90 → kaqing-2.0.91}/adam/commands/medusa/medusa_show_backupjobs.py +0 -0
- {kaqing-2.0.90 → kaqing-2.0.91}/adam/commands/medusa/medusa_show_restorejobs.py +0 -0
- {kaqing-2.0.90 → kaqing-2.0.91}/adam/commands/nodetool_commands.py +0 -0
- {kaqing-2.0.90 → kaqing-2.0.91}/adam/commands/param_get.py +0 -0
- {kaqing-2.0.90 → kaqing-2.0.91}/adam/commands/param_set.py +0 -0
- {kaqing-2.0.90 → kaqing-2.0.91}/adam/commands/postgres/__init__.py +0 -0
- {kaqing-2.0.90 → kaqing-2.0.91}/adam/commands/postgres/postgres.py +0 -0
- {kaqing-2.0.90 → kaqing-2.0.91}/adam/commands/postgres/postgres_ls.py +0 -0
- {kaqing-2.0.90 → kaqing-2.0.91}/adam/commands/postgres/postgres_preview.py +0 -0
- {kaqing-2.0.90 → kaqing-2.0.91}/adam/commands/postgres/postgres_session.py +0 -0
- {kaqing-2.0.90 → kaqing-2.0.91}/adam/commands/postgres/postgres_utils.py +0 -0
- {kaqing-2.0.90 → kaqing-2.0.91}/adam/commands/postgres/psql_completions.py +0 -0
- {kaqing-2.0.90 → kaqing-2.0.91}/adam/commands/postgres/psql_table_completer.py +0 -0
- {kaqing-2.0.90 → kaqing-2.0.91}/adam/commands/preview_table.py +0 -0
- {kaqing-2.0.90 → kaqing-2.0.91}/adam/commands/pwd.py +0 -0
- {kaqing-2.0.90 → kaqing-2.0.91}/adam/commands/reaper/__init__.py +0 -0
- {kaqing-2.0.90 → kaqing-2.0.91}/adam/commands/reaper/reaper.py +0 -0
- {kaqing-2.0.90 → kaqing-2.0.91}/adam/commands/reaper/reaper_forward.py +0 -0
- {kaqing-2.0.90 → kaqing-2.0.91}/adam/commands/reaper/reaper_forward_stop.py +0 -0
- {kaqing-2.0.90 → kaqing-2.0.91}/adam/commands/reaper/reaper_restart.py +0 -0
- {kaqing-2.0.90 → kaqing-2.0.91}/adam/commands/reaper/reaper_run_abort.py +0 -0
- {kaqing-2.0.90 → kaqing-2.0.91}/adam/commands/reaper/reaper_runs.py +0 -0
- {kaqing-2.0.90 → kaqing-2.0.91}/adam/commands/reaper/reaper_runs_abort.py +0 -0
- {kaqing-2.0.90 → kaqing-2.0.91}/adam/commands/reaper/reaper_schedule_activate.py +0 -0
- {kaqing-2.0.90 → kaqing-2.0.91}/adam/commands/reaper/reaper_schedule_start.py +0 -0
- {kaqing-2.0.90 → kaqing-2.0.91}/adam/commands/reaper/reaper_schedule_stop.py +0 -0
- {kaqing-2.0.90 → kaqing-2.0.91}/adam/commands/reaper/reaper_schedules.py +0 -0
- {kaqing-2.0.90 → kaqing-2.0.91}/adam/commands/reaper/reaper_session.py +0 -0
- {kaqing-2.0.90 → kaqing-2.0.91}/adam/commands/reaper/reaper_status.py +0 -0
- {kaqing-2.0.90 → kaqing-2.0.91}/adam/commands/repair/__init__.py +0 -0
- {kaqing-2.0.90 → kaqing-2.0.91}/adam/commands/repair/repair.py +0 -0
- {kaqing-2.0.90 → kaqing-2.0.91}/adam/commands/repair/repair_log.py +0 -0
- {kaqing-2.0.90 → kaqing-2.0.91}/adam/commands/repair/repair_run.py +0 -0
- {kaqing-2.0.90 → kaqing-2.0.91}/adam/commands/repair/repair_scan.py +0 -0
- {kaqing-2.0.90 → kaqing-2.0.91}/adam/commands/repair/repair_stop.py +0 -0
- {kaqing-2.0.90 → kaqing-2.0.91}/adam/commands/report.py +0 -0
- {kaqing-2.0.90 → kaqing-2.0.91}/adam/commands/restart.py +0 -0
- {kaqing-2.0.90 → kaqing-2.0.91}/adam/commands/rollout.py +0 -0
- {kaqing-2.0.90 → kaqing-2.0.91}/adam/commands/shell.py +0 -0
- {kaqing-2.0.90 → kaqing-2.0.91}/adam/commands/show/__init__.py +0 -0
- {kaqing-2.0.90 → kaqing-2.0.91}/adam/commands/show/show.py +0 -0
- {kaqing-2.0.90 → kaqing-2.0.91}/adam/commands/show/show_adam.py +0 -0
- {kaqing-2.0.90 → kaqing-2.0.91}/adam/commands/show/show_app_actions.py +0 -0
- {kaqing-2.0.90 → kaqing-2.0.91}/adam/commands/show/show_app_id.py +0 -0
- {kaqing-2.0.90 → kaqing-2.0.91}/adam/commands/show/show_app_queues.py +0 -0
- {kaqing-2.0.90 → kaqing-2.0.91}/adam/commands/show/show_cassandra_status.py +0 -0
- {kaqing-2.0.90 → kaqing-2.0.91}/adam/commands/show/show_cassandra_version.py +0 -0
- {kaqing-2.0.90 → kaqing-2.0.91}/adam/commands/show/show_commands.py +0 -0
- {kaqing-2.0.90 → kaqing-2.0.91}/adam/commands/show/show_host.py +0 -0
- {kaqing-2.0.90 → kaqing-2.0.91}/adam/commands/show/show_login.py +0 -0
- {kaqing-2.0.90 → kaqing-2.0.91}/adam/commands/show/show_params.py +0 -0
- {kaqing-2.0.90 → kaqing-2.0.91}/adam/commands/show/show_processes.py +0 -0
- {kaqing-2.0.90 → kaqing-2.0.91}/adam/commands/show/show_repairs.py +0 -0
- {kaqing-2.0.90 → kaqing-2.0.91}/adam/commands/show/show_storage.py +0 -0
- {kaqing-2.0.90 → kaqing-2.0.91}/adam/commands/watch.py +0 -0
- {kaqing-2.0.90 → kaqing-2.0.91}/adam/config.py +0 -0
- {kaqing-2.0.90 → kaqing-2.0.91}/adam/embedded_apps.py +0 -0
- {kaqing-2.0.90 → kaqing-2.0.91}/adam/k8s_utils/__init__.py +0 -0
- {kaqing-2.0.90 → kaqing-2.0.91}/adam/k8s_utils/cassandra_clusters.py +0 -0
- {kaqing-2.0.90 → kaqing-2.0.91}/adam/k8s_utils/cassandra_nodes.py +0 -0
- {kaqing-2.0.90 → kaqing-2.0.91}/adam/k8s_utils/config_maps.py +0 -0
- {kaqing-2.0.90 → kaqing-2.0.91}/adam/k8s_utils/custom_resources.py +0 -0
- {kaqing-2.0.90 → kaqing-2.0.91}/adam/k8s_utils/deployment.py +0 -0
- {kaqing-2.0.90 → kaqing-2.0.91}/adam/k8s_utils/ingresses.py +0 -0
- {kaqing-2.0.90 → kaqing-2.0.91}/adam/k8s_utils/jobs.py +0 -0
- {kaqing-2.0.90 → kaqing-2.0.91}/adam/k8s_utils/kube_context.py +0 -0
- {kaqing-2.0.90 → kaqing-2.0.91}/adam/k8s_utils/secrets.py +0 -0
- {kaqing-2.0.90 → kaqing-2.0.91}/adam/k8s_utils/service_accounts.py +0 -0
- {kaqing-2.0.90 → kaqing-2.0.91}/adam/k8s_utils/services.py +0 -0
- {kaqing-2.0.90 → kaqing-2.0.91}/adam/k8s_utils/statefulsets.py +0 -0
- {kaqing-2.0.90 → kaqing-2.0.91}/adam/k8s_utils/volumes.py +0 -0
- {kaqing-2.0.90 → kaqing-2.0.91}/adam/log.py +0 -0
- {kaqing-2.0.90 → kaqing-2.0.91}/adam/repl.py +0 -0
- {kaqing-2.0.90 → kaqing-2.0.91}/adam/repl_session.py +0 -0
- {kaqing-2.0.90 → kaqing-2.0.91}/adam/repl_state.py +0 -0
- {kaqing-2.0.90 → kaqing-2.0.91}/adam/sql/__init__.py +0 -0
- {kaqing-2.0.90 → kaqing-2.0.91}/adam/sql/sql_completer.py +0 -0
- {kaqing-2.0.90 → kaqing-2.0.91}/adam/sql/state_machine.py +0 -0
- {kaqing-2.0.90 → kaqing-2.0.91}/adam/sql/term_completer.py +0 -0
- {kaqing-2.0.90 → kaqing-2.0.91}/adam/sso/__init__.py +0 -0
- {kaqing-2.0.90 → kaqing-2.0.91}/adam/sso/authenticator.py +0 -0
- {kaqing-2.0.90 → kaqing-2.0.91}/adam/sso/authn_ad.py +0 -0
- {kaqing-2.0.90 → kaqing-2.0.91}/adam/sso/authn_okta.py +0 -0
- {kaqing-2.0.90 → kaqing-2.0.91}/adam/sso/cred_cache.py +0 -0
- {kaqing-2.0.90 → kaqing-2.0.91}/adam/sso/id_token.py +0 -0
- {kaqing-2.0.90 → kaqing-2.0.91}/adam/sso/idp.py +0 -0
- {kaqing-2.0.90 → kaqing-2.0.91}/adam/sso/idp_login.py +0 -0
- {kaqing-2.0.90 → kaqing-2.0.91}/adam/sso/idp_session.py +0 -0
- {kaqing-2.0.90 → kaqing-2.0.91}/adam/sso/sso_config.py +0 -0
- {kaqing-2.0.90 → kaqing-2.0.91}/adam/utils.py +0 -0
- {kaqing-2.0.90 → kaqing-2.0.91}/adam/utils_athena.py +0 -0
- {kaqing-2.0.90 → kaqing-2.0.91}/adam/utils_net.py +0 -0
- {kaqing-2.0.90 → kaqing-2.0.91}/kaqing.egg-info/dependency_links.txt +0 -0
- {kaqing-2.0.90 → kaqing-2.0.91}/kaqing.egg-info/entry_points.txt +0 -0
- {kaqing-2.0.90 → kaqing-2.0.91}/kaqing.egg-info/top_level.txt +0 -0
- {kaqing-2.0.90 → kaqing-2.0.91}/setup.cfg +0 -0
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
from adam.commands.command import Command
|
|
2
|
+
from adam.k8s_utils.cassandra_nodes import CassandraNodes
|
|
3
|
+
from adam.repl_state import ReplState, RequiredState
|
|
4
|
+
from adam.utils import log2
|
|
5
|
+
|
|
6
|
+
class Cat(Command):
|
|
7
|
+
COMMAND = 'cat'
|
|
8
|
+
|
|
9
|
+
# the singleton pattern
|
|
10
|
+
def __new__(cls, *args, **kwargs):
|
|
11
|
+
if not hasattr(cls, 'instance'): cls.instance = super(Cat, 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 Cat.COMMAND
|
|
20
|
+
|
|
21
|
+
def required(self):
|
|
22
|
+
return RequiredState.NAMESPACE
|
|
23
|
+
|
|
24
|
+
def run(self, cmd: str, state: ReplState):
|
|
25
|
+
if not(args := self.args(cmd)):
|
|
26
|
+
return super().run(cmd, state)
|
|
27
|
+
|
|
28
|
+
state, args = self.apply_state(args, state)
|
|
29
|
+
if not self.validate_state(state):
|
|
30
|
+
return state
|
|
31
|
+
|
|
32
|
+
if len(args) < 1:
|
|
33
|
+
if state.in_repl:
|
|
34
|
+
log2('File name is required.')
|
|
35
|
+
else:
|
|
36
|
+
log2('* File name is missing.')
|
|
37
|
+
Command.display_help()
|
|
38
|
+
|
|
39
|
+
return 'command-missing'
|
|
40
|
+
|
|
41
|
+
arg = args[0]
|
|
42
|
+
if '@' in arg:
|
|
43
|
+
path_and_pod = arg.split('@')
|
|
44
|
+
CassandraNodes.exec(path_and_pod[1], state.namespace, f'cat {path_and_pod[0]}')
|
|
45
|
+
else:
|
|
46
|
+
CassandraNodes.exec(state.pod, state.namespace, f'cat {arg}')
|
|
47
|
+
|
|
48
|
+
return state
|
|
49
|
+
|
|
50
|
+
def completion(self, state: ReplState):
|
|
51
|
+
return super().completion(state)
|
|
52
|
+
|
|
53
|
+
def help(self, _: ReplState):
|
|
54
|
+
return f'{Cat.COMMAND} <path>[@<pod>] \t print content of the file'
|
|
@@ -6,6 +6,8 @@ from adam.commands.nodetool_commands import NODETOOL_COMMANDS
|
|
|
6
6
|
from adam.config import Config
|
|
7
7
|
from adam.k8s_utils.cassandra_clusters import CassandraClusters
|
|
8
8
|
from adam.k8s_utils.cassandra_nodes import CassandraNodes
|
|
9
|
+
from adam.pod_exec_result import PodExecResult
|
|
10
|
+
from adam.repl_session import ReplSession
|
|
9
11
|
from adam.repl_state import ReplState, RequiredState
|
|
10
12
|
from adam.utils import log, random_alphanumeric
|
|
11
13
|
|
|
@@ -36,15 +38,20 @@ class NodeTool(Command):
|
|
|
36
38
|
return state
|
|
37
39
|
|
|
38
40
|
user, pw = state.user_pass()
|
|
39
|
-
# if args and args[len(args) - 1] == '&':
|
|
40
|
-
# command = f'bash -c "nohup nodetool -u {user} -pw {pw} {" ".join(args[:-1])} &> /tmp/qing-{random_alphanumeric(6)}.log &"'
|
|
41
|
-
# else:
|
|
42
41
|
command = f"nodetool -u {user} -pw {pw} {' '.join(args)}"
|
|
43
42
|
|
|
44
43
|
if state.pod:
|
|
45
|
-
|
|
44
|
+
results: PodExecResult = CassandraNodes.exec(state.pod, state.namespace, command, show_out=True)
|
|
45
|
+
if results and results.log_file and Config().get('repl.history.push-cat-remote-log-file', True):
|
|
46
|
+
ReplSession().prompt_session.history.append_string(f'cat {results.log_file}')
|
|
46
47
|
elif state.sts:
|
|
47
|
-
|
|
48
|
+
results: list[PodExecResult] = CassandraClusters.exec(state.sts, state.namespace, command, action='nodetool', show_out=True)
|
|
49
|
+
if results and Config().get('repl.history.push-cat-remote-log-file', True):
|
|
50
|
+
for result in results:
|
|
51
|
+
if result.log_file:
|
|
52
|
+
ReplSession().prompt_session.history.append_string(f'cat {result.log_file}@{result.pod}')
|
|
53
|
+
|
|
54
|
+
return results
|
|
48
55
|
|
|
49
56
|
def completion(self, state: ReplState):
|
|
50
57
|
if state.pod or state.sts:
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
def config():
|
|
2
|
-
return {'app': {'console-endpoint': 'https://{host}/{env}/{app}/static/console/index.html', 'cr': {'cluster-regex': '(.*?-.*?)-.*', 'group': 'ops.c3.ai', 'v': 'v2', 'plural': 'c3cassandras'}, 'label': 'c3__app_id-0', 'login': {'admin-group': '{host}/C3.ClusterAdmin', 'ingress': '{app_id}-k8singr-appleader-001', 'timeout': 5, 'session-check-url': 'https://{host}/{env}/{app}/api/8/C3/userSessionToken', 'cache-creds': True, 'cache-username': True, 'url': 'https://{host}/{env}/{app}', 'another': "You're logged in to {has}. However, for this app, you need to log in to {need}.", 'token-server-url': 'http://localhost:{port}', 'password-max-length': 128}, 'strip': '0'}, 'audit': {'endpoint': 'https://4psvtaxlcb.execute-api.us-west-2.amazonaws.com/prod/', 'workers': 3, 'timeout': 10, 'log-audit-queries': False, 'athena': {'region': 'us-west-2', 'catalog': 'AwsDataCatalog', 'database': 'audit', 'tables': 'audit', 'output': 's3://s3.ops--audit/ddl/results'}}, 'bash': {'workers': 32}, 'cassandra': {'service-name': 'all-pods-service'}, 'cql': {'workers': 32, 'samples': 3, 'secret': {'cluster-regex': '(.*?-.*?)-.*', 'name': '{cluster}-superuser', 'password-item': 'password'}, 'alter-tables': {'excludes': 'system_auth,system_traces,reaper_db,system_distributed,system_views,system,system_schema,system_virtual_schema', 'gc-grace-periods': '3600,86400,864000,7776000', 'batching': True}}, 'checks': {'compactions-threshold': 250, 'cpu-busy-threshold': 98.0, 'cpu-threshold': 0.0, 'cassandra-data-path': '/c3/cassandra', 'root-disk-threshold': 50, 'cassandra-disk-threshold': 50, 'snapshot-size-cmd': "ls /c3/cassandra/data/data/*/*/snapshots | grep snapshots | sed 's/:$//g' | xargs -I {} du -sk {} | awk '{print $1}' | awk '{s+=$1} END {print s}'", 'snapshot-size-threshold': '40G', 'table-sizes-cmd': "ls -Al /c3/cassandra/data/data/ | awk '{print $9}' | sed 's/\\^r//g' | xargs -I {} du -sk /c3/cassandra/data/data/{}"}, 'get-host-id': {'workers': 32}, 'idps': {'ad': {'email-pattern': '.*@c3.ai', 'uri': 'https://login.microsoftonline.com/53ad779a-93e7-485c-ba20-ac8290d7252b/oauth2/v2.0/authorize?response_type=id_token&response_mode=form_post&client_id=00ff94a8-6b0a-4715-98e0-95490012d818&scope=openid+email+profile&redirect_uri=https%3A%2F%2Fplat.c3ci.cloud%2Fc3%2Fc3%2Foidc%2Flogin&nonce={nonce}&state=EMPTY', 'jwks-uri': 'https://login.microsoftonline.com/common/discovery/keys', 'contact': 'Please contact ted.tran@c3.ai.', 'whitelist-file': '/kaqing/members'}, 'okta': {'default': True, 'email-pattern': '.*@c3iot.com', 'uri': 'https://c3energy.okta.com/oauth2/v1/authorize?response_type=id_token&response_mode=form_post&client_id={client_id}&scope=openid+email+profile+groups&redirect_uri=https%3A%2F%2F{host}%2Fc3%2Fc3%2Foidc%2Flogin&nonce={nonce}&state=EMPTY', 'jwks-uri': 'https://c3energy.okta.com/oauth2/v1/keys'}}, 'issues': {'workers': 32}, 'logs': {'path': '/c3/cassandra/logs/system.log'}, 'medusa': {'restore-auto-complete': False}, 'nodetool': {'workers': 32, 'samples': 3, 'commands_in_line': 40}, 'pg': {'name-pattern': '^{namespace}.*-k8spg-.*', 'excludes': '.helm., -admin-secret', 'agent': {'name': 'ops-pg-agent', 'just-in-time': False, 'timeout': 86400, 'image': 'seanahnsf/kaqing'}, 'default-db': 'postgres', 'default-schema': 'postgres', 'secret': {'endpoint-key': 'postgres-db-endpoint', 'port-key': 'postgres-db-port', 'username-key': 'postgres-admin-username', 'password-key': 'postgres-admin-password'}}, 'pod': {'name': 'ops', 'image': 'seanahnsf/kaqing-cloud', 'sa': {'name': 'ops', 'proto': 'c3', 'additional-cluster-roles': 'c3aiops-k8ssandra-operator'}, 'label-selector': 'run=ops'}, 'preview': {'rows': 10}, 'processes': {'columns': 'pod,cpu,mem', 'header': 'POD_NAME,CPU,MEM/LIMIT'}, 'reaper': {'service-name': 'reaper-service', 'port-forward': {'timeout': 86400, 'local-port': 9001}, 'abort-runs-batch': 10, 'show-runs-batch': 100, 'pod': {'cluster-regex': '(.*?-.*?-.*?-.*?)-.*', 'label-selector': 'k8ssandra.io/reaper={cluster}-reaper'}, 'secret': {'cluster-regex': '(.*?-.*?)-.*', 'name': '{cluster}-reaper-ui', 'password-item': 'password'}}, 'repair': {'log-path': '/home/cassrepair/logs/', 'image': 'ci-registry.c3iot.io/cloudops/cassrepair:2.0.14', 'secret': 'ciregistryc3iotio', 'env': {'interval': 24, 'timeout': 60, 'pr': False, 'runs': 1}}, 'repl': {'start-drive': 'a', 'auto-enter-app': 'c3/c3', 'auto-enter-only-cluster': 'cluster'}, 'status': {'columns': 'status,address,load,tokens,owns,host_id,gossip,compactions', 'header': '--,Address,Load,Tokens,Owns,Host ID,GOSSIP,COMPACTIONS'}, 'storage': {'columns': 'pod,volume_root,volume_cassandra,snapshots,data,compactions', 'header': 'POD_NAME,VOLUME /,VOLUME CASS,SNAPSHOTS,DATA,COMPACTIONS'}, 'watch': {'auto': 'rollout', 'timeout': 3600, 'interval': 10}, 'debug': False, 'debugs': {'timings': False, 'exit-on-error': False, 'show-parallelism': False}}
|
|
2
|
+
return {'app': {'console-endpoint': 'https://{host}/{env}/{app}/static/console/index.html', 'cr': {'cluster-regex': '(.*?-.*?)-.*', 'group': 'ops.c3.ai', 'v': 'v2', 'plural': 'c3cassandras'}, 'label': 'c3__app_id-0', 'login': {'admin-group': '{host}/C3.ClusterAdmin', 'ingress': '{app_id}-k8singr-appleader-001', 'timeout': 5, 'session-check-url': 'https://{host}/{env}/{app}/api/8/C3/userSessionToken', 'cache-creds': True, 'cache-username': True, 'url': 'https://{host}/{env}/{app}', 'another': "You're logged in to {has}. However, for this app, you need to log in to {need}.", 'token-server-url': 'http://localhost:{port}', 'password-max-length': 128}, 'strip': '0'}, 'audit': {'endpoint': 'https://4psvtaxlcb.execute-api.us-west-2.amazonaws.com/prod/', 'workers': 3, 'timeout': 10, 'log-audit-queries': False, 'athena': {'region': 'us-west-2', 'catalog': 'AwsDataCatalog', 'database': 'audit', 'tables': 'audit', 'output': 's3://s3.ops--audit/ddl/results'}}, 'bash': {'workers': 32}, 'cassandra': {'service-name': 'all-pods-service'}, 'cql': {'workers': 32, 'samples': 3, 'secret': {'cluster-regex': '(.*?-.*?)-.*', 'name': '{cluster}-superuser', 'password-item': 'password'}, 'alter-tables': {'excludes': 'system_auth,system_traces,reaper_db,system_distributed,system_views,system,system_schema,system_virtual_schema', 'gc-grace-periods': '3600,86400,864000,7776000', 'batching': True}}, 'checks': {'compactions-threshold': 250, 'cpu-busy-threshold': 98.0, 'cpu-threshold': 0.0, 'cassandra-data-path': '/c3/cassandra', 'root-disk-threshold': 50, 'cassandra-disk-threshold': 50, 'snapshot-size-cmd': "ls /c3/cassandra/data/data/*/*/snapshots | grep snapshots | sed 's/:$//g' | xargs -I {} du -sk {} | awk '{print $1}' | awk '{s+=$1} END {print s}'", 'snapshot-size-threshold': '40G', 'table-sizes-cmd': "ls -Al /c3/cassandra/data/data/ | awk '{print $9}' | sed 's/\\^r//g' | xargs -I {} du -sk /c3/cassandra/data/data/{}"}, 'get-host-id': {'workers': 32}, 'idps': {'ad': {'email-pattern': '.*@c3.ai', 'uri': 'https://login.microsoftonline.com/53ad779a-93e7-485c-ba20-ac8290d7252b/oauth2/v2.0/authorize?response_type=id_token&response_mode=form_post&client_id=00ff94a8-6b0a-4715-98e0-95490012d818&scope=openid+email+profile&redirect_uri=https%3A%2F%2Fplat.c3ci.cloud%2Fc3%2Fc3%2Foidc%2Flogin&nonce={nonce}&state=EMPTY', 'jwks-uri': 'https://login.microsoftonline.com/common/discovery/keys', 'contact': 'Please contact ted.tran@c3.ai.', 'whitelist-file': '/kaqing/members'}, 'okta': {'default': True, 'email-pattern': '.*@c3iot.com', 'uri': 'https://c3energy.okta.com/oauth2/v1/authorize?response_type=id_token&response_mode=form_post&client_id={client_id}&scope=openid+email+profile+groups&redirect_uri=https%3A%2F%2F{host}%2Fc3%2Fc3%2Foidc%2Flogin&nonce={nonce}&state=EMPTY', 'jwks-uri': 'https://c3energy.okta.com/oauth2/v1/keys'}}, 'issues': {'workers': 32}, 'logs': {'path': '/c3/cassandra/logs/system.log'}, 'medusa': {'restore-auto-complete': False}, 'nodetool': {'workers': 32, 'samples': 3, 'commands_in_line': 40}, 'pg': {'name-pattern': '^{namespace}.*-k8spg-.*', 'excludes': '.helm., -admin-secret', 'agent': {'name': 'ops-pg-agent', 'just-in-time': False, 'timeout': 86400, 'image': 'seanahnsf/kaqing'}, 'default-db': 'postgres', 'default-schema': 'postgres', 'secret': {'endpoint-key': 'postgres-db-endpoint', 'port-key': 'postgres-db-port', 'username-key': 'postgres-admin-username', 'password-key': 'postgres-admin-password'}}, 'pod': {'name': 'ops', 'image': 'seanahnsf/kaqing-cloud', 'sa': {'name': 'ops', 'proto': 'c3', 'additional-cluster-roles': 'c3aiops-k8ssandra-operator'}, 'label-selector': 'run=ops'}, 'preview': {'rows': 10}, 'processes': {'columns': 'pod,cpu,mem', 'header': 'POD_NAME,CPU,MEM/LIMIT'}, 'reaper': {'service-name': 'reaper-service', 'port-forward': {'timeout': 86400, 'local-port': 9001}, 'abort-runs-batch': 10, 'show-runs-batch': 100, 'pod': {'cluster-regex': '(.*?-.*?-.*?-.*?)-.*', 'label-selector': 'k8ssandra.io/reaper={cluster}-reaper'}, 'secret': {'cluster-regex': '(.*?-.*?)-.*', 'name': '{cluster}-reaper-ui', 'password-item': 'password'}}, 'repair': {'log-path': '/home/cassrepair/logs/', 'image': 'ci-registry.c3iot.io/cloudops/cassrepair:2.0.14', 'secret': 'ciregistryc3iotio', 'env': {'interval': 24, 'timeout': 60, 'pr': False, 'runs': 1}}, 'repl': {'start-drive': 'a', 'auto-enter-app': 'c3/c3', 'auto-enter-only-cluster': 'cluster', 'history': {'push-cat-remote-log-file': True}}, 'status': {'columns': 'status,address,load,tokens,owns,host_id,gossip,compactions', 'header': '--,Address,Load,Tokens,Owns,Host ID,GOSSIP,COMPACTIONS'}, 'storage': {'columns': 'pod,volume_root,volume_cassandra,snapshots,data,compactions', 'header': 'POD_NAME,VOLUME /,VOLUME CASS,SNAPSHOTS,DATA,COMPACTIONS'}, 'watch': {'auto': 'rollout', 'timeout': 3600, 'interval': 10}, 'debug': False, 'debugs': {'timings': False, 'exit-on-error': False, 'show-parallelism': False}}
|
|
@@ -101,11 +101,13 @@ class Pods:
|
|
|
101
101
|
show_out = KubeContext.show_out(show_out)
|
|
102
102
|
|
|
103
103
|
api = client.CoreV1Api()
|
|
104
|
+
log_file = None
|
|
104
105
|
|
|
105
106
|
tty = True
|
|
106
107
|
exec_command = [shell, '-c', command]
|
|
107
108
|
if command.endswith(' &'):
|
|
108
|
-
|
|
109
|
+
log_file = f'/tmp/qing-{random_alphanumeric(6)}.log'
|
|
110
|
+
command = f"nohup {command.strip(' &')} > {log_file} 2>&1 &"
|
|
109
111
|
exec_command = [shell, '-c', command]
|
|
110
112
|
# should be false for starting a backgroud process
|
|
111
113
|
tty = False
|
|
@@ -158,7 +160,7 @@ class Pods:
|
|
|
158
160
|
finally:
|
|
159
161
|
resp.close()
|
|
160
162
|
|
|
161
|
-
return PodExecResult("".join(stdout), "".join(stderr), k_command, error_output)
|
|
163
|
+
return PodExecResult("".join(stdout), "".join(stderr), k_command, error_output, pod=pod_name, log_file=log_file)
|
|
162
164
|
|
|
163
165
|
def get_container(namespace: str, pod_name: str, container_name: str):
|
|
164
166
|
pod = Pods.get(namespace, pod_name)
|
|
@@ -15,12 +15,14 @@ class PodExecResult:
|
|
|
15
15
|
# ]
|
|
16
16
|
# }
|
|
17
17
|
# }
|
|
18
|
-
def __init__(self, stdout: str, stderr: str, command: str = None, error_output: str = None):
|
|
18
|
+
def __init__(self, stdout: str, stderr: str, command: str = None, error_output: str = None, pod: str = None, log_file: str = None):
|
|
19
19
|
self.stdout: str = stdout
|
|
20
20
|
self.stderr: str = stderr
|
|
21
21
|
self.command: str = command
|
|
22
22
|
if error_output:
|
|
23
23
|
self.error = yaml.safe_load(error_output)
|
|
24
|
+
self.pod = pod
|
|
25
|
+
self.log_file = log_file
|
|
24
26
|
|
|
25
27
|
def exit_code(self) -> int:
|
|
26
28
|
code = 0
|
|
@@ -3,6 +3,7 @@ from adam.commands.app import App
|
|
|
3
3
|
from adam.commands.app_ping import AppPing
|
|
4
4
|
from adam.commands.audit.audit import Audit
|
|
5
5
|
from adam.commands.audit.audit_repair_tables import AuditRepairTables
|
|
6
|
+
from adam.commands.cat import Cat
|
|
6
7
|
from adam.commands.deploy.code_start import CodeStart
|
|
7
8
|
from adam.commands.deploy.code_stop import CodeStop
|
|
8
9
|
from adam.commands.deploy.deploy import Deploy
|
|
@@ -79,7 +80,7 @@ class ReplCommands:
|
|
|
79
80
|
return deduped
|
|
80
81
|
|
|
81
82
|
def navigation() -> list[Command]:
|
|
82
|
-
return [Ls(), PreviewTable(), DeviceApp(), DevicePostgres(), DeviceCass(), DeviceAuditLog(), Cd(), Pwd(), ClipboardCopy(),
|
|
83
|
+
return [Ls(), PreviewTable(), DeviceApp(), DevicePostgres(), DeviceCass(), DeviceAuditLog(), Cd(), Pwd(), Cat(), ClipboardCopy(),
|
|
83
84
|
GetParam(), SetParam(), ShowParams(), ShowKubectlCommands(), ShowLogin(), ShowAdam(), ShowHost()]
|
|
84
85
|
|
|
85
86
|
def cassandra_check() -> list[Command]:
|
kaqing-2.0.90/adam/version.py
DELETED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|