stackit-postgresflex 1.1.0__py3-none-any.whl → 1.2.1__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.
Files changed (29) hide show
  1. stackit/postgresflex/__init__.py +2 -0
  2. stackit/postgresflex/api_client.py +22 -9
  3. stackit/postgresflex/exceptions.py +1 -1
  4. stackit/postgresflex/models/__init__.py +1 -1
  5. stackit/postgresflex/models/api_extension_config_load_response.py +3 -3
  6. stackit/postgresflex/models/api_extension_configure_response.py +3 -3
  7. stackit/postgresflex/models/api_installed_list_response.py +3 -3
  8. stackit/postgresflex/models/extensions_extension_list_response.py +3 -3
  9. stackit/postgresflex/models/extensions_new_config.py +3 -3
  10. stackit/postgresflex/models/instance_data_point.py +7 -1
  11. stackit/postgresflex/models/instance_host.py +3 -3
  12. stackit/postgresflex/models/instance_host_metric.py +3 -3
  13. stackit/postgresflex/models/instance_list_databases_response.py +3 -3
  14. stackit/postgresflex/models/instance_metrics_response.py +3 -3
  15. stackit/postgresflex/models/list_backups_response.py +3 -3
  16. stackit/postgresflex/models/list_flavors_response.py +3 -3
  17. stackit/postgresflex/models/list_instances_response.py +3 -3
  18. stackit/postgresflex/models/list_users_response.py +3 -3
  19. stackit/postgresflex/models/partial_update_instance_payload.py +3 -3
  20. stackit/postgresflex/models/postgres_database_parameter.py +7 -1
  21. stackit/postgresflex/models/postgres_database_parameter_response.py +3 -3
  22. stackit/postgresflex/models/storage_update.py +87 -0
  23. stackit/postgresflex/models/update_instance_payload.py +3 -3
  24. stackit/postgresflex/rest.py +19 -3
  25. {stackit_postgresflex-1.1.0.dist-info → stackit_postgresflex-1.2.1.dist-info}/METADATA +14 -12
  26. {stackit_postgresflex-1.1.0.dist-info → stackit_postgresflex-1.2.1.dist-info}/RECORD +32 -31
  27. {stackit_postgresflex-1.1.0.dist-info → stackit_postgresflex-1.2.1.dist-info}/WHEEL +1 -1
  28. {stackit_postgresflex-1.1.0.dist-info → stackit_postgresflex-1.2.1.dist-info/licenses}/LICENSE.md +0 -0
  29. {stackit_postgresflex-1.1.0.dist-info → stackit_postgresflex-1.2.1.dist-info/licenses}/NOTICE.txt +0 -0
@@ -78,6 +78,7 @@ __all__ = [
78
78
  "ResetUserResponse",
79
79
  "Storage",
80
80
  "StorageRange",
81
+ "StorageUpdate",
81
82
  "UpdateBackupSchedulePayload",
82
83
  "UpdateInstancePayload",
83
84
  "UpdateUserPayload",
@@ -231,6 +232,7 @@ from stackit.postgresflex.models.reset_user_response import (
231
232
  )
232
233
  from stackit.postgresflex.models.storage import Storage as Storage
233
234
  from stackit.postgresflex.models.storage_range import StorageRange as StorageRange
235
+ from stackit.postgresflex.models.storage_update import StorageUpdate as StorageUpdate
234
236
  from stackit.postgresflex.models.update_backup_schedule_payload import (
235
237
  UpdateBackupSchedulePayload as UpdateBackupSchedulePayload,
236
238
  )
@@ -13,11 +13,13 @@
13
13
  """ # noqa: E501
14
14
 
15
15
  import datetime
16
+ import decimal
16
17
  import json
17
18
  import mimetypes
18
19
  import os
19
20
  import re
20
21
  import tempfile
22
+ import uuid
21
23
  from enum import Enum
22
24
  from typing import Dict, List, Optional, Tuple, Union
23
25
  from urllib.parse import quote
@@ -64,8 +66,10 @@ class ApiClient:
64
66
  "bool": bool,
65
67
  "date": datetime.date,
66
68
  "datetime": datetime.datetime,
69
+ "decimal": decimal.Decimal,
67
70
  "object": object,
68
71
  }
72
+ _pool = None
69
73
 
70
74
  def __init__(self, configuration, header_name=None, header_value=None, cookie=None) -> None:
71
75
  self.config: Configuration = configuration
@@ -268,7 +272,7 @@ class ApiClient:
268
272
  return_data = self.__deserialize_file(response_data)
269
273
  elif response_type is not None:
270
274
  match = None
271
- content_type = response_data.getheader("content-type")
275
+ content_type = response_data.headers.get("content-type")
272
276
  if content_type is not None:
273
277
  match = re.search(r"charset=([a-zA-Z\-\d]+)[\s;]?", content_type)
274
278
  encoding = match.group(1) if match else "utf-8"
@@ -285,7 +289,7 @@ class ApiClient:
285
289
  return ApiResponse(
286
290
  status_code=response_data.status,
287
291
  data=return_data,
288
- headers=response_data.getheaders(),
292
+ headers=response_data.headers,
289
293
  raw_data=response_data.data,
290
294
  )
291
295
 
@@ -297,6 +301,7 @@ class ApiClient:
297
301
  If obj is str, int, long, float, bool, return directly.
298
302
  If obj is datetime.datetime, datetime.date
299
303
  convert to string in iso8601 format.
304
+ If obj is decimal.Decimal return string representation.
300
305
  If obj is list, sanitize each element in the list.
301
306
  If obj is dict, return the dict.
302
307
  If obj is OpenAPI model, return the properties dict.
@@ -312,12 +317,16 @@ class ApiClient:
312
317
  return obj.get_secret_value()
313
318
  elif isinstance(obj, self.PRIMITIVE_TYPES):
314
319
  return obj
320
+ elif isinstance(obj, uuid.UUID):
321
+ return str(obj)
315
322
  elif isinstance(obj, list):
316
323
  return [self.sanitize_for_serialization(sub_obj) for sub_obj in obj]
317
324
  elif isinstance(obj, tuple):
318
325
  return tuple(self.sanitize_for_serialization(sub_obj) for sub_obj in obj)
319
326
  elif isinstance(obj, (datetime.datetime, datetime.date)):
320
327
  return obj.isoformat()
328
+ elif isinstance(obj, decimal.Decimal):
329
+ return str(obj)
321
330
 
322
331
  elif isinstance(obj, dict):
323
332
  obj_dict = obj
@@ -327,7 +336,7 @@ class ApiClient:
327
336
  # and attributes which value is not None.
328
337
  # Convert attribute name to json key in
329
338
  # model definition for request.
330
- if hasattr(obj, "to_dict") and callable(obj.to_dict):
339
+ if hasattr(obj, "to_dict") and callable(getattr(obj, "to_dict")): # noqa: B009
331
340
  obj_dict = obj.to_dict()
332
341
  else:
333
342
  obj_dict = obj.__dict__
@@ -355,7 +364,7 @@ class ApiClient:
355
364
  data = json.loads(response_text)
356
365
  except ValueError:
357
366
  data = response_text
358
- elif re.match(r"^application/(json|[\w!#$&.+-^_]+\+json)\s*(;|$)", content_type, re.IGNORECASE):
367
+ elif re.match(r"^application/(json|[\w!#$&.+\-^_]+\+json)\s*(;|$)", content_type, re.IGNORECASE):
359
368
  if response_text == "":
360
369
  data = ""
361
370
  else:
@@ -401,12 +410,14 @@ class ApiClient:
401
410
 
402
411
  if klass in self.PRIMITIVE_TYPES:
403
412
  return self.__deserialize_primitive(data, klass)
404
- elif klass == object:
413
+ elif klass is object:
405
414
  return self.__deserialize_object(data)
406
- elif klass == datetime.date:
415
+ elif klass is datetime.date:
407
416
  return self.__deserialize_date(data)
408
- elif klass == datetime.datetime:
417
+ elif klass is datetime.datetime:
409
418
  return self.__deserialize_datetime(data)
419
+ elif klass is decimal.Decimal:
420
+ return decimal.Decimal(data)
410
421
  elif issubclass(klass, Enum):
411
422
  return self.__deserialize_enum(data, klass)
412
423
  else:
@@ -554,12 +565,14 @@ class ApiClient:
554
565
  os.close(fd)
555
566
  os.remove(path)
556
567
 
557
- content_disposition = response.getheader("Content-Disposition")
568
+ content_disposition = response.headers.get("Content-Disposition")
558
569
  if content_disposition:
559
570
  m = re.search(r'filename=[\'"]?([^\'"\s]+)[\'"]?', content_disposition)
560
571
  if m is None:
561
572
  raise ValueError("Unexpected 'content-disposition' header value")
562
- filename = m.group(1)
573
+ filename = os.path.basename(m.group(1)) # Strip any directory traversal
574
+ if filename in ("", ".", ".."): # fall back to tmp filename
575
+ filename = os.path.basename(path)
563
576
  path = os.path.join(os.path.dirname(path), filename)
564
577
 
565
578
  with open(path, "wb") as f:
@@ -130,7 +130,7 @@ class ApiException(OpenApiException):
130
130
  self.body = http_resp.data.decode("utf-8")
131
131
  except Exception: # noqa: S110
132
132
  pass
133
- self.headers = http_resp.getheaders()
133
+ self.headers = http_resp.headers
134
134
 
135
135
  @classmethod
136
136
  def from_response(
@@ -13,7 +13,6 @@
13
13
  Do not edit the class manually.
14
14
  """ # noqa: E501
15
15
 
16
-
17
16
  # import models into model package
18
17
  from stackit.postgresflex.models.acl import ACL
19
18
  from stackit.postgresflex.models.api_configuration import ApiConfiguration
@@ -92,6 +91,7 @@ from stackit.postgresflex.models.postgres_database_parameter_response import (
92
91
  from stackit.postgresflex.models.reset_user_response import ResetUserResponse
93
92
  from stackit.postgresflex.models.storage import Storage
94
93
  from stackit.postgresflex.models.storage_range import StorageRange
94
+ from stackit.postgresflex.models.storage_update import StorageUpdate
95
95
  from stackit.postgresflex.models.update_backup_schedule_payload import (
96
96
  UpdateBackupSchedulePayload,
97
97
  )
@@ -74,9 +74,9 @@ class ApiExtensionConfigLoadResponse(BaseModel):
74
74
  # override the default output from pydantic by calling `to_dict()` of each item in configuration (list)
75
75
  _items = []
76
76
  if self.configuration:
77
- for _item in self.configuration:
78
- if _item:
79
- _items.append(_item.to_dict())
77
+ for _item_configuration in self.configuration:
78
+ if _item_configuration:
79
+ _items.append(_item_configuration.to_dict())
80
80
  _dict["configuration"] = _items
81
81
  return _dict
82
82
 
@@ -74,9 +74,9 @@ class ApiExtensionConfigureResponse(BaseModel):
74
74
  # override the default output from pydantic by calling `to_dict()` of each item in configuration (list)
75
75
  _items = []
76
76
  if self.configuration:
77
- for _item in self.configuration:
78
- if _item:
79
- _items.append(_item.to_dict())
77
+ for _item_configuration in self.configuration:
78
+ if _item_configuration:
79
+ _items.append(_item_configuration.to_dict())
80
80
  _dict["configuration"] = _items
81
81
  return _dict
82
82
 
@@ -72,9 +72,9 @@ class ApiInstalledListResponse(BaseModel):
72
72
  # override the default output from pydantic by calling `to_dict()` of each item in installed (list)
73
73
  _items = []
74
74
  if self.installed:
75
- for _item in self.installed:
76
- if _item:
77
- _items.append(_item.to_dict())
75
+ for _item_installed in self.installed:
76
+ if _item_installed:
77
+ _items.append(_item_installed.to_dict())
78
78
  _dict["installed"] = _items
79
79
  return _dict
80
80
 
@@ -72,9 +72,9 @@ class ExtensionsExtensionListResponse(BaseModel):
72
72
  # override the default output from pydantic by calling `to_dict()` of each item in list (list)
73
73
  _items = []
74
74
  if self.list:
75
- for _item in self.list:
76
- if _item:
77
- _items.append(_item.to_dict())
75
+ for _item_list in self.list:
76
+ if _item_list:
77
+ _items.append(_item_list.to_dict())
78
78
  _dict["list"] = _items
79
79
  return _dict
80
80
 
@@ -72,9 +72,9 @@ class ExtensionsNewConfig(BaseModel):
72
72
  # override the default output from pydantic by calling `to_dict()` of each item in configuration (list)
73
73
  _items = []
74
74
  if self.configuration:
75
- for _item in self.configuration:
76
- if _item:
77
- _items.append(_item.to_dict())
75
+ for _item_configuration in self.configuration:
76
+ if _item_configuration:
77
+ _items.append(_item_configuration.to_dict())
78
78
  _dict["configuration"] = _items
79
79
  return _dict
80
80
 
@@ -18,7 +18,13 @@ import json
18
18
  import pprint
19
19
  from typing import Any, ClassVar, Dict, List, Optional, Set, Union
20
20
 
21
- from pydantic import BaseModel, ConfigDict, StrictFloat, StrictInt, StrictStr
21
+ from pydantic import (
22
+ BaseModel,
23
+ ConfigDict,
24
+ StrictFloat,
25
+ StrictInt,
26
+ StrictStr,
27
+ )
22
28
  from typing_extensions import Self
23
29
 
24
30
 
@@ -73,9 +73,9 @@ class InstanceHost(BaseModel):
73
73
  # override the default output from pydantic by calling `to_dict()` of each item in host_metrics (list)
74
74
  _items = []
75
75
  if self.host_metrics:
76
- for _item in self.host_metrics:
77
- if _item:
78
- _items.append(_item.to_dict())
76
+ for _item_host_metrics in self.host_metrics:
77
+ if _item_host_metrics:
78
+ _items.append(_item_host_metrics.to_dict())
79
79
  _dict["hostMetrics"] = _items
80
80
  return _dict
81
81
 
@@ -74,9 +74,9 @@ class InstanceHostMetric(BaseModel):
74
74
  # override the default output from pydantic by calling `to_dict()` of each item in datapoints (list)
75
75
  _items = []
76
76
  if self.datapoints:
77
- for _item in self.datapoints:
78
- if _item:
79
- _items.append(_item.to_dict())
77
+ for _item_datapoints in self.datapoints:
78
+ if _item_datapoints:
79
+ _items.append(_item_datapoints.to_dict())
80
80
  _dict["datapoints"] = _items
81
81
  return _dict
82
82
 
@@ -72,9 +72,9 @@ class InstanceListDatabasesResponse(BaseModel):
72
72
  # override the default output from pydantic by calling `to_dict()` of each item in databases (list)
73
73
  _items = []
74
74
  if self.databases:
75
- for _item in self.databases:
76
- if _item:
77
- _items.append(_item.to_dict())
75
+ for _item_databases in self.databases:
76
+ if _item_databases:
77
+ _items.append(_item_databases.to_dict())
78
78
  _dict["databases"] = _items
79
79
  return _dict
80
80
 
@@ -72,9 +72,9 @@ class InstanceMetricsResponse(BaseModel):
72
72
  # override the default output from pydantic by calling `to_dict()` of each item in hosts (list)
73
73
  _items = []
74
74
  if self.hosts:
75
- for _item in self.hosts:
76
- if _item:
77
- _items.append(_item.to_dict())
75
+ for _item_hosts in self.hosts:
76
+ if _item_hosts:
77
+ _items.append(_item_hosts.to_dict())
78
78
  _dict["hosts"] = _items
79
79
  return _dict
80
80
 
@@ -73,9 +73,9 @@ class ListBackupsResponse(BaseModel):
73
73
  # override the default output from pydantic by calling `to_dict()` of each item in items (list)
74
74
  _items = []
75
75
  if self.items:
76
- for _item in self.items:
77
- if _item:
78
- _items.append(_item.to_dict())
76
+ for _item_items in self.items:
77
+ if _item_items:
78
+ _items.append(_item_items.to_dict())
79
79
  _dict["items"] = _items
80
80
  return _dict
81
81
 
@@ -72,9 +72,9 @@ class ListFlavorsResponse(BaseModel):
72
72
  # override the default output from pydantic by calling `to_dict()` of each item in flavors (list)
73
73
  _items = []
74
74
  if self.flavors:
75
- for _item in self.flavors:
76
- if _item:
77
- _items.append(_item.to_dict())
75
+ for _item_flavors in self.flavors:
76
+ if _item_flavors:
77
+ _items.append(_item_flavors.to_dict())
78
78
  _dict["flavors"] = _items
79
79
  return _dict
80
80
 
@@ -73,9 +73,9 @@ class ListInstancesResponse(BaseModel):
73
73
  # override the default output from pydantic by calling `to_dict()` of each item in items (list)
74
74
  _items = []
75
75
  if self.items:
76
- for _item in self.items:
77
- if _item:
78
- _items.append(_item.to_dict())
76
+ for _item_items in self.items:
77
+ if _item_items:
78
+ _items.append(_item_items.to_dict())
79
79
  _dict["items"] = _items
80
80
  return _dict
81
81
 
@@ -73,9 +73,9 @@ class ListUsersResponse(BaseModel):
73
73
  # override the default output from pydantic by calling `to_dict()` of each item in items (list)
74
74
  _items = []
75
75
  if self.items:
76
- for _item in self.items:
77
- if _item:
78
- _items.append(_item.to_dict())
76
+ for _item_items in self.items:
77
+ if _item_items:
78
+ _items.append(_item_items.to_dict())
79
79
  _dict["items"] = _items
80
80
  return _dict
81
81
 
@@ -22,7 +22,7 @@ from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr
22
22
  from typing_extensions import Self
23
23
 
24
24
  from stackit.postgresflex.models.acl import ACL
25
- from stackit.postgresflex.models.storage import Storage
25
+ from stackit.postgresflex.models.storage_update import StorageUpdate
26
26
 
27
27
 
28
28
  class PartialUpdateInstancePayload(BaseModel):
@@ -37,7 +37,7 @@ class PartialUpdateInstancePayload(BaseModel):
37
37
  name: Optional[StrictStr] = None
38
38
  options: Optional[Dict[str, StrictStr]] = None
39
39
  replicas: Optional[StrictInt] = None
40
- storage: Optional[Storage] = None
40
+ storage: Optional[StorageUpdate] = None
41
41
  version: Optional[StrictStr] = None
42
42
  __properties: ClassVar[List[str]] = [
43
43
  "acl",
@@ -114,7 +114,7 @@ class PartialUpdateInstancePayload(BaseModel):
114
114
  "name": obj.get("name"),
115
115
  "options": obj.get("options"),
116
116
  "replicas": obj.get("replicas"),
117
- "storage": Storage.from_dict(obj["storage"]) if obj.get("storage") is not None else None,
117
+ "storage": StorageUpdate.from_dict(obj["storage"]) if obj.get("storage") is not None else None,
118
118
  "version": obj.get("version"),
119
119
  }
120
120
  )
@@ -18,7 +18,13 @@ import json
18
18
  import pprint
19
19
  from typing import Any, ClassVar, Dict, List, Optional, Set
20
20
 
21
- from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr
21
+ from pydantic import (
22
+ BaseModel,
23
+ ConfigDict,
24
+ Field,
25
+ StrictBool,
26
+ StrictStr,
27
+ )
22
28
  from typing_extensions import Self
23
29
 
24
30
 
@@ -74,9 +74,9 @@ class PostgresDatabaseParameterResponse(BaseModel):
74
74
  # override the default output from pydantic by calling `to_dict()` of each item in parameter (list)
75
75
  _items = []
76
76
  if self.parameter:
77
- for _item in self.parameter:
78
- if _item:
79
- _items.append(_item.to_dict())
77
+ for _item_parameter in self.parameter:
78
+ if _item_parameter:
79
+ _items.append(_item_parameter.to_dict())
80
80
  _dict["parameter"] = _items
81
81
  return _dict
82
82
 
@@ -0,0 +1,87 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ STACKIT PostgreSQL Flex API
5
+
6
+ This is the documentation for the STACKIT postgres service
7
+
8
+ The version of the OpenAPI document: 2.0.0
9
+ Contact: support@stackit.cloud
10
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
11
+
12
+ Do not edit the class manually.
13
+ """ # noqa: E501
14
+
15
+ from __future__ import annotations
16
+
17
+ import json
18
+ import pprint
19
+ from typing import Any, ClassVar, Dict, List, Optional, Set
20
+
21
+ from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr
22
+ from typing_extensions import Self
23
+
24
+
25
+ class StorageUpdate(BaseModel):
26
+ """
27
+ StorageUpdate
28
+ """ # noqa: E501
29
+
30
+ var_class: Optional[StrictStr] = Field(
31
+ default=None,
32
+ description=" ⚠️ **DEPRECATED AND NON-FUNCTIONAL:** Updating the performance class field is not possible. ",
33
+ alias="class",
34
+ )
35
+ size: Optional[StrictInt] = None
36
+ __properties: ClassVar[List[str]] = ["class", "size"]
37
+
38
+ model_config = ConfigDict(
39
+ populate_by_name=True,
40
+ validate_assignment=True,
41
+ protected_namespaces=(),
42
+ )
43
+
44
+ def to_str(self) -> str:
45
+ """Returns the string representation of the model using alias"""
46
+ return pprint.pformat(self.model_dump(by_alias=True))
47
+
48
+ def to_json(self) -> str:
49
+ """Returns the JSON representation of the model using alias"""
50
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
51
+ return json.dumps(self.to_dict())
52
+
53
+ @classmethod
54
+ def from_json(cls, json_str: str) -> Optional[Self]:
55
+ """Create an instance of StorageUpdate from a JSON string"""
56
+ return cls.from_dict(json.loads(json_str))
57
+
58
+ def to_dict(self) -> Dict[str, Any]:
59
+ """Return the dictionary representation of the model using alias.
60
+
61
+ This has the following differences from calling pydantic's
62
+ `self.model_dump(by_alias=True)`:
63
+
64
+ * `None` is only added to the output dict for nullable fields that
65
+ were set at model initialization. Other fields with value `None`
66
+ are ignored.
67
+ """
68
+ excluded_fields: Set[str] = set([])
69
+
70
+ _dict = self.model_dump(
71
+ by_alias=True,
72
+ exclude=excluded_fields,
73
+ exclude_none=True,
74
+ )
75
+ return _dict
76
+
77
+ @classmethod
78
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
79
+ """Create an instance of StorageUpdate from a dict"""
80
+ if obj is None:
81
+ return None
82
+
83
+ if not isinstance(obj, dict):
84
+ return cls.model_validate(obj)
85
+
86
+ _obj = cls.model_validate({"class": obj.get("class"), "size": obj.get("size")})
87
+ return _obj
@@ -22,7 +22,7 @@ from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr
22
22
  from typing_extensions import Self
23
23
 
24
24
  from stackit.postgresflex.models.acl import ACL
25
- from stackit.postgresflex.models.storage import Storage
25
+ from stackit.postgresflex.models.storage_update import StorageUpdate
26
26
 
27
27
 
28
28
  class UpdateInstancePayload(BaseModel):
@@ -37,7 +37,7 @@ class UpdateInstancePayload(BaseModel):
37
37
  name: Optional[StrictStr] = None
38
38
  options: Optional[Dict[str, StrictStr]] = None
39
39
  replicas: Optional[StrictInt] = None
40
- storage: Optional[Storage] = None
40
+ storage: Optional[StorageUpdate] = None
41
41
  version: Optional[StrictStr] = None
42
42
  __properties: ClassVar[List[str]] = [
43
43
  "acl",
@@ -114,7 +114,7 @@ class UpdateInstancePayload(BaseModel):
114
114
  "name": obj.get("name"),
115
115
  "options": obj.get("options"),
116
116
  "replicas": obj.get("replicas"),
117
- "storage": Storage.from_dict(obj["storage"]) if obj.get("storage") is not None else None,
117
+ "storage": StorageUpdate.from_dict(obj["storage"]) if obj.get("storage") is not None else None,
118
118
  "version": obj.get("version"),
119
119
  }
120
120
  )
@@ -39,12 +39,17 @@ class RESTResponse(io.IOBase):
39
39
  self.data = self.response.content
40
40
  return self.data
41
41
 
42
+ @property
43
+ def headers(self):
44
+ """Returns a dictionary of response headers."""
45
+ return self.response.headers
46
+
42
47
  def getheaders(self):
43
- """Returns a dictionary of the response headers."""
48
+ """Returns a dictionary of the response headers; use ``headers`` instead."""
44
49
  return self.response.headers
45
50
 
46
51
  def getheader(self, name, default=None):
47
- """Returns a given response header."""
52
+ """Returns a given response header; use ``headers.get()`` instead."""
48
53
  return self.response.headers.get(name, default)
49
54
 
50
55
 
@@ -94,6 +99,7 @@ class RESTClientObject:
94
99
  url,
95
100
  data=request_body,
96
101
  headers=headers,
102
+ timeout=_request_timeout,
97
103
  )
98
104
  elif content_type == "application/x-www-form-urlencoded":
99
105
  r = self.session.request(
@@ -101,6 +107,7 @@ class RESTClientObject:
101
107
  url,
102
108
  params=post_params,
103
109
  headers=headers,
110
+ timeout=_request_timeout,
104
111
  )
105
112
  elif content_type == "multipart/form-data":
106
113
  # must del headers['Content-Type'], or the correct
@@ -114,6 +121,7 @@ class RESTClientObject:
114
121
  url,
115
122
  files=post_params,
116
123
  headers=headers,
124
+ timeout=_request_timeout,
117
125
  )
118
126
  # Pass a `string` parameter directly in the body to support
119
127
  # other content types than JSON when `body` argument is
@@ -124,10 +132,17 @@ class RESTClientObject:
124
132
  url,
125
133
  data=body,
126
134
  headers=headers,
135
+ timeout=_request_timeout,
127
136
  )
128
137
  elif headers["Content-Type"].startswith("text/") and isinstance(body, bool):
129
138
  request_body = "true" if body else "false"
130
- r = self.session.request(method, url, data=request_body, headers=headers)
139
+ r = self.session.request(
140
+ method,
141
+ url,
142
+ data=request_body,
143
+ headers=headers,
144
+ timeout=_request_timeout,
145
+ )
131
146
  else:
132
147
  # Cannot generate the request from given parameters
133
148
  msg = """Cannot prepare a request message for provided
@@ -141,6 +156,7 @@ class RESTClientObject:
141
156
  url,
142
157
  params={},
143
158
  headers=headers,
159
+ timeout=_request_timeout,
144
160
  )
145
161
  except requests.exceptions.SSLError as e:
146
162
  msg = "\n".join([type(e).__name__, str(e)])
@@ -1,10 +1,12 @@
1
- Metadata-Version: 2.3
1
+ Metadata-Version: 2.4
2
2
  Name: stackit-postgresflex
3
- Version: 1.1.0
3
+ Version: 1.2.1
4
4
  Summary: STACKIT PostgreSQL Flex API
5
- Author: STACKIT Developer Tools
6
- Author-email: developer-tools@stackit.cloud
7
- Requires-Python: >=3.9,<4.0
5
+ Project-URL: Homepage, https://github.com/stackitcloud/stackit-sdk-python
6
+ Project-URL: Issues, https://github.com/stackitcloud/stackit-sdk-python/issues
7
+ Author-email: STACKIT Developer Tools <developer-tools@stackit.cloud>
8
+ License-File: LICENSE.md
9
+ License-File: NOTICE.txt
8
10
  Classifier: License :: OSI Approved :: Apache Software License
9
11
  Classifier: Operating System :: OS Independent
10
12
  Classifier: Programming Language :: Python :: 3
@@ -13,12 +15,12 @@ Classifier: Programming Language :: Python :: 3.10
13
15
  Classifier: Programming Language :: Python :: 3.11
14
16
  Classifier: Programming Language :: Python :: 3.12
15
17
  Classifier: Programming Language :: Python :: 3.13
16
- Requires-Dist: pydantic (>=2.9.2)
17
- Requires-Dist: python-dateutil (>=2.9.0.post0)
18
- Requires-Dist: requests (>=2.32.3)
19
- Requires-Dist: stackit-core (>=0.0.1a)
20
- Project-URL: Homepage, https://github.com/stackitcloud/stackit-sdk-python
21
- Project-URL: Issues, https://github.com/stackitcloud/stackit-sdk-python/issues
18
+ Classifier: Programming Language :: Python :: 3.14
19
+ Requires-Python: <4.0,>=3.9
20
+ Requires-Dist: pydantic>=2.9.2
21
+ Requires-Dist: python-dateutil>=2.9.0.post0
22
+ Requires-Dist: requests>=2.32.3
23
+ Requires-Dist: stackit-core>=0.0.1a
22
24
  Description-Content-Type: text/markdown
23
25
 
24
26
  # stackit.postgresflex
@@ -43,4 +45,4 @@ import stackit.postgresflex
43
45
 
44
46
  ## Getting Started
45
47
 
46
- [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.
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.
@@ -1,20 +1,22 @@
1
- stackit/postgresflex/__init__.py,sha256=8LOF61tQ26yxjClswkpgAbG6u3vN5hvj_We9anNyR-M,8987
2
- stackit/postgresflex/api/__init__.py,sha256=o9Yn39BawyTTsTGsVzVPZ5-Or_0CKwHlAAAIUMqtxjc,107
3
- stackit/postgresflex/api/default_api.py,sha256=uKbO0E72NfnijDg04ASrhgr62cAkUG0xx8mPVQ9QXFw,326877
4
- stackit/postgresflex/api_client.py,sha256=SRnZpFjdo4TWj5nDEnbuGdewvPk9ViTLvnTQhl4bwnQ,23368
1
+ stackit/postgresflex/__init__.py,sha256=rMYzq9BlsmdVBxtxHPSHCwgTn-oHBodu9QBvhIRy3oQ,9094
2
+ stackit/postgresflex/api_client.py,sha256=GEm4y-gCopI-sP2j6jQ7zFXSN_ATIt_PpJAHEzvOsg0,23936
5
3
  stackit/postgresflex/api_response.py,sha256=HRYkVqMNIlfODacTQPTbiVj2YdcnutpQrKJdeAoCSpM,642
6
4
  stackit/postgresflex/configuration.py,sha256=zsrENzCv9XNcJXnqzKbPkYzq_j39dRdenDcrpV1alBE,5727
7
- stackit/postgresflex/exceptions.py,sha256=RnOVa-R2uLIgSSl3-rMgTduTrIhx9qHv_TSjWKsMqb4,6429
8
- stackit/postgresflex/models/__init__.py,sha256=oBp-6m5SJb8vIyBJuwDFtOwR-mjVjZ9dLDcnpABxjoA,4940
5
+ stackit/postgresflex/exceptions.py,sha256=8303B2HYwDrW_0t83-NgLqN0DPFot2M4SIi-4xnopB8,6424
6
+ stackit/postgresflex/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
7
+ stackit/postgresflex/rest.py,sha256=tJgc6A80pvzRWAeQASsKaUDYZzOl6F6xCDghElq-M58,6419
8
+ stackit/postgresflex/api/__init__.py,sha256=o9Yn39BawyTTsTGsVzVPZ5-Or_0CKwHlAAAIUMqtxjc,107
9
+ stackit/postgresflex/api/default_api.py,sha256=uKbO0E72NfnijDg04ASrhgr62cAkUG0xx8mPVQ9QXFw,326877
10
+ stackit/postgresflex/models/__init__.py,sha256=DQHOxw-ZI_H4Dr_1Z78NpE__FcOD0IdLKAl34pQAbLs,5008
9
11
  stackit/postgresflex/models/acl.py,sha256=VMNlqiVOsQNH1o6zOJ08EpOJ9Z-4G3bpkoPxchHRXzo,2389
10
12
  stackit/postgresflex/models/api_configuration.py,sha256=kcfW_iCHJfwu6KYONrzurkmOz2VTJwWgjgXN0_OfOfg,2513
11
- stackit/postgresflex/models/api_extension_config_load_response.py,sha256=RiARFfirNrzAiWluvOv5YpsM6wnYeymuSaVULXbhDTo,3289
12
- stackit/postgresflex/models/api_extension_configure_response.py,sha256=WOG-nGFmXFjykwOg7KNrKdfqOxXWdzkLDbiWcRL7WNk,3285
13
+ stackit/postgresflex/models/api_extension_config_load_response.py,sha256=BqhTuUU_CljUhushNPtF-2sTp8cChLrdVh_hOPcqhwc,3331
14
+ stackit/postgresflex/models/api_extension_configure_response.py,sha256=Y-Znp78ahe4BHkFMA4_XTcAnrE-pspNnkDfla9huMkA,3327
13
15
  stackit/postgresflex/models/api_extension_delete_response.py,sha256=sk-aBWkjWNWGPEPqG_oKCa5cwShCPo4hGa9h4Kc6ur8,2540
14
16
  stackit/postgresflex/models/api_extension_list.py,sha256=By2r9WOefSN2NJRf6kI7VuEsIrblRD5dHa1RdErlDGA,2636
15
17
  stackit/postgresflex/models/api_extension_load_response.py,sha256=f4-R2kRS9dGou-GFObFP1k7AH6hhlBq4qVFWWWgPunA,2821
16
18
  stackit/postgresflex/models/api_install_response.py,sha256=RvZuJwoBkSZtoNkk3p7rKmcqvao98XkECA3sQKenPRo,2797
17
- stackit/postgresflex/models/api_installed_list_response.py,sha256=MtkqzjmBIr26CPC0F1ROt0mxCmWHbgUvwCFvEPPr5Og,3098
19
+ stackit/postgresflex/models/api_installed_list_response.py,sha256=eC0oJ6xOINuPW-0sYcL9O30XiAhw-7py98nG3xMKqJY,3128
18
20
  stackit/postgresflex/models/backup.py,sha256=IbDi5GfoZYX5Fufh1CVxTDRtM484lvJHgvvkL27enmE,3197
19
21
  stackit/postgresflex/models/clone_instance_payload.py,sha256=E7CgsUn2XlwEUJ8BSj8FuuWKejLyuio4Cl3BFDAj8Dc,2830
20
22
  stackit/postgresflex/models/clone_instance_response.py,sha256=h2KnTxcmAUl0H4W4TBxGjzWsXShJJ6tUphtWAoItJU8,2518
@@ -25,45 +27,44 @@ stackit/postgresflex/models/create_user_payload.py,sha256=0h-257fraY-V1ZSteY_p3P
25
27
  stackit/postgresflex/models/create_user_response.py,sha256=DN63jE-Xsn3g1fmEMDZANSJyxkk1eF3xbyqjpbpyYKE,2680
26
28
  stackit/postgresflex/models/error.py,sha256=4ttuCN1FR5DBpDSma6-WQTGFjuUsk3tBffkg-h4ZFBk,2746
27
29
  stackit/postgresflex/models/extensions_configuration.py,sha256=cgh8PTDyWdAecmrkH7uUKQsYWrtmrD1MyOxeebefYuI,2541
28
- stackit/postgresflex/models/extensions_extension_list_response.py,sha256=9SUCKMg1v6drOYeP9LUloM_FxeMY_J7X_6BhewhYkkY,3081
29
- stackit/postgresflex/models/extensions_new_config.py,sha256=1SaZma90FS5kMShIqfR-I_O-b6aGNbnV1pogXttuWP8,3141
30
+ stackit/postgresflex/models/extensions_extension_list_response.py,sha256=MowYGyzR53jkERFNCzSB_2_G4QVDEH6kWlm2NEOPWM4,3096
31
+ stackit/postgresflex/models/extensions_new_config.py,sha256=huLYPS026gg2PwSfuR9ADxloS_Pj2lVpuNmP3kVXCNA,3183
30
32
  stackit/postgresflex/models/flavor.py,sha256=Ekl3cEKkY4s-coBgWuYEV-KCZ89bBqNBn_BS_mUf3Vg,2737
31
33
  stackit/postgresflex/models/get_backup_response.py,sha256=GkjM51Y06qTqFAXzvBpRqlOLHX8Rm5B5SJox05V5uZs,2684
32
34
  stackit/postgresflex/models/get_user_response.py,sha256=sJDbGrb5bevbCOthQxEUrrtl3ZVRbvxQq_8XlQN85zQ,2723
33
35
  stackit/postgresflex/models/instance.py,sha256=HFLjdjr78yktO6ZUIGzI8SSbVklLKGQHT8ysd921qCM,4268
34
36
  stackit/postgresflex/models/instance_create_database_response.py,sha256=RSU_KDtLkUfaUCau-h8PHayh3F2GAxIsaBX0eHWZxcM,2479
35
- stackit/postgresflex/models/instance_data_point.py,sha256=4PD-XDt7uGGJ6zOpoxogu6LmfnK9B2xolzowIgN1cjY,2580
37
+ stackit/postgresflex/models/instance_data_point.py,sha256=qE46M6gg-vPGYfZt64w5rynvT1m-Wi_hWydgrqDaVGc,2605
36
38
  stackit/postgresflex/models/instance_database.py,sha256=WBexroR97k56QpHTtp0_mvoLt0clzST3iRtdG6WHyV4,2643
37
- stackit/postgresflex/models/instance_host.py,sha256=n-QiwQ2VgvtCnFzYqSwlXbGSa8plxjsu2ZOa7Ip3GPM,3213
38
- stackit/postgresflex/models/instance_host_metric.py,sha256=MLRO1N3-vfLOXtnPYTH4LNyjdUqJgzlr5i8DGYER_rk,3275
39
- stackit/postgresflex/models/instance_list_databases_response.py,sha256=SP5Y1oqPSagITzvIZuJEixqwiKLRCEU_US9STIzg1k4,3117
39
+ stackit/postgresflex/models/instance_host.py,sha256=Ck3JApd8-kHk1793xbsHo_FThhlQ1WOqfLIBlQGRwHE,3252
40
+ stackit/postgresflex/models/instance_host_metric.py,sha256=hv3IP4YrJ9Er2nyX2vtv_czP_soUtA58cPyEbTTcJOg,3308
41
+ stackit/postgresflex/models/instance_list_databases_response.py,sha256=9bALRoSeS3WgbFvir8aneffGs6IKrBxsGI2TAgdzAp4,3147
40
42
  stackit/postgresflex/models/instance_list_instance.py,sha256=BjL28VdTIRycTK96umTaeVsHokYj6RTLqrCIVFnDqS4,2587
41
- stackit/postgresflex/models/instance_metrics_response.py,sha256=40ipXjcr39_ZxTff-KHyPTHWJQKMS-wsG2BOuRTKmy8,3001
43
+ stackit/postgresflex/models/instance_metrics_response.py,sha256=qGE82k0sHzWS-IyPoQ-DftzB_gJ1XqQtCu4Pe5WzYZ0,3019
42
44
  stackit/postgresflex/models/instance_response.py,sha256=O5BPZvpcWb8lWuD-OBaLkcVAwGNSm4ZUFTjdFMfuX3Q,2688
43
- stackit/postgresflex/models/list_backups_response.py,sha256=66FFoB2YG8Ho43OkXD54uQMh9XplbxmomxXyiPlSv4w,3022
44
- stackit/postgresflex/models/list_flavors_response.py,sha256=PmqL2H530FsDgSMGbkxZPOYgunt8wiMiHEd992bF9TY,2978
45
- stackit/postgresflex/models/list_instances_response.py,sha256=aHnRpGklHxwUwJiRuDYBK9kFfjEMb7gW3EXzqpA9F2w,3168
45
+ stackit/postgresflex/models/list_backups_response.py,sha256=USnL_Bm9_rLTY8zkgcK1T3BFNVLgbrXRDRaASq1MuXc,3040
46
+ stackit/postgresflex/models/list_flavors_response.py,sha256=KvETDBTY8AqJXwjWB0D08mx5HpapPeijCdzFQLFFMCE,3002
47
+ stackit/postgresflex/models/list_instances_response.py,sha256=4nE1noBgQRfq8NWUeUPxerzL6xamuaBryPg0Lxsx4MQ,3186
46
48
  stackit/postgresflex/models/list_storages_response.py,sha256=SKDggdi8kq2cWvMUcWRGcaT5fRxUlYuX67qfvtYd3hg,3117
47
- stackit/postgresflex/models/list_users_response.py,sha256=cbGtIR6HIJRouWFtSD2DzyE-cnSryQfN7ovIYH5AdC8,3157
49
+ stackit/postgresflex/models/list_users_response.py,sha256=ns-nbxAZ4hEySWV1MY76pNYF7rq4xW1t7JFJgIIJtpE,3175
48
50
  stackit/postgresflex/models/list_users_response_item.py,sha256=YxBZu1fHIFAoqIUopnZmjK9PBat5K0k2htMEgkKpdXc,2529
49
51
  stackit/postgresflex/models/list_versions_response.py,sha256=XwhocZU7wRILhDqobX144q7_WrEtg_GJRXAbpEiF4GM,2469
50
- stackit/postgresflex/models/partial_update_instance_payload.py,sha256=CZ3L8NL3lRJ97z1eAQVVvS9X7ODJnPZCfzC3T18P1Ho,4110
52
+ stackit/postgresflex/models/partial_update_instance_payload.py,sha256=ds6PiuAHpEO_zhrIeg8vpK5BBxwasARutBUoHsl7UH4,4135
51
53
  stackit/postgresflex/models/partial_update_instance_response.py,sha256=8DH8msuD1ScR8H4a5ygzM5A8slkN6Vk-FulMx4uVm90,2740
52
54
  stackit/postgresflex/models/partial_update_user_payload.py,sha256=GiZbQJFJEQbh8RaY5JXKuVrd70C7mB-ChtW3wZPg5jk,2559
53
- stackit/postgresflex/models/postgres_database_parameter.py,sha256=tRLOx638HEu_lwolKPP45HtRUW6kP30xyLut_rMirYg,4935
54
- stackit/postgresflex/models/postgres_database_parameter_response.py,sha256=Vvj8ZvsLFe50ZI1MhyNgW-RArH9utTEcTUFbJM_I0CA,3238
55
+ stackit/postgresflex/models/postgres_database_parameter.py,sha256=junb5pUyqmneq91b3w25PpjhU7Uirecu8YGhlimEEko,4960
56
+ stackit/postgresflex/models/postgres_database_parameter_response.py,sha256=h4F2e_CjOC3V80mdXUXTHXKE0bX0ftmr8jSBrrlbQzE,3268
55
57
  stackit/postgresflex/models/reset_user_response.py,sha256=M3ygGTgntGahWQJ70T62fntUlPn_Qcbl5rbfAVZsg-A,2676
56
58
  stackit/postgresflex/models/storage.py,sha256=_L2q-TeB3UwLHUf_rELldKjZ6MiV2zoLvu4nDtwO5Ao,2521
57
59
  stackit/postgresflex/models/storage_range.py,sha256=YY-Avr2EqB7tMIctaIR5cxqhe-QiZ8BVvl5Q3Aw_PVo,2477
60
+ stackit/postgresflex/models/storage_update.py,sha256=MD45w7NHRGyTtwcGq0AZ9-j2CeI5Q7C-9_WmVqseBGY,2689
58
61
  stackit/postgresflex/models/update_backup_schedule_payload.py,sha256=jOv5BkCgRZSHeLkH4_8l4D1HtlBiKvKR7X1Tv0e9bVI,2538
59
- stackit/postgresflex/models/update_instance_payload.py,sha256=lYN-uFoQ7gZpyEKX-HFADtaRNJXezr-cD5YQEYl-WIU,4082
62
+ stackit/postgresflex/models/update_instance_payload.py,sha256=ZEnSqMzkxgtU202oTnR2pzzIm0G5xO-PYeoXcm7zH5A,4107
60
63
  stackit/postgresflex/models/update_user_payload.py,sha256=QkcvJ9jsAX57SxpfDw8LjtjQDqmbPpTUVdEX05GcSPI,2531
61
64
  stackit/postgresflex/models/user.py,sha256=odyvmpwuMJZ6tHcuO1gwoYyWiJiWBITc1S8oOmtGWmA,3095
62
65
  stackit/postgresflex/models/user_response.py,sha256=gnyYLdU-Nuy9Z3wKlDKkgMjC49dhZvT-KaZ4g3CiW0I,2841
63
- stackit/postgresflex/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
64
- stackit/postgresflex/rest.py,sha256=xuGxlzMEu5RvBFlH2JsbL6b7W3J-qzde7XmlvZP7hkU,5817
65
- stackit_postgresflex-1.1.0.dist-info/LICENSE.md,sha256=3dF8Tb7yZn2tS4zyNa-yNe-68pH8qyWdGz4ioMd3MgE,10933
66
- stackit_postgresflex-1.1.0.dist-info/METADATA,sha256=AAPzKiRwLccPst2Mo9c0mR-3hIB1InVNYqugkSwWstA,1723
67
- stackit_postgresflex-1.1.0.dist-info/NOTICE.txt,sha256=dfclnS31cAj0fpPzKDsJywff703M-uXw4rUhlfsixTM,67
68
- stackit_postgresflex-1.1.0.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
69
- stackit_postgresflex-1.1.0.dist-info/RECORD,,
66
+ stackit_postgresflex-1.2.1.dist-info/METADATA,sha256=g98e6ib600E7Ptre8q4Tjr9oasoeIoTiGuRnr-ls9M4,1805
67
+ stackit_postgresflex-1.2.1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
68
+ stackit_postgresflex-1.2.1.dist-info/licenses/LICENSE.md,sha256=3dF8Tb7yZn2tS4zyNa-yNe-68pH8qyWdGz4ioMd3MgE,10933
69
+ stackit_postgresflex-1.2.1.dist-info/licenses/NOTICE.txt,sha256=dfclnS31cAj0fpPzKDsJywff703M-uXw4rUhlfsixTM,67
70
+ stackit_postgresflex-1.2.1.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: poetry-core 2.1.3
2
+ Generator: hatchling 1.27.0
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any