python3-core-api-client 1.0.2__py3-none-any.whl → 1.0.4__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.
- cyberfusion/CoreApiClient/models.py +34 -6
- cyberfusion/CoreApiClient/resources/clusters.py +0 -11
- {python3_core_api_client-1.0.2.dist-info → python3_core_api_client-1.0.4.dist-info}/METADATA +2 -2
- {python3_core_api_client-1.0.2.dist-info → python3_core_api_client-1.0.4.dist-info}/RECORD +6 -6
- {python3_core_api_client-1.0.2.dist-info → python3_core_api_client-1.0.4.dist-info}/WHEEL +0 -0
- {python3_core_api_client-1.0.2.dist-info → python3_core_api_client-1.0.4.dist-info}/top_level.txt +0 -0
@@ -3,15 +3,43 @@ from __future__ import annotations
|
|
3
3
|
from datetime import datetime
|
4
4
|
from enum import StrEnum, IntEnum
|
5
5
|
from ipaddress import IPv4Address, IPv6Address
|
6
|
-
from typing import Dict, List, Literal, Optional, Union
|
6
|
+
from typing import Dict, List, Literal, Optional, Union, Any
|
7
7
|
|
8
8
|
from pydantic import UUID4, AnyUrl, EmailStr, Field, confloat, conint, constr, BaseModel
|
9
|
+
from typing import Iterator
|
9
10
|
|
10
11
|
|
11
12
|
class CoreApiModel(BaseModel):
|
12
13
|
pass
|
13
14
|
|
14
15
|
|
16
|
+
class RootModelCollectionMixin:
|
17
|
+
"""Mixin supporting iterating over and accessing items in a root model, without explicitly accessing __root__.
|
18
|
+
|
19
|
+
Inspired by https://docs.pydantic.dev/2.0/usage/models/#rootmodel-and-custom-root-types
|
20
|
+
"""
|
21
|
+
|
22
|
+
__root__: dict | list | None
|
23
|
+
|
24
|
+
def __iter__(self) -> Iterator:
|
25
|
+
if not isinstance(self.__root__, (list, dict)):
|
26
|
+
raise TypeError("Type does not support iter")
|
27
|
+
|
28
|
+
return iter(self.__root__)
|
29
|
+
|
30
|
+
def __getitem__(self, item: Any) -> Any:
|
31
|
+
if not isinstance(self.__root__, (list, dict)):
|
32
|
+
raise TypeError("Type does not support getitem")
|
33
|
+
|
34
|
+
return self.__root__[item]
|
35
|
+
|
36
|
+
def items(self) -> Any:
|
37
|
+
if not isinstance(self.__root__, (dict)):
|
38
|
+
raise TypeError("Type does not support items")
|
39
|
+
|
40
|
+
return self.__root__.items()
|
41
|
+
|
42
|
+
|
15
43
|
class APIUserAuthenticationMethod(StrEnum):
|
16
44
|
API_KEY = "API Key"
|
17
45
|
JWT_TOKEN = "JWT Token"
|
@@ -438,7 +466,7 @@ class ClusterIPAddress(CoreApiModel):
|
|
438
466
|
l3_ddos_protection_enabled: bool = Field(..., title="L3 Ddos Protection Enabled")
|
439
467
|
|
440
468
|
|
441
|
-
class ClusterIPAddresses(CoreApiModel):
|
469
|
+
class ClusterIPAddresses(RootModelCollectionMixin, CoreApiModel): # type: ignore[misc]
|
442
470
|
__root__: Optional[Dict[str, Dict[str, List[ClusterIPAddress]]]] = None
|
443
471
|
|
444
472
|
|
@@ -634,7 +662,7 @@ class CustomerIPAddressDatabase(CoreApiModel):
|
|
634
662
|
dns_name: Optional[str] = Field(..., title="Dns Name")
|
635
663
|
|
636
664
|
|
637
|
-
class CustomerIPAddresses(CoreApiModel):
|
665
|
+
class CustomerIPAddresses(RootModelCollectionMixin, CoreApiModel): # type: ignore[misc]
|
638
666
|
__root__: Optional[Dict[str, Dict[str, List[CustomerIPAddressDatabase]]]] = None
|
639
667
|
|
640
668
|
|
@@ -1380,7 +1408,7 @@ class MeilisearchEnvironmentEnum(StrEnum):
|
|
1380
1408
|
DEVELOPMENT = "development"
|
1381
1409
|
|
1382
1410
|
|
1383
|
-
class NestedPathsDict(CoreApiModel):
|
1411
|
+
class NestedPathsDict(RootModelCollectionMixin, CoreApiModel): # type: ignore[misc]
|
1384
1412
|
__root__: Optional[Dict[str, Optional[NestedPathsDict]]] = None
|
1385
1413
|
|
1386
1414
|
|
@@ -1570,7 +1598,7 @@ class PHPSettings(CoreApiModel):
|
|
1570
1598
|
post_max_size: conint(ge=32, le=256) = Field(32, title="Post Max Size")
|
1571
1599
|
upload_max_filesize: conint(ge=32, le=256) = Field(32, title="Upload Max Filesize")
|
1572
1600
|
tideways_api_key: Optional[
|
1573
|
-
constr(regex=r"^[a-zA-Z0-
|
1601
|
+
constr(regex=r"^[a-zA-Z0-9_]+$", min_length=16, max_length=32)
|
1574
1602
|
] = Field(None, title="Tideways Api Key")
|
1575
1603
|
tideways_sample_rate: Optional[conint(ge=1, le=100)] = Field(
|
1576
1604
|
None, title="Tideways Sample Rate"
|
@@ -1929,7 +1957,7 @@ class TombstoneDataVirtualHost(CoreApiModel):
|
|
1929
1957
|
|
1930
1958
|
|
1931
1959
|
class TombstoneIncludes(CoreApiModel):
|
1932
|
-
|
1960
|
+
cluster: ClusterResource
|
1933
1961
|
|
1934
1962
|
|
1935
1963
|
class TombstoneDataDatabase(CoreApiModel):
|
@@ -83,17 +83,6 @@ class Clusters(Resource):
|
|
83
83
|
).json
|
84
84
|
)
|
85
85
|
|
86
|
-
def delete_cluster(
|
87
|
-
self,
|
88
|
-
*,
|
89
|
-
id_: int,
|
90
|
-
) -> models.DetailMessage:
|
91
|
-
return models.DetailMessage.parse_obj(
|
92
|
-
self.api_connector.send_or_fail(
|
93
|
-
"DELETE", f"/api/v1/clusters/{id_}", data=None, query_parameters={}
|
94
|
-
).json
|
95
|
-
)
|
96
|
-
|
97
86
|
def get_borg_ssh_key(
|
98
87
|
self,
|
99
88
|
*,
|
{python3_core_api_client-1.0.2.dist-info → python3_core_api_client-1.0.4.dist-info}/METADATA
RENAMED
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: python3-core-api-client
|
3
|
-
Version: 1.0.
|
3
|
+
Version: 1.0.4
|
4
4
|
Summary: Python client for Core API.
|
5
5
|
Author-email: Cyberfusion <support@cyberfusion.io>
|
6
6
|
Project-URL: Source, https://github.com/CyberfusionIO/python3-core-api-client
|
@@ -13,7 +13,7 @@ Requires-Dist: pydantic[dotenv,email]==1.10.4
|
|
13
13
|
|
14
14
|
Python client for Core API.
|
15
15
|
|
16
|
-
This client was built for and tested on the **1.
|
16
|
+
This client was built for and tested on the **1.246** version of the API.
|
17
17
|
|
18
18
|
## Support
|
19
19
|
|
@@ -4,14 +4,14 @@ cyberfusion/CoreApiClient/connector.py,sha256=7yQs9fH8ldGHpw41xHU07NkXD5OPm3_pjc
|
|
4
4
|
cyberfusion/CoreApiClient/exceptions.py,sha256=fNxPtzVL4SzPiVNZmBTu1l8D57dkCxMxflyIXDPLE4Q,204
|
5
5
|
cyberfusion/CoreApiClient/http.py,sha256=z6ZyfQyUnA3QDCmej2BEIw9BOlTYoCE8zvTZ0-u_VoQ,429
|
6
6
|
cyberfusion/CoreApiClient/interfaces.py,sha256=P0wCbmSNEpB-eF49PHudc_qXM4blIXm4TsD2AB0z_7Q,269
|
7
|
-
cyberfusion/CoreApiClient/models.py,sha256=
|
7
|
+
cyberfusion/CoreApiClient/models.py,sha256=zYpoukhCTwfgb3sI-WcqGvFiPc38PgV8vU4g6cIUFw8,268346
|
8
8
|
cyberfusion/CoreApiClient/resources/__init__.py,sha256=E5VMFXttOmN7TjJt0WeARL_tYVoJcLoRoOnIYkCF748,1881
|
9
9
|
cyberfusion/CoreApiClient/resources/basic_authentication_realms.py,sha256=A0B4auQlBSV-kYrww613PwozMey-VsROguycrQBxB4E,2739
|
10
10
|
cyberfusion/CoreApiClient/resources/borg_archives.py,sha256=Dj5seJanmRYZZFSnaagJBkfR7LL-uYO5vpbjody-y0g,4346
|
11
11
|
cyberfusion/CoreApiClient/resources/borg_repositories.py,sha256=yXVQVU1NvgEdChybJdb9CmXt0tzMf5TdvcFClQKu-dQ,3970
|
12
12
|
cyberfusion/CoreApiClient/resources/certificate_managers.py,sha256=-I8on9nFymCytq7HzBixMgVUqsPQ0O6-9kGY8JNHB7I,2997
|
13
13
|
cyberfusion/CoreApiClient/resources/certificates.py,sha256=_ESvxxw1zw_DB1cqrL12nx4WYGBALMiLAt0vbZ7Wk5Q,1897
|
14
|
-
cyberfusion/CoreApiClient/resources/clusters.py,sha256=
|
14
|
+
cyberfusion/CoreApiClient/resources/clusters.py,sha256=eR6wZLxWCzxV3ElTu7SPalMVMGmoicCuLtYDR_g1xGE,6700
|
15
15
|
cyberfusion/CoreApiClient/resources/cmses.py,sha256=Z0gHxWV1Sm5WcNmZJwfxENntRaCY3ryOP6IJztiiy-I,8364
|
16
16
|
cyberfusion/CoreApiClient/resources/crons.py,sha256=jvg4CsW4lKz1zoJ4hY1gkN8HuRvTM2CLYf0gQKnnIro,2152
|
17
17
|
cyberfusion/CoreApiClient/resources/custom_config_snippets.py,sha256=va4xTVhp3bFDYM9DTsDKT7U-quA64k3lUgdVAX_zs6M,2748
|
@@ -53,7 +53,7 @@ cyberfusion/CoreApiClient/resources/tombstones.py,sha256=brtaywIKuIHfzrhAQSg8wtx
|
|
53
53
|
cyberfusion/CoreApiClient/resources/unix_users.py,sha256=64j14_pfh4jWgM1hzJUYCicHcYQ7CT84cFzePCp0zTg,3622
|
54
54
|
cyberfusion/CoreApiClient/resources/url_redirects.py,sha256=GBUin-MRtkuKk9191-8EsYc6iZf5X2cMOk_Y-xleW2s,2358
|
55
55
|
cyberfusion/CoreApiClient/resources/virtual_hosts.py,sha256=ZwlymtfSp8sMtglm8iGrUb7wpw4cGtFU6h5b7HTu9Kw,3702
|
56
|
-
python3_core_api_client-1.0.
|
57
|
-
python3_core_api_client-1.0.
|
58
|
-
python3_core_api_client-1.0.
|
59
|
-
python3_core_api_client-1.0.
|
56
|
+
python3_core_api_client-1.0.4.dist-info/METADATA,sha256=hwUpNy42DAjAtjKZqodyJpZRpPH9qpy0Jd2ThCG9Zrg,7031
|
57
|
+
python3_core_api_client-1.0.4.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
58
|
+
python3_core_api_client-1.0.4.dist-info/top_level.txt,sha256=ss011q9S6SL_KIIyq7iujFmIYa0grSjlnInO7cDkeag,12
|
59
|
+
python3_core_api_client-1.0.4.dist-info/RECORD,,
|
File without changes
|
{python3_core_api_client-1.0.2.dist-info → python3_core_api_client-1.0.4.dist-info}/top_level.txt
RENAMED
File without changes
|