kaqing 2.0.95__py3-none-any.whl → 2.0.97__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of kaqing might be problematic. Click here for more details.
- adam/batch.py +1 -1
- adam/commands/cql/cql_utils.py +3 -0
- adam/commands/describe/describe.py +2 -1
- adam/commands/describe/describe_keyspace.py +3 -3
- adam/commands/describe/describe_keyspaces.py +4 -5
- adam/commands/describe/describe_schema.py +49 -0
- adam/commands/describe/describe_table.py +2 -2
- adam/commands/describe/describe_tables.py +4 -5
- adam/config.py +1 -1
- adam/version.py +1 -1
- {kaqing-2.0.95.dist-info → kaqing-2.0.97.dist-info}/METADATA +1 -1
- {kaqing-2.0.95.dist-info → kaqing-2.0.97.dist-info}/RECORD +15 -14
- {kaqing-2.0.95.dist-info → kaqing-2.0.97.dist-info}/WHEEL +0 -0
- {kaqing-2.0.95.dist-info → kaqing-2.0.97.dist-info}/entry_points.txt +0 -0
- {kaqing-2.0.95.dist-info → kaqing-2.0.97.dist-info}/top_level.txt +0 -0
adam/batch.py
CHANGED
|
@@ -107,7 +107,7 @@ def deploy(kubeconfig: str, config: str, param: list[str], namespace: str, extra
|
|
|
107
107
|
@click.option('--all-nodes', '-a', is_flag=True, help='execute on all Cassandra nodes')
|
|
108
108
|
@click.argument('extra_args', nargs=-1, metavar='<cluster|pod>', type=click.UNPROCESSED)
|
|
109
109
|
def describe(kubeconfig: str, config: str, param: list[str], cluster: str, namespace: str, pod: str, all_nodes: bool, extra_args):
|
|
110
|
-
run_command(Describe(), kubeconfig, config, param, cluster, namespace, pod, ('
|
|
110
|
+
run_command(Describe(), kubeconfig, config, param, cluster, namespace, pod, extra_args + ('&',) if all_nodes else extra_args)
|
|
111
111
|
|
|
112
112
|
|
|
113
113
|
@cli.command(context_settings=dict(ignore_unknown_options=True, allow_extra_args=True), cls=ClusterOrPodCommandHelper, help="Print Qing's issues.")
|
adam/commands/cql/cql_utils.py
CHANGED
|
@@ -42,6 +42,9 @@ def run_cql(state: ReplState, cql: str, opts: list = [], show_out = False, use_s
|
|
|
42
42
|
else:
|
|
43
43
|
command = f'cqlsh -u {user} -p {pw} {" ".join(opts)} -e "{cql}"'
|
|
44
44
|
|
|
45
|
+
if not on_any:
|
|
46
|
+
command = f'{command} &'
|
|
47
|
+
|
|
45
48
|
if state.pod:
|
|
46
49
|
return CassandraNodes.exec(state.pod, state.namespace, command, show_out=show_out)
|
|
47
50
|
else:
|
|
@@ -3,6 +3,7 @@ import click
|
|
|
3
3
|
from adam.commands.command import Command
|
|
4
4
|
from adam.commands.describe.describe_keyspace import DescribeKeyspace
|
|
5
5
|
from adam.commands.describe.describe_keyspaces import DescribeKeyspaces
|
|
6
|
+
from adam.commands.describe.describe_schema import DescribeSchema
|
|
6
7
|
from adam.commands.describe.describe_table import DescribeTable
|
|
7
8
|
from adam.commands.describe.describe_tables import DescribeTables
|
|
8
9
|
from adam.repl_state import ReplState, RequiredState
|
|
@@ -33,7 +34,7 @@ class Describe(Command):
|
|
|
33
34
|
return super().intermediate_run(cmd, state, args, Describe.cmd_list())
|
|
34
35
|
|
|
35
36
|
def cmd_list():
|
|
36
|
-
return [DescribeKeyspace(), DescribeKeyspaces(), DescribeTable(), DescribeTables()]
|
|
37
|
+
return [DescribeKeyspace(), DescribeKeyspaces(), DescribeSchema(), DescribeTable(), DescribeTables()]
|
|
37
38
|
|
|
38
39
|
def completion(self, state: ReplState):
|
|
39
40
|
if state.sts:
|
|
@@ -30,7 +30,7 @@ class DescribeKeyspace(Command):
|
|
|
30
30
|
if not self.validate_state(state):
|
|
31
31
|
return state
|
|
32
32
|
|
|
33
|
-
args, all_nodes = Command.extract_options(args, '
|
|
33
|
+
args, all_nodes = Command.extract_options(args, '&')
|
|
34
34
|
|
|
35
35
|
if not args:
|
|
36
36
|
if state.in_repl:
|
|
@@ -52,9 +52,9 @@ class DescribeKeyspace(Command):
|
|
|
52
52
|
|
|
53
53
|
def completion(self, state: ReplState) -> dict[str, any]:
|
|
54
54
|
if state.sts:
|
|
55
|
-
return super().completion(state, {ks: {'
|
|
55
|
+
return super().completion(state, {ks: {'&': None} for ks in keyspaces(state, on_any=True)})
|
|
56
56
|
|
|
57
57
|
return {}
|
|
58
58
|
|
|
59
59
|
def help(self, _: ReplState) -> str:
|
|
60
|
-
return f'{DescribeKeyspace.COMMAND} <keyspace-name> [
|
|
60
|
+
return f'{DescribeKeyspace.COMMAND} <keyspace-name> [&]\t describe Cassandra keyspace'
|
|
@@ -30,9 +30,8 @@ class DescribeKeyspaces(Command):
|
|
|
30
30
|
if not self.validate_state(state):
|
|
31
31
|
return state
|
|
32
32
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
r: list[PodExecResult] = run_cql(state, f'describe keyspaces', show_out=True, on_any=not all_nodes)
|
|
33
|
+
args, all_nodes = Command.extract_options(args, '&')
|
|
34
|
+
r: list[PodExecResult] = run_cql(state, f'{DescribeKeyspaces.COMMAND} {" ".join(args)}', show_out=True, on_any=not all_nodes)
|
|
36
35
|
if not r:
|
|
37
36
|
log2('No pod is available')
|
|
38
37
|
return 'no-pod'
|
|
@@ -42,9 +41,9 @@ class DescribeKeyspaces(Command):
|
|
|
42
41
|
|
|
43
42
|
def completion(self, state: ReplState) -> dict[str, any]:
|
|
44
43
|
if state.sts:
|
|
45
|
-
return super().completion(state, {'
|
|
44
|
+
return super().completion(state, {'&': None})
|
|
46
45
|
|
|
47
46
|
return {}
|
|
48
47
|
|
|
49
48
|
def help(self, _: ReplState) -> str:
|
|
50
|
-
return f'{DescribeKeyspaces.COMMAND} [
|
|
49
|
+
return f'{DescribeKeyspaces.COMMAND} [&]\t describe Cassandra keyspaces'
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
from adam.commands.command import Command
|
|
2
|
+
from adam.commands.cql.cql_utils import run_cql
|
|
3
|
+
from adam.pod_exec_result import PodExecResult
|
|
4
|
+
from adam.repl_state import ReplState, RequiredState
|
|
5
|
+
from adam.utils import log2
|
|
6
|
+
|
|
7
|
+
class DescribeSchema(Command):
|
|
8
|
+
COMMAND = 'describe schema'
|
|
9
|
+
|
|
10
|
+
# the singleton pattern
|
|
11
|
+
def __new__(cls, *args, **kwargs):
|
|
12
|
+
if not hasattr(cls, 'instance'): cls.instance = super(DescribeSchema, cls).__new__(cls)
|
|
13
|
+
|
|
14
|
+
return cls.instance
|
|
15
|
+
|
|
16
|
+
def __init__(self, successor: Command=None):
|
|
17
|
+
super().__init__(successor)
|
|
18
|
+
|
|
19
|
+
def required(self):
|
|
20
|
+
return RequiredState.CLUSTER
|
|
21
|
+
|
|
22
|
+
def command(self):
|
|
23
|
+
return DescribeSchema.COMMAND
|
|
24
|
+
|
|
25
|
+
def run(self, cmd: str, state: ReplState):
|
|
26
|
+
if not(args := self.args(cmd)):
|
|
27
|
+
return super().run(cmd, state)
|
|
28
|
+
|
|
29
|
+
state, args = self.apply_state(args, state)
|
|
30
|
+
if not self.validate_state(state):
|
|
31
|
+
return state
|
|
32
|
+
|
|
33
|
+
args, all_nodes = Command.extract_options(args, '&')
|
|
34
|
+
r: list[PodExecResult] = run_cql(state, f'{DescribeSchema.COMMAND} {" ".join(args)}', show_out=True, on_any=not all_nodes)
|
|
35
|
+
if not r:
|
|
36
|
+
log2('No pod is available')
|
|
37
|
+
return 'no-pod'
|
|
38
|
+
|
|
39
|
+
# do not continue to cql route
|
|
40
|
+
return state
|
|
41
|
+
|
|
42
|
+
def completion(self, state: ReplState) -> dict[str, any]:
|
|
43
|
+
if state.sts:
|
|
44
|
+
return super().completion(state, {'&': None})
|
|
45
|
+
|
|
46
|
+
return {}
|
|
47
|
+
|
|
48
|
+
def help(self, _: ReplState) -> str:
|
|
49
|
+
return f'{DescribeSchema.COMMAND} [&]\t describe Cassandra tables'
|
|
@@ -52,9 +52,9 @@ class DescribeTable(Command):
|
|
|
52
52
|
|
|
53
53
|
def completion(self, state: ReplState) -> dict[str, any]:
|
|
54
54
|
if state.sts:
|
|
55
|
-
return super().completion(state, {t: {'
|
|
55
|
+
return super().completion(state, {t: {'&': None} for t in table_names(state)})
|
|
56
56
|
|
|
57
57
|
return {}
|
|
58
58
|
|
|
59
59
|
def help(self, _: ReplState) -> str:
|
|
60
|
-
return f'{DescribeTable.COMMAND} <table-name> [
|
|
60
|
+
return f'{DescribeTable.COMMAND} <table-name> [&]\t describe Cassandra table'
|
|
@@ -30,9 +30,8 @@ class DescribeTables(Command):
|
|
|
30
30
|
if not self.validate_state(state):
|
|
31
31
|
return state
|
|
32
32
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
r: list[PodExecResult] = run_cql(state, f'describe tables', show_out=True, on_any=not all_nodes)
|
|
33
|
+
args, all_nodes = Command.extract_options(args, '&')
|
|
34
|
+
r: list[PodExecResult] = run_cql(state, f'{DescribeTables.COMMAND} {" ".join(args)}', show_out=True, on_any=not all_nodes)
|
|
36
35
|
if not r:
|
|
37
36
|
log2('No pod is available')
|
|
38
37
|
return 'no-pod'
|
|
@@ -42,9 +41,9 @@ class DescribeTables(Command):
|
|
|
42
41
|
|
|
43
42
|
def completion(self, state: ReplState) -> dict[str, any]:
|
|
44
43
|
if state.sts:
|
|
45
|
-
return super().completion(state, {'
|
|
44
|
+
return super().completion(state, {'&': None})
|
|
46
45
|
|
|
47
46
|
return {}
|
|
48
47
|
|
|
49
48
|
def help(self, _: ReplState) -> str:
|
|
50
|
-
return f'{DescribeTables.COMMAND} [
|
|
49
|
+
return f'{DescribeTables.COMMAND} [&]\t describe Cassandra tables'
|
adam/config.py
CHANGED
|
@@ -39,7 +39,7 @@ class Config:
|
|
|
39
39
|
return get_deep_keys(self.params)
|
|
40
40
|
|
|
41
41
|
def is_debug(self):
|
|
42
|
-
return os.getenv('QING_DEV').lower() == 'true' or Config().get('debug', False)
|
|
42
|
+
return os.getenv('QING_DEV', 'false').lower() == 'true' or Config().get('debug', False)
|
|
43
43
|
|
|
44
44
|
def debug(self, s: None):
|
|
45
45
|
if self.is_debug():
|
adam/version.py
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
adam/__init__.py,sha256=oVw1FNd9HZPJ7wm6BNn5ybyNGJLjJ8kopMeBiwgMaOI,59
|
|
2
2
|
adam/app_session.py,sha256=Klypm4JYHOlovaRCHAZ2P_Mj_nheMlcQgX403R0TJGk,6969
|
|
3
3
|
adam/apps.py,sha256=okYibOEiCVoM5zsPUKaLJZlwlnvWSHKL7U2J1Yk3-Aw,6701
|
|
4
|
-
adam/batch.py,sha256=
|
|
4
|
+
adam/batch.py,sha256=7VI7g6uiZN5WNDWcTGQPXiatFsH6Mg7qsU0tCi95Qz0,25241
|
|
5
5
|
adam/cli.py,sha256=03pIZdomAu7IL-GSP6Eun_PKwwISShRAmfx6eVRPGC0,458
|
|
6
6
|
adam/cli_group.py,sha256=W3zy1BghCtVcEXizq8fBH-93ZRVVwgAyGPzy0sHno1Y,593
|
|
7
|
-
adam/config.py,sha256=
|
|
7
|
+
adam/config.py,sha256=GRtfpGgGwfeYdVSPfk3LKCRXlOEJZ2vmXM3ADr7IhVk,2880
|
|
8
8
|
adam/embedded_apps.py,sha256=lKPx63mKzJbNmwz0rgL4gF76M9fDGxraYTtNAIGnZ_s,419
|
|
9
9
|
adam/embedded_params.py,sha256=mxwL1A9iBsRkKPjL8xkFZ67wwknm2EPI3PstrF6Rvt0,5012
|
|
10
10
|
adam/log.py,sha256=gg5DK52wLPc9cjykeh0WFHyAk1qI3HEpGaAK8W2dzXY,1146
|
|
@@ -16,7 +16,7 @@ adam/repl_state.py,sha256=VlQpV19Sg5vL8H3o8lQxZB5atyuTuN5iEQsd6xpSkQQ,8774
|
|
|
16
16
|
adam/utils.py,sha256=sbsNZP3qGJtb6fXCa4dDXHry5ay9ev583cCZIQzy07s,7382
|
|
17
17
|
adam/utils_athena.py,sha256=tU6Arg4g7eKV6ei9SLgakOJJqxKgSCsII-7a68OI7_g,3199
|
|
18
18
|
adam/utils_net.py,sha256=65fhBnWMCkhGtyHqz95qcHaCo35q-WX1RBkkXG8dKpI,416
|
|
19
|
-
adam/version.py,sha256=
|
|
19
|
+
adam/version.py,sha256=EhlDYaIpc-OvyS0b47jHaJwdqhOR9YG-9skABPr5nUY,139
|
|
20
20
|
adam/checks/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
21
21
|
adam/checks/check.py,sha256=Qopr3huYcMu2bzQgb99dEUYjFzkjKHRI76S6KA9b9Rk,702
|
|
22
22
|
adam/checks/check_context.py,sha256=FEHkQ32jY1EDopQ2uYWqy9v7aEEX1orLpJWhopwAlh4,402
|
|
@@ -84,7 +84,7 @@ adam/commands/audit/audit_repair_tables.py,sha256=ciKmacngg1r14uR8Z_uzgNH_sk0QlC
|
|
|
84
84
|
adam/commands/cql/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
85
85
|
adam/commands/cql/cql_completions.py,sha256=dXe51NTWEJis76587IWSn9Av-cjC0J6KMaxlBKfF4wM,411
|
|
86
86
|
adam/commands/cql/cql_table_completer.py,sha256=Tth6lmZ1eCEbJeAVZojTx594ttQeeVf-OjhhkSLyRnI,312
|
|
87
|
-
adam/commands/cql/cql_utils.py,sha256=
|
|
87
|
+
adam/commands/cql/cql_utils.py,sha256=n1XBvgC0Bi0AwUdLZHzXi3n2VQivAXF-Ll7g2dyK_M4,4058
|
|
88
88
|
adam/commands/cql/cqlsh.py,sha256=qEQufaDVi9FXkvruum6OHQDfLX01DVWVDnWsAjyCZYQ,2661
|
|
89
89
|
adam/commands/deploy/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
90
90
|
adam/commands/deploy/code_start.py,sha256=-iH8HThTNM83IfBxT_LqTByuHVatV9d-Il4OYOfrwLI,1370
|
|
@@ -100,11 +100,12 @@ adam/commands/deploy/undeploy_frontend.py,sha256=gHekPn7l19JgVbhneKpQ7ModNoDFmzW
|
|
|
100
100
|
adam/commands/deploy/undeploy_pg_agent.py,sha256=RYME8no1FT94WpVg-HXDGL1NmLlpE1I9R4htitjaxpo,1319
|
|
101
101
|
adam/commands/deploy/undeploy_pod.py,sha256=I-pNfdcfBGLJ5YssTjSHoM4miygqoiGN233wUSIUG9Y,1905
|
|
102
102
|
adam/commands/describe/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
103
|
-
adam/commands/describe/describe.py,sha256=
|
|
104
|
-
adam/commands/describe/describe_keyspace.py,sha256=
|
|
105
|
-
adam/commands/describe/describe_keyspaces.py,sha256=
|
|
106
|
-
adam/commands/describe/
|
|
107
|
-
adam/commands/describe/
|
|
103
|
+
adam/commands/describe/describe.py,sha256=h300tQRWPNCil9KXM1mUdNHiNcXb3Gq1x92anpJHtKA,1594
|
|
104
|
+
adam/commands/describe/describe_keyspace.py,sha256=clqDM5-mS_8R90vjz14Z7P7dr38JbKft3v-KN5WAs-w,1901
|
|
105
|
+
adam/commands/describe/describe_keyspaces.py,sha256=3oYiHoCFoTrgFG0xfWgU60412n9C0jLY38d_w0mghnQ,1576
|
|
106
|
+
adam/commands/describe/describe_schema.py,sha256=mOiFqWe_M1JwtL-qSvGsXjlQxgViX0AWZl9f4ho58zY,1555
|
|
107
|
+
adam/commands/describe/describe_table.py,sha256=wMAsi0bZuehDzj5LtkQfLFyiAGTlyfM_aou4Nvg53TE,1867
|
|
108
|
+
adam/commands/describe/describe_tables.py,sha256=rtZtPZ8bHI6XXfKW0TcEXqmdgeOiC73QUoY4ig4xsEw,1555
|
|
108
109
|
adam/commands/medusa/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
109
110
|
adam/commands/medusa/medusa.py,sha256=KNFjStvilIuOJt3wTtcWmKvdm8FdCnrDY2ltEWbratk,1402
|
|
110
111
|
adam/commands/medusa/medusa_backup.py,sha256=Tns-nBbqTnry8zoCFtXCisco3ipcOgArQbN5rc7SRGY,1801
|
|
@@ -183,8 +184,8 @@ adam/utils_k8s/service_accounts.py,sha256=v2oQSqCrNvt2uRnKlNwR3fjtpUG7oF5nqgzEB7
|
|
|
183
184
|
adam/utils_k8s/services.py,sha256=EOJJGACVbbRvu5T3rMKqIJqgYic1_MSJ17EA0TJ6UOk,3156
|
|
184
185
|
adam/utils_k8s/statefulsets.py,sha256=5g7KxGRHgEewT8rnZneDTaJDylUf-dHH2edWJEoorr8,4667
|
|
185
186
|
adam/utils_k8s/volumes.py,sha256=RIBmlOSWM3V3QVXLCFT0owVOyh4rGG1ETp521a-6ndo,1137
|
|
186
|
-
kaqing-2.0.
|
|
187
|
-
kaqing-2.0.
|
|
188
|
-
kaqing-2.0.
|
|
189
|
-
kaqing-2.0.
|
|
190
|
-
kaqing-2.0.
|
|
187
|
+
kaqing-2.0.97.dist-info/METADATA,sha256=qaqFv8l7YzIR5aq2U070P14QwEQwQlt7kImfDS-GV14,132
|
|
188
|
+
kaqing-2.0.97.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
|
|
189
|
+
kaqing-2.0.97.dist-info/entry_points.txt,sha256=SkzhuQJUWsXOzHeZ5TgQ2c3_g53UGK23zzJU_JTZOZI,39
|
|
190
|
+
kaqing-2.0.97.dist-info/top_level.txt,sha256=8_2PZkwBb-xDcnc8a2rAbQeJhXKXskc7zTP7pSPa1fw,5
|
|
191
|
+
kaqing-2.0.97.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|