Skip to content

Commit db7727a

Browse files
Ft/region adjustment (#552)
* Generate sqlserverflex * Generate ske * Generate serviceenablement * Generate serviceaccount * Generate serverupdate * Generate serverbackup * Generate secretsmanager * Generate runcommand * Generate resourcemanager * Generate redis * Generate rabbitmq * Generate postgresflex * Generate opensearch * Generate observability * Update version and changelog for region adjustment Signed-off-by: Alexander Dahmen <[email protected]> --------- Signed-off-by: Alexander Dahmen <[email protected]> Co-authored-by: SDK Generator Bot <[email protected]>
1 parent 8e3722c commit db7727a

File tree

63 files changed

+606
-38
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+606
-38
lines changed

CHANGELOG.md

+46
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,52 @@
22

33
### Highlights
44

5+
- `authorization`: [v0.2.0](services/authorization/CHANGELOG.md#v020-2025-01-13)
6+
- **Breaking Change:**: `get_host_from_settings` returns an error if a region is specified for a global URL.
7+
- `dns`: [v0.2.0](services/dns/CHANGELOG.md#v020-2025-01-13)
8+
- **Breaking Change:**: `get_host_from_settings` returns an error if a region is specified for a global URL.
9+
- `iaas`: [v0.3.0](services/iaas/CHANGELOG.md#v030-2025-01-13)
10+
- **Breaking Change:**: `get_host_from_settings` returns an error if a region is specified for a global URL.
11+
- `loadbalancer`: [v0.2.0](services/loadbalancer/CHANGELOG.md#v020-2025-01-13)
12+
- **Breaking Change:**: `get_host_from_settings` returns an error if a region is specified for a global URL.
13+
- `logme`: [v0.2.0](services/logme/CHANGELOG.md#v020-2025-01-13)
14+
- **Breaking Change:**: `get_host_from_settings` returns an error if a region is specified for a global URL.
15+
- `mariadb`: [v0.2.0](services/mariadb/CHANGELOG.md#v020-2025-01-13)
16+
- **Breaking Change:**: `get_host_from_settings` returns an error if a region is specified for a global URL.
17+
- `mongodbflex`: [v0.2.0](services/mongodbflex/CHANGELOG.md#v020-2025-01-13)
18+
- **Breaking Change:**: `get_host_from_settings` returns an error if a region is specified for a global URL.
19+
- `objectstorage`: [v0.2.0](services/objectstorage/CHANGELOG.md#v020-2025-01-13)
20+
- **Breaking Change:**: `get_host_from_settings` returns an error if a region is specified for a global URL.
21+
- `opensearch`: [v0.2.0](services/opensearch/CHANGELOG.md#v020-2025-01-13)
22+
- **Breaking Change:**: `get_host_from_settings` returns an error if a region is specified for a global URL.
23+
- `postgresflex`: [v0.2.0](services/postgresflex/CHANGELOG.md#v020-2025-01-13)
24+
- **Breaking Change:**: `get_host_from_settings` returns an error if a region is specified for a global URL.
25+
- `rabbitmq`: [v0.2.0](services/rabbitmq/CHANGELOG.md#v020-2025-01-13)
26+
- **Breaking Change:**: `get_host_from_settings` returns an error if a region is specified for a global URL.
27+
- `redis`: [v0.2.0](services/redis/CHANGELOG.md#v020-2025-01-13)
28+
- **Breaking Change:**: `get_host_from_settings` returns an error if a region is specified for a global URL.
29+
- `resourcemanager`: [v0.2.0](services/resourcemanager/CHANGELOG.md#v020-2025-01-13)
30+
- **Breaking Change:**: `get_host_from_settings` returns an error if a region is specified for a global URL.
31+
- `runcommand`: [v0.2.0](services/runcommand/CHANGELOG.md#v020-2025-01-13)
32+
- **Breaking Change:**: `get_host_from_settings` returns an error if a region is specified for a global URL.
33+
- `secretsmanager`: [v0.2.0](services/secretsmanager/CHANGELOG.md#v020-2025-01-13)
34+
- **Breaking Change:**: `get_host_from_settings` returns an error if a region is specified for a global URL.
35+
- `serverupdate`: [v0.2.0](services/serverupdate/CHANGELOG.md#v020-2025-01-13)
36+
- **Breaking Change:**: `get_host_from_settings` returns an error if a region is specified for a global URL.
37+
- `serverbackup`: [v0.2.0](services/serverbackup/CHANGELOG.md#v020-2025-01-13)
38+
- **Breaking Change:**: `get_host_from_settings` returns an error if a region is specified for a global URL.
39+
- `serviceaccount`: [v0.2.0](services/serviceaccount/CHANGELOG.md#v020-2025-01-13)
40+
- **Breaking Change:**: `get_host_from_settings` returns an error if a region is specified for a global URL.
41+
- `serviceenablement`: [v0.2.0](services/serviceenablement/CHANGELOG.md#v020-2025-01-13)
42+
- **Breaking Change:**: `get_host_from_settings` returns an error if a region is specified for a global URL.
43+
- `ske`: [v0.2.0](services/ske/CHANGELOG.md#v020-2025-01-13)
44+
- **Breaking Change:**: `get_host_from_settings` returns an error if a region is specified for a global URL.
45+
- `sqlserverflex`: [v0.2.0](services/sqlserverflex/CHANGELOG.md#v020-2025-01-13)
46+
- **Breaking Change:**: `get_host_from_settings` returns an error if a region is specified for a global URL.
47+
- `certificates`: [v0.2.0](services/certificates/CHANGELOG.md#v020-2025-01-13)
48+
- **Breaking Change:**: `get_host_from_settings` returns an error if a region is specified for a global URL.
49+
- `lbapplication`: [v0.2.0](services/lbapplication/CHANGELOG.md#v020-2025-01-13)
50+
- **Breaking Change:**: `get_host_from_settings` returns an error if a region is specified for a global URL.
551
- `certificates`: [v0.1.0](services/certificates/CHANGELOG.md#v010-2024-12-23)
652
- Manage your STACKIT Load Balancer certificates
753
- `lbapplication`: [v0.1.0](services/lbapplication/CHANGELOG.md#v010-2024-12-23)

services/authorization/CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
## v0.2.0 (2025-01-13)
2+
3+
- **Breaking Change:**: `get_host_from_settings` returns an error if a region is specified for a global URL.
4+
5+
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.
6+
17
## v0.1.0 (2024-12-04)
28

39
- Manage authorization of your STACKIT resources

services/authorization/pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name = "stackit-authorization"
33

44
[tool.poetry]
55
name = "stackit-authorization"
6-
version = "v0.1.0"
6+
version = "v0.2.0"
77
authors = [
88
"STACKIT Developer Tools <[email protected]>",
99
]

services/certificates/CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
## v0.2.0 (2025-01-13)
2+
3+
- **Breaking Change:**: `get_host_from_settings` returns an error if a region is specified for a global URL.
4+
5+
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.
6+
17
## v0.1.0 (2024-12-23)
28

39
- Manage your STACKIT Load Balancer certificates

services/certificates/pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name = "stackit-certificates"
33

44
[tool.poetry]
55
name = "stackit-certificates"
6-
version = "v0.1.0"
6+
version = "v0.2.0"
77
authors = [
88
"STACKIT Developer Tools <[email protected]>",
99
]

services/dns/CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
## v0.2.0 (2025-01-13)
2+
3+
- **Breaking Change:**: `get_host_from_settings` returns an error if a region is specified for a global URL.
4+
5+
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.
6+
17
## v0.1.0 (2024-12-04)
28

39
- Manage your STACKIT DNS resources

services/dns/pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name = "stackit-dns"
33

44
[tool.poetry]
55
name = "stackit-dns"
6-
version = "v0.1.0"
6+
version = "v0.2.0"
77
authors = ["STACKIT Developer Tools <[email protected]>"]
88
description = "STACKIT DNS API"
99
readme = "README.md"

services/iaas/CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
## v0.3.0 (2025-01-13)
2+
3+
- **Breaking Change:**: `get_host_from_settings` returns an error if a region is specified for a global URL.
4+
5+
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.
6+
17
## v0.2.0 (2024-12-23)
28

39
- **Feature:** Add new methods to manage affinity groups: `create_affinity_group`, `delete_affinity_group`, `get_affinity_group`, and `list_affinity_group`

services/iaas/pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name = "stackit-iaas"
33

44
[tool.poetry]
55
name = "stackit-iaas"
6-
version = "v0.2.0"
6+
version = "v0.3.0"
77
authors = [
88
"STACKIT Developer Tools <[email protected]>",
99
]

services/lbapplication/CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
## v0.2.0 (2025-01-13)
2+
3+
- **Breaking Change:**: `get_host_from_settings` returns an error if a region is specified for a global URL.
4+
5+
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.
6+
17
## v0.1.0 (2024-12-23)
28

39
- Manage your STACKIT Load Balancer applications

services/lbapplication/pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name = "stackit-lbapplication"
33

44
[tool.poetry]
55
name = "stackit-lbapplication"
6-
version = "v0.1.0"
6+
version = "v0.2.0"
77
authors = [
88
"STACKIT Developer Tools <[email protected]>",
99
]

services/loadbalancer/CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
## v0.2.0 (2025-01-13)
2+
3+
- **Breaking Change:**: `get_host_from_settings` returns an error if a region is specified for a global URL.
4+
5+
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.
6+
17
## v0.1.0 (2024-12-04)
28

39
- Manage your STACKIT Load Balancer resources

services/loadbalancer/pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name = "stackit-loadbalancer"
33

44
[tool.poetry]
55
name = "stackit-loadbalancer"
6-
version = "v0.1.0"
6+
version = "v0.2.0"
77
authors = [
88
"STACKIT Developer Tools <[email protected]>",
99
]

services/logme/CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
## v0.2.0 (2025-01-13)
2+
3+
- **Breaking Change:**: `get_host_from_settings` returns an error if a region is specified for a global URL.
4+
5+
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.
6+
17
## v0.1.0 (2024-12-04)
28

39
- Manage your STACKIT Logme resources

services/logme/pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name = "stackit-logme"
33

44
[tool.poetry]
55
name = "stackit-logme"
6-
version = "v0.1.0"
6+
version = "v0.2.0"
77
authors = [
88
"STACKIT Developer Tools <[email protected]>",
99
]

services/mariadb/CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
## v0.2.0 (2025-01-13)
2+
3+
- **Breaking Change:**: `get_host_from_settings` returns an error if a region is specified for a global URL.
4+
5+
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.
6+
17
## v0.1.0 (2024-12-04)
28

39
- Manage your STACKIT MariaDB resources

services/mariadb/pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name = "stackit-mariadb"
33

44
[tool.poetry]
55
name = "stackit-mariadb"
6-
version = "v0.1.0"
6+
version = "v0.2.0"
77
authors = [
88
"STACKIT Developer Tools <[email protected]>",
99
]

services/mongodbflex/CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
## v0.2.0 (2025-01-13)
2+
3+
- **Breaking Change:**: `get_host_from_settings` returns an error if a region is specified for a global URL.
4+
5+
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.
6+
17
## v0.1.0 (2024-12-04)
28

39
- Manage your STACKIT MongoDB Flex resources

services/mongodbflex/pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name = "stackit-mongodbflex"
33

44
[tool.poetry]
55
name = "stackit-mongodbflex"
6-
version = "v0.1.0"
6+
version = "v0.2.0"
77
authors = [
88
"STACKIT Developer Tools <[email protected]>",
99
]

services/objectstorage/CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
## v0.2.0 (2025-01-13)
2+
3+
- **Breaking Change:**: `get_host_from_settings` returns an error if a region is specified for a global URL.
4+
5+
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.
6+
17
## v0.1.0 (2024-12-04)
28

39
- Manage your STACKIT Object Storage resources

services/objectstorage/pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name = "stackit-objectstorage"
33

44
[tool.poetry]
55
name = "stackit-objectstorage"
6-
version = "v0.1.0"
6+
version = "v0.2.0"
77
authors = [
88
"STACKIT Developer Tools <[email protected]>",
99
]

services/observability/CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
## v0.2.0 (2025-01-13)
2+
3+
- **Breaking Change:**: `get_host_from_settings` returns an error if a region is specified for a global URL.
4+
5+
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.
6+
17
## v0.1.0 (2024-12-04)
28

39
- Manage your STACKIT Observability resources

services/observability/pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name = "stackit-observability"
33

44
[tool.poetry]
55
name = "stackit-observability"
6-
version = "v0.1.0"
6+
version = "v0.2.0"
77
authors = [
88
"STACKIT Developer Tools <[email protected]>",
99
]

services/observability/src/stackit/observability/configuration.py

+28-1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
Do not edit the class manually.
1313
""" # noqa: E501 docstring might be too long
1414

15+
import os
16+
1517

1618
class HostConfiguration:
1719
def __init__(
@@ -23,7 +25,14 @@ def __init__(
2325
server_operation_variables=None,
2426
ignore_operation_servers=False,
2527
) -> None:
26-
"""Constructor"""
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+
"""
2736
self._base_path = "https://argus.api.eu01.stackit.cloud"
2837
"""Default Base url
2938
"""
@@ -65,6 +74,7 @@ def get_host_from_settings(self, index, variables=None, servers=None):
6574
:param index: array index of the host settings
6675
:param variables: hash of variable and the corresponding value
6776
:param servers: an array of host settings or None
77+
:error: if a region is given for a global url
6878
:return: URL based on host settings
6979
"""
7080
if index is None:
@@ -83,8 +93,25 @@ def get_host_from_settings(self, index, variables=None, servers=None):
8393

8494
url = server["url"]
8595

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+
86100
# go through variables and replace placeholders
87101
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+
)
88115
used_value = variables.get(variable_name, variable["default_value"])
89116

90117
if "enum_values" in variable and used_value not in variable["enum_values"]:

services/opensearch/CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
## v0.2.0 (2025-01-13)
2+
3+
- **Breaking Change:**: `get_host_from_settings` returns an error if a region is specified for a global URL.
4+
5+
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.
6+
17
## v0.1.0 (2024-12-04)
28

39
- Manage your STACKIT OpenSearch resources

services/opensearch/pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name = "stackit-opensearch"
33

44
[tool.poetry]
55
name = "stackit-opensearch"
6-
version = "v0.1.0"
6+
version = "v0.2.0"
77
authors = [
88
"STACKIT Developer Tools <[email protected]>",
99
]

services/opensearch/src/stackit/opensearch/configuration.py

+28-1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
Do not edit the class manually.
1212
""" # noqa: E501 docstring might be too long
1313

14+
import os
15+
1416

1517
class HostConfiguration:
1618
def __init__(
@@ -22,7 +24,14 @@ def __init__(
2224
server_operation_variables=None,
2325
ignore_operation_servers=False,
2426
) -> None:
25-
"""Constructor"""
27+
print(
28+
"WARNING: STACKIT will move to a new way of specifying regions, where the region is provided\n",
29+
"as a function argument instead of being set in the client configuration.\n"
30+
"Once all services have migrated, the methods to specify the region in the client configuration "
31+
"will be removed.",
32+
)
33+
"""Constructor
34+
"""
2635
self._base_path = "https://opensearch.api.eu01.stackit.cloud"
2736
"""Default Base url
2837
"""
@@ -64,6 +73,7 @@ def get_host_from_settings(self, index, variables=None, servers=None):
6473
:param index: array index of the host settings
6574
:param variables: hash of variable and the corresponding value
6675
:param servers: an array of host settings or None
76+
:error: if a region is given for a global url
6777
:return: URL based on host settings
6878
"""
6979
if index is None:
@@ -82,8 +92,25 @@ def get_host_from_settings(self, index, variables=None, servers=None):
8292

8393
url = server["url"]
8494

95+
# check if environment variable was provided for region
96+
# if nothing was set this is None
97+
region_env = os.environ.get("STACKIT_REGION")
98+
8599
# go through variables and replace placeholders
86100
for variable_name, variable in server.get("variables", {}).items():
101+
# If a region is provided by the user for a global url
102+
# return an error (except for providing via environment variable).
103+
# The region is provided as a function argument instead of being set in the client configuration.
104+
if (
105+
variable_name == "region"
106+
and (variable["default_value"] == "global" or variable["default_value"] == "")
107+
and region_env is None
108+
and variables.get(variable_name) is not None
109+
):
110+
raise ValueError(
111+
"this API does not support setting a region in the the client configuration, "
112+
"please check if the region can be specified as a function parameter"
113+
)
87114
used_value = variables.get(variable_name, variable["default_value"])
88115

89116
if "enum_values" in variable and used_value not in variable["enum_values"]:

0 commit comments

Comments
 (0)