stackit-edge 0.6.0__tar.gz → 0.7.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_edge-0.6.0 → stackit_edge-0.7.0}/PKG-INFO +1 -1
- {stackit_edge-0.6.0 → stackit_edge-0.7.0}/pyproject.toml +1 -1
- {stackit_edge-0.6.0 → stackit_edge-0.7.0}/src/stackit/edge/__init__.py +4 -0
- {stackit_edge-0.6.0 → stackit_edge-0.7.0}/src/stackit/edge/models/__init__.py +2 -0
- stackit_edge-0.7.0/src/stackit/edge/models/acl.py +99 -0
- {stackit_edge-0.6.0 → stackit_edge-0.7.0}/src/stackit/edge/models/instance.py +8 -0
- stackit_edge-0.7.0/src/stackit/edge/models/ip_allow_list_entry.py +138 -0
- {stackit_edge-0.6.0 → stackit_edge-0.7.0}/.gitignore +0 -0
- {stackit_edge-0.6.0 → stackit_edge-0.7.0}/LICENSE.md +0 -0
- {stackit_edge-0.6.0 → stackit_edge-0.7.0}/NOTICE.txt +0 -0
- {stackit_edge-0.6.0 → stackit_edge-0.7.0}/README.md +0 -0
- {stackit_edge-0.6.0 → stackit_edge-0.7.0}/src/stackit/edge/api/__init__.py +0 -0
- {stackit_edge-0.6.0 → stackit_edge-0.7.0}/src/stackit/edge/api/default_api.py +0 -0
- {stackit_edge-0.6.0 → stackit_edge-0.7.0}/src/stackit/edge/api_client.py +0 -0
- {stackit_edge-0.6.0 → stackit_edge-0.7.0}/src/stackit/edge/api_response.py +0 -0
- {stackit_edge-0.6.0 → stackit_edge-0.7.0}/src/stackit/edge/configuration.py +0 -0
- {stackit_edge-0.6.0 → stackit_edge-0.7.0}/src/stackit/edge/exceptions.py +0 -0
- {stackit_edge-0.6.0 → stackit_edge-0.7.0}/src/stackit/edge/models/bad_request.py +0 -0
- {stackit_edge-0.6.0 → stackit_edge-0.7.0}/src/stackit/edge/models/create_instance_payload.py +0 -0
- {stackit_edge-0.6.0 → stackit_edge-0.7.0}/src/stackit/edge/models/instance_list.py +0 -0
- {stackit_edge-0.6.0 → stackit_edge-0.7.0}/src/stackit/edge/models/kubeconfig.py +0 -0
- {stackit_edge-0.6.0 → stackit_edge-0.7.0}/src/stackit/edge/models/kubernetes_release_list.py +0 -0
- {stackit_edge-0.6.0 → stackit_edge-0.7.0}/src/stackit/edge/models/plan.py +0 -0
- {stackit_edge-0.6.0 → stackit_edge-0.7.0}/src/stackit/edge/models/plan_list.py +0 -0
- {stackit_edge-0.6.0 → stackit_edge-0.7.0}/src/stackit/edge/models/token.py +0 -0
- {stackit_edge-0.6.0 → stackit_edge-0.7.0}/src/stackit/edge/models/unauthorized_request.py +0 -0
- {stackit_edge-0.6.0 → stackit_edge-0.7.0}/src/stackit/edge/models/update_instance_by_name_payload.py +0 -0
- {stackit_edge-0.6.0 → stackit_edge-0.7.0}/src/stackit/edge/models/update_instance_payload.py +0 -0
- {stackit_edge-0.6.0 → stackit_edge-0.7.0}/src/stackit/edge/models/user.py +0 -0
- {stackit_edge-0.6.0 → stackit_edge-0.7.0}/src/stackit/edge/py.typed +0 -0
- {stackit_edge-0.6.0 → stackit_edge-0.7.0}/src/stackit/edge/rest.py +0 -0
|
@@ -27,10 +27,12 @@ __all__ = [
|
|
|
27
27
|
"ApiKeyError",
|
|
28
28
|
"ApiAttributeError",
|
|
29
29
|
"ApiException",
|
|
30
|
+
"Acl",
|
|
30
31
|
"BadRequest",
|
|
31
32
|
"CreateInstancePayload",
|
|
32
33
|
"Instance",
|
|
33
34
|
"InstanceList",
|
|
35
|
+
"IpAllowListEntry",
|
|
34
36
|
"Kubeconfig",
|
|
35
37
|
"KubernetesReleaseList",
|
|
36
38
|
"Plan",
|
|
@@ -57,12 +59,14 @@ from stackit.edge.exceptions import ApiValueError as ApiValueError
|
|
|
57
59
|
from stackit.edge.exceptions import OpenApiException as OpenApiException
|
|
58
60
|
|
|
59
61
|
# import models into sdk package
|
|
62
|
+
from stackit.edge.models.acl import Acl as Acl
|
|
60
63
|
from stackit.edge.models.bad_request import BadRequest as BadRequest
|
|
61
64
|
from stackit.edge.models.create_instance_payload import (
|
|
62
65
|
CreateInstancePayload as CreateInstancePayload,
|
|
63
66
|
)
|
|
64
67
|
from stackit.edge.models.instance import Instance as Instance
|
|
65
68
|
from stackit.edge.models.instance_list import InstanceList as InstanceList
|
|
69
|
+
from stackit.edge.models.ip_allow_list_entry import IpAllowListEntry as IpAllowListEntry
|
|
66
70
|
from stackit.edge.models.kubeconfig import Kubeconfig as Kubeconfig
|
|
67
71
|
from stackit.edge.models.kubernetes_release_list import (
|
|
68
72
|
KubernetesReleaseList as KubernetesReleaseList,
|
|
@@ -13,10 +13,12 @@ Do not edit the class manually.
|
|
|
13
13
|
""" # noqa: E501
|
|
14
14
|
|
|
15
15
|
# import models into model package
|
|
16
|
+
from stackit.edge.models.acl import Acl
|
|
16
17
|
from stackit.edge.models.bad_request import BadRequest
|
|
17
18
|
from stackit.edge.models.create_instance_payload import CreateInstancePayload
|
|
18
19
|
from stackit.edge.models.instance import Instance
|
|
19
20
|
from stackit.edge.models.instance_list import InstanceList
|
|
21
|
+
from stackit.edge.models.ip_allow_list_entry import IpAllowListEntry
|
|
20
22
|
from stackit.edge.models.kubeconfig import Kubeconfig
|
|
21
23
|
from stackit.edge.models.kubernetes_release_list import KubernetesReleaseList
|
|
22
24
|
from stackit.edge.models.plan import Plan
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
STACKIT Edge Cloud API
|
|
5
|
+
|
|
6
|
+
This API provides endpoints for managing STACKIT Edge Cloud instances.
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 1beta1
|
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
10
|
+
|
|
11
|
+
Do not edit the class manually.
|
|
12
|
+
""" # noqa: E501
|
|
13
|
+
|
|
14
|
+
from __future__ import annotations
|
|
15
|
+
|
|
16
|
+
import json
|
|
17
|
+
import pprint
|
|
18
|
+
from typing import Any, ClassVar, Dict, List, Optional, Set
|
|
19
|
+
|
|
20
|
+
from pydantic import BaseModel, ConfigDict, Field
|
|
21
|
+
from pydantic_core import to_jsonable_python
|
|
22
|
+
from typing_extensions import Self
|
|
23
|
+
|
|
24
|
+
from stackit.edge.models.ip_allow_list_entry import IpAllowListEntry
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
class Acl(BaseModel):
|
|
28
|
+
"""
|
|
29
|
+
The ACL config for the instances API.
|
|
30
|
+
""" # noqa: E501
|
|
31
|
+
|
|
32
|
+
ip_allow_list: Optional[List[IpAllowListEntry]] = Field(default=None, alias="ipAllowList")
|
|
33
|
+
__properties: ClassVar[List[str]] = ["ipAllowList"]
|
|
34
|
+
|
|
35
|
+
model_config = ConfigDict(
|
|
36
|
+
validate_by_name=True,
|
|
37
|
+
validate_by_alias=True,
|
|
38
|
+
validate_assignment=True,
|
|
39
|
+
protected_namespaces=(),
|
|
40
|
+
)
|
|
41
|
+
|
|
42
|
+
def to_str(self) -> str:
|
|
43
|
+
"""Returns the string representation of the model using alias"""
|
|
44
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
45
|
+
|
|
46
|
+
def to_json(self) -> str:
|
|
47
|
+
"""Returns the JSON representation of the model using alias"""
|
|
48
|
+
return json.dumps(to_jsonable_python(self.to_dict()))
|
|
49
|
+
|
|
50
|
+
@classmethod
|
|
51
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
52
|
+
"""Create an instance of Acl from a JSON string"""
|
|
53
|
+
return cls.from_dict(json.loads(json_str))
|
|
54
|
+
|
|
55
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
56
|
+
"""Return the dictionary representation of the model using alias.
|
|
57
|
+
|
|
58
|
+
This has the following differences from calling pydantic's
|
|
59
|
+
`self.model_dump(by_alias=True)`:
|
|
60
|
+
|
|
61
|
+
* `None` is only added to the output dict for nullable fields that
|
|
62
|
+
were set at model initialization. Other fields with value `None`
|
|
63
|
+
are ignored.
|
|
64
|
+
"""
|
|
65
|
+
excluded_fields: Set[str] = set([])
|
|
66
|
+
|
|
67
|
+
_dict = self.model_dump(
|
|
68
|
+
by_alias=True,
|
|
69
|
+
exclude=excluded_fields,
|
|
70
|
+
exclude_none=True,
|
|
71
|
+
)
|
|
72
|
+
# override the default output from pydantic by calling `to_dict()` of each item in ip_allow_list (list)
|
|
73
|
+
_items = []
|
|
74
|
+
if self.ip_allow_list:
|
|
75
|
+
for _item_ip_allow_list in self.ip_allow_list:
|
|
76
|
+
if _item_ip_allow_list:
|
|
77
|
+
_items.append(_item_ip_allow_list.to_dict())
|
|
78
|
+
_dict["ipAllowList"] = _items
|
|
79
|
+
return _dict
|
|
80
|
+
|
|
81
|
+
@classmethod
|
|
82
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
83
|
+
"""Create an instance of Acl from a dict"""
|
|
84
|
+
if obj is None:
|
|
85
|
+
return None
|
|
86
|
+
|
|
87
|
+
if not isinstance(obj, dict):
|
|
88
|
+
return cls.model_validate(obj)
|
|
89
|
+
|
|
90
|
+
_obj = cls.model_validate(
|
|
91
|
+
{
|
|
92
|
+
"ipAllowList": (
|
|
93
|
+
[IpAllowListEntry.from_dict(_item) for _item in obj["ipAllowList"]]
|
|
94
|
+
if obj.get("ipAllowList") is not None
|
|
95
|
+
else None
|
|
96
|
+
)
|
|
97
|
+
}
|
|
98
|
+
)
|
|
99
|
+
return _obj
|
|
@@ -24,12 +24,15 @@ from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator
|
|
|
24
24
|
from pydantic_core import to_jsonable_python
|
|
25
25
|
from typing_extensions import Annotated, Self
|
|
26
26
|
|
|
27
|
+
from stackit.edge.models.acl import Acl
|
|
28
|
+
|
|
27
29
|
|
|
28
30
|
class Instance(BaseModel):
|
|
29
31
|
"""
|
|
30
32
|
Instance
|
|
31
33
|
""" # noqa: E501
|
|
32
34
|
|
|
35
|
+
acl: Optional[Acl] = None
|
|
33
36
|
created: datetime = Field(description="The date and time the creation of the instance was triggered.")
|
|
34
37
|
description: Optional[Annotated[str, Field(strict=True, max_length=256)]] = Field(
|
|
35
38
|
default=None, description="A user chosen description to distinguish multiple instances."
|
|
@@ -44,6 +47,7 @@ class Instance(BaseModel):
|
|
|
44
47
|
plan_id: UUID = Field(description="Service Plan configures the size of the Instance.", alias="planId")
|
|
45
48
|
status: StrictStr = Field(description="The current status of the instance.")
|
|
46
49
|
__properties: ClassVar[List[str]] = [
|
|
50
|
+
"acl",
|
|
47
51
|
"created",
|
|
48
52
|
"description",
|
|
49
53
|
"displayName",
|
|
@@ -110,6 +114,9 @@ class Instance(BaseModel):
|
|
|
110
114
|
exclude=excluded_fields,
|
|
111
115
|
exclude_none=True,
|
|
112
116
|
)
|
|
117
|
+
# override the default output from pydantic by calling `to_dict()` of acl
|
|
118
|
+
if self.acl:
|
|
119
|
+
_dict["acl"] = self.acl.to_dict()
|
|
113
120
|
return _dict
|
|
114
121
|
|
|
115
122
|
@classmethod
|
|
@@ -123,6 +130,7 @@ class Instance(BaseModel):
|
|
|
123
130
|
|
|
124
131
|
_obj = cls.model_validate(
|
|
125
132
|
{
|
|
133
|
+
"acl": Acl.from_dict(obj["acl"]) if obj.get("acl") is not None else None,
|
|
126
134
|
"created": obj.get("created"),
|
|
127
135
|
"description": obj.get("description"),
|
|
128
136
|
"displayName": obj.get("displayName"),
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
STACKIT Edge Cloud API
|
|
5
|
+
|
|
6
|
+
This API provides endpoints for managing STACKIT Edge Cloud instances.
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 1beta1
|
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
10
|
+
|
|
11
|
+
Do not edit the class manually.
|
|
12
|
+
""" # noqa: E501
|
|
13
|
+
|
|
14
|
+
from __future__ import annotations
|
|
15
|
+
|
|
16
|
+
import json
|
|
17
|
+
import pprint
|
|
18
|
+
import re # noqa: F401
|
|
19
|
+
from datetime import datetime
|
|
20
|
+
from typing import Any, ClassVar, Dict, List, Optional, Set
|
|
21
|
+
from uuid import UUID
|
|
22
|
+
|
|
23
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator
|
|
24
|
+
from pydantic_core import to_jsonable_python
|
|
25
|
+
from typing_extensions import Annotated, Self
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
class IpAllowListEntry(BaseModel):
|
|
29
|
+
"""
|
|
30
|
+
IpAllowListEntry
|
|
31
|
+
""" # noqa: E501
|
|
32
|
+
|
|
33
|
+
created_at: Optional[datetime] = Field(
|
|
34
|
+
default=None, description="ISO-8601 timestamp of when the entry was created.", alias="createdAt"
|
|
35
|
+
)
|
|
36
|
+
description: Optional[Annotated[str, Field(strict=True, max_length=256)]] = Field(
|
|
37
|
+
default=None, description="Some description of the entry."
|
|
38
|
+
)
|
|
39
|
+
ip_range: StrictStr = Field(description="The IP CIDR range for the ACL entry.", alias="ipRange")
|
|
40
|
+
updated_at: Optional[datetime] = Field(
|
|
41
|
+
default=None, description="ISO-8601 timestamp of when the entry was last updated.", alias="updatedAt"
|
|
42
|
+
)
|
|
43
|
+
uuid: UUID = Field(
|
|
44
|
+
description="The unique identifier for the ipAllowListEntry entry. This value is immutable, used to identify entries for updates, and cannot be changed after creation."
|
|
45
|
+
)
|
|
46
|
+
__properties: ClassVar[List[str]] = ["createdAt", "description", "ipRange", "updatedAt", "uuid"]
|
|
47
|
+
|
|
48
|
+
@field_validator("created_at", mode="before")
|
|
49
|
+
def created_at_change_year_zero_to_one(cls, value):
|
|
50
|
+
"""Workaround which prevents year 0 issue"""
|
|
51
|
+
if isinstance(value, str):
|
|
52
|
+
# Check for year "0000" at the beginning of the string
|
|
53
|
+
# This assumes common date formats like YYYY-MM-DDTHH:MM:SS+00:00 or YYYY-MM-DDTHH:MM:SSZ
|
|
54
|
+
if value.startswith("0000-01-01T") and re.match(
|
|
55
|
+
r"^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\+\d{2}:\d{2}|Z)$", value
|
|
56
|
+
):
|
|
57
|
+
# Workaround: Replace "0000" with "0001"
|
|
58
|
+
return "0001" + value[4:] # Take "0001" and append the rest of the string
|
|
59
|
+
return value
|
|
60
|
+
|
|
61
|
+
@field_validator("updated_at", mode="before")
|
|
62
|
+
def updated_at_change_year_zero_to_one(cls, value):
|
|
63
|
+
"""Workaround which prevents year 0 issue"""
|
|
64
|
+
if isinstance(value, str):
|
|
65
|
+
# Check for year "0000" at the beginning of the string
|
|
66
|
+
# This assumes common date formats like YYYY-MM-DDTHH:MM:SS+00:00 or YYYY-MM-DDTHH:MM:SSZ
|
|
67
|
+
if value.startswith("0000-01-01T") and re.match(
|
|
68
|
+
r"^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\+\d{2}:\d{2}|Z)$", value
|
|
69
|
+
):
|
|
70
|
+
# Workaround: Replace "0000" with "0001"
|
|
71
|
+
return "0001" + value[4:] # Take "0001" and append the rest of the string
|
|
72
|
+
return value
|
|
73
|
+
|
|
74
|
+
model_config = ConfigDict(
|
|
75
|
+
validate_by_name=True,
|
|
76
|
+
validate_by_alias=True,
|
|
77
|
+
validate_assignment=True,
|
|
78
|
+
protected_namespaces=(),
|
|
79
|
+
)
|
|
80
|
+
|
|
81
|
+
def to_str(self) -> str:
|
|
82
|
+
"""Returns the string representation of the model using alias"""
|
|
83
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
84
|
+
|
|
85
|
+
def to_json(self) -> str:
|
|
86
|
+
"""Returns the JSON representation of the model using alias"""
|
|
87
|
+
return json.dumps(to_jsonable_python(self.to_dict()))
|
|
88
|
+
|
|
89
|
+
@classmethod
|
|
90
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
91
|
+
"""Create an instance of IpAllowListEntry from a JSON string"""
|
|
92
|
+
return cls.from_dict(json.loads(json_str))
|
|
93
|
+
|
|
94
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
95
|
+
"""Return the dictionary representation of the model using alias.
|
|
96
|
+
|
|
97
|
+
This has the following differences from calling pydantic's
|
|
98
|
+
`self.model_dump(by_alias=True)`:
|
|
99
|
+
|
|
100
|
+
* `None` is only added to the output dict for nullable fields that
|
|
101
|
+
were set at model initialization. Other fields with value `None`
|
|
102
|
+
are ignored.
|
|
103
|
+
* OpenAPI `readOnly` fields are excluded.
|
|
104
|
+
* OpenAPI `readOnly` fields are excluded.
|
|
105
|
+
"""
|
|
106
|
+
excluded_fields: Set[str] = set(
|
|
107
|
+
[
|
|
108
|
+
"created_at",
|
|
109
|
+
"updated_at",
|
|
110
|
+
]
|
|
111
|
+
)
|
|
112
|
+
|
|
113
|
+
_dict = self.model_dump(
|
|
114
|
+
by_alias=True,
|
|
115
|
+
exclude=excluded_fields,
|
|
116
|
+
exclude_none=True,
|
|
117
|
+
)
|
|
118
|
+
return _dict
|
|
119
|
+
|
|
120
|
+
@classmethod
|
|
121
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
122
|
+
"""Create an instance of IpAllowListEntry from a dict"""
|
|
123
|
+
if obj is None:
|
|
124
|
+
return None
|
|
125
|
+
|
|
126
|
+
if not isinstance(obj, dict):
|
|
127
|
+
return cls.model_validate(obj)
|
|
128
|
+
|
|
129
|
+
_obj = cls.model_validate(
|
|
130
|
+
{
|
|
131
|
+
"createdAt": obj.get("createdAt"),
|
|
132
|
+
"description": obj.get("description"),
|
|
133
|
+
"ipRange": obj.get("ipRange"),
|
|
134
|
+
"updatedAt": obj.get("updatedAt"),
|
|
135
|
+
"uuid": obj.get("uuid"),
|
|
136
|
+
}
|
|
137
|
+
)
|
|
138
|
+
return _obj
|
|
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
|
{stackit_edge-0.6.0 → stackit_edge-0.7.0}/src/stackit/edge/models/create_instance_payload.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{stackit_edge-0.6.0 → stackit_edge-0.7.0}/src/stackit/edge/models/kubernetes_release_list.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{stackit_edge-0.6.0 → stackit_edge-0.7.0}/src/stackit/edge/models/update_instance_by_name_payload.py
RENAMED
|
File without changes
|
{stackit_edge-0.6.0 → stackit_edge-0.7.0}/src/stackit/edge/models/update_instance_payload.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|