stackit-edge 0.1.0__py3-none-any.whl

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.
@@ -0,0 +1,86 @@
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, StrictStr
21
+ from typing_extensions import Annotated, Self
22
+
23
+
24
+ class UpdateInstanceByNamePayload(BaseModel):
25
+ """
26
+ UpdateInstanceByNamePayload
27
+ """ # noqa: E501
28
+
29
+ description: Optional[Annotated[str, Field(strict=True, max_length=256)]] = Field(
30
+ default=None, description="A user chosen description to distinguish multiple instances."
31
+ )
32
+ plan_id: Optional[StrictStr] = Field(
33
+ default=None, description="Service Plan configures the size of the Instance.", alias="planId"
34
+ )
35
+ __properties: ClassVar[List[str]] = ["description", "planId"]
36
+
37
+ model_config = ConfigDict(
38
+ populate_by_name=True,
39
+ validate_assignment=True,
40
+ protected_namespaces=(),
41
+ )
42
+
43
+ def to_str(self) -> str:
44
+ """Returns the string representation of the model using alias"""
45
+ return pprint.pformat(self.model_dump(by_alias=True))
46
+
47
+ def to_json(self) -> str:
48
+ """Returns the JSON representation of the model using alias"""
49
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
50
+ return json.dumps(self.to_dict())
51
+
52
+ @classmethod
53
+ def from_json(cls, json_str: str) -> Optional[Self]:
54
+ """Create an instance of UpdateInstanceByNamePayload from a JSON string"""
55
+ return cls.from_dict(json.loads(json_str))
56
+
57
+ def to_dict(self) -> Dict[str, Any]:
58
+ """Return the dictionary representation of the model using alias.
59
+
60
+ This has the following differences from calling pydantic's
61
+ `self.model_dump(by_alias=True)`:
62
+
63
+ * `None` is only added to the output dict for nullable fields that
64
+ were set at model initialization. Other fields with value `None`
65
+ are ignored.
66
+ """
67
+ excluded_fields: Set[str] = set([])
68
+
69
+ _dict = self.model_dump(
70
+ by_alias=True,
71
+ exclude=excluded_fields,
72
+ exclude_none=True,
73
+ )
74
+ return _dict
75
+
76
+ @classmethod
77
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
78
+ """Create an instance of UpdateInstanceByNamePayload from a dict"""
79
+ if obj is None:
80
+ return None
81
+
82
+ if not isinstance(obj, dict):
83
+ return cls.model_validate(obj)
84
+
85
+ _obj = cls.model_validate({"description": obj.get("description"), "planId": obj.get("planId")})
86
+ return _obj
@@ -0,0 +1,86 @@
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, StrictStr
21
+ from typing_extensions import Annotated, Self
22
+
23
+
24
+ class UpdateInstancePayload(BaseModel):
25
+ """
26
+ UpdateInstancePayload
27
+ """ # noqa: E501
28
+
29
+ description: Optional[Annotated[str, Field(strict=True, max_length=256)]] = Field(
30
+ default=None, description="A user chosen description to distinguish multiple instances."
31
+ )
32
+ plan_id: Optional[StrictStr] = Field(
33
+ default=None, description="Service Plan configures the size of the Instance.", alias="planId"
34
+ )
35
+ __properties: ClassVar[List[str]] = ["description", "planId"]
36
+
37
+ model_config = ConfigDict(
38
+ populate_by_name=True,
39
+ validate_assignment=True,
40
+ protected_namespaces=(),
41
+ )
42
+
43
+ def to_str(self) -> str:
44
+ """Returns the string representation of the model using alias"""
45
+ return pprint.pformat(self.model_dump(by_alias=True))
46
+
47
+ def to_json(self) -> str:
48
+ """Returns the JSON representation of the model using alias"""
49
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
50
+ return json.dumps(self.to_dict())
51
+
52
+ @classmethod
53
+ def from_json(cls, json_str: str) -> Optional[Self]:
54
+ """Create an instance of UpdateInstancePayload from a JSON string"""
55
+ return cls.from_dict(json.loads(json_str))
56
+
57
+ def to_dict(self) -> Dict[str, Any]:
58
+ """Return the dictionary representation of the model using alias.
59
+
60
+ This has the following differences from calling pydantic's
61
+ `self.model_dump(by_alias=True)`:
62
+
63
+ * `None` is only added to the output dict for nullable fields that
64
+ were set at model initialization. Other fields with value `None`
65
+ are ignored.
66
+ """
67
+ excluded_fields: Set[str] = set([])
68
+
69
+ _dict = self.model_dump(
70
+ by_alias=True,
71
+ exclude=excluded_fields,
72
+ exclude_none=True,
73
+ )
74
+ return _dict
75
+
76
+ @classmethod
77
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
78
+ """Create an instance of UpdateInstancePayload from a dict"""
79
+ if obj is None:
80
+ return None
81
+
82
+ if not isinstance(obj, dict):
83
+ return cls.model_validate(obj)
84
+
85
+ _obj = cls.model_validate({"description": obj.get("description"), "planId": obj.get("planId")})
86
+ return _obj
@@ -0,0 +1,82 @@
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, StrictStr
21
+ from typing_extensions import Self
22
+
23
+
24
+ class User(BaseModel):
25
+ """
26
+ User
27
+ """ # noqa: E501
28
+
29
+ email: StrictStr = Field(description="The email of the user.")
30
+ internal_id: StrictStr = Field(description="The UUID of the user.", alias="internalId")
31
+ __properties: ClassVar[List[str]] = ["email", "internalId"]
32
+
33
+ model_config = ConfigDict(
34
+ populate_by_name=True,
35
+ validate_assignment=True,
36
+ protected_namespaces=(),
37
+ )
38
+
39
+ def to_str(self) -> str:
40
+ """Returns the string representation of the model using alias"""
41
+ return pprint.pformat(self.model_dump(by_alias=True))
42
+
43
+ def to_json(self) -> str:
44
+ """Returns the JSON representation of the model using alias"""
45
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
46
+ return json.dumps(self.to_dict())
47
+
48
+ @classmethod
49
+ def from_json(cls, json_str: str) -> Optional[Self]:
50
+ """Create an instance of User from a JSON string"""
51
+ return cls.from_dict(json.loads(json_str))
52
+
53
+ def to_dict(self) -> Dict[str, Any]:
54
+ """Return the dictionary representation of the model using alias.
55
+
56
+ This has the following differences from calling pydantic's
57
+ `self.model_dump(by_alias=True)`:
58
+
59
+ * `None` is only added to the output dict for nullable fields that
60
+ were set at model initialization. Other fields with value `None`
61
+ are ignored.
62
+ """
63
+ excluded_fields: Set[str] = set([])
64
+
65
+ _dict = self.model_dump(
66
+ by_alias=True,
67
+ exclude=excluded_fields,
68
+ exclude_none=True,
69
+ )
70
+ return _dict
71
+
72
+ @classmethod
73
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
74
+ """Create an instance of User from a dict"""
75
+ if obj is None:
76
+ return None
77
+
78
+ if not isinstance(obj, dict):
79
+ return cls.model_validate(obj)
80
+
81
+ _obj = cls.model_validate({"email": obj.get("email"), "internalId": obj.get("internalId")})
82
+ return _obj
stackit/edge/py.typed ADDED
File without changes
stackit/edge/rest.py ADDED
@@ -0,0 +1,148 @@
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
+ import io
15
+ import json
16
+ import re
17
+
18
+ import requests
19
+ from stackit.core.authorization import Authorization
20
+ from stackit.core.configuration import Configuration
21
+
22
+ from stackit.edge.exceptions import ApiException, ApiValueError
23
+
24
+
25
+ RESTResponseType = requests.Response
26
+
27
+
28
+ class RESTResponse(io.IOBase):
29
+
30
+ def __init__(self, resp) -> None:
31
+ self.response = resp
32
+ self.status = resp.status_code
33
+ self.reason = resp.reason
34
+ self.data = None
35
+
36
+ def read(self):
37
+ if self.data is None:
38
+ self.data = self.response.content
39
+ return self.data
40
+
41
+ def getheaders(self):
42
+ """Returns a dictionary of the response headers."""
43
+ return self.response.headers
44
+
45
+ def getheader(self, name, default=None):
46
+ """Returns a given response header."""
47
+ return self.response.headers.get(name, default)
48
+
49
+
50
+ class RESTClientObject:
51
+ def __init__(self, config: Configuration) -> None:
52
+ self.session = config.custom_http_session if config.custom_http_session else requests.Session()
53
+ authorization = Authorization(config)
54
+ self.session.auth = authorization.auth_method
55
+
56
+ def request(self, method, url, headers=None, body=None, post_params=None, _request_timeout=None):
57
+ """Perform requests.
58
+
59
+ :param method: http request method
60
+ :param url: http request url
61
+ :param headers: http request headers
62
+ :param body: request json body, for `application/json`
63
+ :param post_params: request post parameters,
64
+ `application/x-www-form-urlencoded`
65
+ and `multipart/form-data`
66
+ :param _request_timeout: timeout setting for this request. If one
67
+ number provided, it will be total request
68
+ timeout. It can also be a pair (tuple) of
69
+ (connection, read) timeouts.
70
+ """
71
+ method = method.upper()
72
+ if method not in ["GET", "HEAD", "DELETE", "POST", "PUT", "PATCH", "OPTIONS"]:
73
+ raise ValueError("Method %s not allowed", method)
74
+
75
+ if post_params and body:
76
+ raise ApiValueError("body parameter cannot be used with post_params parameter.")
77
+
78
+ post_params = post_params or {}
79
+ headers = headers or {}
80
+
81
+ try:
82
+ # For `POST`, `PUT`, `PATCH`, `OPTIONS`, `DELETE`
83
+ if method in ["POST", "PUT", "PATCH", "OPTIONS", "DELETE"]:
84
+
85
+ # no content type provided or payload is json
86
+ content_type = headers.get("Content-Type")
87
+ if not content_type or re.search("json", content_type, re.IGNORECASE):
88
+ request_body = None
89
+ if body is not None:
90
+ request_body = json.dumps(body)
91
+ r = self.session.request(
92
+ method,
93
+ url,
94
+ data=request_body,
95
+ headers=headers,
96
+ )
97
+ elif content_type == "application/x-www-form-urlencoded":
98
+ r = self.session.request(
99
+ method,
100
+ url,
101
+ params=post_params,
102
+ headers=headers,
103
+ )
104
+ elif content_type == "multipart/form-data":
105
+ # must del headers['Content-Type'], or the correct
106
+ # Content-Type which generated by urllib3 will be
107
+ # overwritten.
108
+ del headers["Content-Type"]
109
+ # Ensures that dict objects are serialized
110
+ post_params = [(a, json.dumps(b)) if isinstance(b, dict) else (a, b) for a, b in post_params]
111
+ r = self.session.request(
112
+ method,
113
+ url,
114
+ files=post_params,
115
+ headers=headers,
116
+ )
117
+ # Pass a `string` parameter directly in the body to support
118
+ # other content types than JSON when `body` argument is
119
+ # provided in serialized form.
120
+ elif isinstance(body, str) or isinstance(body, bytes):
121
+ r = self.session.request(
122
+ method,
123
+ url,
124
+ data=body,
125
+ headers=headers,
126
+ )
127
+ elif headers["Content-Type"].startswith("text/") and isinstance(body, bool):
128
+ request_body = "true" if body else "false"
129
+ r = self.session.request(method, url, data=request_body, headers=headers)
130
+ else:
131
+ # Cannot generate the request from given parameters
132
+ msg = """Cannot prepare a request message for provided
133
+ arguments. Please check that your arguments match
134
+ declared content type."""
135
+ raise ApiException(status=0, reason=msg)
136
+ # For `GET`, `HEAD`
137
+ else:
138
+ r = self.session.request(
139
+ method,
140
+ url,
141
+ params={},
142
+ headers=headers,
143
+ )
144
+ except requests.exceptions.SSLError as e:
145
+ msg = "\n".join([type(e).__name__, str(e)])
146
+ raise ApiException(status=0, reason=msg)
147
+
148
+ return RESTResponse(r)
@@ -0,0 +1,48 @@
1
+ Metadata-Version: 2.4
2
+ Name: stackit-edge
3
+ Version: 0.1.0
4
+ Summary: STACKIT Edge Cloud API
5
+ License-File: LICENSE.md
6
+ License-File: NOTICE.txt
7
+ Author: STACKIT Developer Tools
8
+ Author-email: developer-tools@stackit.cloud
9
+ Requires-Python: >=3.9,<4.0
10
+ Classifier: License :: OSI Approved :: Apache Software License
11
+ Classifier: Operating System :: OS Independent
12
+ Classifier: Programming Language :: Python :: 3
13
+ Classifier: Programming Language :: Python :: 3.9
14
+ Classifier: Programming Language :: Python :: 3.10
15
+ Classifier: Programming Language :: Python :: 3.11
16
+ Classifier: Programming Language :: Python :: 3.12
17
+ Classifier: Programming Language :: Python :: 3.13
18
+ Classifier: Programming Language :: Python :: 3.14
19
+ Requires-Dist: pydantic (>=2.9.2)
20
+ Requires-Dist: python-dateutil (>=2.9.0.post0)
21
+ Requires-Dist: requests (>=2.32.3)
22
+ Requires-Dist: stackit-core (>=0.0.1a)
23
+ Project-URL: Homepage, https://github.com/stackitcloud/stackit-sdk-python
24
+ Project-URL: Issues, https://github.com/stackitcloud/stackit-sdk-python/issues
25
+ Description-Content-Type: text/markdown
26
+
27
+ # stackit.edge
28
+ This API provides endpoints for managing STACKIT Edge Cloud instances.
29
+
30
+
31
+ This package is part of the STACKIT Python SDK. For additional information, please visit the [GitHub repository](https://github.com/stackitcloud/stackit-sdk-python) of the SDK.
32
+
33
+
34
+ ## Installation & Usage
35
+ ### pip install
36
+
37
+ ```sh
38
+ pip install stackit-edge
39
+ ```
40
+
41
+ Then import the package:
42
+ ```python
43
+ import stackit.edge
44
+ ```
45
+
46
+ ## Getting Started
47
+
48
+ [Examples](https://github.com/stackitcloud/stackit-sdk-python/tree/main/examples) for the usage of the package can be found in the [GitHub repository](https://github.com/stackitcloud/stackit-sdk-python) of the SDK.
@@ -0,0 +1,27 @@
1
+ stackit/edge/__init__.py,sha256=GYfKz3_SuD2YQlZGclm1dJ0h8-auWqx-60C0dnr3o80,2542
2
+ stackit/edge/api/__init__.py,sha256=LY9pxpNxD-xMPRYRtZtsf4fY-wgJ-qAj1mNFTwMuKhI,99
3
+ stackit/edge/api/default_api.py,sha256=gNnAE1zwbWwf17Sm1HVJ9g3e-d6J257DzvLp_-jL0Go,174605
4
+ stackit/edge/api_client.py,sha256=TfQdKr0L20mjWbcI0uVW5Fo_xJlwAQ10ANIa6YvsSqw,23277
5
+ stackit/edge/api_response.py,sha256=HRYkVqMNIlfODacTQPTbiVj2YdcnutpQrKJdeAoCSpM,642
6
+ stackit/edge/configuration.py,sha256=Y2hjqiNFssifxQMuDPBQ0ZCuCcE-6uqOGE3kHE1TemY,5666
7
+ stackit/edge/exceptions.py,sha256=mtCL_YglkeRaJTkCP546IhF1BiFEu-rzVrwOGKIez8A,6402
8
+ stackit/edge/models/__init__.py,sha256=xFPn_-uHrlq6wcU7Rc0ZOquo9dEiiBxutKLow_P7bVk,1075
9
+ stackit/edge/models/bad_request.py,sha256=_cTBB5xwAzA47pto96xlynxwWIuMrZmzE3bYgLfoeyY,2462
10
+ stackit/edge/models/create_instance_payload.py,sha256=lHCBzNK8_aMReCbYXE0Ff2gZ-9eLBPqEAn2LuxK0WJM,3036
11
+ stackit/edge/models/instance.py,sha256=RBjvBM0wpDZ9W3c1ngH83qjjxj2uTkG-LvZOftNGlRU,4825
12
+ stackit/edge/models/instance_list.py,sha256=F5RQTn9bP9dmrFDZ3_pKe-C6LVhZIlhGh97itIc7qg0,2964
13
+ stackit/edge/models/kubeconfig.py,sha256=v5Yk6T6OFDf-PC2X_bzxsqwwv1npH2W4Q5QTaLm5cd0,2444
14
+ stackit/edge/models/plan.py,sha256=lhghQEpVMQpvyUbv4LkdgtabHFb_0RkTiXgx_VKqkcc,2977
15
+ stackit/edge/models/plan_list.py,sha256=Btwi1OKPGsMWZ8zQClEuRnCxlUjvX-lNWshCRRh_4yw,3004
16
+ stackit/edge/models/token.py,sha256=FlwWvzkGBZjF9gO3NFYSok4mhdiasgpOmmcNh7EN6bI,2405
17
+ stackit/edge/models/unauthorized_request.py,sha256=d7h55eq42sQBTZhlEfyFva4rC0xioS7HFaq6-2aqPok,2498
18
+ stackit/edge/models/update_instance_by_name_payload.py,sha256=m5QftM7JPcY0M2nsdpKTDPWU6zk12EmF6Fbpqe26IYQ,2829
19
+ stackit/edge/models/update_instance_payload.py,sha256=Io1rxX7Kvfp3NQAaBY72oPfsdoepoJpH1gmmBHVbf6E,2805
20
+ stackit/edge/models/user.py,sha256=P-aHCopRjFat2-9wRbw5J7zdopxD_rmQOvQ2iDbt1u0,2539
21
+ stackit/edge/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
22
+ stackit/edge/rest.py,sha256=zDv3dxlMuBvS_i-J_4qJ9fWW3UJIDk8lC2hpsDz4LGU,5782
23
+ stackit_edge-0.1.0.dist-info/METADATA,sha256=5XbSJLzUg2rEyAaWfoyNuL6PnbaeZPLeKWutIQIo1H4,1693
24
+ stackit_edge-0.1.0.dist-info/WHEEL,sha256=zp0Cn7JsFoX2ATtOhtaFYIiE2rmFAD4OcMhtUki8W3U,88
25
+ stackit_edge-0.1.0.dist-info/licenses/LICENSE.md,sha256=bxVEBCY6jGvAUq3_nmX12ZB8QzOWIggH_0dVHa9_dyc,10933
26
+ stackit_edge-0.1.0.dist-info/licenses/NOTICE.txt,sha256=o0qHldluTZ_EBJ5rr_nsrFz3NWoLgSVWaUFbqzyzeJo,65
27
+ stackit_edge-0.1.0.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: poetry-core 2.2.1
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any