ominfra 0.0.0.dev205__tar.gz → 0.0.0.dev207__tar.gz
Sign up to get free protection for your applications and to get access to all the features.
- {ominfra-0.0.0.dev205/ominfra.egg-info → ominfra-0.0.0.dev207}/PKG-INFO +4 -4
- ominfra-0.0.0.dev207/ominfra/clouds/aws/instancetypes/cache.json.gz +0 -0
- ominfra-0.0.0.dev207/ominfra/clouds/aws/instancetypes/cache.py +12 -0
- ominfra-0.0.0.dev207/ominfra/clouds/aws/instancetypes/cli.py +80 -0
- ominfra-0.0.0.dev207/ominfra/clouds/aws/models/base.py +161 -0
- ominfra-0.0.0.dev207/ominfra/clouds/aws/models/gen/__main__.py +4 -0
- {ominfra-0.0.0.dev205 → ominfra-0.0.0.dev207}/ominfra/clouds/aws/models/gen/gen.py +8 -1
- {ominfra-0.0.0.dev205 → ominfra-0.0.0.dev207}/ominfra/clouds/aws/models/services/ec2.py +915 -7
- {ominfra-0.0.0.dev205 → ominfra-0.0.0.dev207}/ominfra/clouds/aws/models/services/lambda_.py +7 -4
- {ominfra-0.0.0.dev205 → ominfra-0.0.0.dev207}/ominfra/clouds/aws/models/services/s3.py +139 -0
- {ominfra-0.0.0.dev205 → ominfra-0.0.0.dev207}/ominfra/clouds/aws/models/services/services.toml +1 -1
- ominfra-0.0.0.dev207/ominfra/tools/__init__.py +0 -0
- {ominfra-0.0.0.dev205 → ominfra-0.0.0.dev207/ominfra.egg-info}/PKG-INFO +4 -4
- {ominfra-0.0.0.dev205 → ominfra-0.0.0.dev207}/ominfra.egg-info/SOURCES.txt +5 -0
- {ominfra-0.0.0.dev205 → ominfra-0.0.0.dev207}/ominfra.egg-info/requires.txt +3 -3
- {ominfra-0.0.0.dev205 → ominfra-0.0.0.dev207}/pyproject.toml +5 -4
- ominfra-0.0.0.dev205/ominfra/clouds/aws/models/base.py +0 -101
- {ominfra-0.0.0.dev205 → ominfra-0.0.0.dev207}/LICENSE +0 -0
- {ominfra-0.0.0.dev205 → ominfra-0.0.0.dev207}/MANIFEST.in +0 -0
- {ominfra-0.0.0.dev205 → ominfra-0.0.0.dev207}/README.rst +0 -0
- {ominfra-0.0.0.dev205 → ominfra-0.0.0.dev207}/ominfra/.manifests.json +0 -0
- {ominfra-0.0.0.dev205 → ominfra-0.0.0.dev207}/ominfra/__about__.py +0 -0
- {ominfra-0.0.0.dev205 → ominfra-0.0.0.dev207}/ominfra/__init__.py +0 -0
- {ominfra-0.0.0.dev205 → ominfra-0.0.0.dev207}/ominfra/clouds/__init__.py +0 -0
- {ominfra-0.0.0.dev205 → ominfra-0.0.0.dev207}/ominfra/clouds/aws/__init__.py +0 -0
- {ominfra-0.0.0.dev205 → ominfra-0.0.0.dev207}/ominfra/clouds/aws/__main__.py +0 -0
- {ominfra-0.0.0.dev205 → ominfra-0.0.0.dev207}/ominfra/clouds/aws/auth.py +0 -0
- {ominfra-0.0.0.dev205 → ominfra-0.0.0.dev207}/ominfra/clouds/aws/cli.py +0 -0
- {ominfra-0.0.0.dev205 → ominfra-0.0.0.dev207}/ominfra/clouds/aws/dataclasses.py +0 -0
- {ominfra-0.0.0.dev205/ominfra/clouds/aws/models → ominfra-0.0.0.dev207/ominfra/clouds/aws/instancetypes}/__init__.py +0 -0
- {ominfra-0.0.0.dev205/ominfra/clouds/aws/models/gen → ominfra-0.0.0.dev207/ominfra/clouds/aws/instancetypes}/__main__.py +0 -0
- {ominfra-0.0.0.dev205 → ominfra-0.0.0.dev207}/ominfra/clouds/aws/journald2aws/__init__.py +0 -0
- {ominfra-0.0.0.dev205 → ominfra-0.0.0.dev207}/ominfra/clouds/aws/journald2aws/__main__.py +0 -0
- {ominfra-0.0.0.dev205 → ominfra-0.0.0.dev207}/ominfra/clouds/aws/journald2aws/cursor.py +0 -0
- {ominfra-0.0.0.dev205 → ominfra-0.0.0.dev207}/ominfra/clouds/aws/journald2aws/driver.py +0 -0
- {ominfra-0.0.0.dev205 → ominfra-0.0.0.dev207}/ominfra/clouds/aws/journald2aws/main.py +0 -0
- {ominfra-0.0.0.dev205 → ominfra-0.0.0.dev207}/ominfra/clouds/aws/journald2aws/poster.py +0 -0
- {ominfra-0.0.0.dev205 → ominfra-0.0.0.dev207}/ominfra/clouds/aws/logs.py +0 -0
- {ominfra-0.0.0.dev205 → ominfra-0.0.0.dev207}/ominfra/clouds/aws/metadata.py +0 -0
- {ominfra-0.0.0.dev205/ominfra/clouds/aws/models/gen → ominfra-0.0.0.dev207/ominfra/clouds/aws/models}/__init__.py +0 -0
- {ominfra-0.0.0.dev205/ominfra/clouds/aws/models/services → ominfra-0.0.0.dev207/ominfra/clouds/aws/models/gen}/__init__.py +0 -0
- {ominfra-0.0.0.dev205 → ominfra-0.0.0.dev207}/ominfra/clouds/aws/models/gen/cli.py +0 -0
- {ominfra-0.0.0.dev205/ominfra/clouds/gcp → ominfra-0.0.0.dev207/ominfra/clouds/aws/models/services}/__init__.py +0 -0
- {ominfra-0.0.0.dev205 → ominfra-0.0.0.dev207}/ominfra/clouds/aws/models/services/rds.py +0 -0
- {ominfra-0.0.0.dev205/ominfra/commands → ominfra-0.0.0.dev207/ominfra/clouds/gcp}/__init__.py +0 -0
- {ominfra-0.0.0.dev205 → ominfra-0.0.0.dev207}/ominfra/clouds/gcp/auth.py +0 -0
- {ominfra-0.0.0.dev205/ominfra/journald → ominfra-0.0.0.dev207/ominfra/commands}/__init__.py +0 -0
- {ominfra-0.0.0.dev205 → ominfra-0.0.0.dev207}/ominfra/commands/runners.py +0 -0
- {ominfra-0.0.0.dev205 → ominfra-0.0.0.dev207}/ominfra/commands/ssh.py +0 -0
- {ominfra-0.0.0.dev205/ominfra/manage/commands → ominfra-0.0.0.dev207/ominfra/journald}/__init__.py +0 -0
- {ominfra-0.0.0.dev205 → ominfra-0.0.0.dev207}/ominfra/journald/fields.py +0 -0
- {ominfra-0.0.0.dev205 → ominfra-0.0.0.dev207}/ominfra/journald/genmessages.py +0 -0
- {ominfra-0.0.0.dev205 → ominfra-0.0.0.dev207}/ominfra/journald/messages.py +0 -0
- {ominfra-0.0.0.dev205 → ominfra-0.0.0.dev207}/ominfra/journald/tailer.py +0 -0
- {ominfra-0.0.0.dev205 → ominfra-0.0.0.dev207}/ominfra/manage/__init__.py +0 -0
- {ominfra-0.0.0.dev205 → ominfra-0.0.0.dev207}/ominfra/manage/__main__.py +0 -0
- {ominfra-0.0.0.dev205 → ominfra-0.0.0.dev207}/ominfra/manage/bootstrap.py +0 -0
- {ominfra-0.0.0.dev205 → ominfra-0.0.0.dev207}/ominfra/manage/bootstrap_.py +0 -0
- {ominfra-0.0.0.dev205/ominfra/manage/deploy → ominfra-0.0.0.dev207/ominfra/manage/commands}/__init__.py +0 -0
- {ominfra-0.0.0.dev205 → ominfra-0.0.0.dev207}/ominfra/manage/commands/base.py +0 -0
- {ominfra-0.0.0.dev205 → ominfra-0.0.0.dev207}/ominfra/manage/commands/inject.py +0 -0
- {ominfra-0.0.0.dev205 → ominfra-0.0.0.dev207}/ominfra/manage/commands/injection.py +0 -0
- {ominfra-0.0.0.dev205 → ominfra-0.0.0.dev207}/ominfra/manage/commands/local.py +0 -0
- {ominfra-0.0.0.dev205 → ominfra-0.0.0.dev207}/ominfra/manage/commands/marshal.py +0 -0
- {ominfra-0.0.0.dev205 → ominfra-0.0.0.dev207}/ominfra/manage/commands/ping.py +0 -0
- {ominfra-0.0.0.dev205 → ominfra-0.0.0.dev207}/ominfra/manage/commands/subprocess.py +0 -0
- {ominfra-0.0.0.dev205 → ominfra-0.0.0.dev207}/ominfra/manage/commands/types.py +0 -0
- {ominfra-0.0.0.dev205 → ominfra-0.0.0.dev207}/ominfra/manage/config.py +0 -0
- {ominfra-0.0.0.dev205/ominfra/manage/deploy/conf → ominfra-0.0.0.dev207/ominfra/manage/deploy}/__init__.py +0 -0
- {ominfra-0.0.0.dev205 → ominfra-0.0.0.dev207}/ominfra/manage/deploy/apps.py +0 -0
- {ominfra-0.0.0.dev205 → ominfra-0.0.0.dev207}/ominfra/manage/deploy/commands.py +0 -0
- {ominfra-0.0.0.dev205/ominfra/manage/deploy/paths → ominfra-0.0.0.dev207/ominfra/manage/deploy/conf}/__init__.py +0 -0
- {ominfra-0.0.0.dev205 → ominfra-0.0.0.dev207}/ominfra/manage/deploy/conf/inject.py +0 -0
- {ominfra-0.0.0.dev205 → ominfra-0.0.0.dev207}/ominfra/manage/deploy/conf/manager.py +0 -0
- {ominfra-0.0.0.dev205 → ominfra-0.0.0.dev207}/ominfra/manage/deploy/conf/specs.py +0 -0
- {ominfra-0.0.0.dev205 → ominfra-0.0.0.dev207}/ominfra/manage/deploy/config.py +0 -0
- {ominfra-0.0.0.dev205 → ominfra-0.0.0.dev207}/ominfra/manage/deploy/deploy.py +0 -0
- {ominfra-0.0.0.dev205 → ominfra-0.0.0.dev207}/ominfra/manage/deploy/git.py +0 -0
- {ominfra-0.0.0.dev205 → ominfra-0.0.0.dev207}/ominfra/manage/deploy/inject.py +0 -0
- {ominfra-0.0.0.dev205 → ominfra-0.0.0.dev207}/ominfra/manage/deploy/injection.py +0 -0
- {ominfra-0.0.0.dev205 → ominfra-0.0.0.dev207}/ominfra/manage/deploy/interp.py +0 -0
- {ominfra-0.0.0.dev205 → ominfra-0.0.0.dev207}/ominfra/manage/deploy/nginx.py +0 -0
- {ominfra-0.0.0.dev205/ominfra/manage/remote → ominfra-0.0.0.dev207/ominfra/manage/deploy/paths}/__init__.py +0 -0
- {ominfra-0.0.0.dev205 → ominfra-0.0.0.dev207}/ominfra/manage/deploy/paths/inject.py +0 -0
- {ominfra-0.0.0.dev205 → ominfra-0.0.0.dev207}/ominfra/manage/deploy/paths/manager.py +0 -0
- {ominfra-0.0.0.dev205 → ominfra-0.0.0.dev207}/ominfra/manage/deploy/paths/owners.py +0 -0
- {ominfra-0.0.0.dev205 → ominfra-0.0.0.dev207}/ominfra/manage/deploy/paths/paths.py +0 -0
- {ominfra-0.0.0.dev205 → ominfra-0.0.0.dev207}/ominfra/manage/deploy/paths/specs.py +0 -0
- {ominfra-0.0.0.dev205 → ominfra-0.0.0.dev207}/ominfra/manage/deploy/paths/types.py +0 -0
- {ominfra-0.0.0.dev205 → ominfra-0.0.0.dev207}/ominfra/manage/deploy/specs.py +0 -0
- {ominfra-0.0.0.dev205 → ominfra-0.0.0.dev207}/ominfra/manage/deploy/systemd.py +0 -0
- {ominfra-0.0.0.dev205 → ominfra-0.0.0.dev207}/ominfra/manage/deploy/tags.py +0 -0
- {ominfra-0.0.0.dev205 → ominfra-0.0.0.dev207}/ominfra/manage/deploy/tmp.py +0 -0
- {ominfra-0.0.0.dev205 → ominfra-0.0.0.dev207}/ominfra/manage/deploy/types.py +0 -0
- {ominfra-0.0.0.dev205 → ominfra-0.0.0.dev207}/ominfra/manage/deploy/venvs.py +0 -0
- {ominfra-0.0.0.dev205 → ominfra-0.0.0.dev207}/ominfra/manage/inject.py +0 -0
- {ominfra-0.0.0.dev205 → ominfra-0.0.0.dev207}/ominfra/manage/main.py +0 -0
- {ominfra-0.0.0.dev205 → ominfra-0.0.0.dev207}/ominfra/manage/marshal.py +0 -0
- {ominfra-0.0.0.dev205/ominfra/manage/system → ominfra-0.0.0.dev207/ominfra/manage/remote}/__init__.py +0 -0
- {ominfra-0.0.0.dev205 → ominfra-0.0.0.dev207}/ominfra/manage/remote/_main.py +0 -0
- {ominfra-0.0.0.dev205 → ominfra-0.0.0.dev207}/ominfra/manage/remote/channel.py +0 -0
- {ominfra-0.0.0.dev205 → ominfra-0.0.0.dev207}/ominfra/manage/remote/config.py +0 -0
- {ominfra-0.0.0.dev205 → ominfra-0.0.0.dev207}/ominfra/manage/remote/connection.py +0 -0
- {ominfra-0.0.0.dev205 → ominfra-0.0.0.dev207}/ominfra/manage/remote/execution.py +0 -0
- {ominfra-0.0.0.dev205 → ominfra-0.0.0.dev207}/ominfra/manage/remote/inject.py +0 -0
- {ominfra-0.0.0.dev205 → ominfra-0.0.0.dev207}/ominfra/manage/remote/payload.py +0 -0
- {ominfra-0.0.0.dev205 → ominfra-0.0.0.dev207}/ominfra/manage/remote/spawning.py +0 -0
- {ominfra-0.0.0.dev205/ominfra/manage/targets → ominfra-0.0.0.dev207/ominfra/manage/system}/__init__.py +0 -0
- {ominfra-0.0.0.dev205 → ominfra-0.0.0.dev207}/ominfra/manage/system/commands.py +0 -0
- {ominfra-0.0.0.dev205 → ominfra-0.0.0.dev207}/ominfra/manage/system/config.py +0 -0
- {ominfra-0.0.0.dev205 → ominfra-0.0.0.dev207}/ominfra/manage/system/inject.py +0 -0
- {ominfra-0.0.0.dev205 → ominfra-0.0.0.dev207}/ominfra/manage/system/packages.py +0 -0
- {ominfra-0.0.0.dev205 → ominfra-0.0.0.dev207}/ominfra/manage/system/platforms.py +0 -0
- {ominfra-0.0.0.dev205/ominfra/scripts → ominfra-0.0.0.dev207/ominfra/manage/targets}/__init__.py +0 -0
- {ominfra-0.0.0.dev205 → ominfra-0.0.0.dev207}/ominfra/manage/targets/bestpython.py +0 -0
- {ominfra-0.0.0.dev205 → ominfra-0.0.0.dev207}/ominfra/manage/targets/bestpython.sh +0 -0
- {ominfra-0.0.0.dev205 → ominfra-0.0.0.dev207}/ominfra/manage/targets/connection.py +0 -0
- {ominfra-0.0.0.dev205 → ominfra-0.0.0.dev207}/ominfra/manage/targets/inject.py +0 -0
- {ominfra-0.0.0.dev205 → ominfra-0.0.0.dev207}/ominfra/manage/targets/targets.py +0 -0
- {ominfra-0.0.0.dev205 → ominfra-0.0.0.dev207}/ominfra/pyremote.py +0 -0
- {ominfra-0.0.0.dev205/ominfra/supervisor/utils → ominfra-0.0.0.dev207/ominfra/scripts}/__init__.py +0 -0
- {ominfra-0.0.0.dev205 → ominfra-0.0.0.dev207}/ominfra/scripts/journald2aws.py +0 -0
- {ominfra-0.0.0.dev205 → ominfra-0.0.0.dev207}/ominfra/scripts/manage.py +0 -0
- {ominfra-0.0.0.dev205 → ominfra-0.0.0.dev207}/ominfra/scripts/supervisor.py +0 -0
- {ominfra-0.0.0.dev205 → ominfra-0.0.0.dev207}/ominfra/supervisor/LICENSE.txt +0 -0
- {ominfra-0.0.0.dev205 → ominfra-0.0.0.dev207}/ominfra/supervisor/__init__.py +0 -0
- {ominfra-0.0.0.dev205 → ominfra-0.0.0.dev207}/ominfra/supervisor/__main__.py +0 -0
- {ominfra-0.0.0.dev205 → ominfra-0.0.0.dev207}/ominfra/supervisor/configs.py +0 -0
- {ominfra-0.0.0.dev205 → ominfra-0.0.0.dev207}/ominfra/supervisor/dispatchers.py +0 -0
- {ominfra-0.0.0.dev205 → ominfra-0.0.0.dev207}/ominfra/supervisor/dispatchersimpl.py +0 -0
- {ominfra-0.0.0.dev205 → ominfra-0.0.0.dev207}/ominfra/supervisor/events.py +0 -0
- {ominfra-0.0.0.dev205 → ominfra-0.0.0.dev207}/ominfra/supervisor/exceptions.py +0 -0
- {ominfra-0.0.0.dev205 → ominfra-0.0.0.dev207}/ominfra/supervisor/groups.py +0 -0
- {ominfra-0.0.0.dev205 → ominfra-0.0.0.dev207}/ominfra/supervisor/groupsimpl.py +0 -0
- {ominfra-0.0.0.dev205 → ominfra-0.0.0.dev207}/ominfra/supervisor/http.py +0 -0
- {ominfra-0.0.0.dev205 → ominfra-0.0.0.dev207}/ominfra/supervisor/inject.py +0 -0
- {ominfra-0.0.0.dev205 → ominfra-0.0.0.dev207}/ominfra/supervisor/io.py +0 -0
- {ominfra-0.0.0.dev205 → ominfra-0.0.0.dev207}/ominfra/supervisor/main.py +0 -0
- {ominfra-0.0.0.dev205 → ominfra-0.0.0.dev207}/ominfra/supervisor/pipes.py +0 -0
- {ominfra-0.0.0.dev205 → ominfra-0.0.0.dev207}/ominfra/supervisor/privileges.py +0 -0
- {ominfra-0.0.0.dev205 → ominfra-0.0.0.dev207}/ominfra/supervisor/process.py +0 -0
- {ominfra-0.0.0.dev205 → ominfra-0.0.0.dev207}/ominfra/supervisor/processimpl.py +0 -0
- {ominfra-0.0.0.dev205 → ominfra-0.0.0.dev207}/ominfra/supervisor/setup.py +0 -0
- {ominfra-0.0.0.dev205 → ominfra-0.0.0.dev207}/ominfra/supervisor/setupimpl.py +0 -0
- {ominfra-0.0.0.dev205 → ominfra-0.0.0.dev207}/ominfra/supervisor/signals.py +0 -0
- {ominfra-0.0.0.dev205 → ominfra-0.0.0.dev207}/ominfra/supervisor/spawning.py +0 -0
- {ominfra-0.0.0.dev205 → ominfra-0.0.0.dev207}/ominfra/supervisor/spawningimpl.py +0 -0
- {ominfra-0.0.0.dev205 → ominfra-0.0.0.dev207}/ominfra/supervisor/states.py +0 -0
- {ominfra-0.0.0.dev205 → ominfra-0.0.0.dev207}/ominfra/supervisor/supervisor.py +0 -0
- {ominfra-0.0.0.dev205 → ominfra-0.0.0.dev207}/ominfra/supervisor/types.py +0 -0
- {ominfra-0.0.0.dev205/ominfra/tailscale → ominfra-0.0.0.dev207/ominfra/supervisor/utils}/__init__.py +0 -0
- {ominfra-0.0.0.dev205 → ominfra-0.0.0.dev207}/ominfra/supervisor/utils/collections.py +0 -0
- {ominfra-0.0.0.dev205 → ominfra-0.0.0.dev207}/ominfra/supervisor/utils/diag.py +0 -0
- {ominfra-0.0.0.dev205 → ominfra-0.0.0.dev207}/ominfra/supervisor/utils/fds.py +0 -0
- {ominfra-0.0.0.dev205 → ominfra-0.0.0.dev207}/ominfra/supervisor/utils/fs.py +0 -0
- {ominfra-0.0.0.dev205 → ominfra-0.0.0.dev207}/ominfra/supervisor/utils/os.py +0 -0
- {ominfra-0.0.0.dev205 → ominfra-0.0.0.dev207}/ominfra/supervisor/utils/ostypes.py +0 -0
- {ominfra-0.0.0.dev205 → ominfra-0.0.0.dev207}/ominfra/supervisor/utils/signals.py +0 -0
- {ominfra-0.0.0.dev205 → ominfra-0.0.0.dev207}/ominfra/supervisor/utils/strings.py +0 -0
- {ominfra-0.0.0.dev205 → ominfra-0.0.0.dev207}/ominfra/supervisor/utils/users.py +0 -0
- {ominfra-0.0.0.dev205 → ominfra-0.0.0.dev207}/ominfra/systemd.py +0 -0
- {ominfra-0.0.0.dev205/ominfra/tools → ominfra-0.0.0.dev207/ominfra/tailscale}/__init__.py +0 -0
- {ominfra-0.0.0.dev205 → ominfra-0.0.0.dev207}/ominfra/tailscale/api.py +0 -0
- {ominfra-0.0.0.dev205 → ominfra-0.0.0.dev207}/ominfra/tailscale/cli.py +0 -0
- {ominfra-0.0.0.dev205 → ominfra-0.0.0.dev207}/ominfra/threadworkers.py +0 -0
- {ominfra-0.0.0.dev205 → ominfra-0.0.0.dev207}/ominfra/tools/listresources.py +0 -0
- {ominfra-0.0.0.dev205 → ominfra-0.0.0.dev207}/ominfra.egg-info/dependency_links.txt +0 -0
- {ominfra-0.0.0.dev205 → ominfra-0.0.0.dev207}/ominfra.egg-info/entry_points.txt +0 -0
- {ominfra-0.0.0.dev205 → ominfra-0.0.0.dev207}/ominfra.egg-info/top_level.txt +0 -0
- {ominfra-0.0.0.dev205 → ominfra-0.0.0.dev207}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.2
|
2
2
|
Name: ominfra
|
3
|
-
Version: 0.0.0.
|
3
|
+
Version: 0.0.0.dev207
|
4
4
|
Summary: ominfra
|
5
5
|
Author: wrmsr
|
6
6
|
License: BSD-3-Clause
|
@@ -12,9 +12,9 @@ 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.
|
17
|
-
Requires-Dist: omserv==0.0.0.
|
15
|
+
Requires-Dist: omdev==0.0.0.dev207
|
16
|
+
Requires-Dist: omlish==0.0.0.dev207
|
17
|
+
Requires-Dist: omserv==0.0.0.dev207
|
18
18
|
Provides-Extra: all
|
19
19
|
Requires-Dist: paramiko~=3.5; extra == "all"
|
20
20
|
Requires-Dist: asyncssh~=2.18; extra == "all"
|
Binary file
|
@@ -0,0 +1,12 @@
|
|
1
|
+
import gzip
|
2
|
+
import typing as ta
|
3
|
+
|
4
|
+
from omlish import lang
|
5
|
+
from omlish.formats import json
|
6
|
+
|
7
|
+
|
8
|
+
@lang.cached_function()
|
9
|
+
def load_instance_types() -> ta.Mapping[str, ta.Mapping[str, ta.Any]]:
|
10
|
+
raw = lang.get_relative_resources(globals=globals())['cache.json.gz'].read_bytes()
|
11
|
+
data = gzip.decompress(raw)
|
12
|
+
return json.loads(data)
|
@@ -0,0 +1,80 @@
|
|
1
|
+
import datetime
|
2
|
+
import gzip
|
3
|
+
import os.path
|
4
|
+
import typing as ta
|
5
|
+
|
6
|
+
from omdev.secrets import load_secrets
|
7
|
+
from omlish import lang
|
8
|
+
from omlish import secrets as sec
|
9
|
+
from omlish.argparse import all as ap
|
10
|
+
from omlish.formats import json
|
11
|
+
|
12
|
+
from .cache import load_instance_types
|
13
|
+
|
14
|
+
|
15
|
+
if ta.TYPE_CHECKING:
|
16
|
+
import boto3
|
17
|
+
else:
|
18
|
+
boto3 = lang.proxy_import('boto3')
|
19
|
+
|
20
|
+
|
21
|
+
# Use a hardcoded gz mtime to prevent the gz file from changing when the contents don't. We still have the git metadata
|
22
|
+
# to track modifications.
|
23
|
+
FIXED_CACHE_TIMESTAMP = datetime.datetime(2025, 1, 1, tzinfo=datetime.UTC).timestamp()
|
24
|
+
|
25
|
+
|
26
|
+
@lang.cached_function
|
27
|
+
def _get_secrets() -> sec.Secrets:
|
28
|
+
return load_secrets()
|
29
|
+
|
30
|
+
|
31
|
+
def get_ec2_instance_types(session: boto3.Session) -> dict[str, dict[str, ta.Any]]:
|
32
|
+
ec2 = session.client('ec2')
|
33
|
+
next_token = None
|
34
|
+
dct = {}
|
35
|
+
while True:
|
36
|
+
resp = ec2.describe_instance_types(**(dict(NextToken=next_token) if next_token else {}))
|
37
|
+
for instance_type in resp['InstanceTypes']:
|
38
|
+
name = instance_type['InstanceType']
|
39
|
+
dct[name] = instance_type
|
40
|
+
next_token = resp.get('NextToken')
|
41
|
+
if not next_token:
|
42
|
+
break
|
43
|
+
dct = dict(sorted(dct.items(), key=lambda t: t[0]))
|
44
|
+
return dct
|
45
|
+
|
46
|
+
|
47
|
+
class Cli(ap.Cli):
|
48
|
+
@ap.cmd()
|
49
|
+
def fetch(self) -> None:
|
50
|
+
cfg = _get_secrets()
|
51
|
+
|
52
|
+
session = boto3.Session(
|
53
|
+
aws_access_key_id=cfg.get('aws_access_key_id').reveal(),
|
54
|
+
aws_secret_access_key=cfg.get('aws_secret_access_key').reveal(),
|
55
|
+
region_name=cfg.get('aws_region').reveal(),
|
56
|
+
)
|
57
|
+
|
58
|
+
instance_types = get_ec2_instance_types(session)
|
59
|
+
|
60
|
+
cache_file = os.path.join(os.path.dirname(__file__), 'cache.json.gz')
|
61
|
+
with open(cache_file, 'wb') as f:
|
62
|
+
with gzip.GzipFile(
|
63
|
+
fileobj=f,
|
64
|
+
mode='w',
|
65
|
+
mtime=FIXED_CACHE_TIMESTAMP,
|
66
|
+
) as gf:
|
67
|
+
gf.write(json.dumps_compact(instance_types).encode('utf-8'))
|
68
|
+
|
69
|
+
@ap.cmd()
|
70
|
+
def dump(self) -> None:
|
71
|
+
dct = load_instance_types()
|
72
|
+
print(json.dumps_pretty(dct))
|
73
|
+
|
74
|
+
|
75
|
+
def _main() -> None:
|
76
|
+
Cli()()
|
77
|
+
|
78
|
+
|
79
|
+
if __name__ == '__main__':
|
80
|
+
_main()
|
@@ -0,0 +1,161 @@
|
|
1
|
+
import typing as ta
|
2
|
+
|
3
|
+
from omlish import cached
|
4
|
+
from omlish import check
|
5
|
+
from omlish import collections as col
|
6
|
+
from omlish import dataclasses as dc
|
7
|
+
from omlish import lang
|
8
|
+
|
9
|
+
|
10
|
+
DateTime = ta.NewType('DateTime', str)
|
11
|
+
MillisecondDateTime = ta.NewType('MillisecondDateTime', str)
|
12
|
+
|
13
|
+
Timestamp = ta.NewType('Timestamp', str)
|
14
|
+
|
15
|
+
|
16
|
+
##
|
17
|
+
|
18
|
+
|
19
|
+
class TagList:
|
20
|
+
pass
|
21
|
+
|
22
|
+
|
23
|
+
##
|
24
|
+
|
25
|
+
|
26
|
+
class SHAPE_NAME(lang.Marker): # noqa
|
27
|
+
pass
|
28
|
+
|
29
|
+
|
30
|
+
def common_metadata(
|
31
|
+
*,
|
32
|
+
shape_name: str | None = None,
|
33
|
+
) -> dict[ta.Any, ta.Any]:
|
34
|
+
md = {}
|
35
|
+
|
36
|
+
if shape_name is not None:
|
37
|
+
md[SHAPE_NAME] = shape_name
|
38
|
+
|
39
|
+
return md
|
40
|
+
|
41
|
+
|
42
|
+
##
|
43
|
+
|
44
|
+
|
45
|
+
def shape_metadata(
|
46
|
+
**kwargs: ta.Any,
|
47
|
+
) -> dict[ta.Any, ta.Any]:
|
48
|
+
md = {**common_metadata(**kwargs)}
|
49
|
+
|
50
|
+
return md
|
51
|
+
|
52
|
+
|
53
|
+
class ShapeInfo:
|
54
|
+
def __init__(
|
55
|
+
self,
|
56
|
+
cls: type['Shape'],
|
57
|
+
metadata: ta.Mapping[ta.Any, ta.Any],
|
58
|
+
) -> None:
|
59
|
+
super().__init__()
|
60
|
+
|
61
|
+
self._cls = check.issubclass(cls, Shape)
|
62
|
+
self._metadata = metadata
|
63
|
+
|
64
|
+
@property
|
65
|
+
def cls(self) -> type['Shape']:
|
66
|
+
return self._cls
|
67
|
+
|
68
|
+
@property
|
69
|
+
def metadata(self) -> ta.Mapping[ta.Any, ta.Any]:
|
70
|
+
return self._metadata
|
71
|
+
|
72
|
+
#
|
73
|
+
|
74
|
+
@cached.function
|
75
|
+
def fields(self) -> ta.Sequence[dc.Field]:
|
76
|
+
check.state(dc.is_immediate_dataclass(self._cls))
|
77
|
+
fls = dc.fields(self._cls)
|
78
|
+
return fls # noqa
|
79
|
+
|
80
|
+
@cached.function
|
81
|
+
def fields_by_name(self) -> ta.Mapping[str, dc.Field]:
|
82
|
+
return col.make_map_by(lambda fl: fl.name, self.fields(), strict=True)
|
83
|
+
|
84
|
+
@cached.function
|
85
|
+
def fields_by_member_name(self) -> ta.Mapping[str, dc.Field]:
|
86
|
+
return col.make_map(
|
87
|
+
[(n, f) for f in self.fields() if (n := f.metadata.get(MEMBER_NAME)) is not None],
|
88
|
+
strict=True,
|
89
|
+
)
|
90
|
+
|
91
|
+
@cached.function
|
92
|
+
def fields_by_serialization_name(self) -> ta.Mapping[str, dc.Field]:
|
93
|
+
l = []
|
94
|
+
for f in self.fields():
|
95
|
+
if sn := f.metadata.get(SERIALIZATION_NAME):
|
96
|
+
l.append((sn, f))
|
97
|
+
elif mn := f.metadata.get(MEMBER_NAME):
|
98
|
+
l.append((mn, f))
|
99
|
+
return col.make_map(l, strict=True)
|
100
|
+
|
101
|
+
|
102
|
+
@dc.dataclass(frozen=True)
|
103
|
+
class Shape:
|
104
|
+
__shape__: ShapeInfo
|
105
|
+
|
106
|
+
def __init_subclass__(
|
107
|
+
cls,
|
108
|
+
*,
|
109
|
+
shape_name: str | None = None,
|
110
|
+
**kwargs: ta.Any,
|
111
|
+
) -> None:
|
112
|
+
super().__init_subclass__(**kwargs)
|
113
|
+
|
114
|
+
check.state(not hasattr(cls, '__shape__'))
|
115
|
+
|
116
|
+
info = ShapeInfo(
|
117
|
+
cls,
|
118
|
+
shape_metadata(**kwargs),
|
119
|
+
)
|
120
|
+
|
121
|
+
cls.__shape__ = info
|
122
|
+
|
123
|
+
|
124
|
+
##
|
125
|
+
|
126
|
+
|
127
|
+
class MEMBER_NAME(lang.Marker): # noqa
|
128
|
+
pass
|
129
|
+
|
130
|
+
|
131
|
+
class SERIALIZATION_NAME(lang.Marker): # noqa
|
132
|
+
pass
|
133
|
+
|
134
|
+
|
135
|
+
def field_metadata(
|
136
|
+
*,
|
137
|
+
member_name: str | None = None,
|
138
|
+
serialization_name: str | None = None,
|
139
|
+
**kwargs: ta.Any,
|
140
|
+
) -> dict[ta.Any, ta.Any]:
|
141
|
+
md = {**common_metadata(**kwargs)}
|
142
|
+
|
143
|
+
if member_name is not None:
|
144
|
+
md[MEMBER_NAME] = member_name
|
145
|
+
if serialization_name is not None:
|
146
|
+
md[SERIALIZATION_NAME] = serialization_name
|
147
|
+
|
148
|
+
return md
|
149
|
+
|
150
|
+
|
151
|
+
##
|
152
|
+
|
153
|
+
|
154
|
+
@dc.dataclass(frozen=True, eq=False, kw_only=True)
|
155
|
+
class Operation:
|
156
|
+
name: str
|
157
|
+
|
158
|
+
input: type[Shape] | None = None
|
159
|
+
output: type[Shape] | None = None
|
160
|
+
|
161
|
+
errors: ta.Sequence[type[Shape]] | None = None
|
@@ -156,6 +156,7 @@ class ModelGen:
|
|
156
156
|
'Boolean': 'bool',
|
157
157
|
|
158
158
|
'Integer': 'int',
|
159
|
+
'Long': 'int',
|
159
160
|
|
160
161
|
'String': 'str',
|
161
162
|
|
@@ -317,8 +318,10 @@ class ModelGen:
|
|
317
318
|
fn = self.demangle_name(mn)
|
318
319
|
mds = [
|
319
320
|
f'member_name={mn!r}',
|
320
|
-
f'shape_name={ms.name!r}',
|
321
321
|
]
|
322
|
+
if msn := ms.serialization.get('name'):
|
323
|
+
mds.append(f'serialization_name={msn!r}')
|
324
|
+
mds.append(f'shape_name={ms.name!r}')
|
322
325
|
ma = self.get_type_ann(
|
323
326
|
ms.name,
|
324
327
|
unquoted_names=unquoted_names,
|
@@ -508,3 +511,7 @@ class ModelGen:
|
|
508
511
|
self.gen_all_operations(out)
|
509
512
|
|
510
513
|
return out.getvalue()
|
514
|
+
|
515
|
+
|
516
|
+
if __name__ == '__main__':
|
517
|
+
raise RuntimeError('Use cli')
|