stackit-serverbackup 0.1.0__tar.gz → 0.2.0__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.
- {stackit_serverbackup-0.1.0 → stackit_serverbackup-0.2.0}/PKG-INFO +1 -1
- {stackit_serverbackup-0.1.0 → stackit_serverbackup-0.2.0}/pyproject.toml +4 -1
- {stackit_serverbackup-0.1.0 → stackit_serverbackup-0.2.0}/src/stackit/serverbackup/configuration.py +28 -1
- {stackit_serverbackup-0.1.0 → stackit_serverbackup-0.2.0}/README.md +0 -0
- {stackit_serverbackup-0.1.0 → stackit_serverbackup-0.2.0}/src/stackit/serverbackup/__init__.py +0 -0
- {stackit_serverbackup-0.1.0 → stackit_serverbackup-0.2.0}/src/stackit/serverbackup/api/__init__.py +0 -0
- {stackit_serverbackup-0.1.0 → stackit_serverbackup-0.2.0}/src/stackit/serverbackup/api/default_api.py +0 -0
- {stackit_serverbackup-0.1.0 → stackit_serverbackup-0.2.0}/src/stackit/serverbackup/api_client.py +0 -0
- {stackit_serverbackup-0.1.0 → stackit_serverbackup-0.2.0}/src/stackit/serverbackup/api_response.py +0 -0
- {stackit_serverbackup-0.1.0 → stackit_serverbackup-0.2.0}/src/stackit/serverbackup/exceptions.py +0 -0
- {stackit_serverbackup-0.1.0 → stackit_serverbackup-0.2.0}/src/stackit/serverbackup/models/__init__.py +0 -0
- {stackit_serverbackup-0.1.0 → stackit_serverbackup-0.2.0}/src/stackit/serverbackup/models/backup.py +0 -0
- {stackit_serverbackup-0.1.0 → stackit_serverbackup-0.2.0}/src/stackit/serverbackup/models/backup_job.py +0 -0
- {stackit_serverbackup-0.1.0 → stackit_serverbackup-0.2.0}/src/stackit/serverbackup/models/backup_policy.py +0 -0
- {stackit_serverbackup-0.1.0 → stackit_serverbackup-0.2.0}/src/stackit/serverbackup/models/backup_policy_backup_properties.py +0 -0
- {stackit_serverbackup-0.1.0 → stackit_serverbackup-0.2.0}/src/stackit/serverbackup/models/backup_properties.py +0 -0
- {stackit_serverbackup-0.1.0 → stackit_serverbackup-0.2.0}/src/stackit/serverbackup/models/backup_schedule.py +0 -0
- {stackit_serverbackup-0.1.0 → stackit_serverbackup-0.2.0}/src/stackit/serverbackup/models/backup_volume_backups_inner.py +0 -0
- {stackit_serverbackup-0.1.0 → stackit_serverbackup-0.2.0}/src/stackit/serverbackup/models/create_backup_payload.py +0 -0
- {stackit_serverbackup-0.1.0 → stackit_serverbackup-0.2.0}/src/stackit/serverbackup/models/create_backup_schedule_payload.py +0 -0
- {stackit_serverbackup-0.1.0 → stackit_serverbackup-0.2.0}/src/stackit/serverbackup/models/enable_service_payload.py +0 -0
- {stackit_serverbackup-0.1.0 → stackit_serverbackup-0.2.0}/src/stackit/serverbackup/models/enable_service_resource_payload.py +0 -0
- {stackit_serverbackup-0.1.0 → stackit_serverbackup-0.2.0}/src/stackit/serverbackup/models/get_backup_policies_response.py +0 -0
- {stackit_serverbackup-0.1.0 → stackit_serverbackup-0.2.0}/src/stackit/serverbackup/models/get_backup_schedules_response.py +0 -0
- {stackit_serverbackup-0.1.0 → stackit_serverbackup-0.2.0}/src/stackit/serverbackup/models/get_backups_list_response.py +0 -0
- {stackit_serverbackup-0.1.0 → stackit_serverbackup-0.2.0}/src/stackit/serverbackup/models/restore_backup_payload.py +0 -0
- {stackit_serverbackup-0.1.0 → stackit_serverbackup-0.2.0}/src/stackit/serverbackup/models/restore_volume_backup_payload.py +0 -0
- {stackit_serverbackup-0.1.0 → stackit_serverbackup-0.2.0}/src/stackit/serverbackup/models/update_backup_schedule_payload.py +0 -0
- {stackit_serverbackup-0.1.0 → stackit_serverbackup-0.2.0}/src/stackit/serverbackup/py.typed +0 -0
- {stackit_serverbackup-0.1.0 → stackit_serverbackup-0.2.0}/src/stackit/serverbackup/rest.py +0 -0
{stackit_serverbackup-0.1.0 → stackit_serverbackup-0.2.0}/src/stackit/serverbackup/configuration.py
RENAMED
|
@@ -12,6 +12,8 @@
|
|
|
12
12
|
Do not edit the class manually.
|
|
13
13
|
""" # noqa: E501 docstring might be too long
|
|
14
14
|
|
|
15
|
+
import os
|
|
16
|
+
|
|
15
17
|
|
|
16
18
|
class HostConfiguration:
|
|
17
19
|
def __init__(
|
|
@@ -23,7 +25,14 @@ class HostConfiguration:
|
|
|
23
25
|
server_operation_variables=None,
|
|
24
26
|
ignore_operation_servers=False,
|
|
25
27
|
) -> None:
|
|
26
|
-
|
|
28
|
+
print(
|
|
29
|
+
"WARNING: STACKIT will move to a new way of specifying regions, where the region is provided\n",
|
|
30
|
+
"as a function argument instead of being set in the client configuration.\n"
|
|
31
|
+
"Once all services have migrated, the methods to specify the region in the client configuration "
|
|
32
|
+
"will be removed.",
|
|
33
|
+
)
|
|
34
|
+
"""Constructor
|
|
35
|
+
"""
|
|
27
36
|
self._base_path = "https://server-backup.api.eu01.stackit.cloud"
|
|
28
37
|
"""Default Base url
|
|
29
38
|
"""
|
|
@@ -65,6 +74,7 @@ class HostConfiguration:
|
|
|
65
74
|
:param index: array index of the host settings
|
|
66
75
|
:param variables: hash of variable and the corresponding value
|
|
67
76
|
:param servers: an array of host settings or None
|
|
77
|
+
:error: if a region is given for a global url
|
|
68
78
|
:return: URL based on host settings
|
|
69
79
|
"""
|
|
70
80
|
if index is None:
|
|
@@ -83,8 +93,25 @@ class HostConfiguration:
|
|
|
83
93
|
|
|
84
94
|
url = server["url"]
|
|
85
95
|
|
|
96
|
+
# check if environment variable was provided for region
|
|
97
|
+
# if nothing was set this is None
|
|
98
|
+
region_env = os.environ.get("STACKIT_REGION")
|
|
99
|
+
|
|
86
100
|
# go through variables and replace placeholders
|
|
87
101
|
for variable_name, variable in server.get("variables", {}).items():
|
|
102
|
+
# If a region is provided by the user for a global url
|
|
103
|
+
# return an error (except for providing via environment variable).
|
|
104
|
+
# The region is provided as a function argument instead of being set in the client configuration.
|
|
105
|
+
if (
|
|
106
|
+
variable_name == "region"
|
|
107
|
+
and (variable["default_value"] == "global" or variable["default_value"] == "")
|
|
108
|
+
and region_env is None
|
|
109
|
+
and variables.get(variable_name) is not None
|
|
110
|
+
):
|
|
111
|
+
raise ValueError(
|
|
112
|
+
"this API does not support setting a region in the the client configuration, "
|
|
113
|
+
"please check if the region can be specified as a function parameter"
|
|
114
|
+
)
|
|
88
115
|
used_value = variables.get(variable_name, variable["default_value"])
|
|
89
116
|
|
|
90
117
|
if "enum_values" in variable and used_value not in variable["enum_values"]:
|
|
File without changes
|
{stackit_serverbackup-0.1.0 → stackit_serverbackup-0.2.0}/src/stackit/serverbackup/__init__.py
RENAMED
|
File without changes
|
{stackit_serverbackup-0.1.0 → stackit_serverbackup-0.2.0}/src/stackit/serverbackup/api/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
{stackit_serverbackup-0.1.0 → stackit_serverbackup-0.2.0}/src/stackit/serverbackup/api_client.py
RENAMED
|
File without changes
|
{stackit_serverbackup-0.1.0 → stackit_serverbackup-0.2.0}/src/stackit/serverbackup/api_response.py
RENAMED
|
File without changes
|
{stackit_serverbackup-0.1.0 → stackit_serverbackup-0.2.0}/src/stackit/serverbackup/exceptions.py
RENAMED
|
File without changes
|
|
File without changes
|
{stackit_serverbackup-0.1.0 → stackit_serverbackup-0.2.0}/src/stackit/serverbackup/models/backup.py
RENAMED
|
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
|