You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
STACKIT will move to a new way of specifying regions, where the region is provided
as a function argument instead of being set in the client configuration.
Once all services have migrated, the methods to specify the region in the client
configuration will be removed.
Signed-off-by: Alexander Dahmen <alexander.dahmen@inovex.de>
print('''WARNING: STACKIT will move to a new way of specifying regions, where the region is provided as a function argument instead of being set in the client configuration.
12
+
Once all services have migrated, the methods to specify the region in the client configuration will be removed.''')
11
13
"""Constructor
12
14
"""
13
15
self._base_path = "{{{basePath}}}"
@@ -67,6 +69,7 @@ class HostConfiguration:
67
69
:param index: array index of the host settings
68
70
:param variables: hash of variable and the corresponding value
69
71
:param servers: an array of host settings or None
72
+
:error: if a region is given for a global url
70
73
:return: URL based on host settings
71
74
"""
72
75
if index is None:
@@ -86,6 +89,12 @@ class HostConfiguration:
86
89
87
90
# go through variables and replace placeholders
88
91
for variable_name, variable in server.get('variables', {}).items():
92
+
# If a region is provided by the user return an error.
93
+
# The region is provided as a function argument instead of being set in the client configuration.
94
+
if variable_name == 'region' and variables.get(variable_name) is not None:
95
+
raise ValueError(
96
+
"this API does not support setting a region in the the client configuration, please check if the region can be specified as a function parameter"
0 commit comments