entropy-data 0.3.3__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.
- {entropy_data-0.3.3 → entropy_data-0.3.4}/CHANGELOG.md +13 -0
- {entropy_data-0.3.3 → entropy_data-0.3.4}/PKG-INFO +1 -1
- {entropy_data-0.3.3 → entropy_data-0.3.4}/README.md +8 -5
- {entropy_data-0.3.3 → entropy_data-0.3.4}/pyproject.toml +1 -1
- {entropy_data-0.3.3 → entropy_data-0.3.4}/src/entropy_data/cli.py +4 -0
- {entropy_data-0.3.3 → entropy_data-0.3.4}/src/entropy_data/client.py +9 -2
- entropy_data-0.3.4/src/entropy_data/commands/assets.py +159 -0
- entropy_data-0.3.3/src/entropy_data/commands/teams.py → entropy_data-0.3.4/src/entropy_data/commands/connectors.py +23 -24
- entropy_data-0.3.4/src/entropy_data/commands/datacontracts.py +305 -0
- {entropy_data-0.3.3 → entropy_data-0.3.4}/src/entropy_data/commands/dataproducts.py +53 -0
- entropy_data-0.3.4/src/entropy_data/commands/git_credentials.py +456 -0
- entropy_data-0.3.4/src/entropy_data/commands/notification_channels.py +88 -0
- entropy_data-0.3.4/src/entropy_data/commands/organization.py +98 -0
- entropy_data-0.3.4/src/entropy_data/commands/semantics.py +262 -0
- entropy_data-0.3.4/src/entropy_data/commands/settings.py +111 -0
- entropy_data-0.3.4/src/entropy_data/commands/teams.py +116 -0
- {entropy_data-0.3.3 → entropy_data-0.3.4}/src/entropy_data/config.py +19 -8
- {entropy_data-0.3.3 → entropy_data-0.3.4}/src/entropy_data/output.py +36 -2
- {entropy_data-0.3.3 → entropy_data-0.3.4}/tests/commands/test_assets.py +61 -0
- entropy_data-0.3.4/tests/commands/test_connectors.py +73 -0
- entropy_data-0.3.4/tests/commands/test_datacontracts.py +191 -0
- entropy_data-0.3.4/tests/commands/test_dataproducts.py +78 -0
- entropy_data-0.3.4/tests/commands/test_git_credentials.py +239 -0
- entropy_data-0.3.4/tests/commands/test_notification_channels.py +75 -0
- {entropy_data-0.3.3 → entropy_data-0.3.4}/tests/commands/test_organization.py +54 -0
- entropy_data-0.3.4/tests/commands/test_semantics.py +226 -0
- {entropy_data-0.3.3 → entropy_data-0.3.4}/tests/commands/test_settings.py +69 -0
- {entropy_data-0.3.3 → entropy_data-0.3.4}/tests/commands/test_teams.py +81 -0
- {entropy_data-0.3.3 → entropy_data-0.3.4}/tests/test_config.py +18 -0
- entropy_data-0.3.3/src/entropy_data/commands/assets.py +0 -80
- entropy_data-0.3.3/src/entropy_data/commands/datacontracts.py +0 -124
- entropy_data-0.3.3/src/entropy_data/commands/organization.py +0 -51
- entropy_data-0.3.3/src/entropy_data/commands/settings.py +0 -68
- {entropy_data-0.3.3 → entropy_data-0.3.4}/.editorconfig +0 -0
- {entropy_data-0.3.3 → entropy_data-0.3.4}/.github/dependabot.yml +0 -0
- {entropy_data-0.3.3 → entropy_data-0.3.4}/.github/pull_request_template.md +0 -0
- {entropy_data-0.3.3 → entropy_data-0.3.4}/.github/workflows/ci.yaml +0 -0
- {entropy_data-0.3.3 → entropy_data-0.3.4}/.github/workflows/release.yaml +0 -0
- {entropy_data-0.3.3 → entropy_data-0.3.4}/.gitignore +0 -0
- {entropy_data-0.3.3 → entropy_data-0.3.4}/.pre-commit-config.yaml +0 -0
- {entropy_data-0.3.3 → entropy_data-0.3.4}/CLAUDE.md +0 -0
- {entropy_data-0.3.3 → entropy_data-0.3.4}/Dockerfile +0 -0
- {entropy_data-0.3.3 → entropy_data-0.3.4}/LICENSE +0 -0
- {entropy_data-0.3.3 → entropy_data-0.3.4}/release +0 -0
- {entropy_data-0.3.3 → entropy_data-0.3.4}/src/entropy_data/__init__.py +0 -0
- {entropy_data-0.3.3 → entropy_data-0.3.4}/src/entropy_data/__main__.py +0 -0
- {entropy_data-0.3.3 → entropy_data-0.3.4}/src/entropy_data/commands/__init__.py +0 -0
- {entropy_data-0.3.3 → entropy_data-0.3.4}/src/entropy_data/commands/access.py +0 -0
- {entropy_data-0.3.3 → entropy_data-0.3.4}/src/entropy_data/commands/api_keys.py +0 -0
- {entropy_data-0.3.3 → entropy_data-0.3.4}/src/entropy_data/commands/certifications.py +0 -0
- {entropy_data-0.3.3 → entropy_data-0.3.4}/src/entropy_data/commands/connection.py +0 -0
- {entropy_data-0.3.3 → entropy_data-0.3.4}/src/entropy_data/commands/costs.py +0 -0
- {entropy_data-0.3.3 → entropy_data-0.3.4}/src/entropy_data/commands/definitions.py +0 -0
- {entropy_data-0.3.3 → entropy_data-0.3.4}/src/entropy_data/commands/events.py +0 -0
- {entropy_data-0.3.3 → entropy_data-0.3.4}/src/entropy_data/commands/example_data.py +0 -0
- {entropy_data-0.3.3 → entropy_data-0.3.4}/src/entropy_data/commands/gitconnections.py +0 -0
- {entropy_data-0.3.3 → entropy_data-0.3.4}/src/entropy_data/commands/import_export.py +0 -0
- {entropy_data-0.3.3 → entropy_data-0.3.4}/src/entropy_data/commands/lineage.py +0 -0
- {entropy_data-0.3.3 → entropy_data-0.3.4}/src/entropy_data/commands/search.py +0 -0
- {entropy_data-0.3.3 → entropy_data-0.3.4}/src/entropy_data/commands/sourcesystems.py +0 -0
- {entropy_data-0.3.3 → entropy_data-0.3.4}/src/entropy_data/commands/tags.py +0 -0
- {entropy_data-0.3.3 → entropy_data-0.3.4}/src/entropy_data/commands/test_results.py +0 -0
- {entropy_data-0.3.3 → entropy_data-0.3.4}/src/entropy_data/commands/usage.py +0 -0
- {entropy_data-0.3.3 → entropy_data-0.3.4}/src/entropy_data/util.py +0 -0
- {entropy_data-0.3.3 → entropy_data-0.3.4}/tests/__init__.py +0 -0
- {entropy_data-0.3.3 → entropy_data-0.3.4}/tests/commands/__init__.py +0 -0
- {entropy_data-0.3.3 → entropy_data-0.3.4}/tests/commands/test_api_keys.py +0 -0
- {entropy_data-0.3.3 → entropy_data-0.3.4}/tests/commands/test_connection.py +0 -0
- {entropy_data-0.3.3 → entropy_data-0.3.4}/tests/commands/test_costs.py +0 -0
- {entropy_data-0.3.3 → entropy_data-0.3.4}/tests/commands/test_gitconnections.py +0 -0
- {entropy_data-0.3.3 → entropy_data-0.3.4}/tests/commands/test_lineage.py +0 -0
- {entropy_data-0.3.3 → entropy_data-0.3.4}/tests/commands/test_tags.py +0 -0
- {entropy_data-0.3.3 → entropy_data-0.3.4}/tests/commands/test_usage.py +0 -0
- {entropy_data-0.3.3 → entropy_data-0.3.4}/tests/conftest.py +0 -0
- {entropy_data-0.3.3 → entropy_data-0.3.4}/tests/test_client.py +0 -0
|
@@ -2,6 +2,19 @@
|
|
|
2
2
|
|
|
3
3
|
## [Unreleased]
|
|
4
4
|
|
|
5
|
+
## [0.3.4]
|
|
6
|
+
|
|
7
|
+
- Add `entropy-data datacontracts yaml <id>` to fetch a data contract as ODCS YAML (writes to stdout or `--file`). Backed by `GET /api/datacontracts/{id}.yaml`.
|
|
8
|
+
- Add `entropy-data datacontracts generate <id> --type <kind>` for code generation (`sql-select`, `sql-ddl`, `dbt-models`, `dbt-sources`, `json-schema`, `pydantic`, `custom`). With `--out-dir`, each returned file is written to disk; without it, the JSON response is printed.
|
|
9
|
+
- Add `entropy-data dataproducts import-from-git` and `entropy-data datacontracts import-from-git` to import resources from a Git repository (flags or `--file body.json`).
|
|
10
|
+
- Add `entropy-data organization members list` and `entropy-data organization members get <email>` to inspect organization membership.
|
|
11
|
+
- Add `entropy-data settings get-scim-mapping` and `entropy-data settings put-scim-mapping` to manage the SCIM group mapping (YAML or JSON, mirrors the customization commands).
|
|
12
|
+
- Add `entropy-data connectors list|get|put|delete` to manage connector state.
|
|
13
|
+
- Add `entropy-data assets tags list|add|remove` to manage tag assignments on data assets.
|
|
14
|
+
- Add `entropy-data organization git-credentials list|get|create|update|delete` and `entropy-data teams git-credentials list|get|create|update|delete <team-id>` to manage organization- and team-level git credentials. Pass `--authentication-token -` to read the secret from stdin.
|
|
15
|
+
- Add `entropy-data teams notifications get|put|delete <team-id> <channel-id>` to manage a team's notification channels.
|
|
16
|
+
- Add EXPERIMENTAL `entropy-data semantics namespaces list|get|put|delete`, `entropy-data semantics concepts list|get|put|delete <namespace> [<external-id>]`, and `entropy-data semantics relationships list|get|put|delete <namespace> [<external-id>]` covering the `/api/semantics/experimental/...` endpoints. PUT commands enforce that any `namespace`/`id` in the body matches the path argument.
|
|
17
|
+
|
|
5
18
|
## [0.3.3]
|
|
6
19
|
|
|
7
20
|
- Add `entropy-data organization get` to fetch organization settings (vanity URL, host, full name, plan, SSO) for the API key in use. Backed by the new `GET /api/organization/settings` endpoint.
|
|
@@ -80,23 +80,26 @@ entropy-data search query "customer orders"
|
|
|
80
80
|
entropy-data [--version] [--connection NAME] [--output table|json] [--debug]
|
|
81
81
|
|
|
82
82
|
connection list | add | remove | set-default | test
|
|
83
|
-
dataproducts list | get | put | delete
|
|
84
|
-
datacontracts list | get | put | test | delete
|
|
83
|
+
dataproducts list | get | put | delete | import-from-git | gitconnection ...
|
|
84
|
+
datacontracts list | get | put | test | delete | yaml | generate | import-from-git | gitconnection ...
|
|
85
85
|
access list | get | put | delete | approve | reject | cancel
|
|
86
|
-
teams list | get | put | delete
|
|
86
|
+
teams list | get | put | delete | git-credentials ... | notifications ...
|
|
87
87
|
sourcesystems list | get | put | delete
|
|
88
88
|
definitions list | get | put | delete
|
|
89
89
|
certifications list | get | put | delete
|
|
90
90
|
example-data list | get | put | delete
|
|
91
91
|
test-results list | get | publish | delete
|
|
92
92
|
costs list | add | delete
|
|
93
|
-
assets list | get | put | delete
|
|
93
|
+
assets list | get | put | delete | tags ...
|
|
94
94
|
tags list | get | put | delete
|
|
95
95
|
api-keys create | delete
|
|
96
|
-
|
|
96
|
+
connectors list | get | put | delete
|
|
97
|
+
organization get | members ... | git-credentials ...
|
|
98
|
+
settings get-customization | put-customization | get-scim-mapping | put-scim-mapping
|
|
97
99
|
events poll
|
|
98
100
|
lineage list | submit | delete
|
|
99
101
|
search query
|
|
102
|
+
semantics namespaces ... | concepts ... | relationships ... (EXPERIMENTAL)
|
|
100
103
|
usage list | submit | delete
|
|
101
104
|
import zip
|
|
102
105
|
```
|
|
@@ -95,6 +95,7 @@ from entropy_data.commands.api_keys import api_keys_app # noqa: E402
|
|
|
95
95
|
from entropy_data.commands.assets import assets_app # noqa: E402
|
|
96
96
|
from entropy_data.commands.certifications import certifications_app # noqa: E402
|
|
97
97
|
from entropy_data.commands.connection import connection_app # noqa: E402
|
|
98
|
+
from entropy_data.commands.connectors import connectors_app # noqa: E402
|
|
98
99
|
from entropy_data.commands.costs import costs_app # noqa: E402
|
|
99
100
|
from entropy_data.commands.datacontracts import datacontracts_app # noqa: E402
|
|
100
101
|
from entropy_data.commands.dataproducts import dataproducts_app # noqa: E402
|
|
@@ -105,6 +106,7 @@ from entropy_data.commands.import_export import import_app # noqa: E402
|
|
|
105
106
|
from entropy_data.commands.lineage import lineage_app # noqa: E402
|
|
106
107
|
from entropy_data.commands.organization import organization_app # noqa: E402
|
|
107
108
|
from entropy_data.commands.search import search_app # noqa: E402
|
|
109
|
+
from entropy_data.commands.semantics import semantics_app # noqa: E402
|
|
108
110
|
from entropy_data.commands.settings import settings_app # noqa: E402
|
|
109
111
|
from entropy_data.commands.sourcesystems import sourcesystems_app # noqa: E402
|
|
110
112
|
from entropy_data.commands.tags import tags_app # noqa: E402
|
|
@@ -126,10 +128,12 @@ app.add_typer(costs_app, name="costs", help="Manage costs.")
|
|
|
126
128
|
app.add_typer(assets_app, name="assets", help="Manage data assets.")
|
|
127
129
|
app.add_typer(tags_app, name="tags", help="Manage tags.")
|
|
128
130
|
app.add_typer(api_keys_app, name="api-keys", help="Manage API keys.")
|
|
131
|
+
app.add_typer(connectors_app, name="connectors", help="Manage connectors.")
|
|
129
132
|
app.add_typer(organization_app, name="organization", help="Get organization details.")
|
|
130
133
|
app.add_typer(settings_app, name="settings", help="Manage organization settings.")
|
|
131
134
|
app.add_typer(events_app, name="events", help="Poll events.")
|
|
132
135
|
app.add_typer(lineage_app, name="lineage", help="Manage lineage (OpenLineage events).")
|
|
133
136
|
app.add_typer(search_app, name="search", help="Search across resources.")
|
|
137
|
+
app.add_typer(semantics_app, name="semantics", help="EXPERIMENTAL semantics API.")
|
|
134
138
|
app.add_typer(usage_app, name="usage", help="Manage usage (OpenTelemetry traces).")
|
|
135
139
|
app.add_typer(import_app, name="import", help="Import organization exports.")
|
|
@@ -122,13 +122,20 @@ class EntropyDataClient:
|
|
|
122
122
|
return response.headers.get(RESPONSE_HEADER_LOCATION_HTML)
|
|
123
123
|
|
|
124
124
|
def post_action_json(
|
|
125
|
-
self,
|
|
125
|
+
self,
|
|
126
|
+
path: str,
|
|
127
|
+
resource_id: str,
|
|
128
|
+
action: str,
|
|
129
|
+
params: dict | None = None,
|
|
130
|
+
body: dict | None = None,
|
|
131
|
+
timeout: int = REQUEST_TIMEOUT,
|
|
126
132
|
) -> dict:
|
|
127
|
-
"""POST /api/{path}/{id}/{action}
|
|
133
|
+
"""POST /api/{path}/{id}/{action}. Returns response JSON."""
|
|
128
134
|
_validate_resource_id(resource_id)
|
|
129
135
|
response = self.session.post(
|
|
130
136
|
f"{self.base_url}/api/{path}/{resource_id}/{action}",
|
|
131
137
|
params=params,
|
|
138
|
+
json=body if body is not None else None,
|
|
132
139
|
timeout=timeout,
|
|
133
140
|
)
|
|
134
141
|
_raise_for_status(response)
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
"""Assets commands."""
|
|
2
|
+
|
|
3
|
+
import json
|
|
4
|
+
from pathlib import Path
|
|
5
|
+
from typing import Annotated, Optional
|
|
6
|
+
|
|
7
|
+
import typer
|
|
8
|
+
|
|
9
|
+
from entropy_data.output import OutputFormat, console, print_link, print_resource, print_resource_list, print_success
|
|
10
|
+
from entropy_data.util import read_body
|
|
11
|
+
|
|
12
|
+
assets_app = typer.Typer(no_args_is_help=True)
|
|
13
|
+
tags_app = typer.Typer(no_args_is_help=True)
|
|
14
|
+
RESOURCE_PATH = "assets"
|
|
15
|
+
RESOURCE_TYPE = "assets"
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
@assets_app.command("list")
|
|
19
|
+
def list_assets(
|
|
20
|
+
page: Annotated[int, typer.Option("--page", "-p", help="Page number (0-indexed).")] = 0,
|
|
21
|
+
output: Annotated[Optional[OutputFormat], typer.Option("--output", "-o", help="Output format.")] = None,
|
|
22
|
+
) -> None:
|
|
23
|
+
"""List all data assets."""
|
|
24
|
+
from entropy_data.cli import get_client, get_output_format, handle_error
|
|
25
|
+
|
|
26
|
+
fmt = output or get_output_format()
|
|
27
|
+
try:
|
|
28
|
+
client = get_client()
|
|
29
|
+
data, has_next = client.list_resources(RESOURCE_PATH, params={"p": page})
|
|
30
|
+
print_resource_list(data, RESOURCE_TYPE, fmt, has_next_page=has_next, page=page)
|
|
31
|
+
except Exception as e:
|
|
32
|
+
handle_error(e)
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
@assets_app.command("get")
|
|
36
|
+
def get_asset(
|
|
37
|
+
id: Annotated[str, typer.Argument(help="Asset ID.")],
|
|
38
|
+
output: Annotated[Optional[OutputFormat], typer.Option("--output", "-o", help="Output format.")] = None,
|
|
39
|
+
) -> None:
|
|
40
|
+
"""Get a data asset by ID."""
|
|
41
|
+
from entropy_data.cli import get_client, get_output_format, handle_error
|
|
42
|
+
|
|
43
|
+
fmt = output or get_output_format()
|
|
44
|
+
try:
|
|
45
|
+
client = get_client()
|
|
46
|
+
data = client.get_resource(RESOURCE_PATH, id)
|
|
47
|
+
print_resource(data, RESOURCE_TYPE, fmt)
|
|
48
|
+
except Exception as e:
|
|
49
|
+
handle_error(e)
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
@assets_app.command("put")
|
|
53
|
+
def put_asset(
|
|
54
|
+
id: Annotated[str, typer.Argument(help="Asset ID.")],
|
|
55
|
+
file: Annotated[Path, typer.Option("--file", "-f", help="JSON or YAML file (use - for stdin).")] = ...,
|
|
56
|
+
) -> None:
|
|
57
|
+
"""Create or update a data asset."""
|
|
58
|
+
from entropy_data.cli import get_client, handle_error
|
|
59
|
+
|
|
60
|
+
try:
|
|
61
|
+
body = read_body(file)
|
|
62
|
+
client = get_client()
|
|
63
|
+
location = client.put_resource(RESOURCE_PATH, id, body)
|
|
64
|
+
print_success(f"Asset '{id}' saved.")
|
|
65
|
+
print_link(location)
|
|
66
|
+
except Exception as e:
|
|
67
|
+
handle_error(e)
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
@assets_app.command("delete")
|
|
71
|
+
def delete_asset(
|
|
72
|
+
id: Annotated[str, typer.Argument(help="Asset ID.")],
|
|
73
|
+
) -> None:
|
|
74
|
+
"""Delete a data asset."""
|
|
75
|
+
from entropy_data.cli import get_client, handle_error
|
|
76
|
+
|
|
77
|
+
try:
|
|
78
|
+
client = get_client()
|
|
79
|
+
client.delete_resource(RESOURCE_PATH, id)
|
|
80
|
+
print_success(f"Asset '{id}' deleted.")
|
|
81
|
+
except Exception as e:
|
|
82
|
+
handle_error(e)
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
@tags_app.command("list")
|
|
86
|
+
def list_asset_tags(
|
|
87
|
+
asset_id: Annotated[str, typer.Argument(help="Asset ID.")],
|
|
88
|
+
output: Annotated[Optional[OutputFormat], typer.Option("--output", "-o", help="Output format.")] = None,
|
|
89
|
+
) -> None:
|
|
90
|
+
"""List tags assigned to an asset."""
|
|
91
|
+
from entropy_data.cli import get_client, get_output_format, handle_error
|
|
92
|
+
from entropy_data.client import REQUEST_TIMEOUT, _raise_for_status, _validate_resource_id
|
|
93
|
+
|
|
94
|
+
fmt = output or get_output_format()
|
|
95
|
+
try:
|
|
96
|
+
client = get_client()
|
|
97
|
+
_validate_resource_id(asset_id)
|
|
98
|
+
response = client.session.get(
|
|
99
|
+
f"{client.base_url}/api/assets/{asset_id}/assigned-tags",
|
|
100
|
+
timeout=REQUEST_TIMEOUT,
|
|
101
|
+
)
|
|
102
|
+
_raise_for_status(response)
|
|
103
|
+
data = response.json()
|
|
104
|
+
if fmt == OutputFormat.json:
|
|
105
|
+
console.print_json(json.dumps(data))
|
|
106
|
+
else:
|
|
107
|
+
for tag in data:
|
|
108
|
+
console.print(tag)
|
|
109
|
+
except Exception as e:
|
|
110
|
+
handle_error(e)
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
@tags_app.command("add")
|
|
114
|
+
def add_asset_tag(
|
|
115
|
+
asset_id: Annotated[str, typer.Argument(help="Asset ID.")],
|
|
116
|
+
tag_id: Annotated[str, typer.Argument(help="Tag ID (may be hierarchical, e.g. governance/PII).")],
|
|
117
|
+
) -> None:
|
|
118
|
+
"""Assign a tag to an asset."""
|
|
119
|
+
from entropy_data.cli import get_client, handle_error
|
|
120
|
+
from entropy_data.client import REQUEST_TIMEOUT, _raise_for_status, _validate_resource_id
|
|
121
|
+
|
|
122
|
+
try:
|
|
123
|
+
client = get_client()
|
|
124
|
+
_validate_resource_id(asset_id)
|
|
125
|
+
# tag_id can contain "/" (e.g. governance/PII) so we don't run it through the
|
|
126
|
+
# path-traversal-rejecting validator; the server validates anyway.
|
|
127
|
+
response = client.session.put(
|
|
128
|
+
f"{client.base_url}/api/assets/{asset_id}/assigned-tags/{tag_id}",
|
|
129
|
+
timeout=REQUEST_TIMEOUT,
|
|
130
|
+
)
|
|
131
|
+
_raise_for_status(response)
|
|
132
|
+
print_success(f"Tag '{tag_id}' assigned to asset '{asset_id}'.")
|
|
133
|
+
except Exception as e:
|
|
134
|
+
handle_error(e)
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
@tags_app.command("remove")
|
|
138
|
+
def remove_asset_tag(
|
|
139
|
+
asset_id: Annotated[str, typer.Argument(help="Asset ID.")],
|
|
140
|
+
tag_id: Annotated[str, typer.Argument(help="Tag ID (may be hierarchical, e.g. governance/PII).")],
|
|
141
|
+
) -> None:
|
|
142
|
+
"""Unassign a tag from an asset."""
|
|
143
|
+
from entropy_data.cli import get_client, handle_error
|
|
144
|
+
from entropy_data.client import REQUEST_TIMEOUT, _raise_for_status, _validate_resource_id
|
|
145
|
+
|
|
146
|
+
try:
|
|
147
|
+
client = get_client()
|
|
148
|
+
_validate_resource_id(asset_id)
|
|
149
|
+
response = client.session.delete(
|
|
150
|
+
f"{client.base_url}/api/assets/{asset_id}/assigned-tags/{tag_id}",
|
|
151
|
+
timeout=REQUEST_TIMEOUT,
|
|
152
|
+
)
|
|
153
|
+
_raise_for_status(response)
|
|
154
|
+
print_success(f"Tag '{tag_id}' removed from asset '{asset_id}'.")
|
|
155
|
+
except Exception as e:
|
|
156
|
+
handle_error(e)
|
|
157
|
+
|
|
158
|
+
|
|
159
|
+
assets_app.add_typer(tags_app, name="tags", help="Manage tag assignments on an asset.")
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"""
|
|
1
|
+
"""Connectors commands."""
|
|
2
2
|
|
|
3
3
|
from pathlib import Path
|
|
4
4
|
from typing import Annotated, Optional
|
|
@@ -8,34 +8,33 @@ import typer
|
|
|
8
8
|
from entropy_data.output import OutputFormat, print_link, print_resource, print_resource_list, print_success
|
|
9
9
|
from entropy_data.util import read_body
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
RESOURCE_PATH = "
|
|
13
|
-
RESOURCE_TYPE = "
|
|
11
|
+
connectors_app = typer.Typer(no_args_is_help=True)
|
|
12
|
+
RESOURCE_PATH = "connectors"
|
|
13
|
+
RESOURCE_TYPE = "connectors"
|
|
14
14
|
|
|
15
15
|
|
|
16
|
-
@
|
|
17
|
-
def
|
|
18
|
-
page: Annotated[int, typer.Option("--page", "-p", help="Page number (0-indexed).")] = 0,
|
|
16
|
+
@connectors_app.command("list")
|
|
17
|
+
def list_connectors(
|
|
19
18
|
output: Annotated[Optional[OutputFormat], typer.Option("--output", "-o", help="Output format.")] = None,
|
|
20
19
|
) -> None:
|
|
21
|
-
"""List all
|
|
20
|
+
"""List all connectors."""
|
|
22
21
|
from entropy_data.cli import get_client, get_output_format, handle_error
|
|
23
22
|
|
|
24
23
|
fmt = output or get_output_format()
|
|
25
24
|
try:
|
|
26
25
|
client = get_client()
|
|
27
|
-
data,
|
|
28
|
-
print_resource_list(data, RESOURCE_TYPE, fmt
|
|
26
|
+
data, _ = client.list_resources(RESOURCE_PATH)
|
|
27
|
+
print_resource_list(data, RESOURCE_TYPE, fmt)
|
|
29
28
|
except Exception as e:
|
|
30
29
|
handle_error(e)
|
|
31
30
|
|
|
32
31
|
|
|
33
|
-
@
|
|
34
|
-
def
|
|
35
|
-
id: Annotated[str, typer.Argument(help="
|
|
32
|
+
@connectors_app.command("get")
|
|
33
|
+
def get_connector(
|
|
34
|
+
id: Annotated[str, typer.Argument(help="Connector ID.")],
|
|
36
35
|
output: Annotated[Optional[OutputFormat], typer.Option("--output", "-o", help="Output format.")] = None,
|
|
37
36
|
) -> None:
|
|
38
|
-
"""Get a
|
|
37
|
+
"""Get a connector by ID."""
|
|
39
38
|
from entropy_data.cli import get_client, get_output_format, handle_error
|
|
40
39
|
|
|
41
40
|
fmt = output or get_output_format()
|
|
@@ -47,34 +46,34 @@ def get_team(
|
|
|
47
46
|
handle_error(e)
|
|
48
47
|
|
|
49
48
|
|
|
50
|
-
@
|
|
51
|
-
def
|
|
52
|
-
id: Annotated[str, typer.Argument(help="
|
|
49
|
+
@connectors_app.command("put")
|
|
50
|
+
def put_connector(
|
|
51
|
+
id: Annotated[str, typer.Argument(help="Connector ID.")],
|
|
53
52
|
file: Annotated[Path, typer.Option("--file", "-f", help="JSON or YAML file (use - for stdin).")] = ...,
|
|
54
53
|
) -> None:
|
|
55
|
-
"""Create or update a
|
|
54
|
+
"""Create or update a connector."""
|
|
56
55
|
from entropy_data.cli import get_client, handle_error
|
|
57
56
|
|
|
58
57
|
try:
|
|
59
58
|
body = read_body(file)
|
|
60
59
|
client = get_client()
|
|
61
60
|
location = client.put_resource(RESOURCE_PATH, id, body)
|
|
62
|
-
print_success(f"
|
|
61
|
+
print_success(f"Connector '{id}' saved.")
|
|
63
62
|
print_link(location)
|
|
64
63
|
except Exception as e:
|
|
65
64
|
handle_error(e)
|
|
66
65
|
|
|
67
66
|
|
|
68
|
-
@
|
|
69
|
-
def
|
|
70
|
-
id: Annotated[str, typer.Argument(help="
|
|
67
|
+
@connectors_app.command("delete")
|
|
68
|
+
def delete_connector(
|
|
69
|
+
id: Annotated[str, typer.Argument(help="Connector ID.")],
|
|
71
70
|
) -> None:
|
|
72
|
-
"""Delete a
|
|
71
|
+
"""Delete a connector."""
|
|
73
72
|
from entropy_data.cli import get_client, handle_error
|
|
74
73
|
|
|
75
74
|
try:
|
|
76
75
|
client = get_client()
|
|
77
76
|
client.delete_resource(RESOURCE_PATH, id)
|
|
78
|
-
print_success(f"
|
|
77
|
+
print_success(f"Connector '{id}' deleted.")
|
|
79
78
|
except Exception as e:
|
|
80
79
|
handle_error(e)
|