stackit-sqlserverflex 1.2.0__py3-none-any.whl → 1.4.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.
- stackit/sqlserverflex/__init__.py +133 -94
- stackit/sqlserverflex/api/default_api.py +1982 -1540
- stackit/sqlserverflex/api_client.py +6 -7
- stackit/sqlserverflex/api_response.py +0 -1
- stackit/sqlserverflex/configuration.py +6 -7
- stackit/sqlserverflex/exceptions.py +6 -6
- stackit/sqlserverflex/models/__init__.py +74 -52
- stackit/sqlserverflex/models/{restore_running_restore.py → backup_running_restore.py} +16 -16
- stackit/sqlserverflex/models/backup_sort.py +47 -0
- stackit/sqlserverflex/models/create_database_payload.py +18 -22
- stackit/sqlserverflex/models/create_database_response.py +8 -8
- stackit/sqlserverflex/models/create_instance_payload.py +44 -44
- stackit/sqlserverflex/models/{instance_documentation_options.py → create_instance_payload_network.py} +22 -18
- stackit/sqlserverflex/models/create_instance_response.py +8 -8
- stackit/sqlserverflex/models/create_user_payload.py +14 -10
- stackit/sqlserverflex/models/create_user_response.py +40 -15
- stackit/sqlserverflex/models/{mssql_database_collation.py → database_getcollation.py} +10 -10
- stackit/sqlserverflex/models/{mssql_database_compatibility.py → database_getcompatibility.py} +10 -10
- stackit/sqlserverflex/models/{database.py → database_roles.py} +14 -15
- stackit/sqlserverflex/models/database_sort.py +45 -0
- stackit/sqlserverflex/models/{instance_error.py → error.py} +17 -19
- stackit/sqlserverflex/models/{list_users_response.py → external_s3.py} +32 -26
- stackit/sqlserverflex/models/flavor_sort.py +53 -0
- stackit/sqlserverflex/models/flavor_storage_classes_storage_class.py +91 -0
- stackit/sqlserverflex/models/{storage_range.py → flavor_storage_range.py} +13 -13
- stackit/sqlserverflex/models/get_backup_response.py +17 -23
- stackit/sqlserverflex/models/get_database_response.py +25 -15
- stackit/sqlserverflex/models/get_instance_response.py +90 -15
- stackit/sqlserverflex/models/get_user_response.py +24 -15
- stackit/sqlserverflex/models/instance_edition.py +38 -0
- stackit/sqlserverflex/models/{database_documentation_create_database_request_options.py → instance_encryption.py} +19 -19
- stackit/sqlserverflex/models/{single_database.py → instance_network.py} +26 -21
- stackit/sqlserverflex/models/instance_network_access_scope.py +37 -0
- stackit/sqlserverflex/models/instance_sort.py +45 -0
- stackit/sqlserverflex/models/instance_version.py +36 -0
- stackit/sqlserverflex/models/instance_version_opt.py +36 -0
- stackit/sqlserverflex/models/{backup.py → list_backup.py} +22 -24
- stackit/sqlserverflex/models/{backup_list_backups_response_grouped.py → list_backup_response.py} +23 -17
- stackit/sqlserverflex/models/list_backups_response.py +22 -22
- stackit/sqlserverflex/models/list_collations_response.py +10 -10
- stackit/sqlserverflex/models/list_compatibility_response.py +11 -11
- stackit/sqlserverflex/models/{list_restore_jobs_response.py → list_current_running_restore_jobs.py} +15 -13
- stackit/sqlserverflex/models/{flavor.py → list_database.py} +17 -22
- stackit/sqlserverflex/models/list_databases_response.py +18 -12
- stackit/sqlserverflex/models/list_flavors.py +129 -0
- stackit/sqlserverflex/models/list_flavors_response.py +18 -12
- stackit/sqlserverflex/models/{instance_flavor_entry.py → list_instance.py} +27 -21
- stackit/sqlserverflex/models/list_instances_response.py +25 -21
- stackit/sqlserverflex/models/list_roles_response.py +8 -8
- stackit/sqlserverflex/models/list_storages_response.py +28 -12
- stackit/sqlserverflex/models/list_user.py +85 -0
- stackit/sqlserverflex/models/list_user_response.py +104 -0
- stackit/sqlserverflex/models/list_versions_response.py +24 -9
- stackit/sqlserverflex/models/{instance_documentation_storage.py → pagination.py} +20 -16
- stackit/sqlserverflex/models/partial_update_instance_payload.py +47 -25
- stackit/sqlserverflex/models/{instance_documentation_acl.py → partial_update_instance_payload_network.py} +13 -13
- stackit/sqlserverflex/models/replicas.py +37 -0
- stackit/sqlserverflex/models/reset_user_response.py +20 -15
- stackit/sqlserverflex/models/{host.py → restore_database_from_backup_payload.py} +23 -25
- stackit/sqlserverflex/models/restore_database_from_backup_payload_source.py +150 -0
- stackit/sqlserverflex/models/s3file_info.py +84 -0
- stackit/sqlserverflex/models/source_backup.py +90 -0
- stackit/sqlserverflex/models/source_external_s3.py +107 -0
- stackit/sqlserverflex/models/state.py +41 -0
- stackit/sqlserverflex/models/storage.py +11 -9
- stackit/sqlserverflex/models/{instance_list_instance.py → storage_create.py} +15 -16
- stackit/sqlserverflex/models/{instance_list_user.py → storage_update.py} +14 -15
- stackit/sqlserverflex/models/{trigger_database_restore_payload.py → trigger_restore_payload.py} +13 -12
- stackit/sqlserverflex/models/update_instance_payload.py +48 -24
- stackit/sqlserverflex/models/{acl.py → update_instance_payload_network.py} +14 -14
- stackit/sqlserverflex/models/update_instance_protection_payload.py +83 -0
- stackit/sqlserverflex/models/update_instance_protection_response.py +83 -0
- stackit/sqlserverflex/models/user_sort.py +43 -0
- stackit/sqlserverflex/models/{host_metric.py → validation_error.py} +29 -27
- stackit/sqlserverflex/models/validation_error_validation_inner.py +84 -0
- stackit/sqlserverflex/models/{database_options.py → version.py} +28 -20
- stackit/sqlserverflex/rest.py +6 -7
- {stackit_sqlserverflex-1.2.0.dist-info → stackit_sqlserverflex-1.4.0.dist-info}/METADATA +3 -4
- stackit_sqlserverflex-1.4.0.dist-info/RECORD +84 -0
- {stackit_sqlserverflex-1.2.0.dist-info → stackit_sqlserverflex-1.4.0.dist-info}/WHEEL +1 -1
- stackit/sqlserverflex/models/data_point.py +0 -90
- stackit/sqlserverflex/models/instance.py +0 -129
- stackit/sqlserverflex/models/list_metrics_response.py +0 -94
- stackit/sqlserverflex/models/single_user.py +0 -110
- stackit/sqlserverflex/models/type.py +0 -41
- stackit/sqlserverflex/models/update_instance_response.py +0 -88
- stackit/sqlserverflex/models/user.py +0 -101
- stackit/sqlserverflex/models/user_response_user.py +0 -97
- stackit_sqlserverflex-1.2.0.dist-info/RECORD +0 -70
- {stackit_sqlserverflex-1.2.0.dist-info → stackit_sqlserverflex-1.4.0.dist-info}/licenses/LICENSE.md +0 -0
- {stackit_sqlserverflex-1.2.0.dist-info → stackit_sqlserverflex-1.4.0.dist-info}/licenses/NOTICE.txt +0 -0
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
STACKIT MSSQL Service API
|
|
5
|
+
|
|
6
|
+
This is the documentation for the STACKIT MSSQL service
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 3.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
|
+
from enum import Enum
|
|
19
|
+
|
|
20
|
+
from typing_extensions import Self
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
class Replicas(int, Enum):
|
|
24
|
+
"""
|
|
25
|
+
How many replicas the instance should have.
|
|
26
|
+
"""
|
|
27
|
+
|
|
28
|
+
"""
|
|
29
|
+
allowed enum values
|
|
30
|
+
"""
|
|
31
|
+
NUMBER_1 = 1
|
|
32
|
+
NUMBER_3 = 3
|
|
33
|
+
|
|
34
|
+
@classmethod
|
|
35
|
+
def from_json(cls, json_str: str) -> Self:
|
|
36
|
+
"""Create an instance of Replicas from a JSON string"""
|
|
37
|
+
return cls(json.loads(json_str))
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
# coding: utf-8
|
|
2
2
|
|
|
3
3
|
"""
|
|
4
|
-
|
|
4
|
+
STACKIT MSSQL Service API
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
This is the documentation for the STACKIT MSSQL service
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
The version of the OpenAPI document: 3.0.0
|
|
9
|
+
Contact: support@stackit.cloud
|
|
10
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
Do not edit the class manually.
|
|
13
13
|
""" # noqa: E501
|
|
14
14
|
|
|
15
15
|
from __future__ import annotations
|
|
@@ -18,20 +18,21 @@ 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
|
|
21
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictStr
|
|
22
22
|
from pydantic_core import to_jsonable_python
|
|
23
23
|
from typing_extensions import Self
|
|
24
24
|
|
|
25
|
-
from stackit.sqlserverflex.models.single_user import SingleUser
|
|
26
|
-
|
|
27
25
|
|
|
28
26
|
class ResetUserResponse(BaseModel):
|
|
29
27
|
"""
|
|
30
28
|
ResetUserResponse
|
|
31
29
|
""" # noqa: E501
|
|
32
30
|
|
|
33
|
-
|
|
34
|
-
|
|
31
|
+
password: StrictStr = Field(description="The password for the user.")
|
|
32
|
+
status: StrictStr = Field(description="The current status of the user.")
|
|
33
|
+
uri: StrictStr = Field(description="The connection string for the user to the instance.")
|
|
34
|
+
username: StrictStr = Field(description="The name of the user.")
|
|
35
|
+
__properties: ClassVar[List[str]] = ["password", "status", "uri", "username"]
|
|
35
36
|
|
|
36
37
|
model_config = ConfigDict(
|
|
37
38
|
validate_by_name=True,
|
|
@@ -70,9 +71,6 @@ class ResetUserResponse(BaseModel):
|
|
|
70
71
|
exclude=excluded_fields,
|
|
71
72
|
exclude_none=True,
|
|
72
73
|
)
|
|
73
|
-
# override the default output from pydantic by calling `to_dict()` of item
|
|
74
|
-
if self.item:
|
|
75
|
-
_dict["item"] = self.item.to_dict()
|
|
76
74
|
return _dict
|
|
77
75
|
|
|
78
76
|
@classmethod
|
|
@@ -84,5 +82,12 @@ class ResetUserResponse(BaseModel):
|
|
|
84
82
|
if not isinstance(obj, dict):
|
|
85
83
|
return cls.model_validate(obj)
|
|
86
84
|
|
|
87
|
-
_obj = cls.model_validate(
|
|
85
|
+
_obj = cls.model_validate(
|
|
86
|
+
{
|
|
87
|
+
"password": obj.get("password"),
|
|
88
|
+
"status": obj.get("status"),
|
|
89
|
+
"uri": obj.get("uri"),
|
|
90
|
+
"username": obj.get("username"),
|
|
91
|
+
}
|
|
92
|
+
)
|
|
88
93
|
return _obj
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
# coding: utf-8
|
|
2
2
|
|
|
3
3
|
"""
|
|
4
|
-
|
|
4
|
+
STACKIT MSSQL Service API
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
This is the documentation for the STACKIT MSSQL service
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
The version of the OpenAPI document: 3.0.0
|
|
9
|
+
Contact: support@stackit.cloud
|
|
10
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
Do not edit the class manually.
|
|
13
13
|
""" # noqa: E501
|
|
14
14
|
|
|
15
15
|
from __future__ import annotations
|
|
@@ -22,17 +22,19 @@ from pydantic import BaseModel, ConfigDict, Field, StrictStr
|
|
|
22
22
|
from pydantic_core import to_jsonable_python
|
|
23
23
|
from typing_extensions import Self
|
|
24
24
|
|
|
25
|
-
from stackit.sqlserverflex.models.
|
|
25
|
+
from stackit.sqlserverflex.models.restore_database_from_backup_payload_source import (
|
|
26
|
+
RestoreDatabaseFromBackupPayloadSource,
|
|
27
|
+
)
|
|
26
28
|
|
|
27
29
|
|
|
28
|
-
class
|
|
30
|
+
class RestoreDatabaseFromBackupPayload(BaseModel):
|
|
29
31
|
"""
|
|
30
|
-
|
|
32
|
+
Request to restore a database.
|
|
31
33
|
""" # noqa: E501
|
|
32
34
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
__properties: ClassVar[List[str]] = ["
|
|
35
|
+
database_name: StrictStr = Field(description="The name of the database on the instance to be restore.")
|
|
36
|
+
source: RestoreDatabaseFromBackupPayloadSource
|
|
37
|
+
__properties: ClassVar[List[str]] = ["database_name", "source"]
|
|
36
38
|
|
|
37
39
|
model_config = ConfigDict(
|
|
38
40
|
validate_by_name=True,
|
|
@@ -51,7 +53,7 @@ class Host(BaseModel):
|
|
|
51
53
|
|
|
52
54
|
@classmethod
|
|
53
55
|
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
54
|
-
"""Create an instance of
|
|
56
|
+
"""Create an instance of RestoreDatabaseFromBackupPayload from a JSON string"""
|
|
55
57
|
return cls.from_dict(json.loads(json_str))
|
|
56
58
|
|
|
57
59
|
def to_dict(self) -> Dict[str, Any]:
|
|
@@ -71,18 +73,14 @@ class Host(BaseModel):
|
|
|
71
73
|
exclude=excluded_fields,
|
|
72
74
|
exclude_none=True,
|
|
73
75
|
)
|
|
74
|
-
# override the default output from pydantic by calling `to_dict()` of
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
for _item_host_metrics in self.host_metrics:
|
|
78
|
-
if _item_host_metrics:
|
|
79
|
-
_items.append(_item_host_metrics.to_dict())
|
|
80
|
-
_dict["hostMetrics"] = _items
|
|
76
|
+
# override the default output from pydantic by calling `to_dict()` of source
|
|
77
|
+
if self.source:
|
|
78
|
+
_dict["source"] = self.source.to_dict()
|
|
81
79
|
return _dict
|
|
82
80
|
|
|
83
81
|
@classmethod
|
|
84
82
|
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
85
|
-
"""Create an instance of
|
|
83
|
+
"""Create an instance of RestoreDatabaseFromBackupPayload from a dict"""
|
|
86
84
|
if obj is None:
|
|
87
85
|
return None
|
|
88
86
|
|
|
@@ -91,12 +89,12 @@ class Host(BaseModel):
|
|
|
91
89
|
|
|
92
90
|
_obj = cls.model_validate(
|
|
93
91
|
{
|
|
94
|
-
"
|
|
95
|
-
|
|
96
|
-
|
|
92
|
+
"database_name": obj.get("database_name"),
|
|
93
|
+
"source": (
|
|
94
|
+
RestoreDatabaseFromBackupPayloadSource.from_dict(obj["source"])
|
|
95
|
+
if obj.get("source") is not None
|
|
97
96
|
else None
|
|
98
97
|
),
|
|
99
|
-
"id": obj.get("id"),
|
|
100
98
|
}
|
|
101
99
|
)
|
|
102
100
|
return _obj
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
STACKIT MSSQL Service API
|
|
5
|
+
|
|
6
|
+
This is the documentation for the STACKIT MSSQL service
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 3.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, Dict, Optional, Set, Union
|
|
20
|
+
|
|
21
|
+
from pydantic import (
|
|
22
|
+
BaseModel,
|
|
23
|
+
ConfigDict,
|
|
24
|
+
ValidationError,
|
|
25
|
+
field_validator,
|
|
26
|
+
)
|
|
27
|
+
from typing_extensions import Self
|
|
28
|
+
|
|
29
|
+
from stackit.sqlserverflex.models.source_backup import SourceBackup
|
|
30
|
+
from stackit.sqlserverflex.models.source_external_s3 import SourceExternalS3
|
|
31
|
+
|
|
32
|
+
RESTOREDATABASEFROMBACKUPPAYLOADSOURCE_ONE_OF_SCHEMAS = ["SourceBackup", "SourceExternalS3"]
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
class RestoreDatabaseFromBackupPayloadSource(BaseModel):
|
|
36
|
+
"""
|
|
37
|
+
The source of the restore.
|
|
38
|
+
"""
|
|
39
|
+
|
|
40
|
+
# data type: SourceBackup
|
|
41
|
+
oneof_schema_1_validator: Optional[SourceBackup] = None
|
|
42
|
+
# data type: SourceExternalS3
|
|
43
|
+
oneof_schema_2_validator: Optional[SourceExternalS3] = None
|
|
44
|
+
actual_instance: Optional[Union[SourceBackup, SourceExternalS3]] = None
|
|
45
|
+
one_of_schemas: Set[str] = {"SourceBackup", "SourceExternalS3"}
|
|
46
|
+
|
|
47
|
+
model_config = ConfigDict(
|
|
48
|
+
validate_assignment=True,
|
|
49
|
+
protected_namespaces=(),
|
|
50
|
+
)
|
|
51
|
+
|
|
52
|
+
discriminator_value_class_map: Dict[str, str] = {}
|
|
53
|
+
|
|
54
|
+
def __init__(self, *args, **kwargs) -> None:
|
|
55
|
+
if args:
|
|
56
|
+
if len(args) > 1:
|
|
57
|
+
raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`")
|
|
58
|
+
if kwargs:
|
|
59
|
+
raise ValueError("If a position argument is used, keyword arguments cannot be used.")
|
|
60
|
+
super().__init__(actual_instance=args[0])
|
|
61
|
+
else:
|
|
62
|
+
super().__init__(**kwargs)
|
|
63
|
+
|
|
64
|
+
@field_validator("actual_instance")
|
|
65
|
+
def actual_instance_must_validate_oneof(cls, v):
|
|
66
|
+
instance = RestoreDatabaseFromBackupPayloadSource.model_construct()
|
|
67
|
+
error_messages = []
|
|
68
|
+
match = 0
|
|
69
|
+
# validate data type: SourceBackup
|
|
70
|
+
if not isinstance(v, SourceBackup):
|
|
71
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `SourceBackup`")
|
|
72
|
+
else:
|
|
73
|
+
match += 1
|
|
74
|
+
# validate data type: SourceExternalS3
|
|
75
|
+
if not isinstance(v, SourceExternalS3):
|
|
76
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `SourceExternalS3`")
|
|
77
|
+
else:
|
|
78
|
+
match += 1
|
|
79
|
+
if match == 0:
|
|
80
|
+
# no match
|
|
81
|
+
raise ValueError(
|
|
82
|
+
"No match found when setting `actual_instance` in RestoreDatabaseFromBackupPayloadSource with oneOf schemas: SourceBackup, SourceExternalS3. Details: "
|
|
83
|
+
+ ", ".join(error_messages)
|
|
84
|
+
)
|
|
85
|
+
else:
|
|
86
|
+
return v
|
|
87
|
+
|
|
88
|
+
@classmethod
|
|
89
|
+
def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self:
|
|
90
|
+
return cls.from_json(json.dumps(obj))
|
|
91
|
+
|
|
92
|
+
@classmethod
|
|
93
|
+
def from_json(cls, json_str: str) -> Self:
|
|
94
|
+
"""Returns the object represented by the json string"""
|
|
95
|
+
instance = cls.model_construct()
|
|
96
|
+
error_messages = []
|
|
97
|
+
match = 0
|
|
98
|
+
|
|
99
|
+
# deserialize data into SourceBackup
|
|
100
|
+
try:
|
|
101
|
+
instance.actual_instance = SourceBackup.from_json(json_str)
|
|
102
|
+
match += 1
|
|
103
|
+
except (ValidationError, ValueError) as e:
|
|
104
|
+
error_messages.append(str(e))
|
|
105
|
+
# deserialize data into SourceExternalS3
|
|
106
|
+
try:
|
|
107
|
+
instance.actual_instance = SourceExternalS3.from_json(json_str)
|
|
108
|
+
match += 1
|
|
109
|
+
except (ValidationError, ValueError) as e:
|
|
110
|
+
error_messages.append(str(e))
|
|
111
|
+
|
|
112
|
+
if match > 1:
|
|
113
|
+
# more than 1 match
|
|
114
|
+
raise ValueError(
|
|
115
|
+
"Multiple matches found when deserializing the JSON string into RestoreDatabaseFromBackupPayloadSource with oneOf schemas: SourceBackup, SourceExternalS3. Details: "
|
|
116
|
+
+ ", ".join(error_messages)
|
|
117
|
+
)
|
|
118
|
+
elif match == 0:
|
|
119
|
+
# no match
|
|
120
|
+
raise ValueError(
|
|
121
|
+
"No match found when deserializing the JSON string into RestoreDatabaseFromBackupPayloadSource with oneOf schemas: SourceBackup, SourceExternalS3. Details: "
|
|
122
|
+
+ ", ".join(error_messages)
|
|
123
|
+
)
|
|
124
|
+
else:
|
|
125
|
+
return instance
|
|
126
|
+
|
|
127
|
+
def to_json(self) -> str:
|
|
128
|
+
"""Returns the JSON representation of the actual instance"""
|
|
129
|
+
if self.actual_instance is None:
|
|
130
|
+
return "null"
|
|
131
|
+
|
|
132
|
+
if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json):
|
|
133
|
+
return self.actual_instance.to_json()
|
|
134
|
+
else:
|
|
135
|
+
return json.dumps(self.actual_instance)
|
|
136
|
+
|
|
137
|
+
def to_dict(self) -> Optional[Union[Dict[str, Any], SourceBackup, SourceExternalS3]]:
|
|
138
|
+
"""Returns the dict representation of the actual instance"""
|
|
139
|
+
if self.actual_instance is None:
|
|
140
|
+
return None
|
|
141
|
+
|
|
142
|
+
if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict):
|
|
143
|
+
return self.actual_instance.to_dict()
|
|
144
|
+
else:
|
|
145
|
+
# primitive type
|
|
146
|
+
return self.actual_instance
|
|
147
|
+
|
|
148
|
+
def to_str(self) -> str:
|
|
149
|
+
"""Returns the string representation of the actual instance"""
|
|
150
|
+
return pprint.pformat(self.model_dump())
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
STACKIT MSSQL Service API
|
|
5
|
+
|
|
6
|
+
This is the documentation for the STACKIT MSSQL service
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 3.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 pydantic_core import to_jsonable_python
|
|
23
|
+
from typing_extensions import Self
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
class S3fileInfo(BaseModel):
|
|
27
|
+
"""
|
|
28
|
+
S3fileInfo
|
|
29
|
+
""" # noqa: E501
|
|
30
|
+
|
|
31
|
+
file_number: Optional[StrictInt] = Field(default=None, description="The sequence number of the file")
|
|
32
|
+
file_path: Optional[StrictStr] = Field(default=None, description="The path to the file on the S3 bucket")
|
|
33
|
+
__properties: ClassVar[List[str]] = ["file_number", "file_path"]
|
|
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 S3fileInfo 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
|
+
return _dict
|
|
73
|
+
|
|
74
|
+
@classmethod
|
|
75
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
76
|
+
"""Create an instance of S3fileInfo from a dict"""
|
|
77
|
+
if obj is None:
|
|
78
|
+
return None
|
|
79
|
+
|
|
80
|
+
if not isinstance(obj, dict):
|
|
81
|
+
return cls.model_validate(obj)
|
|
82
|
+
|
|
83
|
+
_obj = cls.model_validate({"file_number": obj.get("file_number"), "file_path": obj.get("file_path")})
|
|
84
|
+
return _obj
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
STACKIT MSSQL Service API
|
|
5
|
+
|
|
6
|
+
This is the documentation for the STACKIT MSSQL service
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 3.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, StrictStr, field_validator
|
|
22
|
+
from pydantic_core import to_jsonable_python
|
|
23
|
+
from typing_extensions import Self
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
class SourceBackup(BaseModel):
|
|
27
|
+
"""
|
|
28
|
+
Restore from an existing managed backup.
|
|
29
|
+
""" # noqa: E501
|
|
30
|
+
|
|
31
|
+
type: StrictStr
|
|
32
|
+
__properties: ClassVar[List[str]] = ["type"]
|
|
33
|
+
|
|
34
|
+
@field_validator("type")
|
|
35
|
+
def type_validate_enum(cls, value):
|
|
36
|
+
"""Validates the enum"""
|
|
37
|
+
if value not in set(["BACKUP"]):
|
|
38
|
+
raise ValueError("must be one of enum values ('BACKUP')")
|
|
39
|
+
return value
|
|
40
|
+
|
|
41
|
+
model_config = ConfigDict(
|
|
42
|
+
validate_by_name=True,
|
|
43
|
+
validate_by_alias=True,
|
|
44
|
+
validate_assignment=True,
|
|
45
|
+
protected_namespaces=(),
|
|
46
|
+
)
|
|
47
|
+
|
|
48
|
+
def to_str(self) -> str:
|
|
49
|
+
"""Returns the string representation of the model using alias"""
|
|
50
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
51
|
+
|
|
52
|
+
def to_json(self) -> str:
|
|
53
|
+
"""Returns the JSON representation of the model using alias"""
|
|
54
|
+
return json.dumps(to_jsonable_python(self.to_dict()))
|
|
55
|
+
|
|
56
|
+
@classmethod
|
|
57
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
58
|
+
"""Create an instance of SourceBackup from a JSON string"""
|
|
59
|
+
return cls.from_dict(json.loads(json_str))
|
|
60
|
+
|
|
61
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
62
|
+
"""Return the dictionary representation of the model using alias.
|
|
63
|
+
|
|
64
|
+
This has the following differences from calling pydantic's
|
|
65
|
+
`self.model_dump(by_alias=True)`:
|
|
66
|
+
|
|
67
|
+
* `None` is only added to the output dict for nullable fields that
|
|
68
|
+
were set at model initialization. Other fields with value `None`
|
|
69
|
+
are ignored.
|
|
70
|
+
"""
|
|
71
|
+
excluded_fields: Set[str] = set([])
|
|
72
|
+
|
|
73
|
+
_dict = self.model_dump(
|
|
74
|
+
by_alias=True,
|
|
75
|
+
exclude=excluded_fields,
|
|
76
|
+
exclude_none=True,
|
|
77
|
+
)
|
|
78
|
+
return _dict
|
|
79
|
+
|
|
80
|
+
@classmethod
|
|
81
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
82
|
+
"""Create an instance of SourceBackup from a dict"""
|
|
83
|
+
if obj is None:
|
|
84
|
+
return None
|
|
85
|
+
|
|
86
|
+
if not isinstance(obj, dict):
|
|
87
|
+
return cls.model_validate(obj)
|
|
88
|
+
|
|
89
|
+
_obj = cls.model_validate({"type": obj.get("type")})
|
|
90
|
+
return _obj
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
STACKIT MSSQL Service API
|
|
5
|
+
|
|
6
|
+
This is the documentation for the STACKIT MSSQL service
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 3.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, StrictStr, field_validator
|
|
22
|
+
from pydantic_core import to_jsonable_python
|
|
23
|
+
from typing_extensions import Self
|
|
24
|
+
|
|
25
|
+
from stackit.sqlserverflex.models.external_s3 import ExternalS3
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
class SourceExternalS3(BaseModel):
|
|
29
|
+
"""
|
|
30
|
+
Restore from an external S3 backup file.
|
|
31
|
+
""" # noqa: E501
|
|
32
|
+
|
|
33
|
+
database_owner: StrictStr = Field(description="The owner of the database.")
|
|
34
|
+
logging_guid: Optional[StrictStr] = Field(
|
|
35
|
+
default=None, description="Logging guid to have a complete activity log over all sub stored procedures."
|
|
36
|
+
)
|
|
37
|
+
s3_details: ExternalS3
|
|
38
|
+
type: StrictStr
|
|
39
|
+
__properties: ClassVar[List[str]] = ["database_owner", "logging_guid", "s3_details", "type"]
|
|
40
|
+
|
|
41
|
+
@field_validator("type")
|
|
42
|
+
def type_validate_enum(cls, value):
|
|
43
|
+
"""Validates the enum"""
|
|
44
|
+
if value not in set(["EXTERNAL_S3"]):
|
|
45
|
+
raise ValueError("must be one of enum values ('EXTERNAL_S3')")
|
|
46
|
+
return value
|
|
47
|
+
|
|
48
|
+
model_config = ConfigDict(
|
|
49
|
+
validate_by_name=True,
|
|
50
|
+
validate_by_alias=True,
|
|
51
|
+
validate_assignment=True,
|
|
52
|
+
protected_namespaces=(),
|
|
53
|
+
)
|
|
54
|
+
|
|
55
|
+
def to_str(self) -> str:
|
|
56
|
+
"""Returns the string representation of the model using alias"""
|
|
57
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
58
|
+
|
|
59
|
+
def to_json(self) -> str:
|
|
60
|
+
"""Returns the JSON representation of the model using alias"""
|
|
61
|
+
return json.dumps(to_jsonable_python(self.to_dict()))
|
|
62
|
+
|
|
63
|
+
@classmethod
|
|
64
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
65
|
+
"""Create an instance of SourceExternalS3 from a JSON string"""
|
|
66
|
+
return cls.from_dict(json.loads(json_str))
|
|
67
|
+
|
|
68
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
69
|
+
"""Return the dictionary representation of the model using alias.
|
|
70
|
+
|
|
71
|
+
This has the following differences from calling pydantic's
|
|
72
|
+
`self.model_dump(by_alias=True)`:
|
|
73
|
+
|
|
74
|
+
* `None` is only added to the output dict for nullable fields that
|
|
75
|
+
were set at model initialization. Other fields with value `None`
|
|
76
|
+
are ignored.
|
|
77
|
+
"""
|
|
78
|
+
excluded_fields: Set[str] = set([])
|
|
79
|
+
|
|
80
|
+
_dict = self.model_dump(
|
|
81
|
+
by_alias=True,
|
|
82
|
+
exclude=excluded_fields,
|
|
83
|
+
exclude_none=True,
|
|
84
|
+
)
|
|
85
|
+
# override the default output from pydantic by calling `to_dict()` of s3_details
|
|
86
|
+
if self.s3_details:
|
|
87
|
+
_dict["s3_details"] = self.s3_details.to_dict()
|
|
88
|
+
return _dict
|
|
89
|
+
|
|
90
|
+
@classmethod
|
|
91
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
92
|
+
"""Create an instance of SourceExternalS3 from a dict"""
|
|
93
|
+
if obj is None:
|
|
94
|
+
return None
|
|
95
|
+
|
|
96
|
+
if not isinstance(obj, dict):
|
|
97
|
+
return cls.model_validate(obj)
|
|
98
|
+
|
|
99
|
+
_obj = cls.model_validate(
|
|
100
|
+
{
|
|
101
|
+
"database_owner": obj.get("database_owner"),
|
|
102
|
+
"logging_guid": obj.get("logging_guid"),
|
|
103
|
+
"s3_details": ExternalS3.from_dict(obj["s3_details"]) if obj.get("s3_details") is not None else None,
|
|
104
|
+
"type": obj.get("type"),
|
|
105
|
+
}
|
|
106
|
+
)
|
|
107
|
+
return _obj
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
STACKIT MSSQL Service API
|
|
5
|
+
|
|
6
|
+
This is the documentation for the STACKIT MSSQL service
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 3.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
|
+
from enum import Enum
|
|
19
|
+
|
|
20
|
+
from typing_extensions import Self
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
class State(str, Enum):
|
|
24
|
+
"""
|
|
25
|
+
State
|
|
26
|
+
"""
|
|
27
|
+
|
|
28
|
+
"""
|
|
29
|
+
allowed enum values
|
|
30
|
+
"""
|
|
31
|
+
READY = "READY"
|
|
32
|
+
PENDING = "PENDING"
|
|
33
|
+
PROGRESSING = "PROGRESSING"
|
|
34
|
+
FAILURE = "FAILURE"
|
|
35
|
+
UNKNOWN = "UNKNOWN"
|
|
36
|
+
TERMINATING = "TERMINATING"
|
|
37
|
+
|
|
38
|
+
@classmethod
|
|
39
|
+
def from_json(cls, json_str: str) -> Self:
|
|
40
|
+
"""Create an instance of State from a JSON string"""
|
|
41
|
+
return cls(json.loads(json_str))
|