kaqing 2.0.184__tar.gz → 2.0.193__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.193/MANIFEST.in +1 -0
- {kaqing-2.0.184 → kaqing-2.0.193}/PKG-INFO +1 -1
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/app_session.py +1 -1
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/batch.py +6 -6
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/commands/app/app.py +2 -2
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/commands/app/show_app_actions.py +1 -1
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/commands/app/utils_app.py +8 -0
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/commands/audit/audit.py +6 -20
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/commands/audit/audit_repair_tables.py +1 -1
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/commands/audit/audit_run.py +1 -1
- kaqing-2.0.193/adam/commands/audit/completions_l.py +15 -0
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/commands/audit/show_last10.py +0 -1
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/commands/bash/bash.py +1 -1
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/commands/bash/utils_bash.py +1 -1
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/commands/cat.py +2 -2
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/commands/cd.py +2 -2
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/commands/cli_commands.py +6 -1
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/commands/clipboard_copy.py +2 -1
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/commands/command.py +22 -9
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/commands/commands_utils.py +41 -6
- kaqing-2.0.193/adam/commands/cql/completions_c.py +29 -0
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/commands/cql/cqlsh.py +2 -6
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/commands/cql/utils_cql.py +15 -7
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/commands/devices/device.py +29 -3
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/commands/devices/device_app.py +1 -1
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/commands/devices/device_export.py +5 -2
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/commands/devices/device_postgres.py +13 -3
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/commands/devices/devices.py +1 -1
- kaqing-2.0.193/adam/commands/download_cassandra_log.py +45 -0
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/commands/download_file.py +5 -5
- kaqing-2.0.193/adam/commands/export/completions_x.py +11 -0
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/commands/export/download_export_session.py +2 -1
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/commands/export/export.py +0 -16
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/commands/export/export_databases.py +3 -2
- kaqing-2.0.193/adam/commands/export/export_select.py +34 -0
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/commands/export/export_sessions.py +1 -1
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/commands/export/export_use.py +3 -3
- kaqing-2.0.184/adam/commands/export/export_select.py → kaqing-2.0.193/adam/commands/export/export_x_select.py +12 -23
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/commands/export/import_files.py +2 -2
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/commands/export/import_session.py +2 -2
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/commands/export/importer_athena.py +0 -29
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/commands/export/show_column_counts.py +10 -10
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/commands/export/show_export_databases.py +2 -1
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/commands/export/show_export_session.py +1 -1
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/commands/export/show_export_sessions.py +1 -1
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/commands/export/utils_export.py +1 -0
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/commands/find_processes.py +3 -3
- kaqing-2.0.193/adam/commands/generate_report.py +52 -0
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/commands/head.py +2 -2
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/commands/intermediate_command.py +3 -0
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/commands/ls.py +2 -2
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/commands/medusa/medusa_restore.py +2 -16
- kaqing-2.0.193/adam/commands/medusa/utils_medusa.py +15 -0
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/commands/nodetool.py +2 -7
- kaqing-2.0.193/adam/commands/postgres/completions_p.py +22 -0
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/commands/postgres/postgres.py +7 -14
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/commands/postgres/postgres_databases.py +3 -3
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/commands/postgres/utils_postgres.py +10 -1
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/commands/preview_table.py +1 -1
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/commands/reaper/reaper_schedule_activate.py +6 -2
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/commands/reaper/reaper_schedule_start.py +1 -2
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/commands/reaper/reaper_schedule_stop.py +1 -2
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/commands/reaper/utils_reaper.py +10 -1
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/commands/repair/repair_scan.py +0 -2
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/commands/repair/repair_stop.py +0 -1
- kaqing-2.0.193/adam/commands/restart_cluster.py +47 -0
- kaqing-2.0.193/adam/commands/restart_node.py +51 -0
- kaqing-2.0.193/adam/commands/restart_nodes.py +47 -0
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/commands/show/show.py +1 -1
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/commands/show/show_cassandra_repairs.py +5 -3
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/commands/show/show_cassandra_status.py +29 -15
- kaqing-2.0.184/adam/commands/show/show_commands.py → kaqing-2.0.193/adam/commands/show/show_cli_commands.py +1 -1
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/commands/show/show_params.py +1 -1
- kaqing-2.0.193/adam/commands/show/show_processes.py +50 -0
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/commands/show/show_storage.py +9 -8
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/config.py +1 -0
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/embedded_params.py +1 -1
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/repl.py +17 -9
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/repl_commands.py +13 -10
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/repl_session.py +7 -1
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/repl_state.py +16 -1
- kaqing-2.0.193/adam/sql/async_executor.py +44 -0
- kaqing-2.0.193/adam/sql/lark_completer.py +286 -0
- kaqing-2.0.193/adam/sql/lark_parser.py +604 -0
- kaqing-2.0.193/adam/sql/qingl.lark +1076 -0
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/utils.py +22 -8
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/utils_k8s/app_pods.py +2 -3
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/utils_k8s/cassandra_nodes.py +3 -4
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/utils_k8s/k8s.py +9 -0
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/utils_k8s/pods.py +3 -0
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/utils_k8s/statefulsets.py +5 -2
- kaqing-2.0.193/adam/utils_repl/appendable_completer.py +6 -0
- kaqing-2.0.193/adam/utils_repl/repl_completer.py +89 -0
- kaqing-2.0.193/adam/version.py +5 -0
- {kaqing-2.0.184 → kaqing-2.0.193}/kaqing.egg-info/PKG-INFO +1 -1
- {kaqing-2.0.184 → kaqing-2.0.193}/kaqing.egg-info/SOURCES.txt +22 -8
- kaqing-2.0.193/kaqing.egg-info/top_level.txt +2 -0
- {kaqing-2.0.184 → kaqing-2.0.193}/setup.py +2 -1
- kaqing-2.0.193/teddy/__init__.py +0 -0
- kaqing-2.0.193/teddy/lark_parser.py +436 -0
- kaqing-2.0.193/teddy/lark_parser2.py +618 -0
- kaqing-2.0.184/adam/commands/cql/cql_completions.py +0 -32
- kaqing-2.0.184/adam/commands/export/export_select_x.py +0 -54
- kaqing-2.0.184/adam/commands/logs.py +0 -37
- kaqing-2.0.184/adam/commands/postgres/psql_completions.py +0 -11
- kaqing-2.0.184/adam/commands/report.py +0 -61
- kaqing-2.0.184/adam/commands/restart.py +0 -60
- kaqing-2.0.184/adam/commands/show/show_processes.py +0 -49
- kaqing-2.0.184/adam/utils_repl/repl_completer.py +0 -46
- kaqing-2.0.184/adam/version.py +0 -5
- kaqing-2.0.184/kaqing.egg-info/top_level.txt +0 -1
- {kaqing-2.0.184 → kaqing-2.0.193}/README +0 -0
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/__init__.py +0 -0
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/apps.py +0 -0
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/checks/__init__.py +0 -0
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/checks/check.py +0 -0
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/checks/check_context.py +0 -0
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/checks/check_result.py +0 -0
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/checks/check_utils.py +0 -0
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/checks/compactionstats.py +0 -0
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/checks/cpu.py +0 -0
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/checks/cpu_metrics.py +0 -0
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/checks/disk.py +0 -0
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/checks/gossip.py +0 -0
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/checks/issue.py +0 -0
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/checks/memory.py +0 -0
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/checks/status.py +0 -0
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/cli.py +0 -0
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/cli_group.py +0 -0
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/columns/__init__.py +0 -0
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/columns/column.py +0 -0
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/columns/columns.py +0 -0
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/columns/compactions.py +0 -0
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/columns/cpu.py +0 -0
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/columns/cpu_metrics.py +0 -0
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/columns/dir_data.py +0 -0
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/columns/dir_snapshots.py +0 -0
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/columns/gossip.py +0 -0
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/columns/host_id.py +0 -0
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/columns/memory.py +0 -0
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/columns/node_address.py +0 -0
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/columns/node_load.py +0 -0
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/columns/node_owns.py +0 -0
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/columns/node_status.py +0 -0
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/columns/node_tokens.py +0 -0
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/columns/node_utils.py +0 -0
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/columns/pod_name.py +0 -0
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/columns/volume_cassandra.py +0 -0
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/columns/volume_root.py +0 -0
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/commands/__init__.py +0 -0
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/commands/alter_tables.py +0 -0
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/commands/app/__init__.py +0 -0
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/commands/app/app_ping.py +0 -0
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/commands/app/show_app_id.py +0 -0
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/commands/app/show_app_queues.py +0 -0
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/commands/audit/__init__.py +0 -0
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/commands/audit/show_slow10.py +0 -0
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/commands/audit/show_top10.py +0 -0
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/commands/audit/utils_show_top10.py +0 -0
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/commands/bash/__init__.py +0 -0
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/commands/bash/bash_completer.py +0 -0
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/commands/check.py +0 -0
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/commands/code.py +0 -0
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/commands/command_helpers.py +0 -0
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/commands/cql/__init__.py +0 -0
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/commands/deploy/__init__.py +0 -0
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/commands/deploy/code_start.py +0 -0
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/commands/deploy/code_stop.py +0 -0
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/commands/deploy/code_utils.py +0 -0
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/commands/deploy/deploy.py +0 -0
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/commands/deploy/deploy_frontend.py +0 -0
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/commands/deploy/deploy_pg_agent.py +0 -0
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/commands/deploy/deploy_pod.py +0 -0
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/commands/deploy/deploy_utils.py +0 -0
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/commands/deploy/undeploy.py +0 -0
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/commands/deploy/undeploy_frontend.py +0 -0
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/commands/deploy/undeploy_pg_agent.py +0 -0
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/commands/deploy/undeploy_pod.py +0 -0
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/commands/devices/__init__.py +0 -0
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/commands/devices/device_auit_log.py +0 -0
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/commands/devices/device_cass.py +0 -0
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/commands/exit.py +0 -0
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/commands/export/__init__.py +0 -0
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/commands/export/clean_up_all_export_sessions.py +0 -0
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/commands/export/clean_up_export_sessions.py +0 -0
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/commands/export/drop_export_database.py +0 -0
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/commands/export/drop_export_databases.py +0 -0
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/commands/export/exporter.py +0 -0
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/commands/export/importer.py +0 -0
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/commands/export/importer_sqlite.py +0 -0
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/commands/find_files.py +0 -0
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/commands/help.py +0 -0
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/commands/issues.py +0 -0
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/commands/kubectl.py +0 -0
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/commands/login.py +0 -0
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/commands/medusa/__init__.py +0 -0
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/commands/medusa/medusa.py +0 -0
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/commands/medusa/medusa_backup.py +0 -0
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/commands/medusa/medusa_show_backupjobs.py +0 -0
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/commands/medusa/medusa_show_restorejobs.py +0 -0
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/commands/nodetool_commands.py +0 -0
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/commands/param_get.py +0 -0
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/commands/param_set.py +0 -0
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/commands/postgres/__init__.py +0 -0
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/commands/postgres/postgres_ls.py +0 -0
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/commands/postgres/postgres_preview.py +0 -0
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/commands/pwd.py +0 -0
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/commands/reaper/__init__.py +0 -0
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/commands/reaper/reaper.py +0 -0
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/commands/reaper/reaper_forward.py +0 -0
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/commands/reaper/reaper_forward_session.py +0 -0
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/commands/reaper/reaper_forward_stop.py +0 -0
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/commands/reaper/reaper_restart.py +0 -0
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/commands/reaper/reaper_run_abort.py +0 -0
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/commands/reaper/reaper_runs.py +0 -0
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/commands/reaper/reaper_runs_abort.py +0 -0
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/commands/reaper/reaper_schedules.py +0 -0
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/commands/reaper/reaper_status.py +0 -0
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/commands/repair/__init__.py +0 -0
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/commands/repair/repair.py +0 -0
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/commands/repair/repair_log.py +0 -0
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/commands/repair/repair_run.py +0 -0
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/commands/rollout.py +0 -0
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/commands/shell.py +0 -0
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/commands/show/__init__.py +0 -0
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/commands/show/show_adam.py +0 -0
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/commands/show/show_cassandra_version.py +0 -0
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/commands/show/show_host.py +0 -0
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/commands/show/show_login.py +0 -0
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/commands/watch.py +0 -0
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/embedded_apps.py +0 -0
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/log.py +0 -0
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/pod_exec_result.py +0 -0
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/sql/__init__.py +0 -0
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/sql/sql_completer.py +0 -0
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/sql/sql_state_machine.py +0 -0
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/sql/term_completer.py +0 -0
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/sso/__init__.py +0 -0
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/sso/authenticator.py +0 -0
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/sso/authn_ad.py +0 -0
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/sso/authn_okta.py +0 -0
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/sso/cred_cache.py +0 -0
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/sso/id_token.py +0 -0
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/sso/idp.py +0 -0
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/sso/idp_login.py +0 -0
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/sso/idp_session.py +0 -0
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/sso/sso_config.py +0 -0
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/utils_athena.py +0 -0
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/utils_audits.py +0 -0
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/utils_issues.py +0 -0
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/utils_k8s/__init__.py +0 -0
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/utils_k8s/app_clusters.py +0 -0
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/utils_k8s/cassandra_clusters.py +0 -0
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/utils_k8s/config_maps.py +0 -0
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/utils_k8s/custom_resources.py +0 -0
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/utils_k8s/deployment.py +0 -0
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/utils_k8s/ingresses.py +0 -0
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/utils_k8s/jobs.py +0 -0
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/utils_k8s/kube_context.py +0 -0
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/utils_k8s/secrets.py +0 -0
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/utils_k8s/service_accounts.py +0 -0
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/utils_k8s/services.py +0 -0
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/utils_k8s/volumes.py +0 -0
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/utils_local.py +0 -0
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/utils_net.py +0 -0
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/utils_repl/__init__.py +0 -0
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/utils_repl/automata_completer.py +0 -0
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/utils_repl/state_machine.py +0 -0
- {kaqing-2.0.184 → kaqing-2.0.193}/adam/utils_sqlite.py +0 -0
- {kaqing-2.0.184 → kaqing-2.0.193}/kaqing.egg-info/dependency_links.txt +0 -0
- {kaqing-2.0.184 → kaqing-2.0.193}/kaqing.egg-info/entry_points.txt +0 -0
- {kaqing-2.0.184 → kaqing-2.0.193}/setup.cfg +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
recursive-include adam qingl.lark
|
|
@@ -8,7 +8,7 @@ from adam.log import Log
|
|
|
8
8
|
from adam.sso.idp import Idp
|
|
9
9
|
from adam.sso.idp_login import IdpLogin
|
|
10
10
|
from adam.config import Config
|
|
11
|
-
from adam.utils import debug, debug_trace, json_to_csv, tabulize,
|
|
11
|
+
from adam.utils import debug, debug_trace, json_to_csv, tabulize, log2, log_exc
|
|
12
12
|
from adam.apps import Apps
|
|
13
13
|
|
|
14
14
|
class AppLogin:
|
|
@@ -11,7 +11,7 @@ from adam.commands.deploy.deploy import Deploy, DeployCommandHelper
|
|
|
11
11
|
from adam.commands.deploy.undeploy import Undeploy, UndeployCommandHelper
|
|
12
12
|
from adam.commands.issues import Issues
|
|
13
13
|
from adam.commands.login import Login
|
|
14
|
-
from adam.commands.
|
|
14
|
+
from adam.commands.download_cassandra_log import DownloadCassandraLog
|
|
15
15
|
from adam.commands.ls import Ls
|
|
16
16
|
from adam.commands.medusa.medusa import Medusa
|
|
17
17
|
from adam.commands.nodetool import NodeTool, NodeToolCommandHelper
|
|
@@ -19,8 +19,8 @@ from adam.commands.postgres.postgres import Postgres, PostgresCommandHelper
|
|
|
19
19
|
from adam.commands.preview_table import PreviewTable
|
|
20
20
|
from adam.commands.reaper.reaper import Reaper, ReaperCommandHelper
|
|
21
21
|
from adam.commands.repair.repair import Repair, RepairCommandHelper
|
|
22
|
-
from adam.commands.
|
|
23
|
-
from adam.commands.
|
|
22
|
+
from adam.commands.generate_report import GenerateReport
|
|
23
|
+
from adam.commands.restart_nodes import RestartNodes
|
|
24
24
|
from adam.commands.rollout import RollOut
|
|
25
25
|
from adam.commands.show.show import Show, ShowCommandHelper
|
|
26
26
|
from adam.commands.watch import Watch
|
|
@@ -128,7 +128,7 @@ def login(kubeconfig: str, config: str, param: list[str], namespace: str, pod: s
|
|
|
128
128
|
@click.option('--pod', '-p', required=False, metavar='pod', help='Kubernetes pod name')
|
|
129
129
|
@click.argument('extra_args', nargs=-1, metavar='<pod>', type=click.UNPROCESSED)
|
|
130
130
|
def logs(kubeconfig: str, config: str, param: list[str], namespace: str, pod: str, extra_args):
|
|
131
|
-
run_command(
|
|
131
|
+
run_command(DownloadCassandraLog(), kubeconfig, config, param, None, namespace, pod, extra_args)
|
|
132
132
|
|
|
133
133
|
|
|
134
134
|
@cli.command(context_settings=dict(ignore_unknown_options=True, allow_extra_args=True), cls=ClusterCommandHelper, help='List statefulset or pods.')
|
|
@@ -221,7 +221,7 @@ def repair(kubeconfig: str, config: str, param: list[str], cluster: str, namespa
|
|
|
221
221
|
@click.option('--show', '-s', is_flag=True, help='show output from Cassandra nodes')
|
|
222
222
|
@click.argument('extra_args', nargs=-1, metavar='[cluster|pod]', type=click.UNPROCESSED)
|
|
223
223
|
def report(kubeconfig: str, config: str, param: list[str], cluster: str, namespace: str, pod: str, show: bool, extra_args):
|
|
224
|
-
run_command(
|
|
224
|
+
run_command(GenerateReport(), kubeconfig, config, param, cluster, namespace, pod, ('-s',) + extra_args if show else extra_args)
|
|
225
225
|
|
|
226
226
|
|
|
227
227
|
@cli.command(context_settings=dict(ignore_unknown_options=True, allow_extra_args=True), cls=ClusterOrPodCommandHelper, help='Restart Cassandra Cluster or Node')
|
|
@@ -234,7 +234,7 @@ def report(kubeconfig: str, config: str, param: list[str], cluster: str, namespa
|
|
|
234
234
|
@click.option('--force', is_flag=True, help='need for restarting the whole cluster')
|
|
235
235
|
@click.argument('extra_args', nargs=-1, metavar='<cluster|pod>', type=click.UNPROCESSED)
|
|
236
236
|
def restart(kubeconfig: str, config: str, param: list[str], cluster: str, namespace: str, pod: str, force: bool, extra_args):
|
|
237
|
-
run_command(
|
|
237
|
+
run_command(RestartNodes(), kubeconfig, config, param, cluster, namespace, pod, ('--force',) + extra_args if force else extra_args)
|
|
238
238
|
|
|
239
239
|
|
|
240
240
|
@cli.command(context_settings=dict(ignore_unknown_options=True, allow_extra_args=True), cls=ClusterOrPodCommandHelper, help='Rolling restart Cassandra Cluster.')
|
|
@@ -31,8 +31,8 @@ class App(Command):
|
|
|
31
31
|
|
|
32
32
|
return state
|
|
33
33
|
|
|
34
|
-
def completion(self,
|
|
35
|
-
return
|
|
34
|
+
def completion(self, _: ReplState):
|
|
35
|
+
return {}
|
|
36
36
|
|
|
37
37
|
def help(self, _: ReplState):
|
|
38
38
|
return f"<AppType>.<AppAction> <args> [--force]\t post app action; check with 'show app actions' command"
|
|
@@ -9,6 +9,14 @@ from adam.utils import log2
|
|
|
9
9
|
from adam.utils_k8s.app_clusters import AppClusters
|
|
10
10
|
from adam.utils_k8s.app_pods import AppPods
|
|
11
11
|
|
|
12
|
+
def app_cd_dirs(state: ReplState):
|
|
13
|
+
if state.app_app:
|
|
14
|
+
return ['..'] + AppPods.pod_names(state.namespace, state.app_env, state.app_app)
|
|
15
|
+
elif state.app_env:
|
|
16
|
+
return ['..'] + [app[0].split('-')[1] for app in Apps.apps(state.app_env)]
|
|
17
|
+
else:
|
|
18
|
+
return [env[0] for env in Apps.envs()]
|
|
19
|
+
|
|
12
20
|
class AppRestHandler:
|
|
13
21
|
def __init__(self, state: ReplState, forced = False):
|
|
14
22
|
self.state = state
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import click
|
|
2
2
|
|
|
3
3
|
from adam.commands import validate_args
|
|
4
|
+
from adam.commands.audit.completions_l import completions_l
|
|
4
5
|
from adam.commands.audit.audit_repair_tables import AuditRepairTables
|
|
5
6
|
from adam.commands.audit.audit_run import AuditRun
|
|
6
7
|
from adam.commands.audit.show_last10 import ShowLast10
|
|
@@ -10,7 +11,7 @@ from adam.commands.audit.utils_show_top10 import show_top10_completions_for_nest
|
|
|
10
11
|
from adam.commands.command import Command
|
|
11
12
|
from adam.commands.intermediate_command import IntermediateCommand
|
|
12
13
|
from adam.repl_state import ReplState
|
|
13
|
-
from adam.sql.
|
|
14
|
+
from adam.sql.lark_completer import LarkCompleter
|
|
14
15
|
from adam.utils import log2, wait_log
|
|
15
16
|
from adam.utils_athena import Athena
|
|
16
17
|
|
|
@@ -50,25 +51,10 @@ class Audit(IntermediateCommand):
|
|
|
50
51
|
return state
|
|
51
52
|
|
|
52
53
|
def completion(self, state: ReplState):
|
|
53
|
-
if state.device
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
# warm up the caches first time when l: drive is accessed
|
|
58
|
-
Athena.table_names()
|
|
59
|
-
Athena.column_names()
|
|
60
|
-
Athena.column_names(partition_cols_only=True)
|
|
61
|
-
|
|
62
|
-
return super().completion(state) | show_top10_completions_for_nesting() | SqlCompleter(
|
|
63
|
-
lambda: Athena.table_names(),
|
|
64
|
-
expandables={
|
|
65
|
-
'columns': lambda table: Athena.column_names(),
|
|
66
|
-
'partition_columns': lambda table: Athena.column_names(partition_cols_only=True)
|
|
67
|
-
},
|
|
68
|
-
variant=SqlVariant.ATHENA
|
|
69
|
-
).completions_for_nesting()
|
|
70
|
-
|
|
71
|
-
return {}
|
|
54
|
+
if state.device != ReplState.L:
|
|
55
|
+
return {}
|
|
56
|
+
|
|
57
|
+
return completions_l()
|
|
72
58
|
|
|
73
59
|
def cmd_list(self):
|
|
74
60
|
return [AuditRepairTables(), AuditRun(), ShowLast10(), ShowSlow10(), ShowTop10()]
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
from adam.repl_state import ReplState
|
|
2
|
+
from adam.sql.lark_completer import LarkCompleter
|
|
3
|
+
from adam.utils_athena import Athena
|
|
4
|
+
|
|
5
|
+
def completions_l():
|
|
6
|
+
return LarkCompleter(
|
|
7
|
+
expandables={
|
|
8
|
+
'tables': lambda x: Athena.table_names(),
|
|
9
|
+
'columns': lambda table: Athena.column_names(),
|
|
10
|
+
'partition-columns': lambda table: Athena.column_names(partition_cols_only=True),
|
|
11
|
+
'topn-counts': lambda x: ['10'],
|
|
12
|
+
'topn-types': lambda x: ['last', 'slow', 'top'],
|
|
13
|
+
'topn-windows': lambda x: ['day', 'month'],
|
|
14
|
+
}, variant=ReplState.L
|
|
15
|
+
).completions_for_nesting()
|
|
@@ -30,7 +30,7 @@ class Bash(Command):
|
|
|
30
30
|
return exec(args)
|
|
31
31
|
|
|
32
32
|
def completion(self, state: ReplState):
|
|
33
|
-
return
|
|
33
|
+
return super().completion(state, {c : {'&': None} for c in ['ls', 'cat', 'head']}, pods=Devices.of(state).pods(state, '-'))
|
|
34
34
|
|
|
35
35
|
def help(self, _: ReplState):
|
|
36
36
|
return f'{Bash.COMMAND} [pod-name] [bash-commands] [&]\t run bash on the Cassandra nodes'
|
|
@@ -27,10 +27,10 @@ class Cat(Command):
|
|
|
27
27
|
|
|
28
28
|
with self.validate(args, state) as (args, state):
|
|
29
29
|
with validate_args(args, state, name='file'):
|
|
30
|
-
return Devices.
|
|
30
|
+
return Devices.of(state).bash(state, state, cmd.split(' '))
|
|
31
31
|
|
|
32
32
|
def completion(self, state: ReplState):
|
|
33
|
-
return super().completion(state, pods=Devices.
|
|
33
|
+
return super().completion(state, lambda: {f: None for f in Devices.of(state).files(state)}, pods=Devices.of(state).pods(state, '-'), auto='jit')
|
|
34
34
|
|
|
35
35
|
def help(self, _: ReplState):
|
|
36
36
|
return f'{Cat.COMMAND} file [&]\t run cat command on the pod'
|
|
@@ -28,14 +28,14 @@ class Cd(Command):
|
|
|
28
28
|
|
|
29
29
|
with self.validate(args, state, apply=False) as (args, state):
|
|
30
30
|
with validate_args(args, state, name='directory') as arg_str:
|
|
31
|
-
device: Device = Devices.
|
|
31
|
+
device: Device = Devices.of(state)
|
|
32
32
|
for dir in arg_str.split('/'):
|
|
33
33
|
device.cd(dir, state)
|
|
34
34
|
|
|
35
35
|
return state
|
|
36
36
|
|
|
37
37
|
def completion(self, state: ReplState):
|
|
38
|
-
return Devices.
|
|
38
|
+
return Devices.of(state).cd_completion(Cd.COMMAND, state, default = {})
|
|
39
39
|
|
|
40
40
|
def help(self, _: ReplState):
|
|
41
41
|
return f'{Cd.COMMAND} <path> | .. \t move around on the operational device hierarchy'
|
|
@@ -3,14 +3,19 @@ import re
|
|
|
3
3
|
|
|
4
4
|
from adam.commands.reaper.utils_reaper import Reapers
|
|
5
5
|
from adam.config import Config
|
|
6
|
+
from adam.utils import log_timing
|
|
6
7
|
from adam.utils_k8s.kube_context import KubeContext
|
|
7
8
|
from adam.utils_k8s.secrets import Secrets
|
|
8
9
|
from adam.utils_k8s.statefulsets import StatefulSets
|
|
9
10
|
from adam.repl_state import ReplState
|
|
10
11
|
|
|
11
12
|
class CliCommands:
|
|
12
|
-
@functools.lru_cache()
|
|
13
13
|
def values(state: ReplState, collapse = False):
|
|
14
|
+
with log_timing('CliCommands.values'):
|
|
15
|
+
return CliCommands._values(state, collapse)
|
|
16
|
+
|
|
17
|
+
@functools.lru_cache()
|
|
18
|
+
def _values(state: ReplState, collapse = False):
|
|
14
19
|
# node-exec-?, nodetool-?, cql-?, reaper-exec, reaper-forward, reaper-ui, reaper-usernae, reaper-password
|
|
15
20
|
d = {}
|
|
16
21
|
|
|
@@ -6,6 +6,7 @@ from adam.commands import validate_args
|
|
|
6
6
|
from adam.commands.command import Command, InvalidArgumentsException
|
|
7
7
|
from adam.commands.command_helpers import ClusterOrPodCommandHelper
|
|
8
8
|
from adam.commands.cli_commands import CliCommands
|
|
9
|
+
from adam.config import Config
|
|
9
10
|
from adam.repl_state import ReplState, RequiredState
|
|
10
11
|
from adam.utils import tabulize, log, log2
|
|
11
12
|
|
|
@@ -62,7 +63,7 @@ class ClipboardCopy(Command):
|
|
|
62
63
|
return state
|
|
63
64
|
|
|
64
65
|
def completion(self, state: ReplState):
|
|
65
|
-
return super().completion(state, lambda: {key: None for key in CliCommands.values(state).keys()})
|
|
66
|
+
return super().completion(state, lambda: {key: None for key in CliCommands.values(state).keys()}, auto_key='cli.cp-auto-complete')
|
|
66
67
|
|
|
67
68
|
def help(self, _: ReplState):
|
|
68
69
|
return f"{ClipboardCopy.COMMAND} <key>\t copy a value to clipboard for conveninence"
|
|
@@ -5,8 +5,10 @@ import subprocess
|
|
|
5
5
|
import sys
|
|
6
6
|
from typing import Union
|
|
7
7
|
|
|
8
|
+
from adam.config import Config
|
|
8
9
|
from adam.repl_state import ReplState, RequiredState
|
|
9
|
-
from adam.
|
|
10
|
+
from adam.sql.lark_completer import LarkCompleter
|
|
11
|
+
from adam.utils import log2
|
|
10
12
|
|
|
11
13
|
repl_cmds: list['Command'] = []
|
|
12
14
|
|
|
@@ -29,10 +31,10 @@ class Command:
|
|
|
29
31
|
|
|
30
32
|
return None
|
|
31
33
|
|
|
32
|
-
def completion(self, state: ReplState, leaf: dict[str, any] = None, pods: tuple[list[str], str] = None) -> dict[str, any]:
|
|
34
|
+
def completion(self, state: ReplState, leaf: dict[str, any] = None, pods: tuple[list[str], str] = None, auto: str = 'on', auto_key: str = None) -> dict[str, any]:
|
|
33
35
|
# pods is a tuple of list of pod names and the current pod repl is on
|
|
34
36
|
if not pods:
|
|
35
|
-
return self._completion(state, leaf)
|
|
37
|
+
return self._completion(state, leaf, auto=auto, auto_key=auto_key)
|
|
36
38
|
|
|
37
39
|
c = {}
|
|
38
40
|
|
|
@@ -40,18 +42,27 @@ class Command:
|
|
|
40
42
|
pod = pods[1]
|
|
41
43
|
|
|
42
44
|
if pod:
|
|
43
|
-
c |= self._completion(state, leaf)
|
|
45
|
+
c |= self._completion(state, leaf, auto=auto, auto_key=auto_key)
|
|
44
46
|
|
|
45
|
-
c |= {f'@{p}': self._completion(state, leaf, to_validate=False) for p in pod_names if p != pod}
|
|
47
|
+
c |= {f'@{p}': self._completion(state.with_pod(p), leaf, to_validate=False, auto=auto, auto_key=auto_key) for p in pod_names if p != pod}
|
|
46
48
|
|
|
47
49
|
return c
|
|
48
50
|
|
|
49
|
-
def _completion(self, state: ReplState, leaf: dict[str, any] = None, to_validate = True) -> dict[str, any]:
|
|
51
|
+
def _completion(self, state: ReplState, leaf: dict[str, any] = None, to_validate = True, auto: str = 'on', auto_key: str = None) -> dict[str, any]:
|
|
50
52
|
if to_validate and not self.validate_state(state, show_err=False):
|
|
51
53
|
return {}
|
|
52
54
|
|
|
53
|
-
if
|
|
54
|
-
|
|
55
|
+
if callable(leaf):
|
|
56
|
+
if auto_key:
|
|
57
|
+
auto_key = f'auto-complete.{auto_key}'
|
|
58
|
+
auto = Config().get(auto_key, 'off')
|
|
59
|
+
|
|
60
|
+
if auto == 'on':
|
|
61
|
+
leaf = leaf()
|
|
62
|
+
elif auto in ['lazy', 'jit']:
|
|
63
|
+
leaf = LarkCompleter.from_lambda(auto_key, leaf, auto=auto)
|
|
64
|
+
else:
|
|
65
|
+
leaf = None
|
|
55
66
|
|
|
56
67
|
d = leaf
|
|
57
68
|
for t in reversed(self.command().split(' ')):
|
|
@@ -130,7 +141,7 @@ class Command:
|
|
|
130
141
|
options = [options]
|
|
131
142
|
|
|
132
143
|
if args and trailing:
|
|
133
|
-
while args[-1] in trailing:
|
|
144
|
+
while args and args[-1] in trailing:
|
|
134
145
|
found_trailing = True
|
|
135
146
|
args = args[:-1]
|
|
136
147
|
|
|
@@ -148,6 +159,8 @@ class Command:
|
|
|
148
159
|
return new_args, found_trailing, found_sequence, found_options
|
|
149
160
|
|
|
150
161
|
def extract_option_sequence(args, sequence):
|
|
162
|
+
new_args = args
|
|
163
|
+
|
|
151
164
|
len_sub = len(sequence)
|
|
152
165
|
len_main = len(args)
|
|
153
166
|
for i in range(len_main - len_sub + 1):
|
|
@@ -1,14 +1,17 @@
|
|
|
1
|
+
from datetime import datetime
|
|
1
2
|
from kubernetes import client
|
|
2
3
|
from typing import List
|
|
3
4
|
|
|
4
5
|
from adam.checks.check_utils import run_checks
|
|
5
6
|
from adam.columns.columns import Columns, collect_checks
|
|
7
|
+
from adam.config import Config
|
|
8
|
+
from adam.repl_session import ReplSession
|
|
6
9
|
from adam.utils_issues import IssuesUtils
|
|
7
10
|
from adam.utils_k8s.cassandra_nodes import CassandraNodes
|
|
8
11
|
from adam.utils_k8s.pods import Pods
|
|
9
12
|
from adam.utils_k8s.statefulsets import StatefulSets
|
|
10
13
|
from adam.repl_state import ReplState
|
|
11
|
-
from adam.utils import SORT, duration, tabulize,
|
|
14
|
+
from adam.utils import SORT, duration, tabulize, log2
|
|
12
15
|
|
|
13
16
|
def show_pods(pods: List[client.V1Pod], ns: str, show_namespace = True, show_host_id = True):
|
|
14
17
|
if len(pods) == 0:
|
|
@@ -59,14 +62,46 @@ def show_rollout(sts: str, ns: str):
|
|
|
59
62
|
else:
|
|
60
63
|
log2(f'Cluster has completed rollout {d} ago.')
|
|
61
64
|
|
|
62
|
-
def show_table(state: ReplState, pods: list[str], cols: str, header: str, show_out=False):
|
|
65
|
+
def show_table(state: ReplState, pods: list[str], cols: str, header: str, show_out=False, backgrounded = False):
|
|
63
66
|
columns = Columns.create_columns(cols)
|
|
64
67
|
|
|
65
68
|
results = run_checks(cluster=state.sts, pod=state.pod, namespace=state.namespace, checks=collect_checks(columns), show_out=show_out)
|
|
66
69
|
|
|
67
|
-
|
|
68
|
-
|
|
70
|
+
r = tabulize(pods, lambda p: ','.join([c.pod_value(results, p) for c in columns]), header=header, separator=',', sorted=SORT, to = 0 if backgrounded else 1)
|
|
71
|
+
|
|
72
|
+
if backgrounded:
|
|
73
|
+
r = write_to_kaqing_log_file(r)
|
|
74
|
+
|
|
75
|
+
IssuesUtils.show(results, state.in_repl)
|
|
76
|
+
|
|
77
|
+
return r
|
|
78
|
+
|
|
79
|
+
def write_to_kaqing_log_file(r: str):
|
|
80
|
+
with kaqing_log_file() as f:
|
|
81
|
+
f.write(r)
|
|
82
|
+
|
|
83
|
+
return f.name
|
|
84
|
+
|
|
85
|
+
def _kaqing_log_file(suffix = 'log'):
|
|
86
|
+
log_prefix = Config().get('log-prefix', '/tmp/qing')
|
|
87
|
+
return f'{log_prefix}-{datetime.now().strftime("%d%H%M%S")}.{suffix}'
|
|
88
|
+
|
|
89
|
+
class LogFileHandler:
|
|
90
|
+
def __init__(self, suffix = 'log'):
|
|
91
|
+
self.suffix = suffix
|
|
92
|
+
|
|
93
|
+
def __enter__(self):
|
|
94
|
+
self.f = open(_kaqing_log_file(), 'w')
|
|
95
|
+
self.f.__enter__()
|
|
96
|
+
|
|
97
|
+
return self.f
|
|
98
|
+
|
|
99
|
+
def __exit__(self, exc_type, exc_val, exc_tb):
|
|
100
|
+
self.f.__exit__(exc_type, exc_val, exc_tb)
|
|
101
|
+
|
|
102
|
+
ReplSession().append_history(f':sh cat {self.f.name}')
|
|
69
103
|
|
|
70
|
-
|
|
104
|
+
return False
|
|
71
105
|
|
|
72
|
-
|
|
106
|
+
def kaqing_log_file(suffix = 'log'):
|
|
107
|
+
return LogFileHandler(suffix = suffix)
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
from adam.commands.cql.utils_cql import cassandra_keyspaces, cassandra_table_names
|
|
2
|
+
from adam.commands.export.export_sessions import ExportSessions
|
|
3
|
+
from adam.commands.export.export_databases import ExportDatabases
|
|
4
|
+
from adam.config import Config
|
|
5
|
+
from adam.repl_state import ReplState
|
|
6
|
+
from adam.sql.lark_completer import LarkCompleter
|
|
7
|
+
from adam.utils import log_timing
|
|
8
|
+
from adam.utils_k8s.statefulsets import StatefulSets
|
|
9
|
+
|
|
10
|
+
def completions_c(state: ReplState) -> dict[str, any]:
|
|
11
|
+
ps = Config().get('cql.alter-tables.gc-grace-periods', '3600,86400,864000,7776000').split(',')
|
|
12
|
+
|
|
13
|
+
with log_timing('lark.completions'):
|
|
14
|
+
return LarkCompleter(
|
|
15
|
+
expandables = {
|
|
16
|
+
'tables': lambda x: cassandra_table_names(state),
|
|
17
|
+
'keyspaces': lambda x: cassandra_keyspaces(state.with_no_pod()),
|
|
18
|
+
'table-props': lambda x: {
|
|
19
|
+
'GC_GRACE_SECONDS': ps
|
|
20
|
+
},
|
|
21
|
+
'table-props-value': lambda x: {'GC_GRACE_SECONDS': ps}[x],
|
|
22
|
+
'export-database-types': lambda x: ['athena', 'sqlite', 'csv'],
|
|
23
|
+
'export-databases': lambda x: ExportDatabases.database_names(),
|
|
24
|
+
'export-sessions': lambda x: ExportSessions.export_session_names(state.sts, state.pod, state.namespace),
|
|
25
|
+
'export-sessions-incomplete': lambda x: ExportSessions.export_session_names(state.sts, state.pod, state.namespace, export_state='pending_import'),
|
|
26
|
+
'hosts': lambda x: [f'@{p}' for p in StatefulSets.pod_names(state.sts, state.namespace)],
|
|
27
|
+
},
|
|
28
|
+
variant=ReplState.C
|
|
29
|
+
).completions_for_nesting()
|
|
@@ -3,9 +3,8 @@ import click
|
|
|
3
3
|
from adam.commands import extract_trailing_options
|
|
4
4
|
from adam.commands.command import Command
|
|
5
5
|
from adam.commands.command_helpers import ClusterOrPodCommandHelper
|
|
6
|
-
from adam.commands.cql.
|
|
6
|
+
from adam.commands.cql.completions_c import completions_c
|
|
7
7
|
from adam.commands.cql.utils_cql import cassandra
|
|
8
|
-
from adam.utils_k8s.statefulsets import StatefulSets
|
|
9
8
|
from adam.repl_state import ReplState, RequiredState
|
|
10
9
|
from adam.utils import log
|
|
11
10
|
|
|
@@ -38,13 +37,10 @@ class Cqlsh(Command):
|
|
|
38
37
|
|
|
39
38
|
def completion(self, state: ReplState) -> dict[str, any]:
|
|
40
39
|
if state.device != state.C:
|
|
41
|
-
# conflicts with psql completions
|
|
42
40
|
return {}
|
|
43
41
|
|
|
44
42
|
if state.sts or state.pod:
|
|
45
|
-
|
|
46
|
-
return c | \
|
|
47
|
-
{f'@{p}': c for p in StatefulSets.pod_names(state.sts, state.namespace)}
|
|
43
|
+
return completions_c(state)
|
|
48
44
|
|
|
49
45
|
return {}
|
|
50
46
|
|
|
@@ -12,6 +12,14 @@ from adam.repl_state import ReplState
|
|
|
12
12
|
from adam.utils import log2, log_timing, wait_log
|
|
13
13
|
from adam.utils_k8s.statefulsets import StatefulSets
|
|
14
14
|
|
|
15
|
+
def cd_dirs(state: ReplState) -> list[str]:
|
|
16
|
+
if state.pod:
|
|
17
|
+
return [".."]
|
|
18
|
+
elif state.sts:
|
|
19
|
+
return [".."] + StatefulSets.pod_names(state.sts, state.namespace)
|
|
20
|
+
else:
|
|
21
|
+
return StatefulSets.list_sts_names()
|
|
22
|
+
|
|
15
23
|
@functools.lru_cache()
|
|
16
24
|
def cassandra_keyspaces(state: ReplState, on_any=True):
|
|
17
25
|
if state.pod:
|
|
@@ -259,16 +267,16 @@ class CassandraPodService:
|
|
|
259
267
|
|
|
260
268
|
return run_cql(state, query, opts=opts, show_out=show_out, show_query=show_query, use_single_quotes=use_single_quotes, on_any=on_any, backgrounded=backgrounded, log_file=log_file)
|
|
261
269
|
|
|
262
|
-
def display_table(self, cols: str, header: str, show_out = True):
|
|
270
|
+
def display_table(self, cols: str, header: str, show_out = True, backgrounded = False):
|
|
263
271
|
state = self.handler.state
|
|
264
272
|
|
|
265
273
|
if state.pod:
|
|
266
|
-
show_table(state, [state.pod], cols, header, show_out=show_out)
|
|
274
|
+
return show_table(state, [state.pod], cols, header, show_out=show_out, backgrounded = backgrounded)
|
|
267
275
|
elif state.sts:
|
|
268
276
|
pod_names = [pod.metadata.name for pod in StatefulSets.pods(state.sts, state.namespace)]
|
|
269
|
-
show_table(state, pod_names, cols, header, show_out=show_out)
|
|
277
|
+
return show_table(state, pod_names, cols, header, show_out=show_out, backgrounded = backgrounded)
|
|
270
278
|
|
|
271
|
-
def nodetool(self, args: str, status = False, show_out = True) -> Union[PodExecResult, list[PodExecResult]]:
|
|
279
|
+
def nodetool(self, args: str, status = False, show_out = True, backgrounded = False) -> Union[PodExecResult, list[PodExecResult]]:
|
|
272
280
|
state = self.handler.state
|
|
273
281
|
pod = self.handler.pod
|
|
274
282
|
|
|
@@ -276,9 +284,9 @@ class CassandraPodService:
|
|
|
276
284
|
command = f"nodetool -u {user} -pw {pw} {args}"
|
|
277
285
|
|
|
278
286
|
if pod:
|
|
279
|
-
return CassandraNodes.exec(pod, state.namespace, command, show_out=show_out)
|
|
287
|
+
return CassandraNodes.exec(pod, state.namespace, command, show_out=show_out, backgrounded=backgrounded)
|
|
280
288
|
else:
|
|
281
|
-
return CassandraClusters.exec(state.sts, state.namespace, command, action='nodetool.status' if status else 'nodetool', show_out=show_out)
|
|
289
|
+
return CassandraClusters.exec(state.sts, state.namespace, command, action='nodetool.status' if status else 'nodetool', show_out=show_out, backgrounded=backgrounded)
|
|
282
290
|
|
|
283
291
|
class CassandraExecHandler:
|
|
284
292
|
def __init__(self, state: ReplState, pod: str = None):
|
|
@@ -294,4 +302,4 @@ class CassandraExecHandler:
|
|
|
294
302
|
return False
|
|
295
303
|
|
|
296
304
|
def cassandra(state: ReplState, pod: str=None):
|
|
297
|
-
return CassandraExecHandler(state, pod=pod)
|
|
305
|
+
return CassandraExecHandler(state, pod=pod)
|
|
@@ -5,10 +5,20 @@ from adam.config import Config
|
|
|
5
5
|
from adam.pod_exec_result import PodExecResult
|
|
6
6
|
from adam.repl_state import BashSession, ReplState
|
|
7
7
|
from adam.utils import log2
|
|
8
|
+
from adam.utils_k8s.pods import Pods
|
|
8
9
|
|
|
9
10
|
class Device:
|
|
10
|
-
def pods(self, state: ReplState) -> tuple[list[str], str]:
|
|
11
|
-
return self.pod_names(state), self.pod(state)
|
|
11
|
+
def pods(self, state: ReplState, me: str = None) -> tuple[list[str], str]:
|
|
12
|
+
return self.pod_names(state), me if me else self.pod(state)
|
|
13
|
+
|
|
14
|
+
def default_pod(self, state: ReplState) -> tuple[list[str], str]:
|
|
15
|
+
if me := self.pod(state):
|
|
16
|
+
return me
|
|
17
|
+
|
|
18
|
+
if pods := self.pod_names(state):
|
|
19
|
+
return pods[0]
|
|
20
|
+
|
|
21
|
+
return None
|
|
12
22
|
|
|
13
23
|
def pod(self, state: ReplState) -> str:
|
|
14
24
|
return None
|
|
@@ -32,6 +42,9 @@ class Device:
|
|
|
32
42
|
def cd_completion(self, cmd: str, state: ReplState, default: dict = {}):
|
|
33
43
|
return default
|
|
34
44
|
|
|
45
|
+
def direct_dirs(self, cmd: str, state: ReplState, default: dict = {}) -> list[str]:
|
|
46
|
+
return []
|
|
47
|
+
|
|
35
48
|
@abstractmethod
|
|
36
49
|
def pwd(self, state: ReplState):
|
|
37
50
|
pass
|
|
@@ -120,4 +133,17 @@ class Device:
|
|
|
120
133
|
pass
|
|
121
134
|
|
|
122
135
|
def bash_completion(self, cmd: str, state: ReplState, default: dict = {}):
|
|
123
|
-
return default
|
|
136
|
+
return default
|
|
137
|
+
|
|
138
|
+
def files(self, state: ReplState):
|
|
139
|
+
r: PodExecResult = Pods.exec(self.default_pod(state), self.default_container(state), state.namespace, f'find -maxdepth 1 -type f', show_out=Config().is_debug(), shell='bash')
|
|
140
|
+
|
|
141
|
+
log_files = []
|
|
142
|
+
for line in r.stdout.split('\n'):
|
|
143
|
+
line = line.strip(' \r')
|
|
144
|
+
if line:
|
|
145
|
+
if line.startswith('./'):
|
|
146
|
+
line = line[2:]
|
|
147
|
+
log_files.append(line)
|
|
148
|
+
|
|
149
|
+
return log_files
|
|
@@ -116,7 +116,7 @@ class DeviceApp(Command, Device):
|
|
|
116
116
|
if state.app_app:
|
|
117
117
|
words.append(f'app/{state.app_app}')
|
|
118
118
|
|
|
119
|
-
return '\t'.join([f'{ReplState.
|
|
119
|
+
return '\t'.join([f'{ReplState.A}:>'] + (words if words else ['/']))
|
|
120
120
|
|
|
121
121
|
def try_fallback_action(self, chain: Command, state: ReplState, cmd: str):
|
|
122
122
|
if state.app_app:
|
|
@@ -3,7 +3,7 @@ from adam.commands.devices.device import Device
|
|
|
3
3
|
from adam.commands.export.export_databases import ExportDatabases, export_db
|
|
4
4
|
from adam.config import Config
|
|
5
5
|
from adam.repl_state import ReplState
|
|
6
|
-
from adam.utils import tabulize,
|
|
6
|
+
from adam.utils import tabulize, log2, wait_log
|
|
7
7
|
|
|
8
8
|
class DeviceExport(Command, Device):
|
|
9
9
|
COMMAND = f'{ReplState.X}:'
|
|
@@ -66,7 +66,10 @@ class DeviceExport(Command, Device):
|
|
|
66
66
|
return '\t'.join([f'{ReplState.X}:>'] + (words if words else ['/']))
|
|
67
67
|
|
|
68
68
|
def try_fallback_action(self, chain: Command, state: ReplState, cmd: str):
|
|
69
|
-
|
|
69
|
+
if cmd.startswith('select '):
|
|
70
|
+
cmd = f'xelect {cmd[7:]}'
|
|
71
|
+
|
|
72
|
+
result = chain.run(cmd, state)
|
|
70
73
|
if type(result) is ReplState:
|
|
71
74
|
if state.export_session and not result.export_session:
|
|
72
75
|
state.export_session = None
|