py-pve-cloud 0.0.1__py3-none-any.whl → 0.14.5rc0__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.
Potentially problematic release.
This version of py-pve-cloud might be problematic. Click here for more details.
- pve_cloud/_version.py +1 -0
- pve_cloud/cli/pvcli.py +187 -0
- pve_cloud/cli/pvclu.py +146 -0
- pve_cloud/lib/inventory.py +276 -0
- pve_cloud/lib/validate.py +25 -0
- {orm → pve_cloud/orm}/alchemy.py +18 -22
- pve_cloud/orm/alembic.ini +147 -0
- pve_cloud/orm/migrations/env.py +83 -0
- pve_cloud/orm/migrations/versions/04398db10434_external_cp_extra_sans.py +44 -0
- pve_cloud/orm/migrations/versions/0ad803c51325_machine_type_refactor.py +65 -0
- pve_cloud/orm/migrations/versions/24a548bfce3e_len_rules_enforcements.py +133 -0
- pve_cloud/orm/migrations/versions/27724e407e2b_proxy_fqdn.py +32 -0
- pve_cloud/orm/migrations/versions/3c95509a5de9_fix.py +44 -0
- pve_cloud/orm/migrations/versions/7868bcd05006_migrate_old.py +83 -0
- pve_cloud/orm/migrations/versions/7dea8c4ee39f_init.py +36 -0
- pve_cloud/orm/migrations/versions/944a8fd5d5bc_ext_ctrl_plns.py +46 -0
- pve_cloud/orm/migrations/versions/d9b711555be8_ext_control_plane.py +37 -0
- pve_cloud/orm/migrations/versions/e60b9cc63413_ingress_generic.py +33 -0
- pve_cloud/orm/migrations/versions/fdcb5aa33b76_slop_firewall_seperation.py +54 -0
- py_pve_cloud-0.14.5rc0.dist-info/METADATA +14 -0
- py_pve_cloud-0.14.5rc0.dist-info/RECORD +25 -0
- py_pve_cloud-0.14.5rc0.dist-info/entry_points.txt +3 -0
- py_pve_cloud-0.14.5rc0.dist-info/licenses/LICENSE.md +660 -0
- py_pve_cloud-0.14.5rc0.dist-info/top_level.txt +1 -0
- cli/pvclu.py +0 -68
- py_pve_cloud-0.0.1.dist-info/METADATA +0 -11
- py_pve_cloud-0.0.1.dist-info/RECORD +0 -8
- py_pve_cloud-0.0.1.dist-info/entry_points.txt +0 -2
- py_pve_cloud-0.0.1.dist-info/licenses/LICENSE +0 -674
- py_pve_cloud-0.0.1.dist-info/top_level.txt +0 -2
- {py_pve_cloud-0.0.1.dist-info → py_pve_cloud-0.14.5rc0.dist-info}/WHEEL +0 -0
cli/pvclu.py
DELETED
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
import argparse
|
|
2
|
-
import yaml
|
|
3
|
-
import os
|
|
4
|
-
import socket
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
def get_cloud_domain(target_pve):
|
|
8
|
-
with open(os.path.expanduser("~/.pve-inventory.yaml"), "r") as f:
|
|
9
|
-
pve_inventory = yaml.safe_load(f)
|
|
10
|
-
|
|
11
|
-
for pve_cloud in pve_inventory:
|
|
12
|
-
for pve_cluster in pve_inventory[pve_cloud]:
|
|
13
|
-
if pve_cluster == target_pve:
|
|
14
|
-
return pve_cloud
|
|
15
|
-
|
|
16
|
-
raise Exception(f"Could not identify cloud domain for {target_pve}")
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
def get_cld_domain_prsr(args):
|
|
20
|
-
print(f"export PVE_CLOUD_DOMAIN='{get_cloud_domain(args.target_pve)}'")
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
def get_online_pve_host(target_pve):
|
|
24
|
-
with open(os.path.expanduser("~/.pve-inventory.yaml"), "r") as f:
|
|
25
|
-
pve_inventory = yaml.safe_load(f)
|
|
26
|
-
|
|
27
|
-
for pve_cloud in pve_inventory:
|
|
28
|
-
for pve_cluster in pve_inventory[pve_cloud]:
|
|
29
|
-
if pve_cluster == target_pve:
|
|
30
|
-
for pve_host in pve_inventory[pve_cloud][pve_cluster]:
|
|
31
|
-
# check if host is available
|
|
32
|
-
pve_host_ip = pve_inventory[pve_cloud][pve_cluster][pve_host]["ansible_host"]
|
|
33
|
-
try:
|
|
34
|
-
with socket.create_connection((pve_host_ip, 22), timeout=3):
|
|
35
|
-
return pve_host_ip
|
|
36
|
-
except Exception as e:
|
|
37
|
-
# debug
|
|
38
|
-
print(e, type(e))
|
|
39
|
-
pass
|
|
40
|
-
|
|
41
|
-
raise Exception(f"Could not find online pve host for {target_pve}")
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
def get_online_pve_host_prsr(args):
|
|
45
|
-
print(f"export PVE_ANSIBLE_HOST='{get_online_pve_host(args.target_pve)}'")
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
def main():
|
|
49
|
-
parser = argparse.ArgumentParser(description="PVE Cloud utility cli. Should be called with bash eval.")
|
|
50
|
-
|
|
51
|
-
base_parser = argparse.ArgumentParser(add_help=False)
|
|
52
|
-
|
|
53
|
-
subparsers = parser.add_subparsers(dest="command", required=True)
|
|
54
|
-
|
|
55
|
-
get_cld_domain_parser = subparsers.add_parser("get-cloud-domain", help="Get the cloud domain of a pve cluster.", parents=[base_parser])
|
|
56
|
-
get_cld_domain_parser.add_argument("--target-pve", type=str, help="The target pve cluster to get the cloud domain of.", required=True)
|
|
57
|
-
get_cld_domain_parser .set_defaults(func=get_cld_domain_prsr)
|
|
58
|
-
|
|
59
|
-
get_online_pve_host_parser = subparsers.add_parser("get-online-host", help="Gets the ip for the first online proxmox host in the cluster.", parents=[base_parser])
|
|
60
|
-
get_online_pve_host_parser.add_argument("--target-pve", type=str, help="The target pve cluster to get the first online ip of.", required=True)
|
|
61
|
-
get_online_pve_host_parser.set_defaults(func=get_online_pve_host_prsr)
|
|
62
|
-
|
|
63
|
-
args = parser.parse_args()
|
|
64
|
-
args.func(args)
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
if __name__ == "__main__":
|
|
68
|
-
main()
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: py-pve-cloud
|
|
3
|
-
Version: 0.0.1
|
|
4
|
-
Author-email: Tobias Huebner <tobias.huebner@vmzberlin.com>
|
|
5
|
-
License-Expression: GPL-3.0-or-later
|
|
6
|
-
License-File: LICENSE
|
|
7
|
-
Requires-Dist: PyYAML==6.0.2
|
|
8
|
-
Requires-Dist: psycopg2-binary==2.9.10
|
|
9
|
-
Requires-Dist: SQLAlchemy==2.0.43
|
|
10
|
-
Requires-Dist: alembic==1.16.5
|
|
11
|
-
Dynamic: license-file
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
cli/pvclu.py,sha256=xv833SHRvcUycwIsZ6gDKQkvvz-5igzwwdqGaN2NpF8,2454
|
|
2
|
-
orm/alchemy.py,sha256=lXsSM8Il71Kw5ASPKTrdw37H_aClHoK067VmLJvzvS0,5065
|
|
3
|
-
py_pve_cloud-0.0.1.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
|
|
4
|
-
py_pve_cloud-0.0.1.dist-info/METADATA,sha256=o_ensrF8aBUZSRM2EW2epU0ble8IUlOqfJeYTQ5NteY,330
|
|
5
|
-
py_pve_cloud-0.0.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
6
|
-
py_pve_cloud-0.0.1.dist-info/entry_points.txt,sha256=qiXb7jB8tpmQdrKoVbLzMAufkJ0WIRVBR8kEYoap0P4,41
|
|
7
|
-
py_pve_cloud-0.0.1.dist-info/top_level.txt,sha256=lMp8FO9npFj6itlgcw2I8ZRWXnHDEe42Cr4vXZZAH2s,8
|
|
8
|
-
py_pve_cloud-0.0.1.dist-info/RECORD,,
|