python3-core-api-client 1.0.2__tar.gz → 1.0.4__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (64) hide show
  1. {python3_core_api_client-1.0.2 → python3_core_api_client-1.0.4}/PKG-INFO +2 -2
  2. {python3_core_api_client-1.0.2 → python3_core_api_client-1.0.4}/README.md +1 -1
  3. {python3_core_api_client-1.0.2 → python3_core_api_client-1.0.4}/pyproject.toml +1 -1
  4. {python3_core_api_client-1.0.2 → python3_core_api_client-1.0.4}/src/cyberfusion/CoreApiClient/models.py +34 -6
  5. {python3_core_api_client-1.0.2 → python3_core_api_client-1.0.4}/src/cyberfusion/CoreApiClient/resources/clusters.py +0 -11
  6. {python3_core_api_client-1.0.2 → python3_core_api_client-1.0.4}/src/python3_core_api_client.egg-info/PKG-INFO +2 -2
  7. {python3_core_api_client-1.0.2 → python3_core_api_client-1.0.4}/setup.cfg +0 -0
  8. {python3_core_api_client-1.0.2 → python3_core_api_client-1.0.4}/src/cyberfusion/CoreApiClient/__init__.py +0 -0
  9. {python3_core_api_client-1.0.2 → python3_core_api_client-1.0.4}/src/cyberfusion/CoreApiClient/_encoders.py +0 -0
  10. {python3_core_api_client-1.0.2 → python3_core_api_client-1.0.4}/src/cyberfusion/CoreApiClient/connector.py +0 -0
  11. {python3_core_api_client-1.0.2 → python3_core_api_client-1.0.4}/src/cyberfusion/CoreApiClient/exceptions.py +0 -0
  12. {python3_core_api_client-1.0.2 → python3_core_api_client-1.0.4}/src/cyberfusion/CoreApiClient/http.py +0 -0
  13. {python3_core_api_client-1.0.2 → python3_core_api_client-1.0.4}/src/cyberfusion/CoreApiClient/interfaces.py +0 -0
  14. {python3_core_api_client-1.0.2 → python3_core_api_client-1.0.4}/src/cyberfusion/CoreApiClient/resources/__init__.py +0 -0
  15. {python3_core_api_client-1.0.2 → python3_core_api_client-1.0.4}/src/cyberfusion/CoreApiClient/resources/basic_authentication_realms.py +0 -0
  16. {python3_core_api_client-1.0.2 → python3_core_api_client-1.0.4}/src/cyberfusion/CoreApiClient/resources/borg_archives.py +0 -0
  17. {python3_core_api_client-1.0.2 → python3_core_api_client-1.0.4}/src/cyberfusion/CoreApiClient/resources/borg_repositories.py +0 -0
  18. {python3_core_api_client-1.0.2 → python3_core_api_client-1.0.4}/src/cyberfusion/CoreApiClient/resources/certificate_managers.py +0 -0
  19. {python3_core_api_client-1.0.2 → python3_core_api_client-1.0.4}/src/cyberfusion/CoreApiClient/resources/certificates.py +0 -0
  20. {python3_core_api_client-1.0.2 → python3_core_api_client-1.0.4}/src/cyberfusion/CoreApiClient/resources/cmses.py +0 -0
  21. {python3_core_api_client-1.0.2 → python3_core_api_client-1.0.4}/src/cyberfusion/CoreApiClient/resources/crons.py +0 -0
  22. {python3_core_api_client-1.0.2 → python3_core_api_client-1.0.4}/src/cyberfusion/CoreApiClient/resources/custom_config_snippets.py +0 -0
  23. {python3_core_api_client-1.0.2 → python3_core_api_client-1.0.4}/src/cyberfusion/CoreApiClient/resources/custom_configs.py +0 -0
  24. {python3_core_api_client-1.0.2 → python3_core_api_client-1.0.4}/src/cyberfusion/CoreApiClient/resources/customers.py +0 -0
  25. {python3_core_api_client-1.0.2 → python3_core_api_client-1.0.4}/src/cyberfusion/CoreApiClient/resources/daemons.py +0 -0
  26. {python3_core_api_client-1.0.2 → python3_core_api_client-1.0.4}/src/cyberfusion/CoreApiClient/resources/database_user_grants.py +0 -0
  27. {python3_core_api_client-1.0.2 → python3_core_api_client-1.0.4}/src/cyberfusion/CoreApiClient/resources/database_users.py +0 -0
  28. {python3_core_api_client-1.0.2 → python3_core_api_client-1.0.4}/src/cyberfusion/CoreApiClient/resources/databases.py +0 -0
  29. {python3_core_api_client-1.0.2 → python3_core_api_client-1.0.4}/src/cyberfusion/CoreApiClient/resources/domain_routers.py +0 -0
  30. {python3_core_api_client-1.0.2 → python3_core_api_client-1.0.4}/src/cyberfusion/CoreApiClient/resources/firewall_groups.py +0 -0
  31. {python3_core_api_client-1.0.2 → python3_core_api_client-1.0.4}/src/cyberfusion/CoreApiClient/resources/firewall_rules.py +0 -0
  32. {python3_core_api_client-1.0.2 → python3_core_api_client-1.0.4}/src/cyberfusion/CoreApiClient/resources/fpm_pools.py +0 -0
  33. {python3_core_api_client-1.0.2 → python3_core_api_client-1.0.4}/src/cyberfusion/CoreApiClient/resources/ftp_users.py +0 -0
  34. {python3_core_api_client-1.0.2 → python3_core_api_client-1.0.4}/src/cyberfusion/CoreApiClient/resources/haproxy_listens.py +0 -0
  35. {python3_core_api_client-1.0.2 → python3_core_api_client-1.0.4}/src/cyberfusion/CoreApiClient/resources/haproxy_listens_to_nodes.py +0 -0
  36. {python3_core_api_client-1.0.2 → python3_core_api_client-1.0.4}/src/cyberfusion/CoreApiClient/resources/health.py +0 -0
  37. {python3_core_api_client-1.0.2 → python3_core_api_client-1.0.4}/src/cyberfusion/CoreApiClient/resources/hosts_entries.py +0 -0
  38. {python3_core_api_client-1.0.2 → python3_core_api_client-1.0.4}/src/cyberfusion/CoreApiClient/resources/htpasswd_files.py +0 -0
  39. {python3_core_api_client-1.0.2 → python3_core_api_client-1.0.4}/src/cyberfusion/CoreApiClient/resources/htpasswd_users.py +0 -0
  40. {python3_core_api_client-1.0.2 → python3_core_api_client-1.0.4}/src/cyberfusion/CoreApiClient/resources/login.py +0 -0
  41. {python3_core_api_client-1.0.2 → python3_core_api_client-1.0.4}/src/cyberfusion/CoreApiClient/resources/logs.py +0 -0
  42. {python3_core_api_client-1.0.2 → python3_core_api_client-1.0.4}/src/cyberfusion/CoreApiClient/resources/mail_accounts.py +0 -0
  43. {python3_core_api_client-1.0.2 → python3_core_api_client-1.0.4}/src/cyberfusion/CoreApiClient/resources/mail_aliases.py +0 -0
  44. {python3_core_api_client-1.0.2 → python3_core_api_client-1.0.4}/src/cyberfusion/CoreApiClient/resources/mail_domains.py +0 -0
  45. {python3_core_api_client-1.0.2 → python3_core_api_client-1.0.4}/src/cyberfusion/CoreApiClient/resources/mail_hostnames.py +0 -0
  46. {python3_core_api_client-1.0.2 → python3_core_api_client-1.0.4}/src/cyberfusion/CoreApiClient/resources/malwares.py +0 -0
  47. {python3_core_api_client-1.0.2 → python3_core_api_client-1.0.4}/src/cyberfusion/CoreApiClient/resources/mariadb_encryption_keys.py +0 -0
  48. {python3_core_api_client-1.0.2 → python3_core_api_client-1.0.4}/src/cyberfusion/CoreApiClient/resources/node_add_ons.py +0 -0
  49. {python3_core_api_client-1.0.2 → python3_core_api_client-1.0.4}/src/cyberfusion/CoreApiClient/resources/nodes.py +0 -0
  50. {python3_core_api_client-1.0.2 → python3_core_api_client-1.0.4}/src/cyberfusion/CoreApiClient/resources/passenger_apps.py +0 -0
  51. {python3_core_api_client-1.0.2 → python3_core_api_client-1.0.4}/src/cyberfusion/CoreApiClient/resources/redis_instances.py +0 -0
  52. {python3_core_api_client-1.0.2 → python3_core_api_client-1.0.4}/src/cyberfusion/CoreApiClient/resources/root_ssh_keys.py +0 -0
  53. {python3_core_api_client-1.0.2 → python3_core_api_client-1.0.4}/src/cyberfusion/CoreApiClient/resources/security_txt_policies.py +0 -0
  54. {python3_core_api_client-1.0.2 → python3_core_api_client-1.0.4}/src/cyberfusion/CoreApiClient/resources/sites.py +0 -0
  55. {python3_core_api_client-1.0.2 → python3_core_api_client-1.0.4}/src/cyberfusion/CoreApiClient/resources/ssh_keys.py +0 -0
  56. {python3_core_api_client-1.0.2 → python3_core_api_client-1.0.4}/src/cyberfusion/CoreApiClient/resources/task_collections.py +0 -0
  57. {python3_core_api_client-1.0.2 → python3_core_api_client-1.0.4}/src/cyberfusion/CoreApiClient/resources/tombstones.py +0 -0
  58. {python3_core_api_client-1.0.2 → python3_core_api_client-1.0.4}/src/cyberfusion/CoreApiClient/resources/unix_users.py +0 -0
  59. {python3_core_api_client-1.0.2 → python3_core_api_client-1.0.4}/src/cyberfusion/CoreApiClient/resources/url_redirects.py +0 -0
  60. {python3_core_api_client-1.0.2 → python3_core_api_client-1.0.4}/src/cyberfusion/CoreApiClient/resources/virtual_hosts.py +0 -0
  61. {python3_core_api_client-1.0.2 → python3_core_api_client-1.0.4}/src/python3_core_api_client.egg-info/SOURCES.txt +0 -0
  62. {python3_core_api_client-1.0.2 → python3_core_api_client-1.0.4}/src/python3_core_api_client.egg-info/dependency_links.txt +0 -0
  63. {python3_core_api_client-1.0.2 → python3_core_api_client-1.0.4}/src/python3_core_api_client.egg-info/requires.txt +0 -0
  64. {python3_core_api_client-1.0.2 → python3_core_api_client-1.0.4}/src/python3_core_api_client.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: python3-core-api-client
3
- Version: 1.0.2
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.241** version of the API.
16
+ This client was built for and tested on the **1.246** version of the API.
17
17
 
18
18
  ## Support
19
19
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  Python client for Core API.
4
4
 
5
- This client was built for and tested on the **1.241** version of the API.
5
+ This client was built for and tested on the **1.246** version of the API.
6
6
 
7
7
  ## Support
8
8
 
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "python3-core-api-client"
7
- version = "1.0.2"
7
+ version = "1.0.4"
8
8
  description = "Python client for Core API."
9
9
  readme = "README.md"
10
10
  authors = [
@@ -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-9]+$", min_length=16, max_length=32)
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
- pass
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
  *,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: python3-core-api-client
3
- Version: 1.0.2
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.241** version of the API.
16
+ This client was built for and tested on the **1.246** version of the API.
17
17
 
18
18
  ## Support
19
19