gulp-cli 1.0.6__tar.gz → 1.0.7__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.
- {gulp_cli-1.0.6/src/gulp_cli.egg-info → gulp_cli-1.0.7}/PKG-INFO +4 -4
- {gulp_cli-1.0.6 → gulp_cli-1.0.7}/docs/examples.md +1 -1
- {gulp_cli-1.0.6 → gulp_cli-1.0.7}/pyproject.toml +3 -3
- {gulp_cli-1.0.6 → gulp_cli-1.0.7}/src/gulp_cli/_version.py +3 -3
- {gulp_cli-1.0.6 → gulp_cli-1.0.7}/src/gulp_cli/commands/db.py +60 -15
- {gulp_cli-1.0.6 → gulp_cli-1.0.7/src/gulp_cli.egg-info}/PKG-INFO +4 -4
- gulp_cli-1.0.7/src/gulp_cli.egg-info/requires.txt +4 -0
- gulp_cli-1.0.6/src/gulp_cli.egg-info/requires.txt +0 -4
- {gulp_cli-1.0.6 → gulp_cli-1.0.7}/.github/workflows/python-package.yml +0 -0
- {gulp_cli-1.0.6 → gulp_cli-1.0.7}/.gitignore +0 -0
- {gulp_cli-1.0.6 → gulp_cli-1.0.7}/README.md +0 -0
- {gulp_cli-1.0.6 → gulp_cli-1.0.7}/docs/command-reference.md +0 -0
- {gulp_cli-1.0.6 → gulp_cli-1.0.7}/docs/extensions.md +0 -0
- {gulp_cli-1.0.6 → gulp_cli-1.0.7}/docs/getting-started.md +0 -0
- {gulp_cli-1.0.6 → gulp_cli-1.0.7}/docs/resource-management.md +0 -0
- {gulp_cli-1.0.6 → gulp_cli-1.0.7}/docs/troubleshooting-cli.md +0 -0
- {gulp_cli-1.0.6 → gulp_cli-1.0.7}/setup.cfg +0 -0
- {gulp_cli-1.0.6 → gulp_cli-1.0.7}/src/gulp_cli/__init__.py +0 -0
- {gulp_cli-1.0.6 → gulp_cli-1.0.7}/src/gulp_cli/__main__.py +0 -0
- {gulp_cli-1.0.6 → gulp_cli-1.0.7}/src/gulp_cli/cli.py +0 -0
- {gulp_cli-1.0.6 → gulp_cli-1.0.7}/src/gulp_cli/client.py +0 -0
- {gulp_cli-1.0.6 → gulp_cli-1.0.7}/src/gulp_cli/commands/__init__.py +0 -0
- {gulp_cli-1.0.6 → gulp_cli-1.0.7}/src/gulp_cli/commands/acl.py +0 -0
- {gulp_cli-1.0.6 → gulp_cli-1.0.7}/src/gulp_cli/commands/auth.py +0 -0
- {gulp_cli-1.0.6 → gulp_cli-1.0.7}/src/gulp_cli/commands/collab.py +0 -0
- {gulp_cli-1.0.6 → gulp_cli-1.0.7}/src/gulp_cli/commands/context.py +0 -0
- {gulp_cli-1.0.6 → gulp_cli-1.0.7}/src/gulp_cli/commands/enhance_map.py +0 -0
- {gulp_cli-1.0.6 → gulp_cli-1.0.7}/src/gulp_cli/commands/glyph.py +0 -0
- {gulp_cli-1.0.6 → gulp_cli-1.0.7}/src/gulp_cli/commands/ingest.py +0 -0
- {gulp_cli-1.0.6 → gulp_cli-1.0.7}/src/gulp_cli/commands/mapping.py +0 -0
- {gulp_cli-1.0.6 → gulp_cli-1.0.7}/src/gulp_cli/commands/operations.py +0 -0
- {gulp_cli-1.0.6 → gulp_cli-1.0.7}/src/gulp_cli/commands/plugin.py +0 -0
- {gulp_cli-1.0.6 → gulp_cli-1.0.7}/src/gulp_cli/commands/query.py +0 -0
- {gulp_cli-1.0.6 → gulp_cli-1.0.7}/src/gulp_cli/commands/source.py +0 -0
- {gulp_cli-1.0.6 → gulp_cli-1.0.7}/src/gulp_cli/commands/stats.py +0 -0
- {gulp_cli-1.0.6 → gulp_cli-1.0.7}/src/gulp_cli/commands/storage.py +0 -0
- {gulp_cli-1.0.6 → gulp_cli-1.0.7}/src/gulp_cli/commands/user_group.py +0 -0
- {gulp_cli-1.0.6 → gulp_cli-1.0.7}/src/gulp_cli/commands/users.py +0 -0
- {gulp_cli-1.0.6 → gulp_cli-1.0.7}/src/gulp_cli/config.py +0 -0
- {gulp_cli-1.0.6 → gulp_cli-1.0.7}/src/gulp_cli/extension/__init__.py +0 -0
- {gulp_cli-1.0.6 → gulp_cli-1.0.7}/src/gulp_cli/extension/query_sigma_zip.py +0 -0
- {gulp_cli-1.0.6 → gulp_cli-1.0.7}/src/gulp_cli/extension/story.py +0 -0
- {gulp_cli-1.0.6 → gulp_cli-1.0.7}/src/gulp_cli/extension_helpers.py +0 -0
- {gulp_cli-1.0.6 → gulp_cli-1.0.7}/src/gulp_cli/extensions.py +0 -0
- {gulp_cli-1.0.6 → gulp_cli-1.0.7}/src/gulp_cli/output.py +0 -0
- {gulp_cli-1.0.6 → gulp_cli-1.0.7}/src/gulp_cli/utils.py +0 -0
- {gulp_cli-1.0.6 → gulp_cli-1.0.7}/src/gulp_cli.egg-info/SOURCES.txt +0 -0
- {gulp_cli-1.0.6 → gulp_cli-1.0.7}/src/gulp_cli.egg-info/dependency_links.txt +0 -0
- {gulp_cli-1.0.6 → gulp_cli-1.0.7}/src/gulp_cli.egg-info/entry_points.txt +0 -0
- {gulp_cli-1.0.6 → gulp_cli-1.0.7}/src/gulp_cli.egg-info/top_level.txt +0 -0
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: gulp-cli
|
|
3
|
-
Version: 1.0.
|
|
3
|
+
Version: 1.0.7
|
|
4
4
|
Summary: Command-line client for gULP
|
|
5
5
|
Author-email: Mentat <info@mentat.is>
|
|
6
6
|
Requires-Python: >=3.12
|
|
7
7
|
Description-Content-Type: text/markdown
|
|
8
|
-
Requires-Dist: typer
|
|
9
|
-
Requires-Dist: rich
|
|
10
|
-
Requires-Dist: click==8.
|
|
8
|
+
Requires-Dist: typer==0.23.1
|
|
9
|
+
Requires-Dist: rich==15.0.0
|
|
10
|
+
Requires-Dist: click==8.3.3
|
|
11
11
|
Requires-Dist: gulp-sdk
|
|
12
12
|
|
|
13
13
|
# 🚀 gulp-cli
|
|
@@ -15,9 +15,9 @@ description = "Command-line client for gULP"
|
|
|
15
15
|
readme = "README.md"
|
|
16
16
|
requires-python = ">=3.12"
|
|
17
17
|
dependencies = [
|
|
18
|
-
"typer
|
|
19
|
-
"rich
|
|
20
|
-
"click==8.
|
|
18
|
+
"typer==0.23.1",
|
|
19
|
+
"rich==15.0.0",
|
|
20
|
+
"click==8.3.3",
|
|
21
21
|
"gulp-sdk",
|
|
22
22
|
]
|
|
23
23
|
|
|
@@ -18,7 +18,7 @@ version_tuple: tuple[int | str, ...]
|
|
|
18
18
|
commit_id: str | None
|
|
19
19
|
__commit_id__: str | None
|
|
20
20
|
|
|
21
|
-
__version__ = version = '1.0.
|
|
22
|
-
__version_tuple__ = version_tuple = (1, 0,
|
|
21
|
+
__version__ = version = '1.0.7'
|
|
22
|
+
__version_tuple__ = version_tuple = (1, 0, 7)
|
|
23
23
|
|
|
24
|
-
__commit_id__ = commit_id = '
|
|
24
|
+
__commit_id__ = commit_id = 'g6e69ea4d4'
|
|
@@ -6,10 +6,23 @@ from typing import Any
|
|
|
6
6
|
import typer
|
|
7
7
|
from gulp_sdk.api.request_utils import wait_for_request_stats
|
|
8
8
|
from gulp_sdk.websocket import WSMessage, WSMessageType
|
|
9
|
-
from rich.progress import
|
|
9
|
+
from rich.progress import (
|
|
10
|
+
BarColumn,
|
|
11
|
+
Progress,
|
|
12
|
+
SpinnerColumn,
|
|
13
|
+
TaskProgressColumn,
|
|
14
|
+
TextColumn,
|
|
15
|
+
TimeElapsedColumn,
|
|
16
|
+
)
|
|
10
17
|
|
|
11
18
|
from gulp_cli.client import get_client
|
|
12
|
-
from gulp_cli.output import
|
|
19
|
+
from gulp_cli.output import (
|
|
20
|
+
console,
|
|
21
|
+
print_json,
|
|
22
|
+
print_records,
|
|
23
|
+
print_warning,
|
|
24
|
+
print_result,
|
|
25
|
+
)
|
|
13
26
|
from gulp_cli.utils import parse_json_option
|
|
14
27
|
|
|
15
28
|
app = typer.Typer(help="Database and OpenSearch commands")
|
|
@@ -38,7 +51,9 @@ async def _wait_for_stats_create(
|
|
|
38
51
|
ws.on_message(WSMessageType.STATS_UPDATE, _on_stats)
|
|
39
52
|
|
|
40
53
|
try:
|
|
41
|
-
await asyncio.wait_for(
|
|
54
|
+
await asyncio.wait_for(
|
|
55
|
+
asyncio.gather(*[ev.wait() for ev in events.values()]), timeout=timeout
|
|
56
|
+
)
|
|
42
57
|
return []
|
|
43
58
|
except asyncio.TimeoutError:
|
|
44
59
|
return [rid for rid, ev in events.items() if not ev.is_set()]
|
|
@@ -50,11 +65,25 @@ async def _wait_for_stats_create(
|
|
|
50
65
|
@app.command("rebase-by-query")
|
|
51
66
|
def rebase_by_query(
|
|
52
67
|
operation_id: str,
|
|
53
|
-
offset_msec: int = typer.Option(
|
|
68
|
+
offset_msec: int = typer.Option(
|
|
69
|
+
...,
|
|
70
|
+
"--offset-msec",
|
|
71
|
+
help="Milliseconds to add to timestamps (negative to subtract)",
|
|
72
|
+
),
|
|
54
73
|
flt: str | None = typer.Option(None, "--flt", help="GulpQueryFilter JSON object"),
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
74
|
+
fields: list[str] | None = typer.Option(
|
|
75
|
+
None,
|
|
76
|
+
"--field",
|
|
77
|
+
help="Optional extra field to rebase other than `@timestamp` and `gulp.timestamp` (no `flat_object` fields, only `date` and integer/long fields are supported; integer/long values are treated as epoch timestamps and the script heuristically infers seconds, milliseconds, microseconds, or nanoseconds before applying the offset)",
|
|
78
|
+
),
|
|
79
|
+
wait: bool = typer.Option(
|
|
80
|
+
False,
|
|
81
|
+
"--wait",
|
|
82
|
+
help="Wait for rebase completion with websocket-driven progress",
|
|
83
|
+
),
|
|
84
|
+
wait_timeout: int = typer.Option(
|
|
85
|
+
300, "--timeout", help="Seconds to wait when --wait is used"
|
|
86
|
+
),
|
|
58
87
|
) -> None:
|
|
59
88
|
"""Rebase document timestamps in an operation using update_by_query."""
|
|
60
89
|
|
|
@@ -69,11 +98,13 @@ def rebase_by_query(
|
|
|
69
98
|
ws_id=client.ws_id,
|
|
70
99
|
offset_msec=offset_msec,
|
|
71
100
|
flt=flt_obj,
|
|
72
|
-
|
|
101
|
+
fields=fields,
|
|
73
102
|
wait=False,
|
|
74
103
|
)
|
|
75
104
|
req_id = result.get("req_id") if isinstance(result, dict) else None
|
|
76
|
-
timed_out = await _wait_for_stats_create(
|
|
105
|
+
timed_out = await _wait_for_stats_create(
|
|
106
|
+
client, [str(req_id)] if req_id else []
|
|
107
|
+
)
|
|
77
108
|
if timed_out:
|
|
78
109
|
print_warning(
|
|
79
110
|
f"Request did not receive STATS_CREATE within {_WS_CONFIRM_TIMEOUT_SEC:.0f}s: "
|
|
@@ -104,18 +135,30 @@ def rebase_by_query(
|
|
|
104
135
|
data = {}
|
|
105
136
|
total_hits = data.get("total_hits")
|
|
106
137
|
updated = data.get("updated")
|
|
107
|
-
if
|
|
108
|
-
|
|
109
|
-
|
|
138
|
+
if (
|
|
139
|
+
isinstance(total_hits, int)
|
|
140
|
+
and total_hits > 0
|
|
141
|
+
and isinstance(updated, int)
|
|
142
|
+
):
|
|
143
|
+
progress.update(
|
|
144
|
+
task_id,
|
|
145
|
+
total=total_hits,
|
|
146
|
+
completed=min(updated, total_hits),
|
|
147
|
+
)
|
|
148
|
+
progress.update(
|
|
149
|
+
task_id, description=f"rebase ({updated}/{total_hits})"
|
|
150
|
+
)
|
|
110
151
|
elif isinstance(updated, int):
|
|
111
|
-
progress.update(
|
|
152
|
+
progress.update(
|
|
153
|
+
task_id, description=f"rebase ({updated} updated)"
|
|
154
|
+
)
|
|
112
155
|
|
|
113
156
|
result = await client.db.rebase_by_query(
|
|
114
157
|
operation_id=operation_id,
|
|
115
158
|
ws_id=client.ws_id,
|
|
116
159
|
offset_msec=offset_msec,
|
|
117
160
|
flt=flt_obj,
|
|
118
|
-
|
|
161
|
+
fields=fields,
|
|
119
162
|
wait=False,
|
|
120
163
|
)
|
|
121
164
|
req_id = result.get("req_id") if isinstance(result, dict) else None
|
|
@@ -163,7 +206,9 @@ def refresh_index(
|
|
|
163
206
|
@app.command("delete-index")
|
|
164
207
|
def delete_index(
|
|
165
208
|
index: str,
|
|
166
|
-
keep_operation: bool = typer.Option(
|
|
209
|
+
keep_operation: bool = typer.Option(
|
|
210
|
+
False, "--keep-operation", help="Do NOT delete the associated collab operation"
|
|
211
|
+
),
|
|
167
212
|
yes: bool = typer.Option(False, "--yes", "-y", help="Skip confirmation prompt"),
|
|
168
213
|
) -> None:
|
|
169
214
|
"""Delete an OpenSearch datastream/index and (by default) its collab operation. WARNING: all data will be lost."""
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: gulp-cli
|
|
3
|
-
Version: 1.0.
|
|
3
|
+
Version: 1.0.7
|
|
4
4
|
Summary: Command-line client for gULP
|
|
5
5
|
Author-email: Mentat <info@mentat.is>
|
|
6
6
|
Requires-Python: >=3.12
|
|
7
7
|
Description-Content-Type: text/markdown
|
|
8
|
-
Requires-Dist: typer
|
|
9
|
-
Requires-Dist: rich
|
|
10
|
-
Requires-Dist: click==8.
|
|
8
|
+
Requires-Dist: typer==0.23.1
|
|
9
|
+
Requires-Dist: rich==15.0.0
|
|
10
|
+
Requires-Dist: click==8.3.3
|
|
11
11
|
Requires-Dist: gulp-sdk
|
|
12
12
|
|
|
13
13
|
# 🚀 gulp-cli
|
|
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
|