py-pve-cloud 0.0.1__tar.gz → 0.0.2__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.

Potentially problematic release.


This version of py-pve-cloud might be problematic. Click here for more details.

Files changed (26) hide show
  1. {py_pve_cloud-0.0.1/py_pve_cloud.egg-info → py_pve_cloud-0.0.2}/PKG-INFO +1 -1
  2. py_pve_cloud-0.0.2/README.md +4 -0
  3. {py_pve_cloud-0.0.1 → py_pve_cloud-0.0.2}/pyproject.toml +5 -4
  4. {py_pve_cloud-0.0.1 → py_pve_cloud-0.0.2/src/pve_cloud}/orm/alchemy.py +3 -3
  5. py_pve_cloud-0.0.2/src/pve_cloud/orm/alembic.ini +147 -0
  6. py_pve_cloud-0.0.2/src/pve_cloud/orm/migrations/env.py +83 -0
  7. py_pve_cloud-0.0.2/src/pve_cloud/orm/migrations/versions/24a548bfce3e_len_rules_enforcements.py +133 -0
  8. py_pve_cloud-0.0.2/src/pve_cloud/orm/migrations/versions/27724e407e2b_proxy_fqdn.py +32 -0
  9. py_pve_cloud-0.0.2/src/pve_cloud/orm/migrations/versions/3c95509a5de9_fix.py +44 -0
  10. py_pve_cloud-0.0.2/src/pve_cloud/orm/migrations/versions/7868bcd05006_migrate_old.py +83 -0
  11. py_pve_cloud-0.0.2/src/pve_cloud/orm/migrations/versions/7dea8c4ee39f_init.py +36 -0
  12. py_pve_cloud-0.0.2/src/pve_cloud/orm/migrations/versions/944a8fd5d5bc_ext_ctrl_plns.py +46 -0
  13. py_pve_cloud-0.0.2/src/pve_cloud/orm/migrations/versions/d9b711555be8_ext_control_plane.py +37 -0
  14. {py_pve_cloud-0.0.1 → py_pve_cloud-0.0.2/src/py_pve_cloud.egg-info}/PKG-INFO +1 -1
  15. py_pve_cloud-0.0.2/src/py_pve_cloud.egg-info/SOURCES.txt +20 -0
  16. py_pve_cloud-0.0.2/src/py_pve_cloud.egg-info/entry_points.txt +2 -0
  17. py_pve_cloud-0.0.2/src/py_pve_cloud.egg-info/top_level.txt +1 -0
  18. py_pve_cloud-0.0.1/README.md +0 -2
  19. py_pve_cloud-0.0.1/py_pve_cloud.egg-info/SOURCES.txt +0 -11
  20. py_pve_cloud-0.0.1/py_pve_cloud.egg-info/entry_points.txt +0 -2
  21. py_pve_cloud-0.0.1/py_pve_cloud.egg-info/top_level.txt +0 -2
  22. {py_pve_cloud-0.0.1 → py_pve_cloud-0.0.2}/LICENSE +0 -0
  23. {py_pve_cloud-0.0.1 → py_pve_cloud-0.0.2}/setup.cfg +0 -0
  24. {py_pve_cloud-0.0.1 → py_pve_cloud-0.0.2/src/pve_cloud}/cli/pvclu.py +0 -0
  25. {py_pve_cloud-0.0.1 → py_pve_cloud-0.0.2/src}/py_pve_cloud.egg-info/dependency_links.txt +0 -0
  26. {py_pve_cloud-0.0.1 → py_pve_cloud-0.0.2/src}/py_pve_cloud.egg-info/requires.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: py-pve-cloud
3
- Version: 0.0.1
3
+ Version: 0.0.2
4
4
  Author-email: Tobias Huebner <tobias.huebner@vmzberlin.com>
5
5
  License-Expression: GPL-3.0-or-later
6
6
  License-File: LICENSE
@@ -0,0 +1,4 @@
1
+ ## Releasing to pypi
2
+
3
+
4
+ `python3 -m build && python3 -m twine upload dist/*`
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "py-pve-cloud"
7
- version = "0.0.1"
7
+ version = "0.0.2"
8
8
  authors = [{ name = "Tobias Huebner", email = "tobias.huebner@vmzberlin.com" }]
9
9
  license = "GPL-3.0-or-later"
10
10
  license-files = ["LICENSE"]
@@ -15,8 +15,9 @@ dependencies = [
15
15
  "alembic==1.16.5"
16
16
  ]
17
17
 
18
+ [tool.setuptools.package-data]
19
+ "pve_cloud.orm" = ["*.mako", "*.ini"]
20
+
18
21
  [project.scripts]
19
- pvclu = "cli.pvclu:main"
22
+ pvclu = "pve_cloud.cli.pvclu:main"
20
23
 
21
- [tool.setuptools]
22
- packages = ["cli", "orm"]
@@ -85,11 +85,11 @@ class K8SExternalControlPlanes(Base):
85
85
 
86
86
 
87
87
  # apply the migrations to the database
88
- def migrate(conn_str, playbook_dir):
89
- alembic_cfg = Config(os.path.dirname(playbook_dir) + "/plugins/module_utils/orm/alembic.ini")
88
+ def migrate(conn_str):
89
+ alembic_cfg = Config(os.path.join(os.path.dirname(__file__), 'alembic.ini'))
90
90
 
91
91
  alembic_cfg.set_main_option("sqlalchemy.url", conn_str)
92
- alembic_cfg.set_main_option("prepend_sys_path", os.path.dirname(playbook_dir) + "/plugins/module_utils/orm")
92
+ alembic_cfg.set_main_option("prepend_sys_path", os.path.dirname(__file__))
93
93
 
94
94
  command.upgrade(alembic_cfg, "head")
95
95
 
@@ -0,0 +1,147 @@
1
+ # A generic, single database configuration.
2
+
3
+ [alembic]
4
+ # path to migration scripts.
5
+ # this is typically a path given in POSIX (e.g. forward slashes)
6
+ # format, relative to the token %(here)s which refers to the location of this
7
+ # ini file
8
+ script_location = %(here)s/migrations
9
+
10
+ # template used to generate migration file names; The default value is %%(rev)s_%%(slug)s
11
+ # Uncomment the line below if you want the files to be prepended with date and time
12
+ # see https://alembic.sqlalchemy.org/en/latest/tutorial.html#editing-the-ini-file
13
+ # for all available tokens
14
+ # file_template = %%(year)d_%%(month).2d_%%(day).2d_%%(hour).2d%%(minute).2d-%%(rev)s_%%(slug)s
15
+
16
+ # sys.path path, will be prepended to sys.path if present.
17
+ # defaults to the current working directory. for multiple paths, the path separator
18
+ # is defined by "path_separator" below.
19
+ prepend_sys_path = .
20
+
21
+
22
+ # timezone to use when rendering the date within the migration file
23
+ # as well as the filename.
24
+ # If specified, requires the python>=3.9 or backports.zoneinfo library and tzdata library.
25
+ # Any required deps can installed by adding `alembic[tz]` to the pip requirements
26
+ # string value is passed to ZoneInfo()
27
+ # leave blank for localtime
28
+ # timezone =
29
+
30
+ # max length of characters to apply to the "slug" field
31
+ # truncate_slug_length = 40
32
+
33
+ # set to 'true' to run the environment during
34
+ # the 'revision' command, regardless of autogenerate
35
+ # revision_environment = false
36
+
37
+ # set to 'true' to allow .pyc and .pyo files without
38
+ # a source .py file to be detected as revisions in the
39
+ # versions/ directory
40
+ # sourceless = false
41
+
42
+ # version location specification; This defaults
43
+ # to <script_location>/versions. When using multiple version
44
+ # directories, initial revisions must be specified with --version-path.
45
+ # The path separator used here should be the separator specified by "path_separator"
46
+ # below.
47
+ # version_locations = %(here)s/bar:%(here)s/bat:%(here)s/alembic/versions
48
+
49
+ # path_separator; This indicates what character is used to split lists of file
50
+ # paths, including version_locations and prepend_sys_path within configparser
51
+ # files such as alembic.ini.
52
+ # The default rendered in new alembic.ini files is "os", which uses os.pathsep
53
+ # to provide os-dependent path splitting.
54
+ #
55
+ # Note that in order to support legacy alembic.ini files, this default does NOT
56
+ # take place if path_separator is not present in alembic.ini. If this
57
+ # option is omitted entirely, fallback logic is as follows:
58
+ #
59
+ # 1. Parsing of the version_locations option falls back to using the legacy
60
+ # "version_path_separator" key, which if absent then falls back to the legacy
61
+ # behavior of splitting on spaces and/or commas.
62
+ # 2. Parsing of the prepend_sys_path option falls back to the legacy
63
+ # behavior of splitting on spaces, commas, or colons.
64
+ #
65
+ # Valid values for path_separator are:
66
+ #
67
+ # path_separator = :
68
+ # path_separator = ;
69
+ # path_separator = space
70
+ # path_separator = newline
71
+ #
72
+ # Use os.pathsep. Default configuration used for new projects.
73
+ path_separator = os
74
+
75
+ # set to 'true' to search source files recursively
76
+ # in each "version_locations" directory
77
+ # new in Alembic version 1.10
78
+ # recursive_version_locations = false
79
+
80
+ # the output encoding used when revision files
81
+ # are written from script.py.mako
82
+ # output_encoding = utf-8
83
+
84
+ # database URL. This is consumed by the user-maintained env.py script only.
85
+ # other means of configuring database URLs may be customized within the env.py
86
+ # file.
87
+ sqlalchemy.url = driver://user:pass@localhost/dbname
88
+
89
+
90
+ [post_write_hooks]
91
+ # post_write_hooks defines scripts or Python functions that are run
92
+ # on newly generated revision scripts. See the documentation for further
93
+ # detail and examples
94
+
95
+ # format using "black" - use the console_scripts runner, against the "black" entrypoint
96
+ # hooks = black
97
+ # black.type = console_scripts
98
+ # black.entrypoint = black
99
+ # black.options = -l 79 REVISION_SCRIPT_FILENAME
100
+
101
+ # lint with attempts to fix using "ruff" - use the module runner, against the "ruff" module
102
+ # hooks = ruff
103
+ # ruff.type = module
104
+ # ruff.module = ruff
105
+ # ruff.options = check --fix REVISION_SCRIPT_FILENAME
106
+
107
+ # Alternatively, use the exec runner to execute a binary found on your PATH
108
+ # hooks = ruff
109
+ # ruff.type = exec
110
+ # ruff.executable = ruff
111
+ # ruff.options = check --fix REVISION_SCRIPT_FILENAME
112
+
113
+ # Logging configuration. This is also consumed by the user-maintained
114
+ # env.py script only.
115
+ [loggers]
116
+ keys = root,sqlalchemy,alembic
117
+
118
+ [handlers]
119
+ keys = console
120
+
121
+ [formatters]
122
+ keys = generic
123
+
124
+ [logger_root]
125
+ level = WARNING
126
+ handlers = console
127
+ qualname =
128
+
129
+ [logger_sqlalchemy]
130
+ level = WARNING
131
+ handlers =
132
+ qualname = sqlalchemy.engine
133
+
134
+ [logger_alembic]
135
+ level = INFO
136
+ handlers =
137
+ qualname = alembic
138
+
139
+ [handler_console]
140
+ class = StreamHandler
141
+ args = (sys.stderr,)
142
+ level = NOTSET
143
+ formatter = generic
144
+
145
+ [formatter_generic]
146
+ format = %(levelname)-5.5s [%(name)s] %(message)s
147
+ datefmt = %H:%M:%S
@@ -0,0 +1,83 @@
1
+ from logging.config import fileConfig
2
+
3
+ from sqlalchemy import engine_from_config
4
+ from sqlalchemy import pool
5
+
6
+ from alembic import context
7
+ import os
8
+
9
+ # this is the Alembic Config object, which provides
10
+ # access to the values within the .ini file in use.
11
+ config = context.config
12
+
13
+ # Interpret the config file for Python logging.
14
+ # This line sets up loggers basically.
15
+ if config.config_file_name is not None:
16
+ fileConfig(config.config_file_name)
17
+
18
+ # Use env variable if set
19
+ db_url = os.getenv("PG_CONN_STR")
20
+ if db_url:
21
+ config.set_main_option("sqlalchemy.url", db_url)
22
+
23
+ # add your model's MetaData object here
24
+ # for 'autogenerate' support
25
+ import alchemy
26
+ target_metadata = alchemy.Base.metadata
27
+
28
+ # other values from the config, defined by the needs of env.py,
29
+ # can be acquired:
30
+ # my_important_option = config.get_main_option("my_important_option")
31
+ # ... etc.
32
+
33
+
34
+ def run_migrations_offline() -> None:
35
+ """Run migrations in 'offline' mode.
36
+
37
+ This configures the context with just a URL
38
+ and not an Engine, though an Engine is acceptable
39
+ here as well. By skipping the Engine creation
40
+ we don't even need a DBAPI to be available.
41
+
42
+ Calls to context.execute() here emit the given string to the
43
+ script output.
44
+
45
+ """
46
+ url = config.get_main_option("sqlalchemy.url")
47
+ context.configure(
48
+ url=url,
49
+ target_metadata=target_metadata,
50
+ literal_binds=True,
51
+ dialect_opts={"paramstyle": "named"},
52
+ )
53
+
54
+ with context.begin_transaction():
55
+ context.run_migrations()
56
+
57
+
58
+ def run_migrations_online() -> None:
59
+ """Run migrations in 'online' mode.
60
+
61
+ In this scenario we need to create an Engine
62
+ and associate a connection with the context.
63
+
64
+ """
65
+ connectable = engine_from_config(
66
+ config.get_section(config.config_ini_section, {}),
67
+ prefix="sqlalchemy.",
68
+ poolclass=pool.NullPool,
69
+ )
70
+
71
+ with connectable.connect() as connection:
72
+ context.configure(
73
+ connection=connection, target_metadata=target_metadata
74
+ )
75
+
76
+ with context.begin_transaction():
77
+ context.run_migrations()
78
+
79
+
80
+ if context.is_offline_mode():
81
+ run_migrations_offline()
82
+ else:
83
+ run_migrations_online()
@@ -0,0 +1,133 @@
1
+ """len rules + enforcements
2
+
3
+ Revision ID: 24a548bfce3e
4
+ Revises: 944a8fd5d5bc
5
+ Create Date: 2025-09-10 17:12:21.594162
6
+
7
+ """
8
+ from typing import Sequence, Union
9
+
10
+ from alembic import op
11
+ import sqlalchemy as sa
12
+
13
+
14
+ # revision identifiers, used by Alembic.
15
+ revision: str = '24a548bfce3e'
16
+ down_revision: Union[str, Sequence[str], None] = '944a8fd5d5bc'
17
+ branch_labels: Union[str, Sequence[str], None] = None
18
+ depends_on: Union[str, Sequence[str], None] = None
19
+
20
+
21
+ def upgrade() -> None:
22
+ """Upgrade schema."""
23
+ # ### commands auto generated by Alembic - please adjust! ###
24
+ op.alter_column('k8s_ext_control_planes', 'zone',
25
+ existing_type=sa.VARCHAR(length=253),
26
+ nullable=False)
27
+ op.alter_column('k8s_ext_control_planes', 'name',
28
+ existing_type=sa.VARCHAR(length=253),
29
+ nullable=False)
30
+ op.alter_column('k8s_ext_control_planes', 'proxy_stack_fqdn',
31
+ existing_type=sa.VARCHAR(length=253),
32
+ nullable=False)
33
+
34
+ # custom migration logic
35
+ op.add_column('k8s_ingress_rules', sa.Column('rule_len', sa.Integer(), nullable=True))
36
+
37
+ conn = op.get_bind()
38
+ conn.execute(sa.text("""
39
+ UPDATE k8s_ingress_rules
40
+ SET rule_len = length(zone) + length(name)
41
+ """))
42
+
43
+ op.alter_column('k8s_ingress_rules', 'rule_len', nullable=False)
44
+
45
+ op.alter_column('k8s_ingress_rules', 'proxy_stack_fqdn',
46
+ existing_type=sa.VARCHAR(length=253),
47
+ nullable=False)
48
+ op.alter_column('k8s_masters', 'hostname',
49
+ existing_type=sa.VARCHAR(length=253),
50
+ nullable=False)
51
+ op.alter_column('k8s_masters', 'stack_fqdn',
52
+ existing_type=sa.VARCHAR(length=253),
53
+ nullable=False)
54
+ op.alter_column('k8s_masters', 'proxy_stack_fqdn',
55
+ existing_type=sa.VARCHAR(length=253),
56
+ nullable=False)
57
+ op.alter_column('k8s_tcp_proxies', 'proxy_name',
58
+ existing_type=sa.VARCHAR(length=253),
59
+ nullable=False)
60
+ op.alter_column('k8s_tcp_proxies', 'node_port',
61
+ existing_type=sa.SMALLINT(),
62
+ nullable=False)
63
+ op.alter_column('k8s_tcp_proxies', 'stack_fqdn',
64
+ existing_type=sa.VARCHAR(length=253),
65
+ nullable=False)
66
+ op.alter_column('k8s_workers', 'hostname',
67
+ existing_type=sa.VARCHAR(length=253),
68
+ nullable=False)
69
+ op.alter_column('k8s_workers', 'stack_fqdn',
70
+ existing_type=sa.VARCHAR(length=253),
71
+ nullable=False)
72
+ op.alter_column('k8s_workers', 'proxy_stack_fqdn',
73
+ existing_type=sa.VARCHAR(length=253),
74
+ nullable=False)
75
+ op.alter_column('kea_reservations', 'hostname',
76
+ existing_type=sa.VARCHAR(length=253),
77
+ nullable=False)
78
+ op.alter_column('kea_reservations', 'stack_fqdn',
79
+ existing_type=sa.VARCHAR(length=253),
80
+ nullable=False)
81
+ # ### end Alembic commands ###
82
+
83
+
84
+ def downgrade() -> None:
85
+ """Downgrade schema."""
86
+ # ### commands auto generated by Alembic - please adjust! ###
87
+ op.alter_column('kea_reservations', 'stack_fqdn',
88
+ existing_type=sa.VARCHAR(length=253),
89
+ nullable=True)
90
+ op.alter_column('kea_reservations', 'hostname',
91
+ existing_type=sa.VARCHAR(length=253),
92
+ nullable=True)
93
+ op.alter_column('k8s_workers', 'proxy_stack_fqdn',
94
+ existing_type=sa.VARCHAR(length=253),
95
+ nullable=True)
96
+ op.alter_column('k8s_workers', 'stack_fqdn',
97
+ existing_type=sa.VARCHAR(length=253),
98
+ nullable=True)
99
+ op.alter_column('k8s_workers', 'hostname',
100
+ existing_type=sa.VARCHAR(length=253),
101
+ nullable=True)
102
+ op.alter_column('k8s_tcp_proxies', 'stack_fqdn',
103
+ existing_type=sa.VARCHAR(length=253),
104
+ nullable=True)
105
+ op.alter_column('k8s_tcp_proxies', 'node_port',
106
+ existing_type=sa.SMALLINT(),
107
+ nullable=True)
108
+ op.alter_column('k8s_tcp_proxies', 'proxy_name',
109
+ existing_type=sa.VARCHAR(length=253),
110
+ nullable=True)
111
+ op.alter_column('k8s_masters', 'proxy_stack_fqdn',
112
+ existing_type=sa.VARCHAR(length=253),
113
+ nullable=True)
114
+ op.alter_column('k8s_masters', 'stack_fqdn',
115
+ existing_type=sa.VARCHAR(length=253),
116
+ nullable=True)
117
+ op.alter_column('k8s_masters', 'hostname',
118
+ existing_type=sa.VARCHAR(length=253),
119
+ nullable=True)
120
+ op.alter_column('k8s_ingress_rules', 'proxy_stack_fqdn',
121
+ existing_type=sa.VARCHAR(length=253),
122
+ nullable=True)
123
+ op.drop_column('k8s_ingress_rules', 'rule_len')
124
+ op.alter_column('k8s_ext_control_planes', 'proxy_stack_fqdn',
125
+ existing_type=sa.VARCHAR(length=253),
126
+ nullable=True)
127
+ op.alter_column('k8s_ext_control_planes', 'name',
128
+ existing_type=sa.VARCHAR(length=253),
129
+ nullable=True)
130
+ op.alter_column('k8s_ext_control_planes', 'zone',
131
+ existing_type=sa.VARCHAR(length=253),
132
+ nullable=True)
133
+ # ### end Alembic commands ###
@@ -0,0 +1,32 @@
1
+ """proxy fqdn
2
+
3
+ Revision ID: 27724e407e2b
4
+ Revises: 3c95509a5de9
5
+ Create Date: 2025-09-10 16:08:17.079028
6
+
7
+ """
8
+ from typing import Sequence, Union
9
+
10
+ from alembic import op
11
+ import sqlalchemy as sa
12
+
13
+
14
+ # revision identifiers, used by Alembic.
15
+ revision: str = '27724e407e2b'
16
+ down_revision: Union[str, Sequence[str], None] = '3c95509a5de9'
17
+ branch_labels: Union[str, Sequence[str], None] = None
18
+ depends_on: Union[str, Sequence[str], None] = None
19
+
20
+
21
+ def upgrade() -> None:
22
+ """Upgrade schema."""
23
+ # ### commands auto generated by Alembic - please adjust! ###
24
+ op.add_column('k8s_ext_control_plane', sa.Column('proxy_stack_fqdn', sa.String(length=253), nullable=True))
25
+ # ### end Alembic commands ###
26
+
27
+
28
+ def downgrade() -> None:
29
+ """Downgrade schema."""
30
+ # ### commands auto generated by Alembic - please adjust! ###
31
+ op.drop_column('k8s_ext_control_plane', 'proxy_stack_fqdn')
32
+ # ### end Alembic commands ###
@@ -0,0 +1,44 @@
1
+ """fix
2
+
3
+ Revision ID: 3c95509a5de9
4
+ Revises: d9b711555be8
5
+ Create Date: 2025-09-10 16:03:18.769927
6
+
7
+ """
8
+ from typing import Sequence, Union
9
+
10
+ from alembic import op
11
+ import sqlalchemy as sa
12
+
13
+
14
+ # revision identifiers, used by Alembic.
15
+ revision: str = '3c95509a5de9'
16
+ down_revision: Union[str, Sequence[str], None] = 'd9b711555be8'
17
+ branch_labels: Union[str, Sequence[str], None] = None
18
+ depends_on: Union[str, Sequence[str], None] = None
19
+
20
+
21
+ def upgrade() -> None:
22
+ """Upgrade schema."""
23
+ # ### commands auto generated by Alembic - please adjust! ###
24
+ op.create_table('k8s_ext_control_plane',
25
+ sa.Column('stack_fqdn', sa.String(length=253), nullable=False),
26
+ sa.Column('zone', sa.String(length=253), nullable=True),
27
+ sa.Column('name', sa.String(length=253), nullable=True),
28
+ sa.PrimaryKeyConstraint('stack_fqdn')
29
+ )
30
+ op.drop_table('k8s_ext_control_plan')
31
+ # ### end Alembic commands ###
32
+
33
+
34
+ def downgrade() -> None:
35
+ """Downgrade schema."""
36
+ # ### commands auto generated by Alembic - please adjust! ###
37
+ op.create_table('k8s_ext_control_plan',
38
+ sa.Column('stack_fqdn', sa.VARCHAR(length=253), autoincrement=False, nullable=False),
39
+ sa.Column('zone', sa.VARCHAR(length=253), autoincrement=False, nullable=True),
40
+ sa.Column('name', sa.VARCHAR(length=253), autoincrement=False, nullable=True),
41
+ sa.PrimaryKeyConstraint('stack_fqdn', name=op.f('k8s_ext_control_plan_pkey'))
42
+ )
43
+ op.drop_table('k8s_ext_control_plane')
44
+ # ### end Alembic commands ###
@@ -0,0 +1,83 @@
1
+ """migrate old
2
+
3
+ Revision ID: 7868bcd05006
4
+ Revises: 7dea8c4ee39f
5
+ Create Date: 2025-09-09 18:09:39.760976
6
+
7
+ """
8
+ from typing import Sequence, Union
9
+
10
+ from alembic import op
11
+ import sqlalchemy as sa
12
+ from sqlalchemy.dialects import postgresql
13
+
14
+ # revision identifiers, used by Alembic.
15
+ revision: str = '7868bcd05006'
16
+ down_revision: Union[str, Sequence[str], None] = '7dea8c4ee39f'
17
+ branch_labels: Union[str, Sequence[str], None] = None
18
+ depends_on: Union[str, Sequence[str], None] = None
19
+
20
+
21
+ def upgrade() -> None:
22
+ """Upgrade schema."""
23
+ # ### commands auto generated by Alembic - please adjust! ###
24
+ op.create_table('acme_x509',
25
+ sa.Column('stack_fqdn', sa.String(length=253), nullable=False),
26
+ sa.Column('config', postgresql.JSONB(astext_type=sa.Text()), nullable=True),
27
+ sa.Column('ec_csr', postgresql.JSONB(astext_type=sa.Text()), nullable=True),
28
+ sa.Column('ec_crt', postgresql.JSONB(astext_type=sa.Text()), nullable=True),
29
+ sa.Column('k8s', postgresql.JSONB(astext_type=sa.Text()), nullable=True),
30
+ sa.PrimaryKeyConstraint('stack_fqdn')
31
+ )
32
+ op.create_table('k8s_ingress_rules',
33
+ sa.Column('zone', sa.String(length=253), nullable=False),
34
+ sa.Column('name', sa.String(length=253), nullable=False),
35
+ sa.Column('stack_fqdn', sa.String(length=253), nullable=False),
36
+ sa.Column('proxy_stack_fqdn', sa.String(length=253), nullable=True),
37
+ sa.Column('external', sa.Boolean(), nullable=True),
38
+ sa.PrimaryKeyConstraint('zone', 'name', 'stack_fqdn')
39
+ )
40
+ op.create_table('k8s_masters',
41
+ sa.Column('ip', postgresql.INET(), nullable=False),
42
+ sa.Column('hostname', sa.String(length=253), nullable=True),
43
+ sa.Column('stack_fqdn', sa.String(length=253), nullable=True),
44
+ sa.Column('proxy_stack_fqdn', sa.String(length=253), nullable=True),
45
+ sa.PrimaryKeyConstraint('ip')
46
+ )
47
+ op.create_table('k8s_tcp_proxies',
48
+ sa.Column('proxy_name', sa.String(length=253), nullable=True),
49
+ sa.Column('haproxy_port', sa.SmallInteger(), nullable=False),
50
+ sa.Column('node_port', sa.SmallInteger(), nullable=True),
51
+ sa.Column('stack_fqdn', sa.String(length=253), nullable=True),
52
+ sa.Column('proxy_snippet', sa.Text(), nullable=True),
53
+ sa.Column('proxy_stack_fqdn', sa.String(length=253), nullable=False),
54
+ sa.Column('external', sa.Boolean(), server_default='false', nullable=True),
55
+ sa.PrimaryKeyConstraint('haproxy_port', 'proxy_stack_fqdn')
56
+ )
57
+ op.create_table('k8s_workers',
58
+ sa.Column('ip', postgresql.INET(), nullable=False),
59
+ sa.Column('hostname', sa.String(length=253), nullable=True),
60
+ sa.Column('stack_fqdn', sa.String(length=253), nullable=True),
61
+ sa.Column('proxy_stack_fqdn', sa.String(length=253), nullable=True),
62
+ sa.PrimaryKeyConstraint('ip')
63
+ )
64
+ op.create_table('kea_reservations',
65
+ sa.Column('mac', postgresql.MACADDR(), nullable=False),
66
+ sa.Column('ip', postgresql.INET(), nullable=False),
67
+ sa.Column('hostname', sa.String(length=253), nullable=True),
68
+ sa.Column('stack_fqdn', sa.String(length=253), nullable=True),
69
+ sa.PrimaryKeyConstraint('ip')
70
+ )
71
+ # ### end Alembic commands ###
72
+
73
+
74
+ def downgrade() -> None:
75
+ """Downgrade schema."""
76
+ # ### commands auto generated by Alembic - please adjust! ###
77
+ op.drop_table('kea_reservations')
78
+ op.drop_table('k8s_workers')
79
+ op.drop_table('k8s_tcp_proxies')
80
+ op.drop_table('k8s_masters')
81
+ op.drop_table('k8s_ingress_rules')
82
+ op.drop_table('acme_x509')
83
+ # ### end Alembic commands ###
@@ -0,0 +1,36 @@
1
+ """init
2
+
3
+ Revision ID: 7dea8c4ee39f
4
+ Revises:
5
+ Create Date: 2025-09-09 14:30:52.222907
6
+
7
+ """
8
+ from typing import Sequence, Union
9
+
10
+ from alembic import op
11
+ import sqlalchemy as sa
12
+
13
+
14
+ # revision identifiers, used by Alembic.
15
+ revision: str = '7dea8c4ee39f'
16
+ down_revision: Union[str, Sequence[str], None] = None
17
+ branch_labels: Union[str, Sequence[str], None] = None
18
+ depends_on: Union[str, Sequence[str], None] = None
19
+
20
+
21
+ def upgrade() -> None:
22
+ """Upgrade schema."""
23
+ # ### commands auto generated by Alembic - please adjust! ###
24
+ op.create_table('bind_domains',
25
+ sa.Column('domain', sa.String(), nullable=False),
26
+ sa.Column('stack_fqdn', sa.String(), nullable=False),
27
+ sa.PrimaryKeyConstraint('domain', 'stack_fqdn')
28
+ )
29
+ # ### end Alembic commands ###
30
+
31
+
32
+ def downgrade() -> None:
33
+ """Downgrade schema."""
34
+ # ### commands auto generated by Alembic - please adjust! ###
35
+ op.drop_table('bind_domains')
36
+ # ### end Alembic commands ###
@@ -0,0 +1,46 @@
1
+ """ext ctrl plns
2
+
3
+ Revision ID: 944a8fd5d5bc
4
+ Revises: 27724e407e2b
5
+ Create Date: 2025-09-10 16:18:19.742118
6
+
7
+ """
8
+ from typing import Sequence, Union
9
+
10
+ from alembic import op
11
+ import sqlalchemy as sa
12
+
13
+
14
+ # revision identifiers, used by Alembic.
15
+ revision: str = '944a8fd5d5bc'
16
+ down_revision: Union[str, Sequence[str], None] = '27724e407e2b'
17
+ branch_labels: Union[str, Sequence[str], None] = None
18
+ depends_on: Union[str, Sequence[str], None] = None
19
+
20
+
21
+ def upgrade() -> None:
22
+ """Upgrade schema."""
23
+ # ### commands auto generated by Alembic - please adjust! ###
24
+ op.create_table('k8s_ext_control_planes',
25
+ sa.Column('stack_fqdn', sa.String(length=253), nullable=False),
26
+ sa.Column('zone', sa.String(length=253), nullable=True),
27
+ sa.Column('name', sa.String(length=253), nullable=True),
28
+ sa.Column('proxy_stack_fqdn', sa.String(length=253), nullable=True),
29
+ sa.PrimaryKeyConstraint('stack_fqdn')
30
+ )
31
+ op.drop_table('k8s_ext_control_plane')
32
+ # ### end Alembic commands ###
33
+
34
+
35
+ def downgrade() -> None:
36
+ """Downgrade schema."""
37
+ # ### commands auto generated by Alembic - please adjust! ###
38
+ op.create_table('k8s_ext_control_plane',
39
+ sa.Column('stack_fqdn', sa.VARCHAR(length=253), autoincrement=False, nullable=False),
40
+ sa.Column('zone', sa.VARCHAR(length=253), autoincrement=False, nullable=True),
41
+ sa.Column('name', sa.VARCHAR(length=253), autoincrement=False, nullable=True),
42
+ sa.Column('proxy_stack_fqdn', sa.VARCHAR(length=253), autoincrement=False, nullable=True),
43
+ sa.PrimaryKeyConstraint('stack_fqdn', name=op.f('k8s_ext_control_plane_pkey'))
44
+ )
45
+ op.drop_table('k8s_ext_control_planes')
46
+ # ### end Alembic commands ###
@@ -0,0 +1,37 @@
1
+ """ext control plane
2
+
3
+ Revision ID: d9b711555be8
4
+ Revises: 7868bcd05006
5
+ Create Date: 2025-09-10 09:05:05.736095
6
+
7
+ """
8
+ from typing import Sequence, Union
9
+
10
+ from alembic import op
11
+ import sqlalchemy as sa
12
+
13
+
14
+ # revision identifiers, used by Alembic.
15
+ revision: str = 'd9b711555be8'
16
+ down_revision: Union[str, Sequence[str], None] = '7868bcd05006'
17
+ branch_labels: Union[str, Sequence[str], None] = None
18
+ depends_on: Union[str, Sequence[str], None] = None
19
+
20
+
21
+ def upgrade() -> None:
22
+ """Upgrade schema."""
23
+ # ### commands auto generated by Alembic - please adjust! ###
24
+ op.create_table('k8s_ext_control_plan',
25
+ sa.Column('stack_fqdn', sa.String(length=253), nullable=False),
26
+ sa.Column('zone', sa.String(length=253), nullable=True),
27
+ sa.Column('name', sa.String(length=253), nullable=True),
28
+ sa.PrimaryKeyConstraint('stack_fqdn')
29
+ )
30
+ # ### end Alembic commands ###
31
+
32
+
33
+ def downgrade() -> None:
34
+ """Downgrade schema."""
35
+ # ### commands auto generated by Alembic - please adjust! ###
36
+ op.drop_table('k8s_ext_control_plan')
37
+ # ### end Alembic commands ###
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: py-pve-cloud
3
- Version: 0.0.1
3
+ Version: 0.0.2
4
4
  Author-email: Tobias Huebner <tobias.huebner@vmzberlin.com>
5
5
  License-Expression: GPL-3.0-or-later
6
6
  License-File: LICENSE
@@ -0,0 +1,20 @@
1
+ LICENSE
2
+ README.md
3
+ pyproject.toml
4
+ src/pve_cloud/cli/pvclu.py
5
+ src/pve_cloud/orm/alchemy.py
6
+ src/pve_cloud/orm/alembic.ini
7
+ src/pve_cloud/orm/migrations/env.py
8
+ src/pve_cloud/orm/migrations/versions/24a548bfce3e_len_rules_enforcements.py
9
+ src/pve_cloud/orm/migrations/versions/27724e407e2b_proxy_fqdn.py
10
+ src/pve_cloud/orm/migrations/versions/3c95509a5de9_fix.py
11
+ src/pve_cloud/orm/migrations/versions/7868bcd05006_migrate_old.py
12
+ src/pve_cloud/orm/migrations/versions/7dea8c4ee39f_init.py
13
+ src/pve_cloud/orm/migrations/versions/944a8fd5d5bc_ext_ctrl_plns.py
14
+ src/pve_cloud/orm/migrations/versions/d9b711555be8_ext_control_plane.py
15
+ src/py_pve_cloud.egg-info/PKG-INFO
16
+ src/py_pve_cloud.egg-info/SOURCES.txt
17
+ src/py_pve_cloud.egg-info/dependency_links.txt
18
+ src/py_pve_cloud.egg-info/entry_points.txt
19
+ src/py_pve_cloud.egg-info/requires.txt
20
+ src/py_pve_cloud.egg-info/top_level.txt
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ pvclu = pve_cloud.cli.pvclu:main
@@ -1,2 +0,0 @@
1
- ## Releasing to pypi
2
-
@@ -1,11 +0,0 @@
1
- LICENSE
2
- README.md
3
- pyproject.toml
4
- cli/pvclu.py
5
- orm/alchemy.py
6
- py_pve_cloud.egg-info/PKG-INFO
7
- py_pve_cloud.egg-info/SOURCES.txt
8
- py_pve_cloud.egg-info/dependency_links.txt
9
- py_pve_cloud.egg-info/entry_points.txt
10
- py_pve_cloud.egg-info/requires.txt
11
- py_pve_cloud.egg-info/top_level.txt
@@ -1,2 +0,0 @@
1
- [console_scripts]
2
- pvclu = cli.pvclu:main
@@ -1,2 +0,0 @@
1
- cli
2
- orm
File without changes
File without changes