python3-core-api-client 0.2__tar.gz → 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.
- {python3_core_api_client-0.2 → python3_core_api_client-0.4}/PKG-INFO +1 -1
- {python3_core_api_client-0.2 → python3_core_api_client-0.4}/pyproject.toml +1 -1
- python3_core_api_client-0.4/src/cyberfusion/CoreApiClient/_encoders.py +14 -0
- {python3_core_api_client-0.2 → python3_core_api_client-0.4}/src/cyberfusion/CoreApiClient/connector.py +3 -3
- {python3_core_api_client-0.2 → python3_core_api_client-0.4}/src/cyberfusion/CoreApiClient/models.py +12 -14
- {python3_core_api_client-0.2 → python3_core_api_client-0.4}/src/python3_core_api_client.egg-info/PKG-INFO +1 -1
- python3_core_api_client-0.2/src/cyberfusion/CoreApiClient/_encoders.py +0 -7
- {python3_core_api_client-0.2 → python3_core_api_client-0.4}/README.md +0 -0
- {python3_core_api_client-0.2 → python3_core_api_client-0.4}/setup.cfg +0 -0
- {python3_core_api_client-0.2 → python3_core_api_client-0.4}/src/cyberfusion/CoreApiClient/__init__.py +0 -0
- {python3_core_api_client-0.2 → python3_core_api_client-0.4}/src/cyberfusion/CoreApiClient/exceptions.py +0 -0
- {python3_core_api_client-0.2 → python3_core_api_client-0.4}/src/cyberfusion/CoreApiClient/http.py +0 -0
- {python3_core_api_client-0.2 → python3_core_api_client-0.4}/src/cyberfusion/CoreApiClient/interfaces.py +0 -0
- {python3_core_api_client-0.2 → python3_core_api_client-0.4}/src/cyberfusion/CoreApiClient/resources/__init__.py +0 -0
- {python3_core_api_client-0.2 → python3_core_api_client-0.4}/src/cyberfusion/CoreApiClient/resources/basic_authentication_realms.py +0 -0
- {python3_core_api_client-0.2 → python3_core_api_client-0.4}/src/cyberfusion/CoreApiClient/resources/borg_archives.py +0 -0
- {python3_core_api_client-0.2 → python3_core_api_client-0.4}/src/cyberfusion/CoreApiClient/resources/borg_repositories.py +0 -0
- {python3_core_api_client-0.2 → python3_core_api_client-0.4}/src/cyberfusion/CoreApiClient/resources/certificate_managers.py +0 -0
- {python3_core_api_client-0.2 → python3_core_api_client-0.4}/src/cyberfusion/CoreApiClient/resources/certificates.py +0 -0
- {python3_core_api_client-0.2 → python3_core_api_client-0.4}/src/cyberfusion/CoreApiClient/resources/clusters.py +0 -0
- {python3_core_api_client-0.2 → python3_core_api_client-0.4}/src/cyberfusion/CoreApiClient/resources/cmses.py +0 -0
- {python3_core_api_client-0.2 → python3_core_api_client-0.4}/src/cyberfusion/CoreApiClient/resources/crons.py +0 -0
- {python3_core_api_client-0.2 → python3_core_api_client-0.4}/src/cyberfusion/CoreApiClient/resources/custom_config_snippets.py +0 -0
- {python3_core_api_client-0.2 → python3_core_api_client-0.4}/src/cyberfusion/CoreApiClient/resources/custom_configs.py +0 -0
- {python3_core_api_client-0.2 → python3_core_api_client-0.4}/src/cyberfusion/CoreApiClient/resources/customers.py +0 -0
- {python3_core_api_client-0.2 → python3_core_api_client-0.4}/src/cyberfusion/CoreApiClient/resources/daemons.py +0 -0
- {python3_core_api_client-0.2 → python3_core_api_client-0.4}/src/cyberfusion/CoreApiClient/resources/database_user_grants.py +0 -0
- {python3_core_api_client-0.2 → python3_core_api_client-0.4}/src/cyberfusion/CoreApiClient/resources/database_users.py +0 -0
- {python3_core_api_client-0.2 → python3_core_api_client-0.4}/src/cyberfusion/CoreApiClient/resources/databases.py +0 -0
- {python3_core_api_client-0.2 → python3_core_api_client-0.4}/src/cyberfusion/CoreApiClient/resources/domain_routers.py +0 -0
- {python3_core_api_client-0.2 → python3_core_api_client-0.4}/src/cyberfusion/CoreApiClient/resources/firewall_groups.py +0 -0
- {python3_core_api_client-0.2 → python3_core_api_client-0.4}/src/cyberfusion/CoreApiClient/resources/firewall_rules.py +0 -0
- {python3_core_api_client-0.2 → python3_core_api_client-0.4}/src/cyberfusion/CoreApiClient/resources/fpm_pools.py +0 -0
- {python3_core_api_client-0.2 → python3_core_api_client-0.4}/src/cyberfusion/CoreApiClient/resources/ftp_users.py +0 -0
- {python3_core_api_client-0.2 → python3_core_api_client-0.4}/src/cyberfusion/CoreApiClient/resources/haproxy_listens.py +0 -0
- {python3_core_api_client-0.2 → python3_core_api_client-0.4}/src/cyberfusion/CoreApiClient/resources/haproxy_listens_to_nodes.py +0 -0
- {python3_core_api_client-0.2 → python3_core_api_client-0.4}/src/cyberfusion/CoreApiClient/resources/health.py +0 -0
- {python3_core_api_client-0.2 → python3_core_api_client-0.4}/src/cyberfusion/CoreApiClient/resources/hosts_entries.py +0 -0
- {python3_core_api_client-0.2 → python3_core_api_client-0.4}/src/cyberfusion/CoreApiClient/resources/htpasswd_files.py +0 -0
- {python3_core_api_client-0.2 → python3_core_api_client-0.4}/src/cyberfusion/CoreApiClient/resources/htpasswd_users.py +0 -0
- {python3_core_api_client-0.2 → python3_core_api_client-0.4}/src/cyberfusion/CoreApiClient/resources/login.py +0 -0
- {python3_core_api_client-0.2 → python3_core_api_client-0.4}/src/cyberfusion/CoreApiClient/resources/logs.py +0 -0
- {python3_core_api_client-0.2 → python3_core_api_client-0.4}/src/cyberfusion/CoreApiClient/resources/mail_accounts.py +0 -0
- {python3_core_api_client-0.2 → python3_core_api_client-0.4}/src/cyberfusion/CoreApiClient/resources/mail_aliases.py +0 -0
- {python3_core_api_client-0.2 → python3_core_api_client-0.4}/src/cyberfusion/CoreApiClient/resources/mail_domains.py +0 -0
- {python3_core_api_client-0.2 → python3_core_api_client-0.4}/src/cyberfusion/CoreApiClient/resources/mail_hostnames.py +0 -0
- {python3_core_api_client-0.2 → python3_core_api_client-0.4}/src/cyberfusion/CoreApiClient/resources/malwares.py +0 -0
- {python3_core_api_client-0.2 → python3_core_api_client-0.4}/src/cyberfusion/CoreApiClient/resources/mariadb_encryption_keys.py +0 -0
- {python3_core_api_client-0.2 → python3_core_api_client-0.4}/src/cyberfusion/CoreApiClient/resources/node_add_ons.py +0 -0
- {python3_core_api_client-0.2 → python3_core_api_client-0.4}/src/cyberfusion/CoreApiClient/resources/nodes.py +0 -0
- {python3_core_api_client-0.2 → python3_core_api_client-0.4}/src/cyberfusion/CoreApiClient/resources/passenger_apps.py +0 -0
- {python3_core_api_client-0.2 → python3_core_api_client-0.4}/src/cyberfusion/CoreApiClient/resources/redis_instances.py +0 -0
- {python3_core_api_client-0.2 → python3_core_api_client-0.4}/src/cyberfusion/CoreApiClient/resources/root_ssh_keys.py +0 -0
- {python3_core_api_client-0.2 → python3_core_api_client-0.4}/src/cyberfusion/CoreApiClient/resources/security_txt_policies.py +0 -0
- {python3_core_api_client-0.2 → python3_core_api_client-0.4}/src/cyberfusion/CoreApiClient/resources/sites.py +0 -0
- {python3_core_api_client-0.2 → python3_core_api_client-0.4}/src/cyberfusion/CoreApiClient/resources/ssh_keys.py +0 -0
- {python3_core_api_client-0.2 → python3_core_api_client-0.4}/src/cyberfusion/CoreApiClient/resources/task_collections.py +0 -0
- {python3_core_api_client-0.2 → python3_core_api_client-0.4}/src/cyberfusion/CoreApiClient/resources/tombstones.py +0 -0
- {python3_core_api_client-0.2 → python3_core_api_client-0.4}/src/cyberfusion/CoreApiClient/resources/unix_users.py +0 -0
- {python3_core_api_client-0.2 → python3_core_api_client-0.4}/src/cyberfusion/CoreApiClient/resources/url_redirects.py +0 -0
- {python3_core_api_client-0.2 → python3_core_api_client-0.4}/src/cyberfusion/CoreApiClient/resources/virtual_hosts.py +0 -0
- {python3_core_api_client-0.2 → python3_core_api_client-0.4}/src/python3_core_api_client.egg-info/SOURCES.txt +0 -0
- {python3_core_api_client-0.2 → python3_core_api_client-0.4}/src/python3_core_api_client.egg-info/dependency_links.txt +0 -0
- {python3_core_api_client-0.2 → python3_core_api_client-0.4}/src/python3_core_api_client.egg-info/requires.txt +0 -0
- {python3_core_api_client-0.2 → python3_core_api_client-0.4}/src/python3_core_api_client.egg-info/top_level.txt +0 -0
@@ -0,0 +1,14 @@
|
|
1
|
+
import datetime
|
2
|
+
from json import JSONEncoder
|
3
|
+
from ipaddress import IPv4Address, IPv6Address
|
4
|
+
from typing import Any
|
5
|
+
|
6
|
+
|
7
|
+
class CustomEncoder(JSONEncoder):
|
8
|
+
def default(self, o: Any) -> str:
|
9
|
+
if isinstance(o, datetime.date):
|
10
|
+
return o.strftime("%Y-%m-%dT%H:%M:%S.%fZ")
|
11
|
+
elif isinstance(o, (IPv6Address, IPv4Address)):
|
12
|
+
return str(o)
|
13
|
+
|
14
|
+
return super().default(o)
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import json
|
2
2
|
from typing import Optional, Tuple
|
3
3
|
|
4
|
-
from cyberfusion.CoreApiClient._encoders import
|
4
|
+
from cyberfusion.CoreApiClient._encoders import CustomEncoder
|
5
5
|
from cyberfusion.CoreApiClient.exceptions import CallException, AuthenticationException
|
6
6
|
|
7
7
|
from requests.sessions import Session
|
@@ -108,13 +108,13 @@ class CoreApiClient:
|
|
108
108
|
url = "".join([self.base_url, path])
|
109
109
|
|
110
110
|
if data and content_type == "application/json":
|
111
|
-
data = json.dumps(data, cls=
|
111
|
+
data = json.dumps(data, cls=CustomEncoder)
|
112
112
|
|
113
113
|
if query_parameters:
|
114
114
|
for key, value in query_parameters.items():
|
115
115
|
if isinstance(value, datetime.datetime):
|
116
116
|
query_parameters[key] = json.loads(
|
117
|
-
json.dumps(value, cls=
|
117
|
+
json.dumps(value, cls=CustomEncoder)
|
118
118
|
)
|
119
119
|
|
120
120
|
requests_response = self.requests_session.request(
|
{python3_core_api_client-0.2 → python3_core_api_client-0.4}/src/cyberfusion/CoreApiClient/models.py
RENAMED
@@ -1110,7 +1110,7 @@ class HTTPRetryConditionEnum(StrEnum):
|
|
1110
1110
|
EMPTY_RESPONSE = "Empty response"
|
1111
1111
|
JUNK_RESPONSE = "Junk response"
|
1112
1112
|
RESPONSE_TIMEOUT = "Response timeout"
|
1113
|
-
|
1113
|
+
ZERO_RTT_REJECTED = "0-RTT rejected"
|
1114
1114
|
HTTP_STATUS_401 = "HTTP status 401"
|
1115
1115
|
HTTP_STATUS_403 = "HTTP status 403"
|
1116
1116
|
HTTP_STATUS_404 = "HTTP status 404"
|
@@ -1856,11 +1856,11 @@ class TokenTypeEnum(StrEnum):
|
|
1856
1856
|
|
1857
1857
|
|
1858
1858
|
class TombstoneDataCertificate(CoreApiModel):
|
1859
|
-
data_type: Literal["certificate"] = Field(...,
|
1859
|
+
data_type: Literal["certificate"] = Field(..., title="Data Type")
|
1860
1860
|
|
1861
1861
|
|
1862
1862
|
class TombstoneDataCron(CoreApiModel):
|
1863
|
-
data_type: Literal["cron"] = Field(...,
|
1863
|
+
data_type: Literal["cron"] = Field(..., title="Data Type")
|
1864
1864
|
name: constr(regex=r"^[a-z0-9-_]+$", min_length=1, max_length=64) = Field(
|
1865
1865
|
..., title="Name"
|
1866
1866
|
)
|
@@ -1868,14 +1868,14 @@ class TombstoneDataCron(CoreApiModel):
|
|
1868
1868
|
|
1869
1869
|
|
1870
1870
|
class TombstoneDataDaemon(CoreApiModel):
|
1871
|
-
data_type: Literal["daemon"] = Field(...,
|
1871
|
+
data_type: Literal["daemon"] = Field(..., title="Data Type")
|
1872
1872
|
name: constr(regex=r"^[a-z0-9-_]+$", min_length=1, max_length=64) = Field(
|
1873
1873
|
..., title="Name"
|
1874
1874
|
)
|
1875
1875
|
|
1876
1876
|
|
1877
1877
|
class TombstoneDataFPMPool(CoreApiModel):
|
1878
|
-
data_type: Literal["fpm_pool"] = Field(...,
|
1878
|
+
data_type: Literal["fpm_pool"] = Field(..., title="Data Type")
|
1879
1879
|
version: str = Field(..., title="Version")
|
1880
1880
|
name: constr(regex=r"^[a-z0-9-_]+$", min_length=1, max_length=64) = Field(
|
1881
1881
|
..., title="Name"
|
@@ -1883,7 +1883,7 @@ class TombstoneDataFPMPool(CoreApiModel):
|
|
1883
1883
|
|
1884
1884
|
|
1885
1885
|
class TombstoneDataMailAccount(CoreApiModel):
|
1886
|
-
data_type: Literal["mail_account"] = Field(...,
|
1886
|
+
data_type: Literal["mail_account"] = Field(..., title="Data Type")
|
1887
1887
|
local_part: constr(regex=r"^[a-z0-9-.]+$", min_length=1, max_length=64) = Field(
|
1888
1888
|
...,
|
1889
1889
|
description="May not be in use by mail alias in the same mail domain.",
|
@@ -1894,14 +1894,14 @@ class TombstoneDataMailAccount(CoreApiModel):
|
|
1894
1894
|
|
1895
1895
|
|
1896
1896
|
class TombstoneDataPassengerApp(CoreApiModel):
|
1897
|
-
data_type: Literal["passenger_app"] = Field(...,
|
1897
|
+
data_type: Literal["passenger_app"] = Field(..., title="Data Type")
|
1898
1898
|
name: constr(regex=r"^[a-z0-9-_]+$", min_length=1, max_length=64) = Field(
|
1899
1899
|
..., title="Name"
|
1900
1900
|
)
|
1901
1901
|
|
1902
1902
|
|
1903
1903
|
class TombstoneDataRedisInstance(CoreApiModel):
|
1904
|
-
data_type: Literal["redis_instance"] = Field(...,
|
1904
|
+
data_type: Literal["redis_instance"] = Field(..., title="Data Type")
|
1905
1905
|
name: constr(regex=r"^[a-z0-9-_]+$", min_length=1, max_length=64) = Field(
|
1906
1906
|
..., title="Name"
|
1907
1907
|
)
|
@@ -1909,22 +1909,20 @@ class TombstoneDataRedisInstance(CoreApiModel):
|
|
1909
1909
|
|
1910
1910
|
|
1911
1911
|
class TombstoneDataUNIXUser(CoreApiModel):
|
1912
|
-
data_type: Literal["unix_user"] = Field(...,
|
1912
|
+
data_type: Literal["unix_user"] = Field(..., title="Data Type")
|
1913
1913
|
home_directory: str = Field(..., title="Home Directory")
|
1914
1914
|
delete_on_cluster: Optional[bool] = Field(False, title="Delete On Cluster")
|
1915
1915
|
|
1916
1916
|
|
1917
1917
|
class TombstoneDataUNIXUserRabbitMQCredentials(CoreApiModel):
|
1918
|
-
data_type: Literal["unix_user_rabbitmq_credentials"] = Field(
|
1919
|
-
..., const=True, title="Data Type"
|
1920
|
-
)
|
1918
|
+
data_type: Literal["unix_user_rabbitmq_credentials"] = Field(..., title="Data Type")
|
1921
1919
|
rabbitmq_virtual_host_name: constr(
|
1922
1920
|
regex=r"^[a-z0-9-.]+$", min_length=1, max_length=32
|
1923
1921
|
) = Field(..., title="Rabbitmq Virtual Host Name")
|
1924
1922
|
|
1925
1923
|
|
1926
1924
|
class TombstoneDataVirtualHost(CoreApiModel):
|
1927
|
-
data_type: Literal["virtual_host"] = Field(...,
|
1925
|
+
data_type: Literal["virtual_host"] = Field(..., title="Data Type")
|
1928
1926
|
domain_root: str = Field(..., title="Domain Root")
|
1929
1927
|
delete_on_cluster: Optional[bool] = Field(False, title="Delete On Cluster")
|
1930
1928
|
|
@@ -1934,7 +1932,7 @@ class TombstoneIncludes(CoreApiModel):
|
|
1934
1932
|
|
1935
1933
|
|
1936
1934
|
class TombstoneDataDatabase(CoreApiModel):
|
1937
|
-
data_type: Literal["database"] = Field(...,
|
1935
|
+
data_type: Literal["database"] = Field(..., title="Data Type")
|
1938
1936
|
name: constr(regex=r"^[a-z0-9-_]+$", min_length=1, max_length=63) = Field(
|
1939
1937
|
..., title="Name"
|
1940
1938
|
)
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{python3_core_api_client-0.2 → python3_core_api_client-0.4}/src/cyberfusion/CoreApiClient/http.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|