ominfra 0.0.0.dev93__py3-none-any.whl → 0.0.0.dev95__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.
- ominfra/.manifests.json +1 -1
- ominfra/tailscale/api.py +66 -0
- ominfra/tailscale/cli.py +10 -4
- {ominfra-0.0.0.dev93.dist-info → ominfra-0.0.0.dev95.dist-info}/METADATA +3 -3
- {ominfra-0.0.0.dev93.dist-info → ominfra-0.0.0.dev95.dist-info}/RECORD +9 -8
- {ominfra-0.0.0.dev93.dist-info → ominfra-0.0.0.dev95.dist-info}/LICENSE +0 -0
- {ominfra-0.0.0.dev93.dist-info → ominfra-0.0.0.dev95.dist-info}/WHEEL +0 -0
- {ominfra-0.0.0.dev93.dist-info → ominfra-0.0.0.dev95.dist-info}/entry_points.txt +0 -0
- {ominfra-0.0.0.dev93.dist-info → ominfra-0.0.0.dev95.dist-info}/top_level.txt +0 -0
ominfra/.manifests.json
CHANGED
ominfra/tailscale/api.py
ADDED
@@ -0,0 +1,66 @@
|
|
1
|
+
import datetime
|
2
|
+
import typing as ta
|
3
|
+
|
4
|
+
from omlish import dataclasses as dc
|
5
|
+
from omlish import marshal as msh
|
6
|
+
|
7
|
+
|
8
|
+
@dc.dataclass(frozen=True)
|
9
|
+
class Device:
|
10
|
+
dc.metadata(msh.ObjectMetadata(
|
11
|
+
field_naming=msh.Naming.LOW_CAMEL,
|
12
|
+
unknown_field='x',
|
13
|
+
))
|
14
|
+
|
15
|
+
addresses: list[str]
|
16
|
+
authorized: bool
|
17
|
+
blocks_incoming_connections: bool
|
18
|
+
client_version: str
|
19
|
+
created: datetime.datetime
|
20
|
+
expires: datetime.datetime
|
21
|
+
hostname: str
|
22
|
+
id: str
|
23
|
+
is_external: bool
|
24
|
+
key_expiry_disabled: bool
|
25
|
+
last_seen: datetime.datetime
|
26
|
+
machine_key: str
|
27
|
+
name: str
|
28
|
+
node_id: str
|
29
|
+
node_key: str
|
30
|
+
os: str
|
31
|
+
tailnet_lock_error: str
|
32
|
+
tailnet_lock_key: str
|
33
|
+
update_available: bool
|
34
|
+
user: bool
|
35
|
+
|
36
|
+
x: ta.Mapping[str, ta.Any] | None = None
|
37
|
+
|
38
|
+
|
39
|
+
@dc.dataclass(frozen=True)
|
40
|
+
class CreatedKey:
|
41
|
+
dc.metadata(msh.ObjectMetadata(
|
42
|
+
field_naming=msh.Naming.LOW_CAMEL,
|
43
|
+
unknown_field='x',
|
44
|
+
))
|
45
|
+
|
46
|
+
id: str
|
47
|
+
key: str
|
48
|
+
created: datetime.datetime
|
49
|
+
expires: datetime.datetime
|
50
|
+
capabilities: ta.Mapping[str, ta.Any]
|
51
|
+
description: str
|
52
|
+
|
53
|
+
x: ta.Mapping[str, ta.Any] | None = None
|
54
|
+
|
55
|
+
|
56
|
+
@dc.dataclass(frozen=True)
|
57
|
+
class ListedKey:
|
58
|
+
dc.metadata(msh.ObjectMetadata(
|
59
|
+
field_naming=msh.Naming.LOW_CAMEL,
|
60
|
+
unknown_field='x',
|
61
|
+
))
|
62
|
+
|
63
|
+
id: str
|
64
|
+
description: str
|
65
|
+
|
66
|
+
x: ta.Mapping[str, ta.Any] | None = None
|
ominfra/tailscale/cli.py
CHANGED
@@ -93,12 +93,18 @@ class Cli(ap.Cli):
|
|
93
93
|
print(json.dumps_pretty(msh.marshal(out)))
|
94
94
|
|
95
95
|
@ap.command(
|
96
|
-
ap.arg('name'),
|
96
|
+
ap.arg('name', nargs='?'),
|
97
97
|
)
|
98
98
|
def ip(self) -> None:
|
99
|
-
|
100
|
-
|
101
|
-
|
99
|
+
status = self.status()
|
100
|
+
ip_lists_by_hostname = {
|
101
|
+
hn: [i for i in node.tailscale_ips or () if _IP_V4_PAT.fullmatch(i)]
|
102
|
+
for hn, node in status.nodes_by_host_name.items()
|
103
|
+
}
|
104
|
+
if self.args.name:
|
105
|
+
print(ip_lists_by_hostname[self.args.name][0])
|
106
|
+
else:
|
107
|
+
print(json.dumps_pretty(ip_lists_by_hostname))
|
102
108
|
|
103
109
|
|
104
110
|
# @omlish-manifest
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: ominfra
|
3
|
-
Version: 0.0.0.
|
3
|
+
Version: 0.0.0.dev95
|
4
4
|
Summary: ominfra
|
5
5
|
Author: wrmsr
|
6
6
|
License: BSD-3-Clause
|
@@ -12,8 +12,8 @@ Classifier: Operating System :: OS Independent
|
|
12
12
|
Classifier: Operating System :: POSIX
|
13
13
|
Requires-Python: >=3.12
|
14
14
|
License-File: LICENSE
|
15
|
-
Requires-Dist: omdev ==0.0.0.
|
16
|
-
Requires-Dist: omlish ==0.0.0.
|
15
|
+
Requires-Dist: omdev ==0.0.0.dev95
|
16
|
+
Requires-Dist: omlish ==0.0.0.dev95
|
17
17
|
Provides-Extra: all
|
18
18
|
Requires-Dist: paramiko ~=3.5 ; extra == 'all'
|
19
19
|
Requires-Dist: asyncssh ~=2.18 ; extra == 'all'
|
@@ -1,4 +1,4 @@
|
|
1
|
-
ominfra/.manifests.json,sha256=
|
1
|
+
ominfra/.manifests.json,sha256=keLK1pWH0vdH4noGhTQelCFztK3fzbhIcjIcPcFDhF0,589
|
2
2
|
ominfra/__about__.py,sha256=6i1AoruFYQCd-PyhhbDQDWY2d1tiQu9nkwWr-fXAqfY,705
|
3
3
|
ominfra/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
4
4
|
ominfra/cmds.py,sha256=E0AfnvEmnKntXWvmLW5L05_NeDpBET1VBXn7vV6EwBQ,2083
|
@@ -69,12 +69,13 @@ ominfra/supervisor/states.py,sha256=JMxXYTZhJkMNQZ2tTV6wId7wrvnWgiZteskACprKskM,
|
|
69
69
|
ominfra/supervisor/supervisor.py,sha256=eXmVKX-A3exX8yHmmJEhHVd-3VnjTtrfDCvV7EEb7o8,13238
|
70
70
|
ominfra/supervisor/types.py,sha256=ec62QG0CDJc0XNxCnf3lXxhsxrr4CCScLPI-1SpQjlc,1141
|
71
71
|
ominfra/tailscale/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
72
|
-
ominfra/tailscale/
|
72
|
+
ominfra/tailscale/api.py,sha256=C5-t_b6jZXUWcy5k8bXm7CFnk73pSdrlMOgGDeGVrpw,1370
|
73
|
+
ominfra/tailscale/cli.py,sha256=2s1T8t6g-fhKF-l58lzVktEl9o5QqD-9FCpuYu5eqD0,3396
|
73
74
|
ominfra/tools/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
74
75
|
ominfra/tools/listresources.py,sha256=L4t5rszm9ulcdWyr7n48_R9d5Etg4S2a4WQhlbHDtnQ,6106
|
75
|
-
ominfra-0.0.0.
|
76
|
-
ominfra-0.0.0.
|
77
|
-
ominfra-0.0.0.
|
78
|
-
ominfra-0.0.0.
|
79
|
-
ominfra-0.0.0.
|
80
|
-
ominfra-0.0.0.
|
76
|
+
ominfra-0.0.0.dev95.dist-info/LICENSE,sha256=B_hVtavaA8zCYDW99DYdcpDLKz1n3BBRjZrcbv8uG8c,1451
|
77
|
+
ominfra-0.0.0.dev95.dist-info/METADATA,sha256=yJvHyiZmUxIFxMsBJIl48lsCfk91S6pgXfRh3zb1esw,739
|
78
|
+
ominfra-0.0.0.dev95.dist-info/WHEEL,sha256=P9jw-gEje8ByB7_hXoICnHtVCrEwMQh-630tKvQWehc,91
|
79
|
+
ominfra-0.0.0.dev95.dist-info/entry_points.txt,sha256=kgecQ2MgGrM9qK744BoKS3tMesaC3yjLnl9pa5CRczg,37
|
80
|
+
ominfra-0.0.0.dev95.dist-info/top_level.txt,sha256=E-b2OHkk_AOBLXHYZQ2EOFKl-_6uOGd8EjeG-Zy6h_w,8
|
81
|
+
ominfra-0.0.0.dev95.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|