kaqing 2.0.74__tar.gz → 2.0.76__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.74 → kaqing-2.0.76}/PKG-INFO +1 -1
- {kaqing-2.0.74 → kaqing-2.0.76}/adam/commands/command.py +0 -1
- kaqing-2.0.76/adam/embedded_params.py +2 -0
- {kaqing-2.0.74 → kaqing-2.0.76}/adam/repl.py +82 -65
- {kaqing-2.0.74 → kaqing-2.0.76}/adam/utils.py +0 -1
- kaqing-2.0.76/adam/version.py +5 -0
- {kaqing-2.0.74 → kaqing-2.0.76}/kaqing.egg-info/PKG-INFO +1 -1
- {kaqing-2.0.74 → kaqing-2.0.76}/setup.py +1 -1
- kaqing-2.0.74/adam/embedded_params.py +0 -2
- kaqing-2.0.74/adam/version.py +0 -5
- {kaqing-2.0.74 → kaqing-2.0.76}/README +0 -0
- {kaqing-2.0.74 → kaqing-2.0.76}/adam/__init__.py +0 -0
- {kaqing-2.0.74 → kaqing-2.0.76}/adam/app_session.py +0 -0
- {kaqing-2.0.74 → kaqing-2.0.76}/adam/apps.py +0 -0
- {kaqing-2.0.74 → kaqing-2.0.76}/adam/batch.py +0 -0
- {kaqing-2.0.74 → kaqing-2.0.76}/adam/checks/__init__.py +0 -0
- {kaqing-2.0.74 → kaqing-2.0.76}/adam/checks/check.py +0 -0
- {kaqing-2.0.74 → kaqing-2.0.76}/adam/checks/check_context.py +0 -0
- {kaqing-2.0.74 → kaqing-2.0.76}/adam/checks/check_result.py +0 -0
- {kaqing-2.0.74 → kaqing-2.0.76}/adam/checks/check_utils.py +0 -0
- {kaqing-2.0.74 → kaqing-2.0.76}/adam/checks/compactionstats.py +0 -0
- {kaqing-2.0.74 → kaqing-2.0.76}/adam/checks/cpu.py +0 -0
- {kaqing-2.0.74 → kaqing-2.0.76}/adam/checks/disk.py +0 -0
- {kaqing-2.0.74 → kaqing-2.0.76}/adam/checks/gossip.py +0 -0
- {kaqing-2.0.74 → kaqing-2.0.76}/adam/checks/issue.py +0 -0
- {kaqing-2.0.74 → kaqing-2.0.76}/adam/checks/memory.py +0 -0
- {kaqing-2.0.74 → kaqing-2.0.76}/adam/checks/status.py +0 -0
- {kaqing-2.0.74 → kaqing-2.0.76}/adam/cli.py +0 -0
- {kaqing-2.0.74 → kaqing-2.0.76}/adam/cli_group.py +0 -0
- {kaqing-2.0.74 → kaqing-2.0.76}/adam/columns/__init__.py +0 -0
- {kaqing-2.0.74 → kaqing-2.0.76}/adam/columns/column.py +0 -0
- {kaqing-2.0.74 → kaqing-2.0.76}/adam/columns/columns.py +0 -0
- {kaqing-2.0.74 → kaqing-2.0.76}/adam/columns/compactions.py +0 -0
- {kaqing-2.0.74 → kaqing-2.0.76}/adam/columns/cpu.py +0 -0
- {kaqing-2.0.74 → kaqing-2.0.76}/adam/columns/dir_data.py +0 -0
- {kaqing-2.0.74 → kaqing-2.0.76}/adam/columns/dir_snapshots.py +0 -0
- {kaqing-2.0.74 → kaqing-2.0.76}/adam/columns/gossip.py +0 -0
- {kaqing-2.0.74 → kaqing-2.0.76}/adam/columns/host_id.py +0 -0
- {kaqing-2.0.74 → kaqing-2.0.76}/adam/columns/memory.py +0 -0
- {kaqing-2.0.74 → kaqing-2.0.76}/adam/columns/node_address.py +0 -0
- {kaqing-2.0.74 → kaqing-2.0.76}/adam/columns/node_load.py +0 -0
- {kaqing-2.0.74 → kaqing-2.0.76}/adam/columns/node_owns.py +0 -0
- {kaqing-2.0.74 → kaqing-2.0.76}/adam/columns/node_status.py +0 -0
- {kaqing-2.0.74 → kaqing-2.0.76}/adam/columns/node_tokens.py +0 -0
- {kaqing-2.0.74 → kaqing-2.0.76}/adam/columns/node_utils.py +0 -0
- {kaqing-2.0.74 → kaqing-2.0.76}/adam/columns/pod_name.py +0 -0
- {kaqing-2.0.74 → kaqing-2.0.76}/adam/columns/volume_cassandra.py +0 -0
- {kaqing-2.0.74 → kaqing-2.0.76}/adam/columns/volume_root.py +0 -0
- {kaqing-2.0.74 → kaqing-2.0.76}/adam/commands/__init__.py +0 -0
- {kaqing-2.0.74 → kaqing-2.0.76}/adam/commands/alter_tables.py +0 -0
- {kaqing-2.0.74 → kaqing-2.0.76}/adam/commands/app.py +0 -0
- {kaqing-2.0.74 → kaqing-2.0.76}/adam/commands/app_ping.py +0 -0
- {kaqing-2.0.74 → kaqing-2.0.76}/adam/commands/bash.py +0 -0
- {kaqing-2.0.74 → kaqing-2.0.76}/adam/commands/cd.py +0 -0
- {kaqing-2.0.74 → kaqing-2.0.76}/adam/commands/check.py +0 -0
- {kaqing-2.0.74 → kaqing-2.0.76}/adam/commands/cli_commands.py +0 -0
- {kaqing-2.0.74 → kaqing-2.0.76}/adam/commands/command_helpers.py +0 -0
- {kaqing-2.0.74 → kaqing-2.0.76}/adam/commands/commands_utils.py +0 -0
- {kaqing-2.0.74 → kaqing-2.0.76}/adam/commands/cp.py +0 -0
- {kaqing-2.0.74 → kaqing-2.0.76}/adam/commands/cql/__init__.py +0 -0
- {kaqing-2.0.74 → kaqing-2.0.76}/adam/commands/cql/cql_completions.py +0 -0
- {kaqing-2.0.74 → kaqing-2.0.76}/adam/commands/cql/cql_table_completer.py +0 -0
- {kaqing-2.0.74 → kaqing-2.0.76}/adam/commands/cql/cql_utils.py +0 -0
- {kaqing-2.0.74 → kaqing-2.0.76}/adam/commands/cql/cqlsh.py +0 -0
- {kaqing-2.0.74 → kaqing-2.0.76}/adam/commands/deploy/__init__.py +0 -0
- {kaqing-2.0.74 → kaqing-2.0.76}/adam/commands/deploy/code_start.py +0 -0
- {kaqing-2.0.74 → kaqing-2.0.76}/adam/commands/deploy/code_stop.py +0 -0
- {kaqing-2.0.74 → kaqing-2.0.76}/adam/commands/deploy/code_utils.py +0 -0
- {kaqing-2.0.74 → kaqing-2.0.76}/adam/commands/deploy/deploy.py +0 -0
- {kaqing-2.0.74 → kaqing-2.0.76}/adam/commands/deploy/deploy_frontend.py +0 -0
- {kaqing-2.0.74 → kaqing-2.0.76}/adam/commands/deploy/deploy_pg_agent.py +0 -0
- {kaqing-2.0.74 → kaqing-2.0.76}/adam/commands/deploy/deploy_pod.py +0 -0
- {kaqing-2.0.74 → kaqing-2.0.76}/adam/commands/deploy/deploy_utils.py +0 -0
- {kaqing-2.0.74 → kaqing-2.0.76}/adam/commands/deploy/undeploy.py +0 -0
- {kaqing-2.0.74 → kaqing-2.0.76}/adam/commands/deploy/undeploy_frontend.py +0 -0
- {kaqing-2.0.74 → kaqing-2.0.76}/adam/commands/deploy/undeploy_pg_agent.py +0 -0
- {kaqing-2.0.74 → kaqing-2.0.76}/adam/commands/deploy/undeploy_pod.py +0 -0
- {kaqing-2.0.74 → kaqing-2.0.76}/adam/commands/describe/__init__.py +0 -0
- {kaqing-2.0.74 → kaqing-2.0.76}/adam/commands/describe/describe.py +0 -0
- {kaqing-2.0.74 → kaqing-2.0.76}/adam/commands/describe/describe_keyspace.py +0 -0
- {kaqing-2.0.74 → kaqing-2.0.76}/adam/commands/describe/describe_keyspaces.py +0 -0
- {kaqing-2.0.74 → kaqing-2.0.76}/adam/commands/describe/describe_table.py +0 -0
- {kaqing-2.0.74 → kaqing-2.0.76}/adam/commands/describe/describe_tables.py +0 -0
- {kaqing-2.0.74 → kaqing-2.0.76}/adam/commands/devices.py +0 -0
- {kaqing-2.0.74 → kaqing-2.0.76}/adam/commands/exit.py +0 -0
- {kaqing-2.0.74 → kaqing-2.0.76}/adam/commands/help.py +0 -0
- {kaqing-2.0.74 → kaqing-2.0.76}/adam/commands/issues.py +0 -0
- {kaqing-2.0.74 → kaqing-2.0.76}/adam/commands/login.py +0 -0
- {kaqing-2.0.74 → kaqing-2.0.76}/adam/commands/logs.py +0 -0
- {kaqing-2.0.74 → kaqing-2.0.76}/adam/commands/ls.py +0 -0
- {kaqing-2.0.74 → kaqing-2.0.76}/adam/commands/medusa/__init__.py +0 -0
- {kaqing-2.0.74 → kaqing-2.0.76}/adam/commands/medusa/medusa.py +0 -0
- {kaqing-2.0.74 → kaqing-2.0.76}/adam/commands/medusa/medusa_backup.py +0 -0
- {kaqing-2.0.74 → kaqing-2.0.76}/adam/commands/medusa/medusa_restore.py +0 -0
- {kaqing-2.0.74 → kaqing-2.0.76}/adam/commands/medusa/medusa_show_backupjobs.py +0 -0
- {kaqing-2.0.74 → kaqing-2.0.76}/adam/commands/medusa/medusa_show_restorejobs.py +0 -0
- {kaqing-2.0.74 → kaqing-2.0.76}/adam/commands/nodetool.py +0 -0
- {kaqing-2.0.74 → kaqing-2.0.76}/adam/commands/nodetool_commands.py +0 -0
- {kaqing-2.0.74 → kaqing-2.0.76}/adam/commands/param_get.py +0 -0
- {kaqing-2.0.74 → kaqing-2.0.76}/adam/commands/param_set.py +0 -0
- {kaqing-2.0.74 → kaqing-2.0.76}/adam/commands/postgres/__init__.py +0 -0
- {kaqing-2.0.74 → kaqing-2.0.76}/adam/commands/postgres/postgres.py +0 -0
- {kaqing-2.0.74 → kaqing-2.0.76}/adam/commands/postgres/postgres_ls.py +0 -0
- {kaqing-2.0.74 → kaqing-2.0.76}/adam/commands/postgres/postgres_preview.py +0 -0
- {kaqing-2.0.74 → kaqing-2.0.76}/adam/commands/postgres/postgres_session.py +0 -0
- {kaqing-2.0.74 → kaqing-2.0.76}/adam/commands/postgres/postgres_utils.py +0 -0
- {kaqing-2.0.74 → kaqing-2.0.76}/adam/commands/postgres/psql_completions.py +0 -0
- {kaqing-2.0.74 → kaqing-2.0.76}/adam/commands/postgres/psql_table_completer.py +0 -0
- {kaqing-2.0.74 → kaqing-2.0.76}/adam/commands/preview_table.py +0 -0
- {kaqing-2.0.74 → kaqing-2.0.76}/adam/commands/pwd.py +0 -0
- {kaqing-2.0.74 → kaqing-2.0.76}/adam/commands/reaper/__init__.py +0 -0
- {kaqing-2.0.74 → kaqing-2.0.76}/adam/commands/reaper/reaper.py +0 -0
- {kaqing-2.0.74 → kaqing-2.0.76}/adam/commands/reaper/reaper_forward.py +0 -0
- {kaqing-2.0.74 → kaqing-2.0.76}/adam/commands/reaper/reaper_forward_stop.py +0 -0
- {kaqing-2.0.74 → kaqing-2.0.76}/adam/commands/reaper/reaper_restart.py +0 -0
- {kaqing-2.0.74 → kaqing-2.0.76}/adam/commands/reaper/reaper_run_abort.py +0 -0
- {kaqing-2.0.74 → kaqing-2.0.76}/adam/commands/reaper/reaper_runs.py +0 -0
- {kaqing-2.0.74 → kaqing-2.0.76}/adam/commands/reaper/reaper_runs_abort.py +0 -0
- {kaqing-2.0.74 → kaqing-2.0.76}/adam/commands/reaper/reaper_schedule_activate.py +0 -0
- {kaqing-2.0.74 → kaqing-2.0.76}/adam/commands/reaper/reaper_schedule_start.py +0 -0
- {kaqing-2.0.74 → kaqing-2.0.76}/adam/commands/reaper/reaper_schedule_stop.py +0 -0
- {kaqing-2.0.74 → kaqing-2.0.76}/adam/commands/reaper/reaper_schedules.py +0 -0
- {kaqing-2.0.74 → kaqing-2.0.76}/adam/commands/reaper/reaper_session.py +0 -0
- {kaqing-2.0.74 → kaqing-2.0.76}/adam/commands/reaper/reaper_status.py +0 -0
- {kaqing-2.0.74 → kaqing-2.0.76}/adam/commands/repair/__init__.py +0 -0
- {kaqing-2.0.74 → kaqing-2.0.76}/adam/commands/repair/repair.py +0 -0
- {kaqing-2.0.74 → kaqing-2.0.76}/adam/commands/repair/repair_log.py +0 -0
- {kaqing-2.0.74 → kaqing-2.0.76}/adam/commands/repair/repair_run.py +0 -0
- {kaqing-2.0.74 → kaqing-2.0.76}/adam/commands/repair/repair_scan.py +0 -0
- {kaqing-2.0.74 → kaqing-2.0.76}/adam/commands/repair/repair_stop.py +0 -0
- {kaqing-2.0.74 → kaqing-2.0.76}/adam/commands/report.py +0 -0
- {kaqing-2.0.74 → kaqing-2.0.76}/adam/commands/restart.py +0 -0
- {kaqing-2.0.74 → kaqing-2.0.76}/adam/commands/rollout.py +0 -0
- {kaqing-2.0.74 → kaqing-2.0.76}/adam/commands/shell.py +0 -0
- {kaqing-2.0.74 → kaqing-2.0.76}/adam/commands/show/__init__.py +0 -0
- {kaqing-2.0.74 → kaqing-2.0.76}/adam/commands/show/show.py +0 -0
- {kaqing-2.0.74 → kaqing-2.0.76}/adam/commands/show/show_adam.py +0 -0
- {kaqing-2.0.74 → kaqing-2.0.76}/adam/commands/show/show_app_actions.py +0 -0
- {kaqing-2.0.74 → kaqing-2.0.76}/adam/commands/show/show_app_id.py +0 -0
- {kaqing-2.0.74 → kaqing-2.0.76}/adam/commands/show/show_app_queues.py +0 -0
- {kaqing-2.0.74 → kaqing-2.0.76}/adam/commands/show/show_cassandra_status.py +0 -0
- {kaqing-2.0.74 → kaqing-2.0.76}/adam/commands/show/show_cassandra_version.py +0 -0
- {kaqing-2.0.74 → kaqing-2.0.76}/adam/commands/show/show_commands.py +0 -0
- {kaqing-2.0.74 → kaqing-2.0.76}/adam/commands/show/show_login.py +0 -0
- {kaqing-2.0.74 → kaqing-2.0.76}/adam/commands/show/show_params.py +0 -0
- {kaqing-2.0.74 → kaqing-2.0.76}/adam/commands/show/show_processes.py +0 -0
- {kaqing-2.0.74 → kaqing-2.0.76}/adam/commands/show/show_repairs.py +0 -0
- {kaqing-2.0.74 → kaqing-2.0.76}/adam/commands/show/show_storage.py +0 -0
- {kaqing-2.0.74 → kaqing-2.0.76}/adam/commands/watch.py +0 -0
- {kaqing-2.0.74 → kaqing-2.0.76}/adam/config.py +0 -0
- {kaqing-2.0.74 → kaqing-2.0.76}/adam/embedded_apps.py +0 -0
- {kaqing-2.0.74 → kaqing-2.0.76}/adam/k8s_utils/__init__.py +0 -0
- {kaqing-2.0.74 → kaqing-2.0.76}/adam/k8s_utils/cassandra_clusters.py +0 -0
- {kaqing-2.0.74 → kaqing-2.0.76}/adam/k8s_utils/cassandra_nodes.py +0 -0
- {kaqing-2.0.74 → kaqing-2.0.76}/adam/k8s_utils/config_maps.py +0 -0
- {kaqing-2.0.74 → kaqing-2.0.76}/adam/k8s_utils/custom_resources.py +0 -0
- {kaqing-2.0.74 → kaqing-2.0.76}/adam/k8s_utils/deployment.py +0 -0
- {kaqing-2.0.74 → kaqing-2.0.76}/adam/k8s_utils/ingresses.py +0 -0
- {kaqing-2.0.74 → kaqing-2.0.76}/adam/k8s_utils/jobs.py +0 -0
- {kaqing-2.0.74 → kaqing-2.0.76}/adam/k8s_utils/kube_context.py +0 -0
- {kaqing-2.0.74 → kaqing-2.0.76}/adam/k8s_utils/pods.py +0 -0
- {kaqing-2.0.74 → kaqing-2.0.76}/adam/k8s_utils/secrets.py +0 -0
- {kaqing-2.0.74 → kaqing-2.0.76}/adam/k8s_utils/service_accounts.py +0 -0
- {kaqing-2.0.74 → kaqing-2.0.76}/adam/k8s_utils/services.py +0 -0
- {kaqing-2.0.74 → kaqing-2.0.76}/adam/k8s_utils/statefulsets.py +0 -0
- {kaqing-2.0.74 → kaqing-2.0.76}/adam/k8s_utils/volumes.py +0 -0
- {kaqing-2.0.74 → kaqing-2.0.76}/adam/log.py +0 -0
- {kaqing-2.0.74 → kaqing-2.0.76}/adam/pod_exec_result.py +0 -0
- {kaqing-2.0.74 → kaqing-2.0.76}/adam/repl_commands.py +0 -0
- {kaqing-2.0.74 → kaqing-2.0.76}/adam/repl_session.py +0 -0
- {kaqing-2.0.74 → kaqing-2.0.76}/adam/repl_state.py +0 -0
- {kaqing-2.0.74 → kaqing-2.0.76}/adam/sql/__init__.py +0 -0
- {kaqing-2.0.74 → kaqing-2.0.76}/adam/sql/sql_completer.py +0 -0
- {kaqing-2.0.74 → kaqing-2.0.76}/adam/sql/state_machine.py +0 -0
- {kaqing-2.0.74 → kaqing-2.0.76}/adam/sql/term_completer.py +0 -0
- {kaqing-2.0.74 → kaqing-2.0.76}/adam/sso/__init__.py +0 -0
- {kaqing-2.0.74 → kaqing-2.0.76}/adam/sso/authenticator.py +0 -0
- {kaqing-2.0.74 → kaqing-2.0.76}/adam/sso/authn_ad.py +0 -0
- {kaqing-2.0.74 → kaqing-2.0.76}/adam/sso/authn_okta.py +0 -0
- {kaqing-2.0.74 → kaqing-2.0.76}/adam/sso/cred_cache.py +0 -0
- {kaqing-2.0.74 → kaqing-2.0.76}/adam/sso/id_token.py +0 -0
- {kaqing-2.0.74 → kaqing-2.0.76}/adam/sso/idp.py +0 -0
- {kaqing-2.0.74 → kaqing-2.0.76}/adam/sso/idp_login.py +0 -0
- {kaqing-2.0.74 → kaqing-2.0.76}/adam/sso/idp_session.py +0 -0
- {kaqing-2.0.74 → kaqing-2.0.76}/adam/sso/sso_config.py +0 -0
- {kaqing-2.0.74 → kaqing-2.0.76}/kaqing.egg-info/SOURCES.txt +0 -0
- {kaqing-2.0.74 → kaqing-2.0.76}/kaqing.egg-info/dependency_links.txt +0 -0
- {kaqing-2.0.74 → kaqing-2.0.76}/kaqing.egg-info/entry_points.txt +0 -0
- {kaqing-2.0.74 → kaqing-2.0.76}/kaqing.egg-info/top_level.txt +0 -0
- {kaqing-2.0.74 → kaqing-2.0.76}/setup.cfg +0 -0
|
@@ -0,0 +1,2 @@
|
|
|
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://sex7je4h2e.execute-api.us-west-2.amazonaws.com/prod', 'workers': 3, 'timeout': 10}, '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': 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}}
|
|
@@ -1,10 +1,13 @@
|
|
|
1
|
+
import getpass
|
|
1
2
|
import os
|
|
2
3
|
import re
|
|
3
4
|
import time
|
|
4
5
|
import traceback
|
|
5
6
|
import click
|
|
7
|
+
import concurrent
|
|
6
8
|
from prompt_toolkit.completion import NestedCompleter
|
|
7
9
|
from prompt_toolkit.key_binding import KeyBindings
|
|
10
|
+
import requests
|
|
8
11
|
|
|
9
12
|
from adam.cli_group import cli
|
|
10
13
|
from adam.commands.command import Command
|
|
@@ -92,73 +95,87 @@ def enter_repl(state: ReplState):
|
|
|
92
95
|
def _(event):
|
|
93
96
|
event.app.current_buffer.text = ''
|
|
94
97
|
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
if
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
98
|
+
with concurrent.futures.ThreadPoolExecutor(max_workers=Config().get('audit.workers', 3)) as executor:
|
|
99
|
+
# use sorted command list only for auto-completion
|
|
100
|
+
sorted_cmds = sorted(cmd_list, key=lambda cmd: cmd.command())
|
|
101
|
+
while True:
|
|
102
|
+
try:
|
|
103
|
+
completer = NestedCompleter.from_nested_dict({})
|
|
104
|
+
if not state.bash_session:
|
|
105
|
+
completions = {}
|
|
106
|
+
# app commands are available only on a: drive
|
|
107
|
+
if state.device == ReplState.A and state.app_app:
|
|
108
|
+
completions = Apps(path='apps.yaml').commands()
|
|
109
|
+
|
|
110
|
+
for cmd in sorted_cmds:
|
|
111
|
+
s1 = time.time()
|
|
112
|
+
try:
|
|
113
|
+
completions = deep_sort_dict(deep_merge_dicts(completions, cmd.completion(state)))
|
|
114
|
+
finally:
|
|
115
|
+
if Config().get('debugs.timings', False):
|
|
116
|
+
log2(f'Timing auto-completion-calc {cmd.command()}: {time.time() - s1:.2f}')
|
|
117
|
+
|
|
118
|
+
# print(json.dumps(completions, indent=4))
|
|
119
|
+
completer = NestedCompleter.from_nested_dict(completions)
|
|
120
|
+
|
|
121
|
+
cmd = session.prompt(prompt_msg(), completer=completer, key_bindings=kb)
|
|
122
|
+
s0 = time.time()
|
|
123
|
+
|
|
124
|
+
if state.bash_session:
|
|
125
|
+
if cmd.strip(' ') == 'exit':
|
|
126
|
+
state.exit_bash()
|
|
127
|
+
continue
|
|
128
|
+
|
|
129
|
+
cmd = f'bash {cmd}'
|
|
130
|
+
|
|
131
|
+
if cmd and cmd.strip(' ') and not cmds.run(cmd, state):
|
|
132
|
+
c_sql_tried = False
|
|
133
|
+
if state.device == ReplState.P:
|
|
134
|
+
pg = PostgresSession(state.namespace, state.pg_path)
|
|
135
|
+
if pg.db:
|
|
136
|
+
c_sql_tried = True
|
|
137
|
+
cmd = f'pg {cmd}'
|
|
138
|
+
cmds.run(cmd, state)
|
|
139
|
+
elif state.device == ReplState.A:
|
|
140
|
+
if state.app_app:
|
|
141
|
+
c_sql_tried = True
|
|
142
|
+
cmd = f'app {cmd}'
|
|
143
|
+
cmds.run(cmd, state)
|
|
144
|
+
elif state.sts:
|
|
132
145
|
c_sql_tried = True
|
|
133
|
-
cmd = f'
|
|
146
|
+
cmd = f'cql {cmd}'
|
|
134
147
|
cmds.run(cmd, state)
|
|
135
|
-
|
|
136
|
-
if
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
log2()
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
148
|
+
|
|
149
|
+
if not c_sql_tried:
|
|
150
|
+
log2(f'* Invalid command: {cmd}')
|
|
151
|
+
log2()
|
|
152
|
+
lines = [c.help(state) for c in cmd_list if c.help(state)]
|
|
153
|
+
log2(lines_to_tabular(lines, separator='\t'))
|
|
154
|
+
except EOFError: # Handle Ctrl+D (EOF) for graceful exit
|
|
155
|
+
break
|
|
156
|
+
except Exception as e:
|
|
157
|
+
if Config().get('debugs.exit-on-error', False):
|
|
158
|
+
raise e
|
|
159
|
+
else:
|
|
160
|
+
log2(e)
|
|
161
|
+
Config().debug(traceback.format_exc())
|
|
162
|
+
finally:
|
|
163
|
+
Config().clear_wait_log_flag()
|
|
164
|
+
if Config().get('debugs.timings', False) and 'cmd' in locals() and 's0' in locals():
|
|
165
|
+
log2(f'Timing command {cmd}: {time.time() - s0:.2f}')
|
|
166
|
+
|
|
167
|
+
# offload audit logging
|
|
168
|
+
if cmd:
|
|
169
|
+
executor.submit(audit_log, cmd, state)
|
|
170
|
+
|
|
171
|
+
def audit_log(cmd: str, state: ReplState):
|
|
172
|
+
payload = {"line": cmd, "ts": time.time(), "cluster": state.namespace if state.namespace else 'NA', "user": getpass.getuser()}
|
|
173
|
+
audit_endpoint = Config().get("audit.endpoint", "https://sex7je4h2e.execute-api.us-west-2.amazonaws.com/prod")
|
|
174
|
+
response = requests.post(audit_endpoint, json=payload, timeout=Config().get("audit.timeout", 10))
|
|
175
|
+
if response.status_code in [200, 201]:
|
|
176
|
+
Config().debug(response.text)
|
|
177
|
+
else:
|
|
178
|
+
log2(f"Error: {response.status_code} {response.text}")
|
|
162
179
|
|
|
163
180
|
@cli.command(context_settings=dict(ignore_unknown_options=True, allow_extra_args=True), cls=ClusterCommandHelper, help="Enter interactive shell.")
|
|
164
181
|
@click.option('--kubeconfig', '-k', required=False, metavar='path', help='path to kubeconfig file')
|
|
@@ -1,2 +0,0 @@
|
|
|
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'}, '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': 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}}
|
kaqing-2.0.74/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
|