data-ops-cli 0.3.1__tar.gz → 0.3.4__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.
- {data_ops_cli-0.3.1 → data_ops_cli-0.3.4}/PKG-INFO +2 -2
- {data_ops_cli-0.3.1 → data_ops_cli-0.3.4}/pyproject.toml +1 -1
- {data_ops_cli-0.3.1 → data_ops_cli-0.3.4}/src/data_ops_cli.egg-info/PKG-INFO +2 -2
- {data_ops_cli-0.3.1 → data_ops_cli-0.3.4}/src/data_ops_cli.egg-info/requires.txt +1 -1
- {data_ops_cli-0.3.1 → data_ops_cli-0.3.4}/src/dataops_cli/__init__.py +1 -1
- {data_ops_cli-0.3.1 → data_ops_cli-0.3.4}/src/dataops_cli/cli/alarm.py +19 -18
- {data_ops_cli-0.3.1 → data_ops_cli-0.3.4}/src/dataops_cli/cli/api.py +3 -6
- {data_ops_cli-0.3.1 → data_ops_cli-0.3.4}/src/dataops_cli/cli/auth.py +2 -1
- {data_ops_cli-0.3.1 → data_ops_cli-0.3.4}/src/dataops_cli/cli/data_table.py +5 -4
- {data_ops_cli-0.3.1 → data_ops_cli-0.3.4}/src/dataops_cli/cli/dataset.py +2 -1
- {data_ops_cli-0.3.1 → data_ops_cli-0.3.4}/src/dataops_cli/cli/datasource.py +2 -1
- {data_ops_cli-0.3.1 → data_ops_cli-0.3.4}/src/dataops_cli/cli/dict_.py +5 -10
- {data_ops_cli-0.3.1 → data_ops_cli-0.3.4}/src/dataops_cli/cli/hazard.py +2 -1
- {data_ops_cli-0.3.1 → data_ops_cli-0.3.4}/src/dataops_cli/cli/metrics.py +2 -1
- {data_ops_cli-0.3.1 → data_ops_cli-0.3.4}/src/dataops_cli/cli/ref.py +27 -8
- {data_ops_cli-0.3.1 → data_ops_cli-0.3.4}/src/dataops_cli/cli/report.py +2 -1
- data_ops_cli-0.3.4/src/dataops_cli/cli/skill.py +340 -0
- {data_ops_cli-0.3.1 → data_ops_cli-0.3.4}/src/dataops_cli/cli/table.py +10 -9
- {data_ops_cli-0.3.1 → data_ops_cli-0.3.4}/src/dataops_cli/cli/utils.py +43 -1
- {data_ops_cli-0.3.1 → data_ops_cli-0.3.4}/src/dataops_cli/cli/widget.py +2 -1
- {data_ops_cli-0.3.1 → data_ops_cli-0.3.4}/src/dataops_cli/cli/workflow.py +2 -1
- data_ops_cli-0.3.1/src/dataops_cli/cli/skill.py +0 -342
- {data_ops_cli-0.3.1 → data_ops_cli-0.3.4}/setup.cfg +0 -0
- {data_ops_cli-0.3.1 → data_ops_cli-0.3.4}/src/data_ops_cli.egg-info/SOURCES.txt +0 -0
- {data_ops_cli-0.3.1 → data_ops_cli-0.3.4}/src/data_ops_cli.egg-info/dependency_links.txt +0 -0
- {data_ops_cli-0.3.1 → data_ops_cli-0.3.4}/src/data_ops_cli.egg-info/entry_points.txt +0 -0
- {data_ops_cli-0.3.1 → data_ops_cli-0.3.4}/src/data_ops_cli.egg-info/top_level.txt +0 -0
- {data_ops_cli-0.3.1 → data_ops_cli-0.3.4}/src/dataops_cli/_compat.py +0 -0
- {data_ops_cli-0.3.1 → data_ops_cli-0.3.4}/src/dataops_cli/cli/__init__.py +0 -0
- {data_ops_cli-0.3.1 → data_ops_cli-0.3.4}/src/dataops_cli/cli/factory.py +0 -0
- {data_ops_cli-0.3.1 → data_ops_cli-0.3.4}/src/dataops_cli/exceptions.py +0 -0
- {data_ops_cli-0.3.1 → data_ops_cli-0.3.4}/src/dataops_cli/runner.py +0 -0
- {data_ops_cli-0.3.1 → data_ops_cli-0.3.4}/src/dataops_cli/schems.py +0 -0
- {data_ops_cli-0.3.1 → data_ops_cli-0.3.4}/src/dataops_cli/sdk.py +0 -0
- {data_ops_cli-0.3.1 → data_ops_cli-0.3.4}/src/dataops_cli/session.py +0 -0
- {data_ops_cli-0.3.1 → data_ops_cli-0.3.4}/src/dataops_cli/utils.py +0 -0
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: data-ops-cli
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.4
|
|
4
4
|
Summary: Command-line wrapper around dataops_sdk for the DataOps platform.
|
|
5
5
|
Requires-Python: >=3.11
|
|
6
|
-
Requires-Dist: dataops-sdk[runner]>=0.3.
|
|
6
|
+
Requires-Dist: dataops-sdk[runner]>=0.3.4
|
|
7
7
|
Requires-Dist: typer
|
|
8
8
|
Requires-Dist: rich
|
|
9
9
|
Provides-Extra: dev
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: data-ops-cli
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.4
|
|
4
4
|
Summary: Command-line wrapper around dataops_sdk for the DataOps platform.
|
|
5
5
|
Requires-Python: >=3.11
|
|
6
|
-
Requires-Dist: dataops-sdk[runner]>=0.3.
|
|
6
|
+
Requires-Dist: dataops-sdk[runner]>=0.3.4
|
|
7
7
|
Requires-Dist: typer
|
|
8
8
|
Requires-Dist: rich
|
|
9
9
|
Provides-Extra: dev
|
|
@@ -7,10 +7,9 @@
|
|
|
7
7
|
"""
|
|
8
8
|
|
|
9
9
|
import json
|
|
10
|
-
from typing import Annotated, Any
|
|
10
|
+
from typing import Annotated, Any
|
|
11
11
|
|
|
12
12
|
import typer
|
|
13
|
-
from dataops_cli.cli.utils import print_list
|
|
14
13
|
from dataops_sdk.exceptions import DataOpsError
|
|
15
14
|
from dataops_sdk.schemas.query import SqlQueryParam
|
|
16
15
|
from dataops_sdk.services.alarm import (
|
|
@@ -32,6 +31,8 @@ from pydantic_core import to_json
|
|
|
32
31
|
from rich.console import Console
|
|
33
32
|
from rich.table import Table
|
|
34
33
|
|
|
34
|
+
from dataops_cli.cli.utils import print_list
|
|
35
|
+
|
|
35
36
|
# ---------------------------------------------------------------------------
|
|
36
37
|
# CLI 命令(薄包装,负责输出渲染)
|
|
37
38
|
# ---------------------------------------------------------------------------
|
|
@@ -89,8 +90,8 @@ def _print_column_list(data: Any) -> None:
|
|
|
89
90
|
@rule_match_typer.command("count", help="查询告警匹配规则数量")
|
|
90
91
|
def count_alarm_rules_match(
|
|
91
92
|
spec: Annotated[list[str], typer.Option(help="专业值", default_factory=list)],
|
|
92
|
-
query: Annotated[
|
|
93
|
-
enabled: Annotated[
|
|
93
|
+
query: Annotated[str | None, typer.Option("-q", "--query", help="搜索关键字")] = None,
|
|
94
|
+
enabled: Annotated[bool | None, typer.Option(help="启用状态")] = None,
|
|
94
95
|
):
|
|
95
96
|
"""查询告警匹配规则数量。
|
|
96
97
|
|
|
@@ -117,8 +118,8 @@ def list_alarm_rules_match(
|
|
|
117
118
|
spec: Annotated[list[str], typer.Option(help="专业值", default_factory=list)],
|
|
118
119
|
page_num: Annotated[int, typer.Option("-n", "--page-num", help="页码")] = 0,
|
|
119
120
|
page_size: Annotated[int, typer.Option("-s", "--page-size", help="每页大小")] = 20,
|
|
120
|
-
query: Annotated[
|
|
121
|
-
enabled: Annotated[
|
|
121
|
+
query: Annotated[str | None, typer.Option("-q", "--query", help="搜索关键字")] = None,
|
|
122
|
+
enabled: Annotated[bool | None, typer.Option(help="启用状态")] = None,
|
|
122
123
|
):
|
|
123
124
|
"""查询告警匹配规则列表。
|
|
124
125
|
|
|
@@ -172,8 +173,8 @@ def list_alarm_rules_match(
|
|
|
172
173
|
def list_alarm_specs(
|
|
173
174
|
page_num: Annotated[int, typer.Option("-n", "--page-num", help="页码")] = 0,
|
|
174
175
|
page_size: Annotated[int, typer.Option("-s", "--page-size", help="每页大小")] = 20,
|
|
175
|
-
query: Annotated[
|
|
176
|
-
active: Annotated[
|
|
176
|
+
query: Annotated[str | None, typer.Option("-q", "--query", help="搜索关键字")] = None,
|
|
177
|
+
active: Annotated[bool | None, typer.Option(help="启用状态")] = None,
|
|
177
178
|
):
|
|
178
179
|
"""查询告警专业列表。
|
|
179
180
|
|
|
@@ -213,8 +214,8 @@ def list_alarm_specs(
|
|
|
213
214
|
|
|
214
215
|
@alarm_spec_typer.command("count", help="查询告警专业数量")
|
|
215
216
|
def count_alarm_specs(
|
|
216
|
-
query: Annotated[
|
|
217
|
-
enabled: Annotated[
|
|
217
|
+
query: Annotated[str | None, typer.Option("-q", "--query", help="搜索关键字")] = None,
|
|
218
|
+
enabled: Annotated[bool | None, typer.Option(help="启用状态")] = None,
|
|
218
219
|
):
|
|
219
220
|
"""查询告警专业的总数。
|
|
220
221
|
|
|
@@ -233,8 +234,8 @@ def count_alarm_specs(
|
|
|
233
234
|
def list_alarm_rules(
|
|
234
235
|
page_num: Annotated[int, typer.Option("-n", "--page-num", help="页码")] = 0,
|
|
235
236
|
page_size: Annotated[int, typer.Option("-s", "--page-size", help="每页大小")] = 20,
|
|
236
|
-
query: Annotated[
|
|
237
|
-
enabled: Annotated[
|
|
237
|
+
query: Annotated[str | None, typer.Option("-q", "--query", help="搜索关键字")] = None,
|
|
238
|
+
enabled: Annotated[bool | None, typer.Option(help="启用状态")] = None,
|
|
238
239
|
):
|
|
239
240
|
"""查询告警规则列表。
|
|
240
241
|
|
|
@@ -268,8 +269,8 @@ def list_alarm_rules(
|
|
|
268
269
|
|
|
269
270
|
@alarm_spec_typer.command("count", help="查询告警规则数量")
|
|
270
271
|
def count_alarm_specs(
|
|
271
|
-
query: Annotated[
|
|
272
|
-
enabled: Annotated[
|
|
272
|
+
query: Annotated[str | None, typer.Option("-q", "--query", help="搜索关键字")] = None,
|
|
273
|
+
enabled: Annotated[bool | None, typer.Option(help="启用状态")] = None,
|
|
273
274
|
):
|
|
274
275
|
"""查询告警规则的总数。
|
|
275
276
|
|
|
@@ -289,8 +290,8 @@ def list_alarm_actions(
|
|
|
289
290
|
rule: Annotated[list[str], typer.Option(help="专业值", default_factory=list)],
|
|
290
291
|
page_num: Annotated[int, typer.Option("-n", "--page-num", help="页码")] = 0,
|
|
291
292
|
page_size: Annotated[int, typer.Option("-s", "--page-size", help="每页大小")] = 20,
|
|
292
|
-
query: Annotated[
|
|
293
|
-
enabled: Annotated[
|
|
293
|
+
query: Annotated[str | None, typer.Option("-q", "--query", help="搜索关键字")] = None,
|
|
294
|
+
enabled: Annotated[bool | None, typer.Option(help="启用状态")] = None,
|
|
294
295
|
):
|
|
295
296
|
"""查询告警动作列表。
|
|
296
297
|
|
|
@@ -341,8 +342,8 @@ def list_alarm_actions(
|
|
|
341
342
|
@alarm_action_typer.command("count", help="查询告警动作数量")
|
|
342
343
|
def count_alarm_actions(
|
|
343
344
|
rule: Annotated[list[str], typer.Option(help="专业值", default_factory=list)],
|
|
344
|
-
query: Annotated[
|
|
345
|
-
enabled: Annotated[
|
|
345
|
+
query: Annotated[str | None, typer.Option("-q", "--query", help="搜索关键字")] = None,
|
|
346
|
+
enabled: Annotated[bool | None, typer.Option(help="启用状态")] = None,
|
|
346
347
|
):
|
|
347
348
|
"""查询告警动作的总数。
|
|
348
349
|
|
|
@@ -9,13 +9,14 @@
|
|
|
9
9
|
from typing import Annotated
|
|
10
10
|
|
|
11
11
|
import typer
|
|
12
|
-
from dataops_cli.cli.utils import print_list
|
|
13
12
|
from dataops_sdk.exceptions import DataOpsError
|
|
14
13
|
from dataops_sdk.schemas import MetaType
|
|
15
14
|
from dataops_sdk.services.api import service_get_api_by_code
|
|
16
15
|
from dataops_sdk.services.meta import release_list_list
|
|
17
16
|
from dataops_sdk.utils import filter_nodes_by_pattern
|
|
18
17
|
|
|
18
|
+
from dataops_cli.cli.utils import print_list
|
|
19
|
+
|
|
19
20
|
# ---------------------------------------------------------------------------
|
|
20
21
|
# 常量
|
|
21
22
|
# ---------------------------------------------------------------------------
|
|
@@ -89,14 +90,10 @@ def list_apis(
|
|
|
89
90
|
|
|
90
91
|
print_list(
|
|
91
92
|
["code", "title", "remark"],
|
|
92
|
-
[
|
|
93
|
-
[node.CODE, node.TITLE, _first_line(node.REMARK or "")]
|
|
94
|
-
for node in group_nodes
|
|
95
|
-
]
|
|
93
|
+
[[node.CODE, node.TITLE, _first_line(node.REMARK or "")] for node in group_nodes],
|
|
96
94
|
)
|
|
97
95
|
|
|
98
96
|
|
|
99
|
-
|
|
100
97
|
@api_typer.command("detail", rich_help_panel="API 查询", no_args_is_help=True)
|
|
101
98
|
def get_api_detail(
|
|
102
99
|
code: Annotated[str, typer.Argument(help="API 接口编码")],
|
|
@@ -9,7 +9,6 @@
|
|
|
9
9
|
from typing import Annotated
|
|
10
10
|
|
|
11
11
|
import typer
|
|
12
|
-
from dataops_cli.cli.utils import print_list
|
|
13
12
|
from dataops_sdk.constants import USER_INFO_FILE
|
|
14
13
|
from dataops_sdk.exceptions import AuthenticationError
|
|
15
14
|
from dataops_sdk.schemas import UserInfo
|
|
@@ -27,6 +26,8 @@ from dataops_sdk.utils import get_work_dir
|
|
|
27
26
|
from rich.console import Console
|
|
28
27
|
from rich.table import Table
|
|
29
28
|
|
|
29
|
+
from dataops_cli.cli.utils import print_list
|
|
30
|
+
|
|
30
31
|
auth_typer = typer.Typer(name="auth", help="认证相关命令", no_args_is_help=True)
|
|
31
32
|
application_typer = typer.Typer(name="application", help="应用相关命令", no_args_is_help=True)
|
|
32
33
|
auth_typer.add_typer(application_typer)
|
|
@@ -5,10 +5,9 @@
|
|
|
5
5
|
|
|
6
6
|
from __future__ import annotations
|
|
7
7
|
|
|
8
|
-
from typing import Annotated
|
|
8
|
+
from typing import Annotated
|
|
9
9
|
|
|
10
10
|
import typer
|
|
11
|
-
from dataops_cli.cli.utils import print_list, render_table
|
|
12
11
|
from dataops_sdk.exceptions import DataOpsError
|
|
13
12
|
from dataops_sdk.schemas import MetaType, PageParam, SqlQueryParam
|
|
14
13
|
from dataops_sdk.services import (
|
|
@@ -22,6 +21,8 @@ from dataops_sdk.utils import filter_nodes_by_pattern
|
|
|
22
21
|
from rich.console import Console
|
|
23
22
|
from rich.table import Table
|
|
24
23
|
|
|
24
|
+
from dataops_cli.cli.utils import print_list
|
|
25
|
+
|
|
25
26
|
# ---------------------------------------------------------------------------
|
|
26
27
|
# CLI 命令
|
|
27
28
|
# ---------------------------------------------------------------------------
|
|
@@ -75,7 +76,7 @@ def list_datatable(
|
|
|
75
76
|
@data_table_typer.command("detail", no_args_is_help=True)
|
|
76
77
|
def get_datatable_detail(
|
|
77
78
|
arg1: Annotated[str, typer.Argument(help="编码或数据源")],
|
|
78
|
-
name: Annotated[
|
|
79
|
+
name: Annotated[str | None, typer.Argument(help="表名")] = None,
|
|
79
80
|
) -> None:
|
|
80
81
|
"""获取多维表格的完整详情。
|
|
81
82
|
|
|
@@ -239,7 +240,7 @@ def get_datatable_detail(
|
|
|
239
240
|
@data_table_typer.command("data", no_args_is_help=True)
|
|
240
241
|
def get_datatable_data(
|
|
241
242
|
arg1: Annotated[str, typer.Argument(help="编码或数据源")],
|
|
242
|
-
name: Annotated[
|
|
243
|
+
name: Annotated[str | None, typer.Argument(help="表名")] = None,
|
|
243
244
|
page_num: Annotated[int, typer.Option("-n", "--page-num", help="页码")] = 0,
|
|
244
245
|
page_size: Annotated[int, typer.Option("-s", "--page-size", help="每页大小")] = 20,
|
|
245
246
|
query_param: Annotated[
|
|
@@ -6,7 +6,6 @@
|
|
|
6
6
|
from typing import Annotated
|
|
7
7
|
|
|
8
8
|
import typer
|
|
9
|
-
from dataops_cli.cli.utils import print_list
|
|
10
9
|
from dataops_sdk.exceptions import DataOpsError
|
|
11
10
|
from dataops_sdk.schemas import PageParam, SqlQueryParam
|
|
12
11
|
from dataops_sdk.services import (
|
|
@@ -20,6 +19,8 @@ from pydantic import ValidationError
|
|
|
20
19
|
from rich.console import Console
|
|
21
20
|
from rich.table import Table
|
|
22
21
|
|
|
22
|
+
from dataops_cli.cli.utils import print_list
|
|
23
|
+
|
|
23
24
|
dataset_typer = typer.Typer(name="dataset", help="Manage dataset.", no_args_is_help=True)
|
|
24
25
|
|
|
25
26
|
|
|
@@ -11,7 +11,6 @@ from __future__ import annotations
|
|
|
11
11
|
from typing import Annotated
|
|
12
12
|
|
|
13
13
|
import typer
|
|
14
|
-
from dataops_cli.cli.utils import print_list
|
|
15
14
|
from dataops_sdk.exceptions import DataOpsError
|
|
16
15
|
from dataops_sdk.schemas import (
|
|
17
16
|
DataDataSource,
|
|
@@ -34,6 +33,8 @@ from dataops_sdk.utils import filter_nodes_by_pattern
|
|
|
34
33
|
from rich.console import Console
|
|
35
34
|
from rich.table import Table
|
|
36
35
|
|
|
36
|
+
from dataops_cli.cli.utils import print_list
|
|
37
|
+
|
|
37
38
|
# ---------------------------------------------------------------------------
|
|
38
39
|
# CLI 命令(薄包装,负责输出渲染)
|
|
39
40
|
# ---------------------------------------------------------------------------
|
|
@@ -3,10 +3,9 @@
|
|
|
3
3
|
提供数据源字典的列表查询与详情查看能力。
|
|
4
4
|
"""
|
|
5
5
|
|
|
6
|
-
from typing import Annotated
|
|
6
|
+
from typing import Annotated
|
|
7
7
|
|
|
8
8
|
import typer
|
|
9
|
-
from dataops_cli.cli.utils import print_list
|
|
10
9
|
from dataops_sdk.exceptions import DataOpsError
|
|
11
10
|
from dataops_sdk.services.dict_ import (
|
|
12
11
|
service_get_dict_detail_by_code,
|
|
@@ -15,6 +14,8 @@ from dataops_sdk.services.dict_ import (
|
|
|
15
14
|
)
|
|
16
15
|
from dataops_sdk.utils import filter_nodes_by_pattern
|
|
17
16
|
|
|
17
|
+
from dataops_cli.cli.utils import print_list
|
|
18
|
+
|
|
18
19
|
dict_typer = typer.Typer(name="dict", help="Manage dict.", no_args_is_help=True)
|
|
19
20
|
|
|
20
21
|
|
|
@@ -63,7 +64,7 @@ def list_dict(
|
|
|
63
64
|
@dict_typer.command("detail", no_args_is_help=True)
|
|
64
65
|
def get_dict_detail(
|
|
65
66
|
arg1: Annotated[str, typer.Argument(help="编码或数据源")],
|
|
66
|
-
name: Annotated[
|
|
67
|
+
name: Annotated[str | None, typer.Argument(help="字典名称")] = None,
|
|
67
68
|
# full: Annotated[bool, typer.Option("--full", help="是否显示完整信息")] = False,
|
|
68
69
|
) -> None:
|
|
69
70
|
"""获取字典详情信息。
|
|
@@ -97,10 +98,4 @@ def get_dict_detail(
|
|
|
97
98
|
typer.echo(f"错误: {e.message}")
|
|
98
99
|
raise typer.Exit(code=1) from None
|
|
99
100
|
print(f"{meta.name}({meta.title})")
|
|
100
|
-
print_list(
|
|
101
|
-
["value", "label"],
|
|
102
|
-
[
|
|
103
|
-
[option.value, option.label]
|
|
104
|
-
for option in meta.data.options
|
|
105
|
-
]
|
|
106
|
-
)
|
|
101
|
+
print_list(["value", "label"], [[option.value, option.label] for option in meta.data.options])
|
|
@@ -21,7 +21,6 @@ from datetime import datetime
|
|
|
21
21
|
from typing import Annotated, Any
|
|
22
22
|
|
|
23
23
|
import typer
|
|
24
|
-
from dataops_cli.cli.utils import print_list
|
|
25
24
|
from dataops_sdk.exceptions import DataOpsError
|
|
26
25
|
from dataops_sdk.schemas.query import PageParam, SqlQueryParam
|
|
27
26
|
from dataops_sdk.services import (
|
|
@@ -37,6 +36,8 @@ from pydantic_core import to_json
|
|
|
37
36
|
from rich.console import Console
|
|
38
37
|
from rich.table import Table
|
|
39
38
|
|
|
39
|
+
from dataops_cli.cli.utils import print_list
|
|
40
|
+
|
|
40
41
|
# ---------------------------------------------------------------------------
|
|
41
42
|
# CLI 命令(薄包装,负责输出渲染)
|
|
42
43
|
# ---------------------------------------------------------------------------
|
|
@@ -9,7 +9,6 @@
|
|
|
9
9
|
from typing import Annotated
|
|
10
10
|
|
|
11
11
|
import typer
|
|
12
|
-
from dataops_cli.cli.utils import print_list
|
|
13
12
|
from dataops_sdk.schemas.enums import MetaType
|
|
14
13
|
from dataops_sdk.schemas.query import SqlQueryParam
|
|
15
14
|
from dataops_sdk.services.meta import (
|
|
@@ -21,6 +20,8 @@ from dataops_sdk.utils import filter_nodes_by_pattern
|
|
|
21
20
|
from rich.console import Console
|
|
22
21
|
from rich.table import Table
|
|
23
22
|
|
|
23
|
+
from dataops_cli.cli.utils import print_list
|
|
24
|
+
|
|
24
25
|
# ---------------------------------------------------------------------------
|
|
25
26
|
# CLI 命令
|
|
26
27
|
# ---------------------------------------------------------------------------
|
|
@@ -9,11 +9,12 @@
|
|
|
9
9
|
from typing import Annotated
|
|
10
10
|
|
|
11
11
|
import typer
|
|
12
|
-
from dataops_cli.cli.utils import print_list
|
|
13
12
|
from dataops_sdk.exceptions import DataOpsError
|
|
14
13
|
from dataops_sdk.schemas import MetaType
|
|
15
14
|
from dataops_sdk.services.ref import service_ref_backward, service_ref_forward
|
|
16
15
|
|
|
16
|
+
from dataops_cli.cli.utils import print_list
|
|
17
|
+
|
|
17
18
|
# ---------------------------------------------------------------------------
|
|
18
19
|
# CLI 命令
|
|
19
20
|
# ---------------------------------------------------------------------------
|
|
@@ -57,16 +58,29 @@ def ref_forward(
|
|
|
57
58
|
typer.echo(f"错误: {e.message}")
|
|
58
59
|
raise typer.Exit(code=1) from None
|
|
59
60
|
|
|
60
|
-
headers = (
|
|
61
|
+
headers = (
|
|
62
|
+
("ref-code", "ref-type", "ref-name", "ref-title")
|
|
63
|
+
if full
|
|
64
|
+
else ("ref-code", "ref-type", "ref-name")
|
|
65
|
+
)
|
|
61
66
|
print("引用关系查询")
|
|
62
67
|
print_list(
|
|
63
68
|
headers,
|
|
64
69
|
[
|
|
65
|
-
[
|
|
66
|
-
|
|
67
|
-
|
|
70
|
+
[
|
|
71
|
+
result.refCode,
|
|
72
|
+
result.refType,
|
|
73
|
+
result.refName if result.refName != result.refCode else "",
|
|
74
|
+
result.refTitle,
|
|
75
|
+
]
|
|
76
|
+
if full
|
|
77
|
+
else [
|
|
78
|
+
result.refCode,
|
|
79
|
+
result.refType,
|
|
80
|
+
result.refName if result.refName != result.refCode else "",
|
|
81
|
+
]
|
|
68
82
|
for result in results
|
|
69
|
-
]
|
|
83
|
+
],
|
|
70
84
|
)
|
|
71
85
|
|
|
72
86
|
|
|
@@ -111,9 +125,14 @@ def ref_backward(
|
|
|
111
125
|
print_list(
|
|
112
126
|
headers,
|
|
113
127
|
[
|
|
114
|
-
[
|
|
128
|
+
[
|
|
129
|
+
result.code,
|
|
130
|
+
result.type,
|
|
131
|
+
result.name if result.name != result.code else "",
|
|
132
|
+
result.title,
|
|
133
|
+
]
|
|
115
134
|
if full
|
|
116
135
|
else [result.code, result.type, result.name if result.name != result.code else ""]
|
|
117
136
|
for result in results
|
|
118
|
-
]
|
|
137
|
+
],
|
|
119
138
|
)
|
|
@@ -9,7 +9,6 @@
|
|
|
9
9
|
from typing import Annotated
|
|
10
10
|
|
|
11
11
|
import typer
|
|
12
|
-
from dataops_cli.cli.utils import print_list
|
|
13
12
|
from dataops_sdk.exceptions import DataOpsError
|
|
14
13
|
from dataops_sdk.schemas import MetaType
|
|
15
14
|
from dataops_sdk.services.meta import (
|
|
@@ -18,6 +17,8 @@ from dataops_sdk.services.meta import (
|
|
|
18
17
|
from dataops_sdk.services.report import service_get_report
|
|
19
18
|
from dataops_sdk.utils import filter_nodes_by_pattern
|
|
20
19
|
|
|
20
|
+
from dataops_cli.cli.utils import print_list
|
|
21
|
+
|
|
21
22
|
# ---------------------------------------------------------------------------
|
|
22
23
|
# CLI 命令
|
|
23
24
|
# ---------------------------------------------------------------------------
|