kaqing 2.0.177__tar.gz → 2.0.184__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.177 → kaqing-2.0.184}/PKG-INFO +1 -1
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/checks/check_utils.py +3 -1
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/commands/__init__.py +4 -2
- kaqing-2.0.184/adam/commands/app/app.py +38 -0
- kaqing-2.0.184/adam/commands/app/app_ping.py +38 -0
- kaqing-2.0.184/adam/commands/app/show_app_actions.py +49 -0
- kaqing-2.0.184/adam/commands/app/show_app_id.py +44 -0
- kaqing-2.0.184/adam/commands/app/show_app_queues.py +38 -0
- kaqing-2.0.184/adam/commands/app/utils_app.py +98 -0
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/commands/cat.py +3 -7
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/commands/clipboard_copy.py +1 -1
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/commands/command.py +36 -7
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/commands/cql/cqlsh.py +1 -1
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/commands/cql/utils_cql.py +9 -53
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/commands/deploy/deploy_pg_agent.py +2 -2
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/commands/deploy/undeploy_pg_agent.py +2 -2
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/commands/devices/device.py +12 -7
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/commands/devices/device_app.py +14 -22
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/commands/devices/device_cass.py +13 -19
- kaqing-2.0.184/adam/commands/devices/device_postgres.py +150 -0
- kaqing-2.0.184/adam/commands/download_file.py +47 -0
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/commands/export/clean_up_all_export_sessions.py +3 -3
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/commands/export/clean_up_export_sessions.py +5 -10
- kaqing-2.0.184/adam/commands/export/download_export_session.py +39 -0
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/commands/export/export_databases.py +10 -4
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/commands/export/export_select.py +1 -18
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/commands/export/export_sessions.py +90 -5
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/commands/export/export_use.py +4 -3
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/commands/export/exporter.py +60 -22
- kaqing-2.0.184/adam/commands/export/import_files.py +44 -0
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/commands/export/import_session.py +6 -2
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/commands/export/importer.py +7 -0
- kaqing-2.0.184/adam/commands/export/importer_athena.py +177 -0
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/commands/export/importer_sqlite.py +29 -4
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/commands/export/show_column_counts.py +0 -1
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/commands/export/show_export_databases.py +3 -2
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/commands/export/show_export_session.py +4 -5
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/commands/export/show_export_sessions.py +3 -9
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/commands/export/utils_export.py +41 -14
- kaqing-2.0.184/adam/commands/find_files.py +51 -0
- kaqing-2.0.184/adam/commands/find_processes.py +76 -0
- kaqing-2.0.184/adam/commands/head.py +36 -0
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/commands/nodetool.py +1 -1
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/commands/param_set.py +1 -1
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/commands/postgres/postgres.py +12 -12
- kaqing-2.0.184/adam/commands/postgres/postgres_databases.py +269 -0
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/commands/postgres/psql_completions.py +3 -2
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/commands/postgres/utils_postgres.py +20 -20
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/commands/preview_table.py +1 -1
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/commands/shell.py +1 -1
- kaqing-2.0.184/adam/embedded_params.py +2 -0
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/repl_commands.py +10 -3
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/repl_state.py +23 -9
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/sql/sql_state_machine.py +8 -2
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/utils.py +72 -15
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/utils_k8s/app_clusters.py +2 -2
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/utils_k8s/app_pods.py +5 -2
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/utils_k8s/cassandra_clusters.py +11 -3
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/utils_k8s/cassandra_nodes.py +2 -2
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/utils_k8s/pods.py +23 -5
- kaqing-2.0.184/adam/utils_local.py +4 -0
- kaqing-2.0.184/adam/utils_repl/__init__.py +0 -0
- kaqing-2.0.184/adam/version.py +5 -0
- {kaqing-2.0.177 → kaqing-2.0.184}/kaqing.egg-info/PKG-INFO +1 -1
- {kaqing-2.0.177 → kaqing-2.0.184}/kaqing.egg-info/SOURCES.txt +15 -1
- {kaqing-2.0.177 → kaqing-2.0.184}/setup.py +1 -1
- kaqing-2.0.177/adam/commands/devices/device_postgres.py +0 -142
- kaqing-2.0.177/adam/commands/export/importer_athena.py +0 -81
- kaqing-2.0.177/adam/commands/postgres/postgres_context.py +0 -272
- kaqing-2.0.177/adam/embedded_params.py +0 -2
- kaqing-2.0.177/adam/version.py +0 -5
- {kaqing-2.0.177 → kaqing-2.0.184}/README +0 -0
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/__init__.py +0 -0
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/app_session.py +0 -0
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/apps.py +0 -0
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/batch.py +0 -0
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/checks/__init__.py +0 -0
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/checks/check.py +0 -0
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/checks/check_context.py +0 -0
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/checks/check_result.py +0 -0
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/checks/compactionstats.py +0 -0
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/checks/cpu.py +0 -0
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/checks/cpu_metrics.py +0 -0
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/checks/disk.py +0 -0
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/checks/gossip.py +0 -0
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/checks/issue.py +0 -0
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/checks/memory.py +0 -0
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/checks/status.py +0 -0
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/cli.py +0 -0
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/cli_group.py +0 -0
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/columns/__init__.py +0 -0
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/columns/column.py +0 -0
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/columns/columns.py +0 -0
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/columns/compactions.py +0 -0
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/columns/cpu.py +0 -0
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/columns/cpu_metrics.py +0 -0
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/columns/dir_data.py +0 -0
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/columns/dir_snapshots.py +0 -0
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/columns/gossip.py +0 -0
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/columns/host_id.py +0 -0
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/columns/memory.py +0 -0
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/columns/node_address.py +0 -0
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/columns/node_load.py +0 -0
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/columns/node_owns.py +0 -0
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/columns/node_status.py +0 -0
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/columns/node_tokens.py +0 -0
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/columns/node_utils.py +0 -0
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/columns/pod_name.py +0 -0
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/columns/volume_cassandra.py +0 -0
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/columns/volume_root.py +0 -0
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/commands/alter_tables.py +0 -0
- {kaqing-2.0.177/adam/commands/audit → kaqing-2.0.184/adam/commands/app}/__init__.py +0 -0
- {kaqing-2.0.177/adam/commands/cql → kaqing-2.0.184/adam/commands/audit}/__init__.py +0 -0
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/commands/audit/audit.py +0 -0
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/commands/audit/audit_repair_tables.py +0 -0
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/commands/audit/audit_run.py +0 -0
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/commands/audit/show_last10.py +0 -0
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/commands/audit/show_slow10.py +0 -0
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/commands/audit/show_top10.py +0 -0
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/commands/audit/utils_show_top10.py +0 -0
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/commands/bash/__init__.py +0 -0
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/commands/bash/bash.py +0 -0
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/commands/bash/bash_completer.py +0 -0
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/commands/bash/utils_bash.py +0 -0
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/commands/cd.py +0 -0
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/commands/check.py +0 -0
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/commands/cli_commands.py +0 -0
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/commands/code.py +0 -0
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/commands/command_helpers.py +0 -0
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/commands/commands_utils.py +0 -0
- {kaqing-2.0.177/adam/commands/deploy → kaqing-2.0.184/adam/commands/cql}/__init__.py +0 -0
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/commands/cql/cql_completions.py +0 -0
- {kaqing-2.0.177/adam/commands/devices → kaqing-2.0.184/adam/commands/deploy}/__init__.py +0 -0
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/commands/deploy/code_start.py +0 -0
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/commands/deploy/code_stop.py +0 -0
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/commands/deploy/code_utils.py +0 -0
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/commands/deploy/deploy.py +0 -0
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/commands/deploy/deploy_frontend.py +0 -0
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/commands/deploy/deploy_pod.py +0 -0
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/commands/deploy/deploy_utils.py +0 -0
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/commands/deploy/undeploy.py +0 -0
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/commands/deploy/undeploy_frontend.py +0 -0
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/commands/deploy/undeploy_pod.py +0 -0
- {kaqing-2.0.177/adam/commands/export → kaqing-2.0.184/adam/commands/devices}/__init__.py +0 -0
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/commands/devices/device_auit_log.py +0 -0
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/commands/devices/device_export.py +0 -0
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/commands/devices/devices.py +0 -0
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/commands/exit.py +0 -0
- {kaqing-2.0.177/adam/commands/medusa → kaqing-2.0.184/adam/commands/export}/__init__.py +0 -0
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/commands/export/drop_export_database.py +0 -0
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/commands/export/drop_export_databases.py +0 -0
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/commands/export/export.py +0 -0
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/commands/export/export_select_x.py +0 -0
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/commands/help.py +0 -0
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/commands/intermediate_command.py +0 -0
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/commands/issues.py +0 -0
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/commands/kubectl.py +0 -0
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/commands/login.py +0 -0
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/commands/logs.py +0 -0
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/commands/ls.py +0 -0
- {kaqing-2.0.177/adam/commands/postgres → kaqing-2.0.184/adam/commands/medusa}/__init__.py +0 -0
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/commands/medusa/medusa.py +0 -0
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/commands/medusa/medusa_backup.py +0 -0
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/commands/medusa/medusa_restore.py +0 -0
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/commands/medusa/medusa_show_backupjobs.py +0 -0
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/commands/medusa/medusa_show_restorejobs.py +0 -0
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/commands/nodetool_commands.py +0 -0
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/commands/param_get.py +0 -0
- {kaqing-2.0.177/adam/commands/reaper → kaqing-2.0.184/adam/commands/postgres}/__init__.py +0 -0
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/commands/postgres/postgres_ls.py +0 -0
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/commands/postgres/postgres_preview.py +0 -0
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/commands/pwd.py +0 -0
- {kaqing-2.0.177/adam/commands/repair → kaqing-2.0.184/adam/commands/reaper}/__init__.py +0 -0
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/commands/reaper/reaper.py +0 -0
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/commands/reaper/reaper_forward.py +0 -0
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/commands/reaper/reaper_forward_session.py +0 -0
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/commands/reaper/reaper_forward_stop.py +0 -0
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/commands/reaper/reaper_restart.py +0 -0
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/commands/reaper/reaper_run_abort.py +0 -0
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/commands/reaper/reaper_runs.py +0 -0
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/commands/reaper/reaper_runs_abort.py +0 -0
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/commands/reaper/reaper_schedule_activate.py +0 -0
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/commands/reaper/reaper_schedule_start.py +0 -0
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/commands/reaper/reaper_schedule_stop.py +0 -0
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/commands/reaper/reaper_schedules.py +0 -0
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/commands/reaper/reaper_status.py +0 -0
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/commands/reaper/utils_reaper.py +0 -0
- {kaqing-2.0.177/adam/commands/show → kaqing-2.0.184/adam/commands/repair}/__init__.py +0 -0
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/commands/repair/repair.py +0 -0
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/commands/repair/repair_log.py +0 -0
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/commands/repair/repair_run.py +0 -0
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/commands/repair/repair_scan.py +0 -0
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/commands/repair/repair_stop.py +0 -0
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/commands/report.py +0 -0
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/commands/restart.py +0 -0
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/commands/rollout.py +0 -0
- {kaqing-2.0.177/adam/sql → kaqing-2.0.184/adam/commands/show}/__init__.py +0 -0
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/commands/show/show.py +0 -0
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/commands/show/show_adam.py +0 -0
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/commands/show/show_cassandra_repairs.py +0 -0
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/commands/show/show_cassandra_status.py +0 -0
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/commands/show/show_cassandra_version.py +0 -0
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/commands/show/show_commands.py +0 -0
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/commands/show/show_host.py +0 -0
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/commands/show/show_login.py +0 -0
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/commands/show/show_params.py +0 -0
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/commands/show/show_processes.py +0 -0
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/commands/show/show_storage.py +0 -0
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/commands/watch.py +0 -0
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/config.py +0 -0
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/embedded_apps.py +0 -0
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/log.py +0 -0
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/pod_exec_result.py +0 -0
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/repl.py +0 -0
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/repl_session.py +0 -0
- {kaqing-2.0.177/adam/sso → kaqing-2.0.184/adam/sql}/__init__.py +0 -0
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/sql/sql_completer.py +0 -0
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/sql/term_completer.py +0 -0
- {kaqing-2.0.177/adam/utils_k8s → kaqing-2.0.184/adam/sso}/__init__.py +0 -0
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/sso/authenticator.py +0 -0
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/sso/authn_ad.py +0 -0
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/sso/authn_okta.py +0 -0
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/sso/cred_cache.py +0 -0
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/sso/id_token.py +0 -0
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/sso/idp.py +0 -0
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/sso/idp_login.py +0 -0
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/sso/idp_session.py +0 -0
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/sso/sso_config.py +0 -0
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/utils_athena.py +0 -0
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/utils_audits.py +0 -0
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/utils_issues.py +0 -0
- {kaqing-2.0.177/adam/utils_repl → kaqing-2.0.184/adam/utils_k8s}/__init__.py +0 -0
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/utils_k8s/config_maps.py +0 -0
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/utils_k8s/custom_resources.py +0 -0
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/utils_k8s/deployment.py +0 -0
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/utils_k8s/ingresses.py +0 -0
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/utils_k8s/jobs.py +0 -0
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/utils_k8s/k8s.py +0 -0
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/utils_k8s/kube_context.py +0 -0
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/utils_k8s/secrets.py +0 -0
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/utils_k8s/service_accounts.py +0 -0
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/utils_k8s/services.py +0 -0
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/utils_k8s/statefulsets.py +0 -0
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/utils_k8s/volumes.py +0 -0
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/utils_net.py +0 -0
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/utils_repl/automata_completer.py +0 -0
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/utils_repl/repl_completer.py +0 -0
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/utils_repl/state_machine.py +0 -0
- {kaqing-2.0.177 → kaqing-2.0.184}/adam/utils_sqlite.py +0 -0
- {kaqing-2.0.177 → kaqing-2.0.184}/kaqing.egg-info/dependency_links.txt +0 -0
- {kaqing-2.0.177 → kaqing-2.0.184}/kaqing.egg-info/entry_points.txt +0 -0
- {kaqing-2.0.177 → kaqing-2.0.184}/kaqing.egg-info/top_level.txt +0 -0
- {kaqing-2.0.177 → kaqing-2.0.184}/setup.cfg +0 -0
|
@@ -47,7 +47,9 @@ def run_checks(cluster: str = None, namespace: str = None, pod: str = None, chec
|
|
|
47
47
|
if not pod or pod == pod_name:
|
|
48
48
|
sts_ns_pods.append((sts, ns, pod_name))
|
|
49
49
|
|
|
50
|
-
with parallelize(sts_ns_pods,
|
|
50
|
+
with parallelize(sts_ns_pods,
|
|
51
|
+
Config().action_workers('issues', 30),
|
|
52
|
+
msg='d`Running|Ran checks on {size} pods') as exec:
|
|
51
53
|
return exec.map(lambda sts_ns_pod: run_checks_on_pod(checks, sts_ns_pod[0], sts_ns_pod[1], sts_ns_pod[2], show_out))
|
|
52
54
|
|
|
53
55
|
def run_checks_on_pod(checks: list[Check], cluster: str = None, namespace: str = None, pod: str = None, show_out=True):
|
|
@@ -18,5 +18,7 @@ def extract_all_options(args: list[str], trailing = None, sequence = None, optio
|
|
|
18
18
|
def extract_sequence(args: list[str], sequence: list[str]):
|
|
19
19
|
return ExtractSequenceOptionsHandler(args, sequence = sequence)
|
|
20
20
|
|
|
21
|
-
def validate_args(args: list[str], state: ReplState,
|
|
22
|
-
|
|
21
|
+
def validate_args(args: list[str], state: ReplState, at_least: int = 1, exactly: int = -1,
|
|
22
|
+
name: str = None, msg: Callable[[], None] = None, default: str = None,
|
|
23
|
+
separator=None):
|
|
24
|
+
return ValidateArgCountHandler(args, state, at_least=at_least, exactly=exactly, name=name, msg=msg, default=default, separator=separator)
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
from adam.commands import app, extract_options
|
|
2
|
+
from adam.commands.command import Command
|
|
3
|
+
from adam.repl_state import ReplState, RequiredState
|
|
4
|
+
|
|
5
|
+
class App(Command):
|
|
6
|
+
COMMAND = 'app'
|
|
7
|
+
|
|
8
|
+
# the singleton pattern
|
|
9
|
+
def __new__(cls, *args, **kwargs):
|
|
10
|
+
if not hasattr(cls, 'instance'): cls.instance = super(App, cls).__new__(cls)
|
|
11
|
+
|
|
12
|
+
return cls.instance
|
|
13
|
+
|
|
14
|
+
def __init__(self, successor: Command=None):
|
|
15
|
+
super().__init__(successor)
|
|
16
|
+
|
|
17
|
+
def command(self):
|
|
18
|
+
return App.COMMAND
|
|
19
|
+
|
|
20
|
+
def required(self):
|
|
21
|
+
return RequiredState.APP_APP
|
|
22
|
+
|
|
23
|
+
def run(self, cmd: str, state: ReplState):
|
|
24
|
+
if not(args := self.args(cmd)):
|
|
25
|
+
return super().run(cmd, state)
|
|
26
|
+
|
|
27
|
+
with self.validate(args, state) as (args, state):
|
|
28
|
+
with extract_options(args, '--force') as (args, forced):
|
|
29
|
+
with app(state) as http:
|
|
30
|
+
http.post(args, forced=forced)
|
|
31
|
+
|
|
32
|
+
return state
|
|
33
|
+
|
|
34
|
+
def completion(self, state: ReplState):
|
|
35
|
+
return super().completion(state, {'--force': None})
|
|
36
|
+
|
|
37
|
+
def help(self, _: ReplState):
|
|
38
|
+
return f"<AppType>.<AppAction> <args> [--force]\t post app action; check with 'show app actions' command"
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
from adam.commands import app, extract_options
|
|
2
|
+
from adam.commands.command import Command
|
|
3
|
+
from adam.repl_state import ReplState, RequiredState
|
|
4
|
+
|
|
5
|
+
class AppPing(Command):
|
|
6
|
+
COMMAND = 'app ping'
|
|
7
|
+
|
|
8
|
+
# the singleton pattern
|
|
9
|
+
def __new__(cls, *args, **kwargs):
|
|
10
|
+
if not hasattr(cls, 'instance'): cls.instance = super(AppPing, cls).__new__(cls)
|
|
11
|
+
|
|
12
|
+
return cls.instance
|
|
13
|
+
|
|
14
|
+
def __init__(self, successor: Command=None):
|
|
15
|
+
super().__init__(successor)
|
|
16
|
+
|
|
17
|
+
def command(self):
|
|
18
|
+
return AppPing.COMMAND
|
|
19
|
+
|
|
20
|
+
def required(self):
|
|
21
|
+
return RequiredState.APP_APP
|
|
22
|
+
|
|
23
|
+
def run(self, cmd: str, state: ReplState):
|
|
24
|
+
if not(args := self.args(cmd)):
|
|
25
|
+
return super().run(cmd, state)
|
|
26
|
+
|
|
27
|
+
with self.validate(args, state) as (args, state):
|
|
28
|
+
with extract_options(args, '--force') as (args, forced):
|
|
29
|
+
with app(state) as http:
|
|
30
|
+
http.post(['Echo.echoStatic'], forced=forced)
|
|
31
|
+
|
|
32
|
+
return state
|
|
33
|
+
|
|
34
|
+
def completion(self, state: ReplState):
|
|
35
|
+
return super().completion(state, {'--force': None})
|
|
36
|
+
|
|
37
|
+
def help(self, _: ReplState):
|
|
38
|
+
return f"{AppPing.COMMAND} [--force]\t ping app server with Echo.echoStatic()"
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
from adam.app_session import AppSession
|
|
2
|
+
from adam.apps import AppAction, Apps
|
|
3
|
+
from adam.commands.command import Command
|
|
4
|
+
from adam.config import Config
|
|
5
|
+
from adam.repl_state import ReplState
|
|
6
|
+
from adam.utils import tabulize, log
|
|
7
|
+
|
|
8
|
+
class ShowAppActions(Command):
|
|
9
|
+
COMMAND = 'show app actions'
|
|
10
|
+
|
|
11
|
+
# the singleton pattern
|
|
12
|
+
def __new__(cls, *args, **kwargs):
|
|
13
|
+
if not hasattr(cls, 'instance'): cls.instance = super(ShowAppActions, cls).__new__(cls)
|
|
14
|
+
|
|
15
|
+
return cls.instance
|
|
16
|
+
|
|
17
|
+
def __init__(self, successor: Command=None):
|
|
18
|
+
super().__init__(successor)
|
|
19
|
+
|
|
20
|
+
def command(self):
|
|
21
|
+
return ShowAppActions.COMMAND
|
|
22
|
+
|
|
23
|
+
def required(self):
|
|
24
|
+
return ReplState.A
|
|
25
|
+
|
|
26
|
+
def run(self, cmd: str, state: ReplState):
|
|
27
|
+
if not (args := self.args(cmd)):
|
|
28
|
+
return super().run(cmd, state)
|
|
29
|
+
|
|
30
|
+
with self.validate(args, state) as (args, state):
|
|
31
|
+
actions = []
|
|
32
|
+
for typ in Apps().app_types():
|
|
33
|
+
actions.extend(typ.actions)
|
|
34
|
+
|
|
35
|
+
lines = tabulize(actions, lambda a: str(a), header='ACTION,ARGS,DESCRIPTION', separator=',')
|
|
36
|
+
log()
|
|
37
|
+
|
|
38
|
+
app_session: AppSession = AppSession.create(state.app_env or 'c3', state.app_app or 'c3')
|
|
39
|
+
endpoint = Config().get('app.console-endpoint', 'https://{host}/{env}/{app}/static/console/index.html')
|
|
40
|
+
endpoint = endpoint.replace('{host}', app_session.host).replace('{env}', app_session.env).replace('{app}', state.app_app or 'c3')
|
|
41
|
+
tabulize([f'CONSOLE:,{endpoint}'], separator=',')
|
|
42
|
+
|
|
43
|
+
return lines
|
|
44
|
+
|
|
45
|
+
def completion(self, state: ReplState):
|
|
46
|
+
return super().completion(state)
|
|
47
|
+
|
|
48
|
+
def help(self, _: ReplState):
|
|
49
|
+
return f"{ShowAppActions.COMMAND}\t show app actions"
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
from adam.commands.command import Command
|
|
2
|
+
from adam.utils_k8s.custom_resources import CustomResources
|
|
3
|
+
from adam.repl_state import ReplState, RequiredState
|
|
4
|
+
from adam.utils import log
|
|
5
|
+
|
|
6
|
+
class ShowAppId(Command):
|
|
7
|
+
COMMAND = 'show app id'
|
|
8
|
+
|
|
9
|
+
# the singleton pattern
|
|
10
|
+
def __new__(cls, *args, **kwargs):
|
|
11
|
+
if not hasattr(cls, 'instance'): cls.instance = super(ShowAppId, 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 ShowAppId.COMMAND
|
|
20
|
+
|
|
21
|
+
def required(self):
|
|
22
|
+
return RequiredState.CLUSTER_OR_POD
|
|
23
|
+
|
|
24
|
+
def run(self, cmd: str, state: ReplState):
|
|
25
|
+
if not(args := self.args(cmd)):
|
|
26
|
+
return super().run(cmd, state)
|
|
27
|
+
|
|
28
|
+
with self.validate(args, state) as (args, state):
|
|
29
|
+
c3_app_id = 'Unknown'
|
|
30
|
+
|
|
31
|
+
apps = CustomResources.get_app_ids()
|
|
32
|
+
cr_name = CustomResources.get_cr_name(state.sts if state.sts else state.pod, namespace=state.namespace)
|
|
33
|
+
if cr_name in apps:
|
|
34
|
+
c3_app_id = (apps[cr_name])
|
|
35
|
+
|
|
36
|
+
log(c3_app_id)
|
|
37
|
+
|
|
38
|
+
return c3_app_id
|
|
39
|
+
|
|
40
|
+
def completion(self, state: ReplState):
|
|
41
|
+
return super().completion(state)
|
|
42
|
+
|
|
43
|
+
def help(self, _: ReplState):
|
|
44
|
+
return f'{ShowAppId.COMMAND}\t show app id for the Cassandra cluster'
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
from adam.commands import app, extract_options
|
|
2
|
+
from adam.commands.command import Command
|
|
3
|
+
from adam.repl_state import ReplState, RequiredState
|
|
4
|
+
|
|
5
|
+
class ShowAppQueues(Command):
|
|
6
|
+
COMMAND = 'show app queues'
|
|
7
|
+
|
|
8
|
+
# the singleton pattern
|
|
9
|
+
def __new__(cls, *args, **kwargs):
|
|
10
|
+
if not hasattr(cls, 'instance'): cls.instance = super(ShowAppQueues, cls).__new__(cls)
|
|
11
|
+
|
|
12
|
+
return cls.instance
|
|
13
|
+
|
|
14
|
+
def __init__(self, successor: Command=None):
|
|
15
|
+
super().__init__(successor)
|
|
16
|
+
|
|
17
|
+
def command(self):
|
|
18
|
+
return ShowAppQueues.COMMAND
|
|
19
|
+
|
|
20
|
+
def required(self):
|
|
21
|
+
return RequiredState.APP_APP
|
|
22
|
+
|
|
23
|
+
def run(self, cmd: str, state: ReplState):
|
|
24
|
+
if not(args := self.args(cmd)):
|
|
25
|
+
return super().run(cmd, state)
|
|
26
|
+
|
|
27
|
+
with self.validate(args, state) as (_, state):
|
|
28
|
+
with extract_options(args, '--force') as (args, forced):
|
|
29
|
+
with app(state) as http:
|
|
30
|
+
http.post(['InvalidationQueue.countAll'], forced=forced)
|
|
31
|
+
|
|
32
|
+
return state
|
|
33
|
+
|
|
34
|
+
def completion(self, state: ReplState):
|
|
35
|
+
return super().completion(state, {'--force': None})
|
|
36
|
+
|
|
37
|
+
def help(self, _: ReplState):
|
|
38
|
+
return f"{ShowAppQueues.COMMAND} [--force]\t show invalidation queue counts"
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import json
|
|
2
|
+
from typing import Union
|
|
3
|
+
|
|
4
|
+
from adam.app_session import AppSession
|
|
5
|
+
from adam.apps import Apps
|
|
6
|
+
from adam.pod_exec_result import PodExecResult
|
|
7
|
+
from adam.repl_state import ReplState
|
|
8
|
+
from adam.utils import log2
|
|
9
|
+
from adam.utils_k8s.app_clusters import AppClusters
|
|
10
|
+
from adam.utils_k8s.app_pods import AppPods
|
|
11
|
+
|
|
12
|
+
class AppRestHandler:
|
|
13
|
+
def __init__(self, state: ReplState, forced = False):
|
|
14
|
+
self.state = state
|
|
15
|
+
self.forced = forced
|
|
16
|
+
|
|
17
|
+
def __enter__(self):
|
|
18
|
+
return self.post
|
|
19
|
+
|
|
20
|
+
def __exit__(self, exc_type, exc_val, exc_tb):
|
|
21
|
+
return False
|
|
22
|
+
|
|
23
|
+
def post(self, args: list[str]) -> Union[ReplState, str]:
|
|
24
|
+
if not args:
|
|
25
|
+
return 'arg missing'
|
|
26
|
+
|
|
27
|
+
t_f = args[0].split('.')
|
|
28
|
+
if len(t_f) < 2:
|
|
29
|
+
return 'arg missing'
|
|
30
|
+
|
|
31
|
+
state = self.state
|
|
32
|
+
|
|
33
|
+
payload, valid = Apps().payload(t_f[0], t_f[1], args[1:] if len(args) > 1 else [])
|
|
34
|
+
if not valid:
|
|
35
|
+
log2('Missing one or more action arguments.')
|
|
36
|
+
return state
|
|
37
|
+
|
|
38
|
+
if payload:
|
|
39
|
+
try:
|
|
40
|
+
payload = json.loads(payload)
|
|
41
|
+
except json.decoder.JSONDecodeError as e:
|
|
42
|
+
log2(f'Invalid json argument: {e}')
|
|
43
|
+
return state
|
|
44
|
+
|
|
45
|
+
AppSession.run(state.app_env, state.app_app, state.namespace, t_f[0], t_f[1], payload=payload, forced=self.forced)
|
|
46
|
+
|
|
47
|
+
return state
|
|
48
|
+
|
|
49
|
+
class AppPodService:
|
|
50
|
+
def __init__(self, handler: 'AppHandler'):
|
|
51
|
+
self.handler = handler
|
|
52
|
+
|
|
53
|
+
def exec(self, command: str, show_out = True) -> Union[PodExecResult, list[PodExecResult]]:
|
|
54
|
+
state = self.handler.state
|
|
55
|
+
|
|
56
|
+
if state.app_pod:
|
|
57
|
+
return AppPods.exec(state.app_pod, state.namespace, command, show_out=show_out, shell='bash')
|
|
58
|
+
elif state.app_app:
|
|
59
|
+
pods = AppPods.pod_names(state.namespace, state.app_env, state.app_app)
|
|
60
|
+
return AppClusters.exec(pods, state.namespace, command, action='bash', show_out=show_out, shell='bash')
|
|
61
|
+
|
|
62
|
+
return []
|
|
63
|
+
|
|
64
|
+
def post(self, args: list[str], forced=False) -> Union[ReplState, str]:
|
|
65
|
+
state = self.handler.state
|
|
66
|
+
|
|
67
|
+
if not args:
|
|
68
|
+
return 'arg missing'
|
|
69
|
+
|
|
70
|
+
t_f = args[0].split('.')
|
|
71
|
+
if len(t_f) < 2:
|
|
72
|
+
return 'arg missing'
|
|
73
|
+
|
|
74
|
+
payload, valid = Apps().payload(t_f[0], t_f[1], args[1:] if len(args) > 1 else [])
|
|
75
|
+
if not valid:
|
|
76
|
+
log2('Missing one or more action arguments.')
|
|
77
|
+
return state
|
|
78
|
+
|
|
79
|
+
if payload:
|
|
80
|
+
try:
|
|
81
|
+
payload = json.loads(payload)
|
|
82
|
+
except json.decoder.JSONDecodeError as e:
|
|
83
|
+
log2(f'Invalid json argument: {e}')
|
|
84
|
+
return state
|
|
85
|
+
|
|
86
|
+
AppSession.run(state.app_env, state.app_app, state.namespace, t_f[0], t_f[1], payload=payload, forced=forced)
|
|
87
|
+
|
|
88
|
+
return state
|
|
89
|
+
|
|
90
|
+
class AppHandler:
|
|
91
|
+
def __init__(self, state: ReplState):
|
|
92
|
+
self.state = state
|
|
93
|
+
|
|
94
|
+
def __enter__(self):
|
|
95
|
+
return AppPodService(self)
|
|
96
|
+
|
|
97
|
+
def __exit__(self, exc_type, exc_val, exc_tb):
|
|
98
|
+
return False
|
|
@@ -2,7 +2,6 @@ from adam.commands import validate_args
|
|
|
2
2
|
from adam.commands.command import Command
|
|
3
3
|
from adam.commands.devices.devices import Devices
|
|
4
4
|
from adam.repl_state import ReplState, RequiredState
|
|
5
|
-
from adam.utils import log2
|
|
6
5
|
|
|
7
6
|
class Cat(Command):
|
|
8
7
|
COMMAND = 'cat'
|
|
@@ -28,13 +27,10 @@ class Cat(Command):
|
|
|
28
27
|
|
|
29
28
|
with self.validate(args, state) as (args, state):
|
|
30
29
|
with validate_args(args, state, name='file'):
|
|
31
|
-
return Devices.device(state).
|
|
30
|
+
return Devices.device(state).bash(state, state, cmd.split(' '))
|
|
32
31
|
|
|
33
32
|
def completion(self, state: ReplState):
|
|
34
|
-
|
|
35
|
-
return Devices.device(state).cat_completion(Cat.COMMAND, state, default={})
|
|
36
|
-
|
|
37
|
-
return {}
|
|
33
|
+
return super().completion(state, pods=Devices.device(state).pods(state))
|
|
38
34
|
|
|
39
35
|
def help(self, _: ReplState):
|
|
40
|
-
return f'{Cat.COMMAND} file [&]\t run cat command on the
|
|
36
|
+
return f'{Cat.COMMAND} file [&]\t run cat command on the pod'
|
|
@@ -29,8 +29,25 @@ class Command:
|
|
|
29
29
|
|
|
30
30
|
return None
|
|
31
31
|
|
|
32
|
-
def completion(self, state: ReplState, leaf: dict[str, any] = None) -> dict[str, any]:
|
|
33
|
-
|
|
32
|
+
def completion(self, state: ReplState, leaf: dict[str, any] = None, pods: tuple[list[str], str] = None) -> dict[str, any]:
|
|
33
|
+
# pods is a tuple of list of pod names and the current pod repl is on
|
|
34
|
+
if not pods:
|
|
35
|
+
return self._completion(state, leaf)
|
|
36
|
+
|
|
37
|
+
c = {}
|
|
38
|
+
|
|
39
|
+
pod_names = pods[0]
|
|
40
|
+
pod = pods[1]
|
|
41
|
+
|
|
42
|
+
if pod:
|
|
43
|
+
c |= self._completion(state, leaf)
|
|
44
|
+
|
|
45
|
+
c |= {f'@{p}': self._completion(state, leaf, to_validate=False) for p in pod_names if p != pod}
|
|
46
|
+
|
|
47
|
+
return c
|
|
48
|
+
|
|
49
|
+
def _completion(self, state: ReplState, leaf: dict[str, any] = None, to_validate = True) -> dict[str, any]:
|
|
50
|
+
if to_validate and not self.validate_state(state, show_err=False):
|
|
34
51
|
return {}
|
|
35
52
|
|
|
36
53
|
if is_lambda(leaf):
|
|
@@ -181,16 +198,20 @@ class InvalidArgumentsException(Exception):
|
|
|
181
198
|
super().__init__(f'Invalid arguments')
|
|
182
199
|
|
|
183
200
|
class ValidateArgCountHandler:
|
|
184
|
-
def __init__(self, args: list[str], state: ReplState,
|
|
201
|
+
def __init__(self, args: list[str], state: ReplState, at_least: int = 1, exactly: int = 1,
|
|
202
|
+
name: str = None, msg: Callable[[], None] = None, default: Union[str, list[str]] = None,
|
|
203
|
+
separator: str = None):
|
|
185
204
|
self.args = args
|
|
186
205
|
self.state = state
|
|
187
|
-
self.
|
|
206
|
+
self.at_least = at_least
|
|
207
|
+
self.exactly = exactly
|
|
188
208
|
self.name = name
|
|
189
209
|
self.msg = msg
|
|
190
210
|
self.default = default
|
|
211
|
+
self.separator = separator
|
|
191
212
|
|
|
192
|
-
def __enter__(self) -> tuple[list[str], ReplState]:
|
|
193
|
-
if len(self.args) < self.
|
|
213
|
+
def __enter__(self) -> Union[tuple[list[str], ReplState], tuple[str, ReplState]]:
|
|
214
|
+
if self.exactly > 0 and len(self.args) != self.exactly or len(self.args) < self.at_least:
|
|
194
215
|
if self.default:
|
|
195
216
|
v = self.default
|
|
196
217
|
if isinstance(v, list):
|
|
@@ -210,7 +231,15 @@ class ValidateArgCountHandler:
|
|
|
210
231
|
|
|
211
232
|
raise InvalidArgumentsException()
|
|
212
233
|
|
|
213
|
-
|
|
234
|
+
if self.separator == ' ':
|
|
235
|
+
return self.args
|
|
236
|
+
|
|
237
|
+
# join and re-split with separator
|
|
238
|
+
args_to_return = ' '.join(self.args)
|
|
239
|
+
if self.separator:
|
|
240
|
+
args_to_return = [arg.strip(' ') for arg in args_to_return.split(self.separator)]
|
|
241
|
+
|
|
242
|
+
return args_to_return
|
|
214
243
|
|
|
215
244
|
def __exit__(self, exc_type, exc_val, exc_tb):
|
|
216
245
|
return False
|
|
@@ -34,7 +34,7 @@ class Cqlsh(Command):
|
|
|
34
34
|
with self.validate(args, state) as (args, state):
|
|
35
35
|
with extract_trailing_options(args, '&') as (args, backgrounded):
|
|
36
36
|
with cassandra(state) as pods:
|
|
37
|
-
pods.cql(args,
|
|
37
|
+
pods.cql(args, backgrounded=backgrounded)
|
|
38
38
|
|
|
39
39
|
def completion(self, state: ReplState) -> dict[str, any]:
|
|
40
40
|
if state.device != state.C:
|
|
@@ -47,7 +47,7 @@ def table_spec(state: ReplState, table: str, on_any=False) -> 'TableSpec':
|
|
|
47
47
|
|
|
48
48
|
return parse_cql_desc_table(r.stdout if state.pod else r[0].stdout)
|
|
49
49
|
|
|
50
|
-
def run_cql(state: ReplState, cql: str, opts: list = [], show_out = False, show_query = False, use_single_quotes = False, on_any = False,
|
|
50
|
+
def run_cql(state: ReplState, cql: str, opts: list = [], show_out = False, show_query = False, use_single_quotes = False, on_any = False, backgrounded=False, log_file=None) -> list[PodExecResult]:
|
|
51
51
|
if show_query:
|
|
52
52
|
log2(cql)
|
|
53
53
|
|
|
@@ -61,7 +61,7 @@ def run_cql(state: ReplState, cql: str, opts: list = [], show_out = False, show_
|
|
|
61
61
|
|
|
62
62
|
with log_timing(cql):
|
|
63
63
|
with cassandra(state) as pods:
|
|
64
|
-
return pods.exec(command, action='cql', show_out=show_out, on_any=on_any,
|
|
64
|
+
return pods.exec(command, action='cql', show_out=show_out, on_any=on_any, backgrounded=backgrounded, log_file=log_file)
|
|
65
65
|
|
|
66
66
|
def parse_cql_desc_tables(out: str):
|
|
67
67
|
# Keyspace data_endpoint_auth
|
|
@@ -215,68 +215,24 @@ def parse_cql_desc_table(out: str) -> TableSpec:
|
|
|
215
215
|
|
|
216
216
|
return TableSpec(columns)
|
|
217
217
|
|
|
218
|
-
class CqlShHandler:
|
|
219
|
-
def __init__(self, state: ReplState, opts: list = [], show_out = False, show_query = False, use_single_quotes = False, on_any = False, background=False):
|
|
220
|
-
self.state = state
|
|
221
|
-
self.opts = opts
|
|
222
|
-
self.show_out = show_out
|
|
223
|
-
self.show_query = show_query
|
|
224
|
-
self.use_single_quotes = use_single_quotes
|
|
225
|
-
self.on_any = on_any
|
|
226
|
-
self.backgroud = background
|
|
227
|
-
|
|
228
|
-
def __enter__(self):
|
|
229
|
-
return self.query
|
|
230
|
-
|
|
231
|
-
def __exit__(self, exc_type, exc_val, exc_tb):
|
|
232
|
-
return False
|
|
233
|
-
|
|
234
|
-
def query(self, args: list[str], log_file: str = None):
|
|
235
|
-
query: str = args
|
|
236
|
-
background = self.backgroud
|
|
237
|
-
show_out = self.show_out
|
|
238
|
-
|
|
239
|
-
if isinstance(query, list):
|
|
240
|
-
opts = []
|
|
241
|
-
cqls = []
|
|
242
|
-
for index, arg in enumerate(args):
|
|
243
|
-
if arg.startswith('--'):
|
|
244
|
-
opts.append(arg)
|
|
245
|
-
elif arg != '-e':
|
|
246
|
-
cqls.append(arg)
|
|
247
|
-
if not cqls:
|
|
248
|
-
if self.state.in_repl:
|
|
249
|
-
log2('Please enter cql statement. e.g. select host_id from system.local')
|
|
250
|
-
else:
|
|
251
|
-
log2('* CQL statement is missing.')
|
|
252
|
-
log2()
|
|
253
|
-
Command.display_help()
|
|
254
|
-
|
|
255
|
-
return 'no-cql'
|
|
256
|
-
|
|
257
|
-
query = ' '.join(cqls)
|
|
258
|
-
show_out = True
|
|
259
|
-
|
|
260
|
-
return run_cql(self.state, query, opts=self.opts, show_out=show_out, show_query=self.show_query, use_single_quotes=self.use_single_quotes, on_any=self.on_any, background=background, log_file=log_file)
|
|
261
|
-
|
|
262
218
|
class CassandraPodService:
|
|
263
219
|
def __init__(self, handler: 'CassandraExecHandler'):
|
|
264
220
|
self.handler = handler
|
|
265
221
|
|
|
266
|
-
def exec(self, command: str, action='bash', show_out = True, on_any = False, throw_err = False, shell = '/bin/sh',
|
|
222
|
+
def exec(self, command: str, action='bash', show_out = True, on_any = False, throw_err = False, shell = '/bin/sh', backgrounded = False, log_file = None) -> Union[PodExecResult, list[PodExecResult]]:
|
|
267
223
|
state = self.handler.state
|
|
268
224
|
pod = self.handler.pod
|
|
269
225
|
|
|
270
226
|
if pod:
|
|
271
227
|
return CassandraNodes.exec(pod, state.namespace, command,
|
|
272
|
-
show_out=show_out, throw_err=throw_err, shell=shell,
|
|
228
|
+
show_out=show_out, throw_err=throw_err, shell=shell, backgrounded=backgrounded, log_file=log_file)
|
|
273
229
|
elif state.sts:
|
|
274
230
|
return CassandraClusters.exec(state.sts, state.namespace, command, action=action,
|
|
275
|
-
show_out=show_out, on_any=on_any, shell=shell,
|
|
231
|
+
show_out=show_out, on_any=on_any, shell=shell, backgrounded=backgrounded, log_file=log_file)
|
|
276
232
|
|
|
277
233
|
return []
|
|
278
234
|
|
|
279
|
-
def cql(self, args: list[str], opts: list = [], show_out = False, show_query = False, use_single_quotes = False, on_any = False,
|
|
235
|
+
def cql(self, args: list[str], opts: list = [], show_out = False, show_query = False, use_single_quotes = False, on_any = False, backgrounded=False, log_file: str = None):
|
|
280
236
|
state = self.handler.state
|
|
281
237
|
query: str = args
|
|
282
238
|
|
|
@@ -301,7 +257,7 @@ class CassandraPodService:
|
|
|
301
257
|
query = ' '.join(cqls)
|
|
302
258
|
show_out = True
|
|
303
259
|
|
|
304
|
-
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,
|
|
260
|
+
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)
|
|
305
261
|
|
|
306
262
|
def display_table(self, cols: str, header: str, show_out = True):
|
|
307
263
|
state = self.handler.state
|
|
@@ -312,7 +268,7 @@ class CassandraPodService:
|
|
|
312
268
|
pod_names = [pod.metadata.name for pod in StatefulSets.pods(state.sts, state.namespace)]
|
|
313
269
|
show_table(state, pod_names, cols, header, show_out=show_out)
|
|
314
270
|
|
|
315
|
-
def nodetool(self, args: str, show_out = True) -> Union[PodExecResult, list[PodExecResult]]:
|
|
271
|
+
def nodetool(self, args: str, status = False, show_out = True) -> Union[PodExecResult, list[PodExecResult]]:
|
|
316
272
|
state = self.handler.state
|
|
317
273
|
pod = self.handler.pod
|
|
318
274
|
|
|
@@ -322,7 +278,7 @@ class CassandraPodService:
|
|
|
322
278
|
if pod:
|
|
323
279
|
return CassandraNodes.exec(pod, state.namespace, command, show_out=show_out)
|
|
324
280
|
else:
|
|
325
|
-
return CassandraClusters.exec(state.sts, state.namespace, command, action='nodetool', show_out=show_out)
|
|
281
|
+
return CassandraClusters.exec(state.sts, state.namespace, command, action='nodetool.status' if status else 'nodetool', show_out=show_out)
|
|
326
282
|
|
|
327
283
|
class CassandraExecHandler:
|
|
328
284
|
def __init__(self, state: ReplState, pod: str = None):
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
from adam.commands.command import Command
|
|
2
|
-
from adam.commands.postgres.
|
|
2
|
+
from adam.commands.postgres.postgres_databases import PostgresDatabases
|
|
3
3
|
from adam.config import Config
|
|
4
4
|
from adam.repl_state import ReplState, RequiredState
|
|
5
5
|
|
|
@@ -26,7 +26,7 @@ class DeployPgAgent(Command):
|
|
|
26
26
|
return super().run(cmd, state)
|
|
27
27
|
|
|
28
28
|
with self.validate(args, state) as (args, state):
|
|
29
|
-
|
|
29
|
+
PostgresDatabases.deploy_pg_agent(Config().get('pg.agent.name', 'ops-pg-agent'), state.namespace)
|
|
30
30
|
|
|
31
31
|
def completion(self, state: ReplState):
|
|
32
32
|
return super().completion(state)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
from adam.commands.command import Command
|
|
2
|
-
from adam.commands.postgres.
|
|
2
|
+
from adam.commands.postgres.postgres_databases import PostgresDatabases
|
|
3
3
|
from adam.config import Config
|
|
4
4
|
from adam.repl_state import ReplState, RequiredState
|
|
5
5
|
from adam.utils import ing
|
|
@@ -28,7 +28,7 @@ class UndeployPgAgent(Command):
|
|
|
28
28
|
|
|
29
29
|
with self.validate(args, state) as (args, state):
|
|
30
30
|
with ing('Deleting pod'):
|
|
31
|
-
|
|
31
|
+
PostgresDatabases.undeploy_pg_agent(Config().get('pg.agent.name', 'ops-pg-agent'), state.namespace)
|
|
32
32
|
|
|
33
33
|
return state
|
|
34
34
|
|
|
@@ -7,18 +7,23 @@ from adam.repl_state import BashSession, ReplState
|
|
|
7
7
|
from adam.utils import log2
|
|
8
8
|
|
|
9
9
|
class Device:
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
pass
|
|
10
|
+
def pods(self, state: ReplState) -> tuple[list[str], str]:
|
|
11
|
+
return self.pod_names(state), self.pod(state)
|
|
13
12
|
|
|
14
|
-
def
|
|
15
|
-
return
|
|
13
|
+
def pod(self, state: ReplState) -> str:
|
|
14
|
+
return None
|
|
15
|
+
|
|
16
|
+
def pod_names(self, state: ReplState) -> list[str]:
|
|
17
|
+
return []
|
|
18
|
+
|
|
19
|
+
def default_container(self, state: ReplState) -> str:
|
|
20
|
+
return None
|
|
16
21
|
|
|
17
22
|
@abstractmethod
|
|
18
|
-
def
|
|
23
|
+
def ls(self, cmd: str, state: ReplState):
|
|
19
24
|
pass
|
|
20
25
|
|
|
21
|
-
def
|
|
26
|
+
def ls_completion(self, cmd: str, state: ReplState, default: dict = {}):
|
|
22
27
|
return default
|
|
23
28
|
|
|
24
29
|
def cd(self, dir: str, state: ReplState):
|